diff --git a/.gitignore b/.gitignore index 33595a8..6e0aa94 100644 --- a/.gitignore +++ b/.gitignore
@@ -104,6 +104,7 @@ /chrome/browser/resources/software_rendering_list # Asset files downloaded by gclient runhooks. /chrome/browser/resources/vr/assets/google_chrome/*.png +/chrome/browser/resources/vr/assets/google_chrome/*.wav /chrome/browser/spellchecker/internal /chrome/browser_tests_run.xml /chrome/chrome_run.xml
diff --git a/BUILD.gn b/BUILD.gn index 45f69298..375462b 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -13,8 +13,8 @@ import("//build/config/sanitizers/sanitizers.gni") import("//build/config/ui.gni") import("//components/nacl/features.gni") -import("//device/vr/features/features.gni") -import("//extensions/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//media/gpu/args.gni") import("//remoting/remoting_enable.gni")
diff --git a/DEPS b/DEPS index 1df5487..9436e20 100644 --- a/DEPS +++ b/DEPS
@@ -79,7 +79,7 @@ # 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': 'fa303398d503a48d054e26dd1582282d3121b8ec', + 'skia_revision': '66abdf6658969285fa64eadfaf4de4bdbad09332', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -91,7 +91,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': 'ed8b49195844f126569367415aec366a725294c1', + 'angle_revision': 'e8a93c6ed6feda4e0f22bd034cf95dd4aae3618d', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -103,7 +103,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '04d792fb7510e328f508bc81379ca15791af93e7', + 'pdfium_revision': '5a7e330ef5e013e5df5fe771d3901ff890aa9731', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -135,7 +135,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': '6fbfa7cb20f44fdf0a0336137a33febc44f6fd84', + 'catapult_revision': '8f3d6b77acab8e35a062745097cd2c4d1c9a4de6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -151,7 +151,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'feed_revision': '4dedff6189bbd8f3dc594ba3e2159ccdf929359a', + 'feed_revision': '6dd696995de00102e0fd9e3433e8ace87247b6d4', } # Only these hosts are allowed for dependencies in this DEPS file. @@ -331,7 +331,7 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + '670a0ff9f5a1d27b62e2a09d929f6e2ea32278ba', + 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + 'e22d01d973dcda6c8d2aa39ad5512a6ef80678f6', 'condition': 'checkout_linux', }, @@ -341,7 +341,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '53014653d8eb98ac09f1ea1bb5231bcd8c92ff66', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '44048672dcd7f444eec5449388078ffd43e397a7', 'src/third_party/devtools-node-modules': Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'), @@ -524,7 +524,7 @@ # Graphics buffer allocator for Chrome OS. 'src/third_party/minigbm/src': { - 'url': Var('chromium_git') + '/chromiumos/platform/minigbm.git' + '@' + '7f79cb53e1b38e8284f365a22c5dc9223f6ad847', + 'url': Var('chromium_git') + '/chromiumos/platform/minigbm.git' + '@' + '6eca36809e185337bfcca95310a1765c34c360e1', 'condition': 'checkout_linux', }, @@ -657,7 +657,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '3c1cb0203b6cfc10389e85a350b2ea6ca29d01ce', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '8861da8356ee9b395027e1f4878dd6af5ce339c7', # commit position 21742 + Var('webrtc_git') + '/src.git' + '@' + '6d72c3258ff5b9a887fbf23f70dd60dddb4dfbf1', # commit position 21742 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', @@ -680,7 +680,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@595b668667262c291190744691b5974062336795', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@e0f4e29651e2cf36186758ab69c5f67366ac0862', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index 1eb0bd1d..23c7b43a 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1570,6 +1570,11 @@ 'wake_lock': { 'filepath': 'wake_lock', }, + 'web_package': { + 'filepath': 'content/browser/loader/prefetch_url_loader'\ + '|content/browser/web_package/'\ + '|content/test/data/htxg/' + }, 'web_share': { 'filepath': 'chrome/android/java/src/org/chromium/chrome/browser/webshare/'\ '|chrome/android/javatests/src/org/chromium/chrome/browser/WebShare.*'\ @@ -2305,6 +2310,7 @@ 'virtual_reality': ['feature-vr-reviews@chromium.org'], 'wake_lock': ['cco3+watch@chromium.org', 'mattreynolds+watch@chromium.org'], + 'web_package': ['twifkak+watch@chromium.org'], 'web_share': ['mgiuca+watch@chromium.org'], 'webrtc_browser_tests': ['phoglund+watch@chromium.org'], 'website_settings': ['markusheintz@chromium.org',
diff --git a/android_webview/test/BUILD.gn b/android_webview/test/BUILD.gn index e76323a..3bfc49f 100644 --- a/android_webview/test/BUILD.gn +++ b/android_webview/test/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/android/rules.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//testing/test.gni") import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
diff --git a/apps/BUILD.gn b/apps/BUILD.gn index 466f312f..271934ab 100644 --- a/apps/BUILD.gn +++ b/apps/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/features.gni") import("//build/config/ui.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(!is_android && !is_ios) assert(enable_extensions,
diff --git a/apps/ui/views/BUILD.gn b/apps/ui/views/BUILD.gn index 8eed4dbd..aa62f251 100644 --- a/apps/ui/views/BUILD.gn +++ b/apps/ui/views/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/ui.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions)
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index b59dbc9..77732ff3 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -62,6 +62,7 @@ "accessibility/accessibility_highlight_layer.h", "accessibility/accessibility_layer.cc", "accessibility/accessibility_layer.h", + "accessibility/accessibility_observer.h", "accessibility/accessibility_panel_layout_manager.cc", "accessibility/accessibility_panel_layout_manager.h", "accessibility/default_accessibility_delegate.cc", @@ -177,12 +178,6 @@ "drag_drop/drag_image_view.h", "event_matcher_util.cc", "event_matcher_util.h", - "fast_ink/fast_ink_pointer_controller.cc", - "fast_ink/fast_ink_pointer_controller.h", - "fast_ink/fast_ink_points.cc", - "fast_ink/fast_ink_points.h", - "fast_ink/fast_ink_view.cc", - "fast_ink/fast_ink_view.h", "first_run/desktop_cleaner.cc", "first_run/desktop_cleaner.h", "first_run/first_run_helper.cc", @@ -482,13 +477,14 @@ "sticky_keys/sticky_keys_overlay.cc", "sticky_keys/sticky_keys_overlay.h", "sticky_keys/sticky_keys_state.h", - "system/accessibility_observer.h", "system/audio/audio_detailed_view.cc", "system/audio/audio_detailed_view.h", "system/audio/tray_audio.cc", "system/audio/tray_audio.h", "system/audio/volume_view.cc", "system/audio/volume_view.h", + "system/bluetooth/bluetooth_feature_pod_controller.cc", + "system/bluetooth/bluetooth_feature_pod_controller.h", "system/bluetooth/bluetooth_notification_controller.cc", "system/bluetooth/bluetooth_notification_controller.h", "system/bluetooth/bluetooth_observer.h", @@ -1111,6 +1107,7 @@ deps = [ "//ash/autoclick/common:autoclick", "//ash/components/autoclick/public/mojom", + "//ash/components/fast_ink", "//ash/components/quick_launch/public/mojom", "//ash/touch_hud", "//base", @@ -1410,6 +1407,8 @@ "accessibility/touch_accessibility_enabler_unittest.cc", "accessibility/touch_exploration_controller_unittest.cc", "app_list/app_list_presenter_delegate_unittest.cc", + "app_list/model/app_list_item_list_unittest.cc", + "app_list/model/app_list_model_unittest.cc", "ash_touch_exploration_manager_chromeos_unittest.cc", "autoclick/autoclick_unittest.cc", "detachable_base/detachable_base_handler_unittest.cc", @@ -1438,7 +1437,6 @@ "drag_drop/drag_drop_tracker_unittest.cc", "drag_drop/drag_image_view_unittest.cc", "extended_desktop_unittest.cc", - "fast_ink/fast_ink_points_unittest.cc", "first_run/first_run_helper_unittest.cc", "focus_cycler_unittest.cc", "frame/caption_buttons/frame_caption_button_container_view_unittest.cc", @@ -1646,6 +1644,8 @@ "//ash/app_list/presenter", "//ash/app_list/presenter:test_support", "//ash/autoclick/common:autoclick", + "//ash/components/fast_ink", + "//ash/components/fast_ink:unit_tests", "//ash/components/shortcut_viewer:ksv_unittests", "//ash/public/cpp", "//ash/public/cpp:unit_tests", @@ -1940,6 +1940,7 @@ "//ash", "//ash/app_list/presenter", "//ash/app_list/presenter:test_support", + "//ash/components/fast_ink", "//ash/public/cpp", "//ash/public/interfaces:test_interfaces", "//ash/resources",
diff --git a/ash/accessibility/accessibility_controller.cc b/ash/accessibility/accessibility_controller.cc index 2d3bf67..15bade2 100644 --- a/ash/accessibility/accessibility_controller.cc +++ b/ash/accessibility/accessibility_controller.cc
@@ -8,6 +8,7 @@ #include <utility> #include "ash/accessibility/accessibility_highlight_controller.h" +#include "ash/accessibility/accessibility_observer.h" #include "ash/accessibility/accessibility_panel_layout_manager.h" #include "ash/autoclick/autoclick_controller.h" #include "ash/components/autoclick/public/mojom/autoclick.mojom.h" @@ -22,7 +23,6 @@ #include "ash/sticky_keys/sticky_keys_controller.h" #include "ash/system/power/backlights_forced_off_setter.h" #include "ash/system/power/scoped_backlights_forced_off.h" -#include "ash/system/tray/system_tray_notifier.h" #include "ash/touch/touch_devices_controller.h" #include "chromeos/audio/cras_audio_handler.h" #include "components/pref_registry/pref_registry_syncable.h" @@ -42,12 +42,6 @@ namespace ash { namespace { -void NotifyAccessibilityStatusChanged( - AccessibilityNotificationVisibility notification_visibility) { - Shell::Get()->system_tray_notifier()->NotifyAccessibilityStatusChanged( - notification_visibility); -} - PrefService* GetActivePrefService() { return Shell::Get()->session_controller()->GetActivePrefService(); } @@ -122,6 +116,14 @@ registry->RegisterForeignPref(prefs::kAccessibilityVirtualKeyboardEnabled); } +void AccessibilityController::AddObserver(AccessibilityObserver* observer) { + observers_.AddObserver(observer); +} + +void AccessibilityController::RemoveObserver(AccessibilityObserver* observer) { + observers_.RemoveObserver(observer); +} + void AccessibilityController::BindRequest( mojom::AccessibilityControllerRequest request) { bindings_.AddBinding(this, std::move(request)); @@ -317,6 +319,12 @@ client_->PlaySpokenFeedbackToggleCountdown(tick_count); } +void AccessibilityController::NotifyAccessibilityStatusChanged( + AccessibilityNotificationVisibility notify) { + for (auto& observer : observers_) + observer.OnAccessibilityStatusChanged(notify); +} + void AccessibilityController::SetAccessibilityPanelFullscreen(bool fullscreen) { // The accessibility panel is only shown on the primary display. aura::Window* root = Shell::GetPrimaryRootWindow();
diff --git a/ash/accessibility/accessibility_controller.h b/ash/accessibility/accessibility_controller.h index 6b50b32..136e313 100644 --- a/ash/accessibility/accessibility_controller.h +++ b/ash/accessibility/accessibility_controller.h
@@ -13,6 +13,7 @@ #include "ash/public/interfaces/accessibility_controller.mojom.h" #include "ash/session/session_observer.h" #include "base/macros.h" +#include "base/observer_list.h" #include "base/time/time.h" #include "mojo/public/cpp/bindings/binding_set.h" #include "ui/accessibility/ax_enums.mojom.h" @@ -28,6 +29,7 @@ namespace ash { class AccessibilityHighlightController; +class AccessibilityObserver; class ScopedBacklightsForcedOff; // The controller for accessibility features in ash. Features can be enabled @@ -43,6 +45,9 @@ // See Shell::RegisterProfilePrefs(). static void RegisterProfilePrefs(PrefRegistrySimple* registry, bool for_test); + void AddObserver(AccessibilityObserver* observer); + void RemoveObserver(AccessibilityObserver* observer); + // Binds the mojom::AccessibilityController interface to this object. void BindRequest(mojom::AccessibilityControllerRequest request); @@ -128,6 +133,11 @@ // TODO(jamescook): Convert to mojo interface. void SetAccessibilityPanelFullscreen(bool fullscreen); + // Public because a11y features like screen magnifier and tap dragging are + // managed outside of this controller. + void NotifyAccessibilityStatusChanged( + AccessibilityNotificationVisibility notify); + // mojom::AccessibilityController: void SetClient(mojom::AccessibilityControllerClientPtr client) override; void SetDarkenScreen(bool darken) override; @@ -196,6 +206,8 @@ // Used to force the backlights off to darken the screen. std::unique_ptr<ScopedBacklightsForcedOff> scoped_backlights_forced_off_; + base::ObserverList<AccessibilityObserver> observers_; + DISALLOW_COPY_AND_ASSIGN(AccessibilityController); };
diff --git a/ash/accessibility/accessibility_controller_unittest.cc b/ash/accessibility/accessibility_controller_unittest.cc index de7c041..4aa8bd0 100644 --- a/ash/accessibility/accessibility_controller_unittest.cc +++ b/ash/accessibility/accessibility_controller_unittest.cc
@@ -4,6 +4,7 @@ #include "ash/accessibility/accessibility_controller.h" +#include "ash/accessibility/accessibility_observer.h" #include "ash/accessibility/test_accessibility_controller_client.h" #include "ash/ash_constants.h" #include "ash/public/cpp/ash_pref_names.h" @@ -11,8 +12,6 @@ #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/sticky_keys/sticky_keys_controller.h" -#include "ash/system/accessibility_observer.h" -#include "ash/system/tray/system_tray_notifier.h" #include "ash/test/ash_test_base.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_power_manager_client.h" @@ -101,7 +100,7 @@ EXPECT_FALSE(controller->IsAutoclickEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetAutoclickEnabled(true); @@ -112,7 +111,7 @@ EXPECT_FALSE(controller->IsAutoclickEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetCaretHighlightEnabled) { @@ -121,7 +120,7 @@ EXPECT_FALSE(controller->IsCaretHighlightEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetCaretHighlightEnabled(true); @@ -132,7 +131,7 @@ EXPECT_FALSE(controller->IsCaretHighlightEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetCursorHighlightEnabled) { @@ -141,7 +140,7 @@ EXPECT_FALSE(controller->IsCursorHighlightEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetCursorHighlightEnabled(true); @@ -152,7 +151,7 @@ EXPECT_FALSE(controller->IsCursorHighlightEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetFocusHighlightEnabled) { @@ -161,7 +160,7 @@ EXPECT_FALSE(controller->IsFocusHighlightEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetFocusHighlightEnabled(true); @@ -172,7 +171,7 @@ EXPECT_FALSE(controller->IsFocusHighlightEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetHighContrastEnabled) { @@ -181,7 +180,7 @@ EXPECT_FALSE(controller->IsHighContrastEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetHighContrastEnabled(true); @@ -192,7 +191,7 @@ EXPECT_FALSE(controller->IsHighContrastEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetLargeCursorEnabled) { @@ -201,7 +200,7 @@ EXPECT_FALSE(controller->IsLargeCursorEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetLargeCursorEnabled(true); @@ -212,7 +211,7 @@ EXPECT_FALSE(controller->IsLargeCursorEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, DisableLargeCursorResetsSize) { @@ -238,7 +237,7 @@ EXPECT_FALSE(controller->IsMonoAudioEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetMonoAudioEnabled(true); @@ -249,7 +248,7 @@ EXPECT_FALSE(controller->IsMonoAudioEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetSpokenFeedbackEnabled) { @@ -258,7 +257,7 @@ EXPECT_FALSE(controller->IsSpokenFeedbackEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); EXPECT_EQ(0, observer.notification_show_changed_); @@ -272,7 +271,7 @@ EXPECT_EQ(1, observer.notification_none_changed_); EXPECT_EQ(1, observer.notification_show_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetStickyKeysEnabled) { @@ -281,7 +280,7 @@ EXPECT_FALSE(controller->IsStickyKeysEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); StickyKeysController* sticky_keys_controller = @@ -296,7 +295,7 @@ EXPECT_FALSE(controller->IsStickyKeysEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetTapDraggingEnabled) { @@ -305,7 +304,7 @@ EXPECT_FALSE(controller->IsTapDraggingEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetTapDraggingEnabled(true); @@ -316,7 +315,7 @@ EXPECT_FALSE(controller->IsTapDraggingEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } TEST_F(AccessibilityControllerTest, SetVirtualKeyboardEnabled) { @@ -325,7 +324,7 @@ EXPECT_FALSE(controller->IsVirtualKeyboardEnabled()); TestAccessibilityObserver observer; - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(&observer); + controller->AddObserver(&observer); EXPECT_EQ(0, observer.notification_none_changed_); controller->SetVirtualKeyboardEnabled(true); @@ -338,7 +337,7 @@ EXPECT_FALSE(controller->IsVirtualKeyboardEnabled()); EXPECT_EQ(2, observer.notification_none_changed_); - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(&observer); + controller->RemoveObserver(&observer); } // Tests that ash's controller gets shutdown sound duration properly from
diff --git a/ash/system/accessibility_observer.h b/ash/accessibility/accessibility_observer.h similarity index 81% rename from ash/system/accessibility_observer.h rename to ash/accessibility/accessibility_observer.h index aac205e5..ce79d0c9 100644 --- a/ash/system/accessibility_observer.h +++ b/ash/accessibility/accessibility_observer.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_SYSTEM_ACCESSIBILITY_OBSERVER_H_ -#define ASH_SYSTEM_ACCESSIBILITY_OBSERVER_H_ +#ifndef ASH_ACCESSIBILITY_ACCESSIBILITY_OBSERVER_H_ +#define ASH_ACCESSIBILITY_ACCESSIBILITY_OBSERVER_H_ #include "ash/ash_export.h" #include "ash/public/cpp/accessibility_types.h" @@ -24,4 +24,4 @@ } // namespace ash -#endif // ASH_SYSTEM_ACCESSIBILITY_OBSERVER_H_ +#endif // ASH_ACCESSIBILITY_ACCESSIBILITY_OBSERVER_H_
diff --git a/ui/app_list/app_list_item_list_unittest.cc b/ash/app_list/model/app_list_item_list_unittest.cc similarity index 100% rename from ui/app_list/app_list_item_list_unittest.cc rename to ash/app_list/model/app_list_item_list_unittest.cc
diff --git a/ui/app_list/app_list_model_unittest.cc b/ash/app_list/model/app_list_model_unittest.cc similarity index 96% rename from ui/app_list/app_list_model_unittest.cc rename to ash/app_list/model/app_list_model_unittest.cc index 7016268..47ad217 100644 --- a/ui/app_list/app_list_model_unittest.cc +++ b/ash/app_list/model/app_list_model_unittest.cc
@@ -30,8 +30,7 @@ : status_changed_count_(0), items_added_(0), items_removed_(0), - items_updated_(0) { - } + items_updated_(0) {} ~TestObserver() override {} // AppListModelObserver @@ -162,8 +161,8 @@ AppListItem* item2 = model_.CreateItem("Added Item 2"); model_.AddItem(item2); EXPECT_EQ("Item 0,Item 1,Added Item 1,Added Item 2", GetModelContents()); - model_.SetItemPosition( - item2, item0->position().CreateBetween(item1->position())); + model_.SetItemPosition(item2, + item0->position().CreateBetween(item1->position())); EXPECT_EQ(num_apps + 2, model_.top_level_item_list()->item_count()); EXPECT_EQ(num_apps + 2, observer_.items_added()); EXPECT_EQ("Item 0,Added Item 2,Item 1,Added Item 1", GetModelContents()); @@ -223,8 +222,7 @@ class AppListModelFolderTest : public AppListModelTest { public: - AppListModelFolderTest() { - } + AppListModelFolderTest() {} ~AppListModelFolderTest() override {} // testing::Test overrides: @@ -247,8 +245,7 @@ } ASSERT_EQ(num_folder_apps, folder->item_list()->item_count()); // Check that items 0 and 3 are observed. - EXPECT_TRUE(ItemObservedByFolder( - folder, folder->item_list()->item_at(0))); + EXPECT_TRUE(ItemObservedByFolder(folder, folder->item_list()->item_at(0))); EXPECT_TRUE(ItemObservedByFolder( folder, folder->item_list()->item_at(num_observed_apps - 1))); // Check that item 4 is not observed. @@ -258,13 +255,11 @@ // Confirm that everything was moved where expected. EXPECT_EQ(model_.GetItemName(num_observed_apps), folder->item_list()->item_at(0)->id()); - EXPECT_EQ(model_.GetItemName(0), - folder->item_list()->item_at(1)->id()); + EXPECT_EQ(model_.GetItemName(0), folder->item_list()->item_at(1)->id()); EXPECT_EQ(model_.GetItemName(num_observed_apps - 1), folder->item_list()->item_at(num_observed_apps)->id()); // Check that items 0 and 3 are observed. - EXPECT_TRUE(ItemObservedByFolder( - folder, folder->item_list()->item_at(0))); + EXPECT_TRUE(ItemObservedByFolder(folder, folder->item_list()->item_at(0))); EXPECT_TRUE(ItemObservedByFolder( folder, folder->item_list()->item_at(num_observed_apps - 1))); // Check that item 4 is not observed. @@ -381,8 +376,7 @@ EXPECT_EQ("Item 0,Item 1,folder1,Item 2,Item 3", GetModelContents()); // Move Item 1 to folder1, then Item 2 before Item 1. model_.MoveItemToFolderAt(model_.top_level_item_list()->item_at(1), - folder1->id(), - syncer::StringOrdinal()); + folder1->id(), syncer::StringOrdinal()); EXPECT_EQ("Item 0,folder1,Item 2,Item 3", GetModelContents()); model_.MoveItemToFolderAt(model_.top_level_item_list()->item_at(2), folder1->id(), @@ -390,13 +384,13 @@ EXPECT_EQ("Item 2,Item 1", GetItemListContents(folder1->item_list())); EXPECT_EQ("Item 0,folder1,Item 3", GetModelContents()); // Move Item 2 out of folder to before folder. - model_.MoveItemToFolderAt( - folder1->item_list()->item_at(0), "", folder1->position()); + model_.MoveItemToFolderAt(folder1->item_list()->item_at(0), "", + folder1->position()); EXPECT_EQ("Item 0,Item 2,folder1,Item 3", GetModelContents()); // Move remaining folder item, (Item 1) out of folder to folder position. ASSERT_EQ(1u, folder1->item_list()->item_count()); - model_.MoveItemToFolderAt( - folder1->item_list()->item_at(0), "", folder1->position()); + model_.MoveItemToFolderAt(folder1->item_list()->item_at(0), "", + folder1->position()); EXPECT_EQ("Item 0,Item 2,Item 1,Item 3", GetModelContents()); }
diff --git a/ash/ash_touch_exploration_manager_chromeos.cc b/ash/ash_touch_exploration_manager_chromeos.cc index 32b4e2b8..9306f6308 100644 --- a/ash/ash_touch_exploration_manager_chromeos.cc +++ b/ash/ash_touch_exploration_manager_chromeos.cc
@@ -14,7 +14,6 @@ #include "ash/public/cpp/app_types.h" #include "ash/root_window_controller.h" #include "ash/shell.h" -#include "ash/system/tray/system_tray_notifier.h" #include "ash/wm/window_util.h" #include "base/command_line.h" #include "chromeos/audio/chromeos_sounds.h" @@ -41,17 +40,16 @@ audio_handler_(chromeos::CrasAudioHandler::Get()), keyboard_observer_(this) { Shell::Get()->AddShellObserver(this); - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); + Shell::Get()->accessibility_controller()->AddObserver(this); Shell::Get()->activation_client()->AddObserver(this); display::Screen::GetScreen()->AddObserver(this); UpdateTouchExplorationState(); } AshTouchExplorationManager::~AshTouchExplorationManager() { - SystemTrayNotifier* system_tray_notifier = - Shell::Get()->system_tray_notifier(); - if (system_tray_notifier) - system_tray_notifier->RemoveAccessibilityObserver(this); + // TODO(jamescook): Clean up shutdown order so this check isn't needed. + if (Shell::Get()->accessibility_controller()) + Shell::Get()->accessibility_controller()->RemoveObserver(this); Shell::Get()->activation_client()->RemoveObserver(this); display::Screen::GetScreen()->RemoveObserver(this); Shell::Get()->RemoveShellObserver(this);
diff --git a/ash/ash_touch_exploration_manager_chromeos.h b/ash/ash_touch_exploration_manager_chromeos.h index f0bb64b..fd39c1e 100644 --- a/ash/ash_touch_exploration_manager_chromeos.h +++ b/ash/ash_touch_exploration_manager_chromeos.h
@@ -7,11 +7,11 @@ #include <memory> +#include "ash/accessibility/accessibility_observer.h" #include "ash/accessibility/touch_accessibility_enabler.h" #include "ash/accessibility/touch_exploration_controller.h" #include "ash/ash_export.h" #include "ash/shell_observer.h" -#include "ash/system/accessibility_observer.h" #include "base/macros.h" #include "base/scoped_observer.h" #include "ui/display/display_observer.h"
diff --git a/ash/components/fast_ink/BUILD.gn b/ash/components/fast_ink/BUILD.gn new file mode 100644 index 0000000..9aee966 --- /dev/null +++ b/ash/components/fast_ink/BUILD.gn
@@ -0,0 +1,42 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +source_set("fast_ink") { + sources = [ + "fast_ink_pointer_controller.cc", + "fast_ink_pointer_controller.h", + "fast_ink_points.cc", + "fast_ink_points.h", + "fast_ink_view.cc", + "fast_ink_view.h", + ] + + deps = [ + "//base", + "//cc", + "//components/viz/service", + "//gpu", + "//gpu/command_buffer/client:gles2_interface", + "//services/ui/public/interfaces", + "//skia", + "//ui/aura", + "//ui/gfx", + "//ui/gfx/geometry", + "//ui/gl", + "//ui/views:views", + ] +} + +source_set("unit_tests") { + testonly = true + sources = [ + "fast_ink_points_unittest.cc", + ] + + deps = [ + ":fast_ink", + "//testing/gtest", + "//ui/events:test_support", + ] +}
diff --git a/ash/components/fast_ink/DEPS b/ash/components/fast_ink/DEPS new file mode 100644 index 0000000..7aabca3e --- /dev/null +++ b/ash/components/fast_ink/DEPS
@@ -0,0 +1,13 @@ +include_rules = [ + "+base", + "+cc", + "+components/viz/common", + "+gpu/command_buffer/client", + "+testing", + "+ui/aura", + "+ui/base", + "+ui/display", + "+ui/events", + "+ui/gfx", + "+ui/views", +]
diff --git a/ash/fast_ink/OWNERS b/ash/components/fast_ink/OWNERS similarity index 100% rename from ash/fast_ink/OWNERS rename to ash/components/fast_ink/OWNERS
diff --git a/ash/fast_ink/fast_ink_pointer_controller.cc b/ash/components/fast_ink/fast_ink_pointer_controller.cc similarity index 60% rename from ash/fast_ink/fast_ink_pointer_controller.cc rename to ash/components/fast_ink/fast_ink_pointer_controller.cc index 4aa9fb6..7b5620b 100644 --- a/ash/fast_ink/fast_ink_pointer_controller.cc +++ b/ash/components/fast_ink/fast_ink_pointer_controller.cc
@@ -2,47 +2,27 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/fast_ink/fast_ink_pointer_controller.h" +#include "ash/components/fast_ink/fast_ink_pointer_controller.h" -#include "ash/public/cpp/ash_switches.h" -#include "ash/shell.h" -#include "ash/system/palette/palette_utils.h" -#include "base/command_line.h" -#include "base/strings/string_number_conversions.h" +#include "ui/aura/window.h" #include "ui/display/screen.h" #include "ui/events/base_event_utils.h" #include "ui/views/widget/widget.h" -namespace ash { - +namespace fast_ink { namespace { -// The default amount of time used to estimate time from VSYNC event to when -// visible light can be noticed by the user. This is used when a device -// specific estimate was not provided using --estimated-presentation-delay. -const int kDefaultPresentationDelayMs = 18; - -base::TimeDelta GetPresentationDelay() { - int64_t presentation_delay_ms; - // Use device specific presentation delay if specified. - std::string presentation_delay_string = - base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - switches::kAshEstimatedPresentationDelay); - if (!base::StringToInt64(presentation_delay_string, &presentation_delay_ms)) - presentation_delay_ms = kDefaultPresentationDelayMs; - return base::TimeDelta::FromMilliseconds(presentation_delay_ms); -} +// The amount of time used to estimate time from VSYNC event to when +// visible light can be noticed by the user. +const int kPresentationDelayMs = 18; } // namespace FastInkPointerController::FastInkPointerController() - : presentation_delay_(GetPresentationDelay()) { - Shell::Get()->AddPreTargetHandler(this); -} + : presentation_delay_( + base::TimeDelta::FromMilliseconds(kPresentationDelayMs)) {} -FastInkPointerController::~FastInkPointerController() { - Shell::Get()->RemovePreTargetHandler(this); -} +FastInkPointerController::~FastInkPointerController() {} void FastInkPointerController::SetEnabled(bool enabled) { enabled_ = enabled; @@ -81,9 +61,6 @@ static_cast<aura::Window*>(event->target())->GetRootWindow(); if (CanStartNewGesture(event)) { - // Ignore events over the palette. - if (palette_utils::PaletteContainsPointInScreen(event->root_location())) - return; DestroyPointerView(); CreatePointerView(presentation_delay_, root_window); } else { @@ -93,7 +70,7 @@ views::Widget* widget = pointer_view->GetWidget(); if (widget->IsClosed() || widget->GetNativeWindow()->GetRootWindow() != root_window) { - // The pointer widget is longer valid, end the current pointer session. + // The pointer widget is no longer valid, end the current pointer session. DestroyPointerView(); return; } @@ -103,4 +80,4 @@ event->StopPropagation(); } -} // namespace ash +} // namespace fast_ink
diff --git a/ash/fast_ink/fast_ink_pointer_controller.h b/ash/components/fast_ink/fast_ink_pointer_controller.h similarity index 83% rename from ash/fast_ink/fast_ink_pointer_controller.h rename to ash/components/fast_ink/fast_ink_pointer_controller.h index 4aad6e2..7efe9940 100644 --- a/ash/fast_ink/fast_ink_pointer_controller.h +++ b/ash/components/fast_ink/fast_ink_pointer_controller.h
@@ -2,10 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_FAST_INK_FAST_INK_POINTER_CONTROLLER_H_ -#define ASH_FAST_INK_FAST_INK_POINTER_CONTROLLER_H_ +#ifndef ASH_COMPONENTS_FAST_INK_FAST_INK_POINTER_CONTROLLER_H_ +#define ASH_COMPONENTS_FAST_INK_FAST_INK_POINTER_CONTROLLER_H_ -#include "ash/ash_export.h" #include "base/macros.h" #include "base/time/time.h" #include "ui/events/event_handler.h" @@ -18,11 +17,11 @@ class View; } -namespace ash { +namespace fast_ink { // Base class for a fast ink based pointer controller. Enables/disables // the pointer, receives points and passes them off to be rendered. -class ASH_EXPORT FastInkPointerController : public ui::EventHandler { +class FastInkPointerController : public ui::EventHandler { public: FastInkPointerController(); ~FastInkPointerController() override; @@ -62,6 +61,6 @@ DISALLOW_COPY_AND_ASSIGN(FastInkPointerController); }; -} // namespace ash +} // namespace fast_ink -#endif // ASH_FAST_INK_FAST_INK_POINTER_CONTROLLER_H_ +#endif // ASH_COMPONENTS_FAST_INK_FAST_INK_POINTER_CONTROLLER_H_
diff --git a/ash/fast_ink/fast_ink_points.cc b/ash/components/fast_ink/fast_ink_points.cc similarity index 97% rename from ash/fast_ink/fast_ink_points.cc rename to ash/components/fast_ink/fast_ink_points.cc index 728a5398..dd3da323 100644 --- a/ash/fast_ink/fast_ink_points.cc +++ b/ash/components/fast_ink/fast_ink_points.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_points.h" #include <algorithm> #include <array> @@ -13,7 +13,7 @@ #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/rect_conversions.h" -namespace ash { +namespace fast_ink { FastInkPoints::FastInkPoints(base::TimeDelta life_duration) : life_duration_(life_duration) {} @@ -169,7 +169,7 @@ gfx::Vector2dF jerk; if (valid_positions > 3) - jerk = acceleration[0] - acceleration[1]; + jerk = acceleration[0] - acceleration[1]; // |jerk| is aways valid (zero if |valid_positions| < 4). // Adjust max prediction time based on speed as prediction data is not great @@ -201,4 +201,4 @@ } } -} // namespace ash +} // namespace fast_ink
diff --git a/ash/fast_ink/fast_ink_points.h b/ash/components/fast_ink/fast_ink_points.h similarity index 92% rename from ash/fast_ink/fast_ink_points.h rename to ash/components/fast_ink/fast_ink_points.h index 90c9155c..04802fa 100644 --- a/ash/fast_ink/fast_ink_points.h +++ b/ash/components/fast_ink/fast_ink_points.h
@@ -2,24 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_FAST_INK_FAST_INK_POINTS_H_ -#define ASH_FAST_INK_FAST_INK_POINTS_H_ +#ifndef ASH_COMPONENTS_FAST_INK_FAST_INK_POINTS_H_ +#define ASH_COMPONENTS_FAST_INK_FAST_INK_POINTS_H_ #include <memory> -#include "ash/ash_export.h" #include "base/containers/circular_deque.h" #include "base/macros.h" #include "base/time/time.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/rect_f.h" -namespace ash { +namespace fast_ink { // FastInkPoints is a helper class used for displaying low-latency palette // tools. It contains a collection of points representing one or more // contiguous trajectory segments. -class ASH_EXPORT FastInkPoints { +class FastInkPoints { public: // Struct to describe each point. struct FastInkPoint { @@ -77,6 +76,6 @@ DISALLOW_COPY_AND_ASSIGN(FastInkPoints); }; -} // namespace ash +} // namespace fast_ink -#endif // ASH_FAST_INK_FAST_INK_POINTS_H_ +#endif // ASH_COMPONENTS_FAST_INK_FAST_INK_POINTS_H_
diff --git a/ash/fast_ink/fast_ink_points_unittest.cc b/ash/components/fast_ink/fast_ink_points_unittest.cc similarity index 97% rename from ash/fast_ink/fast_ink_points_unittest.cc rename to ash/components/fast_ink/fast_ink_points_unittest.cc index 53115cbb..5942f0d 100644 --- a/ash/fast_ink/fast_ink_points_unittest.cc +++ b/ash/components/fast_ink/fast_ink_points_unittest.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/fast_ink/fast_ink_points.h" -#include "ash/test/ash_test_base.h" +#include "ash/components/fast_ink/fast_ink_points.h" +#include "testing/gtest/include/gtest/gtest.h" #include "ui/events/test/event_generator.h" -namespace ash { +namespace fast_ink { namespace { const int kTestPointsLifetimeSeconds = 5; -class FastInkPointsTest : public AshTestBase { +class FastInkPointsTest : public testing::Test { public: FastInkPointsTest() : points_(base::TimeDelta::FromSeconds(kTestPointsLifetimeSeconds)), @@ -252,4 +252,5 @@ EXPECT_TRUE(points[4].gap_after); EXPECT_FALSE(points[5].gap_after); } -} // namespace ash + +} // namespace fast_ink
diff --git a/ash/fast_ink/fast_ink_view.cc b/ash/components/fast_ink/fast_ink_view.cc similarity index 93% rename from ash/fast_ink/fast_ink_view.cc rename to ash/components/fast_ink/fast_ink_view.cc index 17a9b1f..f9c85c7 100644 --- a/ash/fast_ink/fast_ink_view.cc +++ b/ash/components/fast_ink/fast_ink_view.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ash/fast_ink/fast_ink_view.h" +#include "ash/components/fast_ink/fast_ink_view.h" #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> @@ -10,9 +10,6 @@ #include <memory> -#include "ash/public/cpp/config.h" -#include "ash/shell.h" -#include "ash/shell_observer.h" #include "base/threading/thread_task_runner_handle.h" #include "cc/base/math_util.h" #include "cc/trees/layer_tree_frame_sink.h" @@ -23,6 +20,7 @@ #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" #include "ui/aura/env.h" +#include "ui/aura/env_observer.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/layout.h" @@ -31,7 +29,7 @@ #include "ui/gfx/gpu_memory_buffer.h" #include "ui/views/widget/widget.h" -namespace ash { +namespace fast_ink { namespace { gfx::Rect BufferRectFromScreenRect( @@ -99,7 +97,7 @@ ~Resource() { // context_provider might be null in unit tests when ran with --mash // TODO(kaznacheev) Have MASH provide a context provider for tests - // when crbug/772562 is fixed + // when https://crbug/772562 is fixed if (!context_provider) return; gpu::gles2::GLES2Interface* gles2 = context_provider->ContextGL(); @@ -120,7 +118,7 @@ class FastInkView::LayerTreeFrameSinkHolder : public cc::LayerTreeFrameSinkClient, - public ash::ShellObserver { + public aura::EnvObserver { public: LayerTreeFrameSinkHolder(FastInkView* view, std::unique_ptr<cc::LayerTreeFrameSink> frame_sink) @@ -130,13 +128,13 @@ ~LayerTreeFrameSinkHolder() override { if (frame_sink_) frame_sink_->DetachFromClient(); - if (shell_) - shell_->RemoveShellObserver(this); + if (env_) + env_->RemoveObserver(this); } // Delete frame sink after having reclaimed all exported resources. // TODO(reveman): Find a better way to handle deletion of in-flight resources. - // crbug.com/765763 + // https://crbug.com/765763 static void DeleteWhenLastResourceHasBeenReclaimed( std::unique_ptr<LayerTreeFrameSinkHolder> holder) { if (holder->last_frame_size_in_pixels_.IsEmpty()) { @@ -167,14 +165,15 @@ if (holder->exported_resources_.empty()) return; - ash::Shell* shell = ash::Shell::Get(); - holder->shell_ = shell; + aura::Env* env = aura::Env::GetInstance(); + holder->env_ = env; holder->view_ = nullptr; // If we have exported resources to reclaim then extend the lifetime of - // holder by adding it as a shell observer. The holder will delete itself - // when shell shuts down or when all exported resources have been reclaimed. - shell->AddShellObserver(holder.release()); + // holder by adding it as an aura env observer. The holder will delete + // itself when aura shuts down or when all exported resources have been + // reclaimed. + env->AddObserver(holder.release()); } void SubmitCompositorFrame(viz::CompositorFrame frame, @@ -205,7 +204,7 @@ view_->ReclaimResource(std::move(resource)); } - if (shell_ && exported_resources_.empty()) + if (env_ && exported_resources_.empty()) ScheduleDelete(); } void SetTreeActivationCallback(const base::Closure& callback) override {} @@ -220,7 +219,7 @@ void DidDiscardCompositorFrame(uint32_t presentation_token) override {} void DidLoseLayerTreeFrameSink() override { exported_resources_.clear(); - if (shell_) + if (env_) ScheduleDelete(); } void OnDraw(const gfx::Transform& transform, @@ -231,11 +230,12 @@ const gfx::Rect& viewport_rect, const gfx::Transform& transform) override {} - // Overridden from ash::ShellObserver: - void OnShellDestroyed() override { - shell_->RemoveShellObserver(this); - shell_ = nullptr; - // Make sure frame sink never outlives the shell. + // Overridden from aura::EnvObserver: + void OnWindowInitialized(aura::Window* window) override {} + void OnWillDestroyEnv() override { + env_->RemoveObserver(this); + env_ = nullptr; + // Make sure frame sink never outlives aura. frame_sink_->DetachFromClient(); frame_sink_.reset(); ScheduleDelete(); @@ -255,7 +255,7 @@ exported_resources_; gfx::Size last_frame_size_in_pixels_; float last_frame_device_scale_factor_ = 1.0f; - ash::Shell* shell_ = nullptr; + aura::Env* env_ = nullptr; bool delete_pending_ = false; DISALLOW_COPY_AND_ASSIGN(LayerTreeFrameSinkHolder); @@ -427,14 +427,7 @@ } } gles2->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, resource->image); - - // For mus and mash, the compositor isn't sharing the GPU channel with - // FastInkView, so it cannot consume unverified sync token generated here. - // We need generate verified sync token for mus and mash. - if (ash::Shell::GetAshConfig() == ash::Config::CLASSIC) - gles2->GenUnverifiedSyncTokenCHROMIUM(resource->sync_token.GetData()); - else - gles2->GenSyncTokenCHROMIUM(resource->sync_token.GetData()); + gles2->GenSyncTokenCHROMIUM(resource->sync_token.GetData()); resource->damaged = false; } @@ -521,4 +514,4 @@ returned_resources_.push_back(std::move(resource)); } -} // namespace ash +} // namespace fast_ink
diff --git a/ash/fast_ink/fast_ink_view.h b/ash/components/fast_ink/fast_ink_view.h similarity index 93% rename from ash/fast_ink/fast_ink_view.h rename to ash/components/fast_ink/fast_ink_view.h index ad32cde..75143935 100644 --- a/ash/fast_ink/fast_ink_view.h +++ b/ash/components/fast_ink/fast_ink_view.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef ASH_FAST_INK_FAST_INK_VIEW_H_ -#define ASH_FAST_INK_FAST_INK_VIEW_H_ +#ifndef ASH_COMPONENTS_FAST_INK_FAST_INK_VIEW_H_ +#define ASH_COMPONENTS_FAST_INK_FAST_INK_VIEW_H_ #include <memory> #include <vector> @@ -27,7 +27,7 @@ class Widget; } -namespace ash { +namespace fast_ink { // FastInkView is a view supporting low-latency rendering. The view can enter // 'auto-refresh' mode in order to provide minimum latency updates for the @@ -94,6 +94,6 @@ DISALLOW_COPY_AND_ASSIGN(FastInkView); }; -} // namespace ash +} // namespace fast_ink -#endif // ASH_FAST_INK_FAST_INK_VIEW_H_ +#endif // ASH_COMPONENTS_FAST_INK_FAST_INK_VIEW_H_
diff --git a/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc b/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc index 04914c9d..21246573 100644 --- a/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc +++ b/ash/components/shortcut_viewer/views/keyboard_shortcut_view.cc
@@ -15,6 +15,7 @@ #include "ash/components/strings/grit/ash_components_strings.h" #include "ash/public/cpp/shelf_item.h" #include "ash/public/cpp/window_properties.h" +#include "base/bind.h" #include "base/i18n/string_search.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -174,24 +175,44 @@ for (const auto& item : GetKeyboardShortcutItemList()) { for (auto category : item.categories) { shortcut_views_.emplace_back( - new KeyboardShortcutItemView(item, category)); + std::make_unique<KeyboardShortcutItemView>(item, category)); + shortcut_views_.back()->set_owned_by_client(); } } std::sort(shortcut_views_.begin(), shortcut_views_.end(), - [](KeyboardShortcutItemView* lhs, KeyboardShortcutItemView* rhs) { + [](const auto& lhs, const auto& rhs) { if (lhs->category() != rhs->category()) return lhs->category() < rhs->category(); return lhs->description_label_view()->text() < rhs->description_label_view()->text(); }); - // Init views of TabbedPane and KeyboardShortcutItemListView. - tabbed_pane_ = + // Init views of |categories_tabbed_pane_| and KeyboardShortcutItemListViews. + categories_tabbed_pane_ = new views::TabbedPane(views::TabbedPane::Orientation::kVertical, views::TabbedPane::TabStripStyle::kHighlight); + AddChildView(categories_tabbed_pane_); + InitCategoriesTabbedPane(); +} + +void KeyboardShortcutView::InitCategoriesTabbedPane() { + // If the tab count is 0, |GetSelectedTabIndex()| will return -1, which we do + // not want to cache. + active_tab_index_ = + std::max(0, categories_tabbed_pane_->GetSelectedTabIndex()); + // Although we remove all child views, when the KeyboardShortcutItemView is + // added back to the |categories_tabbed_pane_|, because there is no width + // changes, it will not layout the KeyboardShortcutItemView again due to the + // |MaybeCalculateAndDoLayout()| optimization in KeyboardShortcutItemView. + // Cannot remove |tab_strip_| and |contents_|, child views of the + // |categories_tabbed_pane_|, because they are added in the ctor of + // TabbedPane. + categories_tabbed_pane_->child_at(0)->RemoveAllChildViews(true); + categories_tabbed_pane_->child_at(1)->RemoveAllChildViews(true); + ShortcutCategory current_category = ShortcutCategory::kUnknown; KeyboardShortcutItemListView* item_list_view; - for (auto* item_view : shortcut_views_) { + for (const auto& item_view : shortcut_views_) { const ShortcutCategory category = item_view->category(); DCHECK_NE(ShortcutCategory::kUnknown, category); if (current_category != category) { @@ -199,20 +220,26 @@ item_list_view = new KeyboardShortcutItemListView(); views::ScrollView* const scroller = CreateScrollView(); scroller->SetContents(item_list_view); - tabbed_pane_->AddTab(GetStringForCategory(current_category), scroller); + categories_tabbed_pane_->AddTab(GetStringForCategory(current_category), + scroller); } if (item_list_view->has_children()) item_list_view->AddHorizontalSeparator(); - item_list_view->AddChildView(item_view); + views::StyledLabel* description_label_view = + item_view->description_label_view(); + // Clear any styles used to highlight matched search query in search mode. + description_label_view->ClearStyleRanges(); + item_list_view->AddChildView(item_view.get()); + // Remove the search query highlight. + description_label_view->Layout(); } - AddChildView(tabbed_pane_); } void KeyboardShortcutView::RequestFocusForActiveTab() { - // Get the |tab_strip_| of the |tabbed_pane_| in order to set focus on - // the selected tab. - tabbed_pane_->child_at(0) - ->child_at(tabbed_pane_->GetSelectedTabIndex()) + // Get the |tab_strip_| of the |categories_tabbed_pane_| in order to set focus + // on the selected tab. + categories_tabbed_pane_->child_at(0) + ->child_at(active_tab_index_) ->RequestFocus(); } @@ -252,9 +279,9 @@ search_box_bounds.set_y(top + kSearchBoxTopPadding); search_box_view_->SetBoundsRect(search_box_bounds); - views::View* content_view = - tabbed_pane_->visible() ? tabbed_pane_ : search_results_container_; - + views::View* content_view = categories_tabbed_pane_->visible() + ? categories_tabbed_pane_ + : search_results_container_; const int search_box_used_height = search_box_bounds.height() + kSearchBoxTopPadding + kSearchBoxBottomPadding; @@ -275,19 +302,71 @@ UpdateViewsLayout(/*is_search_box_active=*/true); } + debounce_timer_.Stop(); // If search box is empty, do not show |search_results_container_|. if (query_empty) return; + // TODO(wutao): This timeout value is chosen based on subjective search + // latency tests on Minnie. Objective method or UMA is desired. + constexpr base::TimeDelta kTimeOut(base::TimeDelta::FromMilliseconds(250)); + debounce_timer_.Start( + FROM_HERE, kTimeOut, + base::Bind(&KeyboardShortcutView::ShowSearchResults, + base::Unretained(this), sender->search_box()->text())); +} + +void KeyboardShortcutView::ActiveChanged( + search_box::SearchBoxViewBase* sender) { + const bool is_search_box_active = sender->is_search_box_active(); + is_search_box_empty_ = sender->IsSearchBoxTrimmedQueryEmpty(); + sender->ShowBackOrGoogleIcon(is_search_box_active); + if (is_search_box_active) { + base::RecordAction( + base::UserMetricsAction("KeyboardShortcutViewer.Search")); + } + UpdateViewsLayout(is_search_box_active); +} + +void KeyboardShortcutView::UpdateViewsLayout(bool is_search_box_active) { + // 1. Search box is not active: show |categories_tabbed_pane_| and focus on + // active tab. + // 2. Search box is active and empty: show |categories_tabbed_pane_| but focus + // on search box. + // 3. Search box is not empty, show |search_results_container_|. Focus is on + // search box. + const bool should_show_search_results = + is_search_box_active && !is_search_box_empty_; + if (!should_show_search_results) { + // Remove all child views, including horizontal separator lines, to prepare + // for showing search results next time. + search_results_container_->RemoveAllChildViews(true); + if (!categories_tabbed_pane_->visible()) { + // Repopulate |categories_tabbed_pane_| child views, which were removed + // when they were added to |search_results_container_|. + InitCategoriesTabbedPane(); + // Select the category that was active before entering search mode. + categories_tabbed_pane_->SelectTabAt(active_tab_index_); + } + if (!is_search_box_active) + RequestFocusForActiveTab(); + } + categories_tabbed_pane_->SetVisible(!should_show_search_results); + search_results_container_->SetVisible(should_show_search_results); + Layout(); + SchedulePaint(); +} + +void KeyboardShortcutView::ShowSearchResults( + const base::string16& search_query) { search_results_container_->RemoveAllChildViews(true); auto* search_container_content_view = search_no_result_view_.get(); auto found_items_list_view = std::make_unique<KeyboardShortcutItemListView>(); - const base::string16& new_contents = sender->search_box()->text(); base::i18n::FixedPatternStringSearchIgnoringCaseAndAccents finder( - new_contents); + search_query); ShortcutCategory current_category = ShortcutCategory::kUnknown; bool has_category_item = false; - for (auto* item_view : shortcut_views_) { + for (const auto& item_view : shortcut_views_) { base::string16 description_text = item_view->description_label_view()->text(); base::string16 shortcut_text = item_view->shortcut_label_view()->text(); @@ -310,20 +389,22 @@ found_items_list_view->AddHorizontalSeparator(); else has_category_item = true; - auto* matched_item_view = - new KeyboardShortcutItemView(*item_view->shortcut_item(), category); // Highlight matched query in |description_label_view_|. if (match_length > 0) { views::StyledLabel::RangeStyleInfo style; views::StyledLabel* description_label_view = - matched_item_view->description_label_view(); + item_view->description_label_view(); + // Clear previous styles. + description_label_view->ClearStyleRanges(); style.custom_font = description_label_view->GetDefaultFontList().Derive( 0, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::BOLD); description_label_view->AddStyleRange( gfx::Range(match_index, match_index + match_length), style); + // Apply new styles to highlight matched search query. + description_label_view->Layout(); } - found_items_list_view->AddChildView(matched_item_view); + found_items_list_view->AddChildView(item_view.get()); } } @@ -338,47 +419,23 @@ scroller->SetContents(found_items_list_view.release()); search_container_content_view = scroller; } + search_results_container_->AddChildView(search_container_content_view); Layout(); SchedulePaint(); } -void KeyboardShortcutView::ActiveChanged( - search_box::SearchBoxViewBase* sender) { - const bool is_search_box_active = sender->is_search_box_active(); - is_search_box_empty_ = sender->IsSearchBoxTrimmedQueryEmpty(); - sender->ShowBackOrGoogleIcon(is_search_box_active); - if (is_search_box_active) { - base::RecordAction( - base::UserMetricsAction("KeyboardShortcutViewer.Search")); - } - UpdateViewsLayout(is_search_box_active); -} - -void KeyboardShortcutView::UpdateViewsLayout(bool is_search_box_active) { - // 1. Search box is not active: show |tabbed_pane_| and focus on active tab. - // 2. Search box is active and empty: show |tabbed_pane_| but focus on search - // box. - // 3. Search box is not empty, show |search_results_container_|. Focus is on - // search box. - const bool should_show_search_results = - is_search_box_active && !is_search_box_empty_; - search_results_container_->SetVisible(should_show_search_results); - tabbed_pane_->SetVisible(!should_show_search_results); - if (!is_search_box_active) { - search_results_container_->RemoveAllChildViews(true); - RequestFocusForActiveTab(); - } - Layout(); - SchedulePaint(); -} - KeyboardShortcutView* KeyboardShortcutView::GetInstanceForTesting() { return g_ksv_view; } int KeyboardShortcutView::GetTabCountForTesting() const { - return tabbed_pane_->GetTabCount(); + return categories_tabbed_pane_->GetTabCount(); +} + +const std::vector<std::unique_ptr<KeyboardShortcutItemView>>& +KeyboardShortcutView::GetShortcutViewsForTesting() const { + return shortcut_views_; } } // namespace keyboard_shortcut_viewer
diff --git a/ash/components/shortcut_viewer/views/keyboard_shortcut_view.h b/ash/components/shortcut_viewer/views/keyboard_shortcut_view.h index cb00eab..47f212f9 100644 --- a/ash/components/shortcut_viewer/views/keyboard_shortcut_view.h +++ b/ash/components/shortcut_viewer/views/keyboard_shortcut_view.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/macros.h" +#include "base/timer/timer.h" #include "ui/chromeos/search_box/search_box_view_delegate.h" #include "ui/views/widget/widget_delegate.h" @@ -48,6 +49,10 @@ void InitViews(); + // Initialize |categories_tabbed_pane_| with category tabs and containers of + // |shortcut_views_|, called on construction and when exiting search mode. + void InitCategoriesTabbedPane(); + // Put focus on the active tab. Used when the first time to show the widget or // after exiting search mode. void RequestFocusForActiveTab(); @@ -55,11 +60,8 @@ // Update views' layout based on search box status. void UpdateViewsLayout(bool is_search_box_active); - static KeyboardShortcutView* GetInstanceForTesting(); - int GetTabCountForTesting() const; - const std::vector<KeyboardShortcutItemView*>& GetShortcutViewsForTesting() { - return shortcut_views_; - } + // Show search results in |search_results_container_|. + void ShowSearchResults(const base::string16& search_query); // views::WidgetDelegate: bool CanMaximize() const override; @@ -67,17 +69,25 @@ bool CanResize() const override; views::ClientView* CreateClientView(views::Widget* widget) override; + static KeyboardShortcutView* GetInstanceForTesting(); + int GetTabCountForTesting() const; + const std::vector<std::unique_ptr<KeyboardShortcutItemView>>& + GetShortcutViewsForTesting() const; + // Owned by views hierarchy. - views::TabbedPane* tabbed_pane_; - views::View* search_results_container_; + // The container for category tabs and lists of KeyboardShortcutItemViews. + views::TabbedPane* categories_tabbed_pane_ = nullptr; + // The container for KeyboardShortcutItemViews matching a user's query. + views::View* search_results_container_ = nullptr; // SearchBoxViewBase is a WidgetDelegateView, which owns itself and cannot be // deleted from the views hierarchy automatically. std::unique_ptr<KSVSearchBoxView> search_box_view_; - // Contains all the shortcut item views from all categories. This list is used - // for searching. The views are owned by the Views hierarchy. - std::vector<KeyboardShortcutItemView*> shortcut_views_; + // Contains all the shortcut item views from all categories. This list is also + // used for searching. The views are not owned by the Views hierarchy to avoid + // KeyboardShortcutItemView layout when switching between tabs and search. + std::vector<std::unique_ptr<KeyboardShortcutItemView>> shortcut_views_; // An illustration to indicate no search results found. Since this view need // to be added and removed frequently from the |search_results_container_|, it @@ -88,6 +98,12 @@ // update views' layout. bool is_search_box_empty_ = true; + // Cached value of active tab index before entering search mode. + int active_tab_index_ = 0; + + // Debounce for search queries. + base::OneShotTimer debounce_timer_; + DISALLOW_COPY_AND_ASSIGN(KeyboardShortcutView); };
diff --git a/ash/components/shortcut_viewer/views/keyboard_shortcut_view_unittest.cc b/ash/components/shortcut_viewer/views/keyboard_shortcut_view_unittest.cc index 59e07dc..b43ab0a 100644 --- a/ash/components/shortcut_viewer/views/keyboard_shortcut_view_unittest.cc +++ b/ash/components/shortcut_viewer/views/keyboard_shortcut_view_unittest.cc
@@ -25,7 +25,8 @@ return GetView()->GetTabCountForTesting(); } - const std::vector<KeyboardShortcutItemView*>& GetShortcutViews() { + const std::vector<std::unique_ptr<KeyboardShortcutItemView>>& + GetShortcutViews() { DCHECK(GetView()); return GetView()->GetShortcutViewsForTesting(); } @@ -55,7 +56,7 @@ int category_number = 0; ShortcutCategory current_category = ShortcutCategory::kUnknown; - for (auto* item_view : GetShortcutViews()) { + for (const auto& item_view : GetShortcutViews()) { const ShortcutCategory category = item_view->category(); if (current_category != category) { DCHECK(current_category < category); @@ -74,7 +75,7 @@ // Showing the widget. views::Widget* widget = KeyboardShortcutView::Show(CurrentContext()); - for (auto* item_view : GetShortcutViews()) { + for (const auto& item_view : GetShortcutViews()) { DCHECK(item_view->child_count() == 2); // The top lines in both |description_label_view_| and
diff --git a/ash/display/display_move_window_util.cc b/ash/display/display_move_window_util.cc index 75fc7a0..c5b17fa8 100644 --- a/ash/display/display_move_window_util.cc +++ b/ash/display/display_move_window_util.cc
@@ -9,7 +9,7 @@ #include <array> #include "ash/accessibility/accessibility_controller.h" -#include "ash/public/cpp/ash_switches.h" +#include "ash/public/cpp/ash_features.h" #include "ash/shell.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/window_util.h" @@ -47,7 +47,7 @@ } // namespace bool CanHandleMoveActiveWindowBetweenDisplays() { - if (!switches::IsDisplayMoveWindowAccelsEnabled()) + if (!features::IsDisplayMoveWindowAccelsEnabled()) return false; display::DisplayManager* display_manager = Shell::Get()->display_manager(); // Accelerators to move window between displays on unified desktop mode and @@ -76,7 +76,7 @@ display::CreateDisplayIdList(displays); // Find target display id in sorted display id list in a cycling way. auto itr = std::upper_bound(display_id_list.begin(), display_id_list.end(), - origin_display_id); + origin_display_id, display::CompareDisplayIds); int64_t target_display_id = itr == display_id_list.end() ? display_id_list[0] : *itr; wm::MoveWindowToDisplay(window, target_display_id);
diff --git a/ash/display/display_move_window_util_unittest.cc b/ash/display/display_move_window_util_unittest.cc index 1e5f1c0..73faae55 100644 --- a/ash/display/display_move_window_util_unittest.cc +++ b/ash/display/display_move_window_util_unittest.cc
@@ -8,7 +8,7 @@ #include "ash/accelerators/accelerator_table.h" #include "ash/accessibility/accessibility_controller.h" #include "ash/accessibility/test_accessibility_controller_client.h" -#include "ash/public/cpp/ash_switches.h" +#include "ash/public/cpp/ash_features.h" #include "ash/root_window_controller.h" #include "ash/screen_util.h" #include "ash/shell.h" @@ -19,6 +19,7 @@ #include "ash/wm/wm_event.h" #include "base/command_line.h" #include "base/macros.h" +#include "base/test/scoped_feature_list.h" #include "ui/aura/test/test_windows.h" #include "ui/display/display.h" #include "ui/display/display_layout.h" @@ -74,12 +75,15 @@ // AshTestBase: void SetUp() override { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kAshEnableDisplayMoveWindowAccels); + // Explicitly enable the display move window accels feature for the tests. + scoped_feature_list_.InitAndEnableFeature( + features::kDisplayMoveWindowAccels); AshTestBase::SetUp(); } private: + base::test::ScopedFeatureList scoped_feature_list_; + DISALLOW_COPY_AND_ASSIGN(DisplayMoveWindowUtilTest); };
diff --git a/ash/display/persistent_window_controller_unittest.cc b/ash/display/persistent_window_controller_unittest.cc index ca0d0c77..51e8dd4 100644 --- a/ash/display/persistent_window_controller_unittest.cc +++ b/ash/display/persistent_window_controller_unittest.cc
@@ -6,6 +6,7 @@ #include "ash/display/display_move_window_util.h" #include "ash/display/window_tree_host_manager.h" +#include "ash/public/cpp/ash_features.h" #include "ash/public/cpp/ash_switches.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" @@ -14,6 +15,7 @@ #include "ash/wm/window_util.h" #include "base/command_line.h" #include "base/test/histogram_tester.h" +#include "base/test/scoped_feature_list.h" using session_manager::SessionState; @@ -26,14 +28,16 @@ // AshTestBase: void SetUp() override { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - switches::kAshEnableDisplayMoveWindowAccels); + scoped_feature_list_.InitAndEnableFeature( + features::kDisplayMoveWindowAccels); base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kAshEnablePersistentWindowBounds); AshTestBase::SetUp(); } private: + base::test::ScopedFeatureList scoped_feature_list_; + DISALLOW_COPY_AND_ASSIGN(PersistentWindowControllerTest); };
diff --git a/ash/fast_ink/DEPS b/ash/fast_ink/DEPS deleted file mode 100644 index 57b8ea9..0000000 --- a/ash/fast_ink/DEPS +++ /dev/null
@@ -1,5 +0,0 @@ -include_rules = [ - "+cc", - "+components/viz/common/gpu", - "+gpu/command_buffer/client", -]
diff --git a/ash/frame/OWNERS b/ash/frame/OWNERS deleted file mode 100644 index e710530..0000000 --- a/ash/frame/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -pkotwicz@chromium.org
diff --git a/ash/highlighter/DEPS b/ash/highlighter/DEPS index 2067a546..b5c982c 100644 --- a/ash/highlighter/DEPS +++ b/ash/highlighter/DEPS
@@ -1,3 +1,3 @@ include_rules = [ - "+ash/fast_ink", + "+ash/components/fast_ink", ]
diff --git a/ash/highlighter/highlighter_controller.cc b/ash/highlighter/highlighter_controller.cc index 3267f76..0d4a2e9 100644 --- a/ash/highlighter/highlighter_controller.cc +++ b/ash/highlighter/highlighter_controller.cc
@@ -13,6 +13,7 @@ #include "ash/public/cpp/scale_utility.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" +#include "ash/system/palette/palette_utils.h" #include "base/metrics/histogram_macros.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" @@ -55,9 +56,13 @@ } // namespace HighlighterController::HighlighterController() - : binding_(this), weak_factory_(this) {} + : binding_(this), weak_factory_(this) { + Shell::Get()->AddPreTargetHandler(this); +} -HighlighterController::~HighlighterController() = default; +HighlighterController::~HighlighterController() { + Shell::Get()->RemovePreTargetHandler(this); +} void HighlighterController::SetExitCallback(base::OnceClosure exit_callback, bool require_success) { @@ -159,7 +164,7 @@ highlighter_view_->GetWidget()->GetNativeWindow()->GetRootWindow(); const gfx::Rect bounds = current_window->bounds(); - const FastInkPoints& points = highlighter_view_->points(); + const fast_ink::FastInkPoints& points = highlighter_view_->points(); gfx::RectF box = points.GetBoundingBoxF(); const HighlighterGestureType gesture_type = @@ -232,6 +237,9 @@ } bool HighlighterController::CanStartNewGesture(ui::TouchEvent* event) { + // Ignore events over the palette. + if (ash::palette_utils::PaletteContainsPointInScreen(event->root_location())) + return false; return !interrupted_stroke_timer_ && FastInkPointerController::CanStartNewGesture(event); }
diff --git a/ash/highlighter/highlighter_controller.h b/ash/highlighter/highlighter_controller.h index 0d39502..7136d0e 100644 --- a/ash/highlighter/highlighter_controller.h +++ b/ash/highlighter/highlighter_controller.h
@@ -7,7 +7,8 @@ #include <memory> -#include "ash/fast_ink/fast_ink_pointer_controller.h" +#include "ash/ash_export.h" +#include "ash/components/fast_ink/fast_ink_pointer_controller.h" #include "ash/public/interfaces/highlighter_controller.mojom.h" #include "base/callback.h" #include "base/memory/weak_ptr.h" @@ -25,8 +26,9 @@ // Controller for the highlighter functionality. // Enables/disables highlighter as well as receives points // and passes them off to be rendered. -class ASH_EXPORT HighlighterController : public FastInkPointerController, - public mojom::HighlighterController { +class ASH_EXPORT HighlighterController + : public fast_ink::FastInkPointerController, + public mojom::HighlighterController { public: HighlighterController(); ~HighlighterController() override; @@ -37,7 +39,7 @@ // after the first complete gesture, regardless of the recognition result. void SetExitCallback(base::OnceClosure callback, bool require_success); - // FastInkPointerController: + // fast_ink::FastInkPointerController: void SetEnabled(bool enabled) override; void BindRequest(mojom::HighlighterControllerRequest request); @@ -49,7 +51,7 @@ private: friend class HighlighterControllerTestApi; - // FastInkPointerController: + // fast_ink::FastInkPointerController: views::View* GetPointerView() const override; void CreatePointerView(base::TimeDelta presentation_delay, aura::Window* root_window) override;
diff --git a/ash/highlighter/highlighter_controller_test_api.cc b/ash/highlighter/highlighter_controller_test_api.cc index e10f4c1..ec010f8 100644 --- a/ash/highlighter/highlighter_controller_test_api.cc +++ b/ash/highlighter/highlighter_controller_test_api.cc
@@ -4,7 +4,7 @@ #include "ash/highlighter/highlighter_controller_test_api.h" -#include "ash/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_points.h" #include "ash/highlighter/highlighter_controller.h" #include "ash/highlighter/highlighter_view.h" @@ -74,11 +74,12 @@ instance_->interrupted_stroke_timer_->IsRunning(); } -const FastInkPoints& HighlighterControllerTestApi::points() const { +const fast_ink::FastInkPoints& HighlighterControllerTestApi::points() const { return instance_->highlighter_view_->points_; } -const FastInkPoints& HighlighterControllerTestApi::predicted_points() const { +const fast_ink::FastInkPoints& HighlighterControllerTestApi::predicted_points() + const { return instance_->highlighter_view_->predicted_points_; }
diff --git a/ash/highlighter/highlighter_controller_test_api.h b/ash/highlighter/highlighter_controller_test_api.h index 67c9dc25..8349d32 100644 --- a/ash/highlighter/highlighter_controller_test_api.h +++ b/ash/highlighter/highlighter_controller_test_api.h
@@ -10,9 +10,12 @@ #include "mojo/public/cpp/bindings/binding.h" #include "ui/gfx/geometry/rect.h" +namespace fast_ink { +class FastInkPoints; +} + namespace ash { -class FastInkPoints; class HighlighterController; // An api for testing the HighlighterController class. @@ -39,8 +42,8 @@ bool IsFadingAway() const; bool IsWaitingToResumeStroke() const; bool IsShowingSelectionResult() const; - const FastInkPoints& points() const; - const FastInkPoints& predicted_points() const; + const fast_ink::FastInkPoints& points() const; + const fast_ink::FastInkPoints& predicted_points() const; void ResetEnabledState() { handle_enabled_state_changed_called_ = false; } // Flushes the mojo connection, then checks whether HandleEnabledStateChange
diff --git a/ash/highlighter/highlighter_controller_unittest.cc b/ash/highlighter/highlighter_controller_unittest.cc index ba9a7df8..b64adfae 100644 --- a/ash/highlighter/highlighter_controller_unittest.cc +++ b/ash/highlighter/highlighter_controller_unittest.cc
@@ -6,7 +6,7 @@ #include <memory> -#include "ash/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_points.h" #include "ash/highlighter/highlighter_controller_test_api.h" #include "ash/public/cpp/config.h" #include "ash/shell.h"
diff --git a/ash/highlighter/highlighter_gesture_util.cc b/ash/highlighter/highlighter_gesture_util.cc index 8e85f24..4db93a6 100644 --- a/ash/highlighter/highlighter_gesture_util.cc +++ b/ash/highlighter/highlighter_gesture_util.cc
@@ -4,7 +4,7 @@ #include "ash/highlighter/highlighter_gesture_util.h" -#include "ash/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_points.h" #include <cmath> @@ -27,7 +27,8 @@ box.height() < box.width() * kHorizontalStrokeFlatnessThreshold; } -bool DetectClosedShape(const gfx::RectF& box, const FastInkPoints& points) { +bool DetectClosedShape(const gfx::RectF& box, + const fast_ink::FastInkPoints& points) { if (points.GetNumberOfPoints() < 3) return false; @@ -85,9 +86,10 @@ } // namespace -HighlighterGestureType DetectHighlighterGesture(const gfx::RectF& box, - const gfx::SizeF& pen_tip_size, - const FastInkPoints& points) { +HighlighterGestureType DetectHighlighterGesture( + const gfx::RectF& box, + const gfx::SizeF& pen_tip_size, + const fast_ink::FastInkPoints& points) { if (DetectHorizontalStroke(box, pen_tip_size)) return HighlighterGestureType::kHorizontalStroke;
diff --git a/ash/highlighter/highlighter_gesture_util.h b/ash/highlighter/highlighter_gesture_util.h index c80babd..dc1567fb 100644 --- a/ash/highlighter/highlighter_gesture_util.h +++ b/ash/highlighter/highlighter_gesture_util.h
@@ -10,9 +10,11 @@ #include "ash/ash_export.h" #include "ui/gfx/geometry/rect_f.h" -namespace ash { - +namespace fast_ink { class FastInkPoints; +} + +namespace ash { // Highlighter gesture recognition result type. This enum is used to back // an UMA histogram and should be treated as append-only. @@ -27,7 +29,7 @@ HighlighterGestureType ASH_EXPORT DetectHighlighterGesture(const gfx::RectF& box, const gfx::SizeF& pen_tip_size, - const FastInkPoints& points); + const fast_ink::FastInkPoints& points); } // namespace ash
diff --git a/ash/highlighter/highlighter_gesture_util_unittest.cc b/ash/highlighter/highlighter_gesture_util_unittest.cc index 91790e68..88f5e53 100644 --- a/ash/highlighter/highlighter_gesture_util_unittest.cc +++ b/ash/highlighter/highlighter_gesture_util_unittest.cc
@@ -3,7 +3,7 @@ // found in the LICENSE file. #include "ash/highlighter/highlighter_gesture_util.h" -#include "ash/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_points.h" #include "ash/test/ash_test_base.h" #include "ui/gfx/geometry/rect_conversions.h" @@ -30,7 +30,7 @@ ~HighlighterGestureUtilTest() override = default; protected: - FastInkPoints points_; + fast_ink::FastInkPoints points_; void MoveTo(float x, float y) { AddPoint(x, y); }
diff --git a/ash/highlighter/highlighter_view.cc b/ash/highlighter/highlighter_view.cc index 9bed51d66..7eb937f 100644 --- a/ash/highlighter/highlighter_view.cc +++ b/ash/highlighter/highlighter_view.cc
@@ -220,10 +220,10 @@ // is exactly kPenTipHeight. const int height = kPenTipHeight - kPenTipWidth; - FastInkPoints::FastInkPoint previous_point; + fast_ink::FastInkPoints::FastInkPoint previous_point; for (int i = 0; i < num_points; ++i) { - FastInkPoints::FastInkPoint current_point; + fast_ink::FastInkPoints::FastInkPoint current_point; if (i < points_.GetNumberOfPoints()) { current_point = points_.points()[i]; } else {
diff --git a/ash/highlighter/highlighter_view.h b/ash/highlighter/highlighter_view.h index e508e4f5..e14fc84 100644 --- a/ash/highlighter/highlighter_view.h +++ b/ash/highlighter/highlighter_view.h
@@ -7,8 +7,8 @@ #include <vector> -#include "ash/fast_ink/fast_ink_points.h" -#include "ash/fast_ink/fast_ink_view.h" +#include "ash/components/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_view.h" #include "base/time/time.h" namespace aura { @@ -26,7 +26,7 @@ // HighlighterView displays the highlighter palette tool. It draws the // highlighter stroke which consists of a series of thick lines connecting // touch points. -class HighlighterView : public FastInkView { +class HighlighterView : public fast_ink::FastInkView { public: static const SkColor kPenColor; static const gfx::SizeF kPenTipSize; @@ -35,7 +35,7 @@ aura::Window* container); ~HighlighterView() override; - const FastInkPoints& points() const { return points_; } + const fast_ink::FastInkPoints& points() const { return points_; } bool animating() const { return animation_timer_.get(); } void AddNewPoint(const gfx::PointF& new_point, const base::TimeTicks& time); @@ -54,8 +54,8 @@ void UpdateBuffer(); void Draw(gfx::Canvas& canvas); - FastInkPoints points_; - FastInkPoints predicted_points_; + fast_ink::FastInkPoints points_; + fast_ink::FastInkPoints predicted_points_; const base::TimeDelta presentation_delay_; std::unique_ptr<base::OneShotTimer> animation_timer_; gfx::Rect highlighter_damage_rect_;
diff --git a/ash/keyboard/keyboard_ui.cc b/ash/keyboard/keyboard_ui.cc index 6e1390a..16b64a4 100644 --- a/ash/keyboard/keyboard_ui.cc +++ b/ash/keyboard/keyboard_ui.cc
@@ -7,9 +7,9 @@ #include <memory> #include "ash/accessibility/accessibility_controller.h" +#include "ash/accessibility/accessibility_observer.h" #include "ash/keyboard/keyboard_ui_observer.h" #include "ash/shell.h" -#include "ash/system/accessibility_observer.h" #include "ash/system/tray/system_tray_notifier.h" #include "ash/system/tray_accessibility.h" #include "ui/keyboard/keyboard_controller.h" @@ -19,12 +19,12 @@ class KeyboardUIImpl : public KeyboardUI, public AccessibilityObserver { public: KeyboardUIImpl() : enabled_(false) { - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); + Shell::Get()->accessibility_controller()->AddObserver(this); } ~KeyboardUIImpl() override { - if (Shell::HasInstance() && Shell::Get()->system_tray_notifier()) - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this); + if (Shell::HasInstance() && Shell::Get()->accessibility_controller()) + Shell::Get()->accessibility_controller()->RemoveObserver(this); } void ShowInDisplay(const int64_t display_id) override {
diff --git a/ash/laser/DEPS b/ash/laser/DEPS index 2067a546..b5c982c 100644 --- a/ash/laser/DEPS +++ b/ash/laser/DEPS
@@ -1,3 +1,3 @@ include_rules = [ - "+ash/fast_ink", + "+ash/components/fast_ink", ]
diff --git a/ash/laser/laser_pointer_controller.cc b/ash/laser/laser_pointer_controller.cc index ed6f097..ff9b804 100644 --- a/ash/laser/laser_pointer_controller.cc +++ b/ash/laser/laser_pointer_controller.cc
@@ -9,6 +9,7 @@ #include "ash/laser/laser_pointer_view.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" +#include "ash/system/palette/palette_utils.h" #include "ui/display/screen.h" #include "ui/events/base_event_utils.h" #include "ui/views/widget/widget.h" @@ -31,9 +32,13 @@ } // namespace -LaserPointerController::LaserPointerController() = default; +LaserPointerController::LaserPointerController() { + Shell::Get()->AddPreTargetHandler(this); +} -LaserPointerController::~LaserPointerController() = default; +LaserPointerController::~LaserPointerController() { + Shell::Get()->RemovePreTargetHandler(this); +} void LaserPointerController::SetEnabled(bool enabled) { FastInkPointerController::SetEnabled(enabled); @@ -68,4 +73,11 @@ laser_pointer_view_.reset(); } +bool LaserPointerController::CanStartNewGesture(ui::TouchEvent* event) { + // Ignore events over the palette. + if (ash::palette_utils::PaletteContainsPointInScreen(event->root_location())) + return false; + return FastInkPointerController::CanStartNewGesture(event); +} + } // namespace ash
diff --git a/ash/laser/laser_pointer_controller.h b/ash/laser/laser_pointer_controller.h index 4e951f4..da1fa85a 100644 --- a/ash/laser/laser_pointer_controller.h +++ b/ash/laser/laser_pointer_controller.h
@@ -7,7 +7,8 @@ #include <memory> -#include "ash/fast_ink/fast_ink_pointer_controller.h" +#include "ash/ash_export.h" +#include "ash/components/fast_ink/fast_ink_pointer_controller.h" namespace ash { @@ -15,23 +16,25 @@ // Controller for the laser pointer functionality. Enables/disables laser // pointer as well as receives points and passes them off to be rendered. -class ASH_EXPORT LaserPointerController : public FastInkPointerController { +class ASH_EXPORT LaserPointerController + : public fast_ink::FastInkPointerController { public: LaserPointerController(); ~LaserPointerController() override; - // FastInkPointerController: + // fast_ink::FastInkPointerController: void SetEnabled(bool enabled) override; private: friend class LaserPointerControllerTestApi; - // FastInkPointerController: + // fast_ink::FastInkPointerController: views::View* GetPointerView() const override; void CreatePointerView(base::TimeDelta presentation_delay, aura::Window* root_window) override; void UpdatePointerView(ui::TouchEvent* event) override; void DestroyPointerView() override; + bool CanStartNewGesture(ui::TouchEvent* event) override; // |laser_pointer_view_| will only hold an instance when the laser pointer is // enabled and activated (pressed or dragged).
diff --git a/ash/laser/laser_pointer_controller_test_api.cc b/ash/laser/laser_pointer_controller_test_api.cc index 9db5e53..71e90a1 100644 --- a/ash/laser/laser_pointer_controller_test_api.cc +++ b/ash/laser/laser_pointer_controller_test_api.cc
@@ -4,7 +4,7 @@ #include "ash/laser/laser_pointer_controller_test_api.h" -#include "ash/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_points.h" #include "ash/laser/laser_pointer_controller.h" #include "ash/laser/laser_pointer_view.h" @@ -29,12 +29,13 @@ !instance_->laser_pointer_view_->fadeout_done_.is_null(); } -const FastInkPoints& LaserPointerControllerTestApi::laser_points() const { +const fast_ink::FastInkPoints& LaserPointerControllerTestApi::laser_points() + const { return instance_->laser_pointer_view_->laser_points_; } -const FastInkPoints& LaserPointerControllerTestApi::predicted_laser_points() - const { +const fast_ink::FastInkPoints& +LaserPointerControllerTestApi::predicted_laser_points() const { return instance_->laser_pointer_view_->predicted_laser_points_; }
diff --git a/ash/laser/laser_pointer_controller_test_api.h b/ash/laser/laser_pointer_controller_test_api.h index 9c8fb6e..11df2a3 100644 --- a/ash/laser/laser_pointer_controller_test_api.h +++ b/ash/laser/laser_pointer_controller_test_api.h
@@ -7,9 +7,12 @@ #include "base/macros.h" +namespace fast_ink { +class FastInkPoints; +} + namespace ash { -class FastInkPoints; class LaserPointerController; class LaserPointerView; @@ -22,8 +25,8 @@ void SetEnabled(bool enabled); bool IsShowingLaserPointer() const; bool IsFadingAway() const; - const FastInkPoints& laser_points() const; - const FastInkPoints& predicted_laser_points() const; + const fast_ink::FastInkPoints& laser_points() const; + const fast_ink::FastInkPoints& predicted_laser_points() const; LaserPointerView* laser_pointer_view() const; private:
diff --git a/ash/laser/laser_pointer_view.h b/ash/laser/laser_pointer_view.h index 4fd9b330..887a9892 100644 --- a/ash/laser/laser_pointer_view.h +++ b/ash/laser/laser_pointer_view.h
@@ -5,15 +5,15 @@ #ifndef ASH_LASER_LASER_POINTER_VIEW_H_ #define ASH_LASER_LASER_POINTER_VIEW_H_ -#include "ash/fast_ink/fast_ink_points.h" -#include "ash/fast_ink/fast_ink_view.h" +#include "ash/components/fast_ink/fast_ink_points.h" +#include "ash/components/fast_ink/fast_ink_view.h" namespace ash { // LaserPointerView displays the palette tool laser pointer. It draws the laser, // which consists of a point where the mouse cursor should be, as well as a // trail of lines to help users track. -class LaserPointerView : public FastInkView { +class LaserPointerView : public fast_ink::FastInkView { public: LaserPointerView(base::TimeDelta life_duration, base::TimeDelta presentation_delay, @@ -37,8 +37,8 @@ gfx::Rect GetBoundingBox(); void Draw(gfx::Canvas& canvas); - FastInkPoints laser_points_; - FastInkPoints predicted_laser_points_; + fast_ink::FastInkPoints laser_points_; + fast_ink::FastInkPoints predicted_laser_points_; const base::TimeDelta presentation_delay_; // Timer which will add a new stationary point when the stylus stops moving. // This will remove points that are too old.
diff --git a/ash/magnifier/docked_magnifier_controller.cc b/ash/magnifier/docked_magnifier_controller.cc index 4ef1c6a0..0ebae3c 100644 --- a/ash/magnifier/docked_magnifier_controller.cc +++ b/ash/magnifier/docked_magnifier_controller.cc
@@ -16,7 +16,6 @@ #include "ash/shelf/shelf.h" #include "ash/shelf/shelf_layout_manager.h" #include "ash/shell.h" -#include "ash/system/tray/system_tray_notifier.h" #include "base/numerics/ranges.h" #include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_registry_simple.h" @@ -524,7 +523,7 @@ // Update the green checkmark status in the accessibility menu in the system // tray. - shell->system_tray_notifier()->NotifyAccessibilityStatusChanged( + shell->accessibility_controller()->NotifyAccessibilityStatusChanged( A11Y_NOTIFICATION_NONE); // We use software composited mouse cursor so that it can be mirrored into the
diff --git a/ash/public/cpp/ash_features.cc b/ash/public/cpp/ash_features.cc index a335c2e..882c29f 100644 --- a/ash/public/cpp/ash_features.cc +++ b/ash/public/cpp/ash_features.cc
@@ -7,6 +7,9 @@ namespace ash { namespace features { +const base::Feature kDisplayMoveWindowAccels{"DisplayMoveWindowAccels", + base::FEATURE_ENABLED_BY_DEFAULT}; + const base::Feature kDockedMagnifier{"DockedMagnifier", base::FEATURE_ENABLED_BY_DEFAULT}; @@ -22,6 +25,10 @@ const base::Feature kLockScreenNotifications{"LockScreenNotifications", base::FEATURE_DISABLED_BY_DEFAULT}; +bool IsDisplayMoveWindowAccelsEnabled() { + return base::FeatureList::IsEnabled(kDisplayMoveWindowAccels); +} + bool IsDockedMagnifierEnabled() { return base::FeatureList::IsEnabled(kDockedMagnifier); }
diff --git a/ash/public/cpp/ash_features.h b/ash/public/cpp/ash_features.h index 55a4366..1551c70 100644 --- a/ash/public/cpp/ash_features.h +++ b/ash/public/cpp/ash_features.h
@@ -11,6 +11,11 @@ namespace ash { namespace features { +// Enables the keyboard shortcut to move active window between displays. +// TODO(warx): Remove this after the feature is fully launched. +// https://crbug.com/773749. +ASH_PUBLIC_EXPORT extern const base::Feature kDisplayMoveWindowAccels; + // Enables the docked (a.k.a. picture-in-picture) magnifier. // TODO(afakhry): Remove this after the feature is fully launched. // https://crbug.com/709824. @@ -32,6 +37,8 @@ // Enables notifications on the lock screen. ASH_PUBLIC_EXPORT extern const base::Feature kLockScreenNotifications; +ASH_PUBLIC_EXPORT bool IsDisplayMoveWindowAccelsEnabled(); + ASH_PUBLIC_EXPORT bool IsDockedMagnifierEnabled(); ASH_PUBLIC_EXPORT bool IsKeyboardShortcutViewerEnabled();
diff --git a/ash/public/cpp/ash_switches.cc b/ash/public/cpp/ash_switches.cc index 1cb55dc..5e38cf60 100644 --- a/ash/public/cpp/ash_switches.cc +++ b/ash/public/cpp/ash_switches.cc
@@ -41,11 +41,6 @@ // TODO(oshima): Remove this once the feature is launched. crbug.com/749713. const char kAshEnableV1AppBackButton[] = "ash-enable-v1-app-back-button"; -// Enables move window between displays accelerators. -// TODO(warx): Remove this once the feature is launched. crbug.com/773749. -const char kAshEnableDisplayMoveWindowAccels[] = - "ash-enable-display-move-window-accels"; - // Enables key bindings to scroll magnified screen. const char kAshEnableMagnifierKeyScroller[] = "ash-enable-magnifier-key-scroller"; @@ -85,11 +80,6 @@ // to modify the dsf of the device to any non discrete value. const char kAshEnableScaleSettingsTray[] = "ash-enable-scale-settings-tray"; -// Specifies the estimated time (in milliseconds) from VSYNC event until when -// visible light can be noticed by the user. -const char kAshEstimatedPresentationDelay[] = - "ash-estimated-presentation-delay"; - // Enables the stylus tools next to the status area. const char kAshForceEnableStylusTools[] = "force-enable-stylus-tools"; @@ -164,11 +154,6 @@ // enables the IME service (i.e. InputMethodMus) instead. const char kUseIMEService[] = "use-ime-service"; -bool IsDisplayMoveWindowAccelsEnabled() { - return base::CommandLine::ForCurrentProcess()->HasSwitch( - kAshEnableDisplayMoveWindowAccels); -} - bool IsNightLightEnabled() { return base::CommandLine::ForCurrentProcess()->HasSwitch( kAshEnableNightLight);
diff --git a/ash/public/cpp/ash_switches.h b/ash/public/cpp/ash_switches.h index 182085b..0f3493b 100644 --- a/ash/public/cpp/ash_switches.h +++ b/ash/public/cpp/ash_switches.h
@@ -25,7 +25,6 @@ ASH_PUBLIC_EXPORT extern const char kAshDisableTrilinearFiltering[]; ASH_PUBLIC_EXPORT extern const char kAshDisableTouchExplorationMode[]; ASH_PUBLIC_EXPORT extern const char kAshEnableV1AppBackButton[]; -ASH_PUBLIC_EXPORT extern const char kAshEnableDisplayMoveWindowAccels[]; ASH_PUBLIC_EXPORT extern const char kAshEnableMagnifierKeyScroller[]; ASH_PUBLIC_EXPORT extern const char kAshEnableNewOverviewUi[]; ASH_PUBLIC_EXPORT extern const char kAshEnableNightLight[]; @@ -35,7 +34,6 @@ ASH_PUBLIC_EXPORT extern const char kAshEnableTabletMode[]; ASH_PUBLIC_EXPORT extern const char kAshEnableWaylandServer[]; ASH_PUBLIC_EXPORT extern const char kAshEnableMirroredScreen[]; -ASH_PUBLIC_EXPORT extern const char kAshEstimatedPresentationDelay[]; ASH_PUBLIC_EXPORT extern const char kAshForceEnableStylusTools[]; ASH_PUBLIC_EXPORT extern const char kAshUiMode[]; ASH_PUBLIC_EXPORT extern const char kAshUiModeAuto[];
diff --git a/ash/public/interfaces/BUILD.gn b/ash/public/interfaces/BUILD.gn index 4c1c82a..4fc03e9 100644 --- a/ash/public/interfaces/BUILD.gn +++ b/ash/public/interfaces/BUILD.gn
@@ -60,11 +60,15 @@ "//components/signin/public/interfaces", "//components/sync/mojo:interfaces", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//services/preferences/public/mojom", "//skia/public/interfaces", + "//ui/accessibility:ax_enums_mojo", "//ui/events/mojo:interfaces", + "//ui/gfx/geometry/mojo", "//ui/gfx/image/mojo:interfaces", "//ui/message_center/public/mojo:mojo", + "//url/mojom:url_mojom_gurl", ] component_output_prefix = "ash_public_interfaces_internal" @@ -83,5 +87,6 @@ ] deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", ] }
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc index 7c7e78b..56aca09 100644 --- a/ash/shelf/shelf_view.cc +++ b/ash/shelf/shelf_view.cc
@@ -352,19 +352,19 @@ gfx::Rect ShelfView::GetIdealBoundsOfItemIcon(const ShelfID& id) { int index = model_->ItemIndexByID(id); - if (index < 0 || last_visible_index_ < 0) + if (index < 0 || last_visible_index_ < 0 || index >= view_model_->view_size()) return gfx::Rect(); - // Map all items from overflow area to the overflow button. Note that the - // section between last_index_hidden_ and model_->FirstPanelIndex() is the - // list of invisible panel items. However, these items are currently nowhere - // represented and get dropped instead - see (crbug.com/378907). As such there - // is no way to address them or place them. We therefore move them over the - // overflow button. + + // Map items in the overflow bubble to the overflow button. if (index > last_visible_index_ && index < model_->FirstPanelIndex()) - index = last_visible_index_ + 1; + return GetMirroredRect(overflow_button_->bounds()); + const gfx::Rect& ideal_bounds(view_model_->ideal_bounds(index)); - DCHECK_NE(TYPE_APP_LIST, model_->items()[index].type); views::View* view = view_model_->view_at(index); + // The app list and back button are not ShelfButton subclass instances. + if (view == GetAppListButton() || view == GetBackButton()) + return GetMirroredRect(ideal_bounds); + CHECK_EQ(ShelfButton::kViewClassName, view->GetClassName()); ShelfButton* button = static_cast<ShelfButton*>(view); gfx::Rect icon_bounds = button->GetIconBounds();
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc index 5283e75..e5e82698b 100644 --- a/ash/shelf/shelf_view_unittest.cc +++ b/ash/shelf/shelf_view_unittest.cc
@@ -18,6 +18,7 @@ #include "ash/root_window_controller.h" #include "ash/session/session_controller.h" #include "ash/shelf/app_list_button.h" +#include "ash/shelf/back_button.h" #include "ash/shelf/overflow_bubble.h" #include "ash/shelf/overflow_bubble_view.h" #include "ash/shelf/overflow_bubble_view_test_api.h" @@ -682,47 +683,27 @@ DISALLOW_COPY_AND_ASSIGN(ShelfViewTextDirectionTest); }; -// Checks that the ideal item icon bounds match the view's bounds in the screen -// in both LTR and RTL. -TEST_P(ShelfViewTextDirectionTest, IdealBoundsOfItemIcon) { - ShelfID id = AddApp(); - ShelfButton* button = GetButtonByID(id); - gfx::Rect item_bounds = button->GetBoundsInScreen(); - gfx::Point icon_offset = button->GetIconBounds().origin(); - item_bounds.Offset(icon_offset.OffsetFromOrigin()); - gfx::Rect ideal_bounds = shelf_view_->GetIdealBoundsOfItemIcon(id); - gfx::Point screen_origin; - views::View::ConvertPointToScreen(shelf_view_, &screen_origin); - ideal_bounds.Offset(screen_origin.x(), screen_origin.y()); - EXPECT_EQ(item_bounds.x(), ideal_bounds.x()); - EXPECT_EQ(item_bounds.y(), ideal_bounds.y()); -} +// Check the ideal bounds of several items in LTR and RTL UI. +TEST_P(ShelfViewTextDirectionTest, GetIdealBoundsOfItemIcon) { + ShelfID id_1 = AddAppShortcut(); + AddButtonsUntilOverflow(); + ShelfID id_2 = AddAppShortcut(); + ShelfID id_3 = AddAppShortcut(); -// Check that items in the overflow area are returning the overflow button as -// ideal bounds. -TEST_F(ShelfViewTest, OverflowButtonBounds) { - ShelfID first_id = AddApp(); - ShelfID overflow_id = AddApp(); - int items_added = 0; - while (!test_api_->IsOverflowButtonVisible()) { - // Added button is visible after animation while in this loop. - EXPECT_TRUE(GetButtonByID(overflow_id)->visible()); - overflow_id = AddApp(); - ++items_added; - ASSERT_LT(items_added, 10000); - } - ShelfID last_id = AddApp(); + const gfx::Rect bounds_1 = shelf_view_->GetIdealBoundsOfItemIcon(id_1); + const gfx::Rect bounds_2 = shelf_view_->GetIdealBoundsOfItemIcon(id_2); + const gfx::Rect bounds_3 = shelf_view_->GetIdealBoundsOfItemIcon(id_3); - gfx::Rect first_bounds = shelf_view_->GetIdealBoundsOfItemIcon(first_id); - gfx::Rect overflow_bounds = - shelf_view_->GetIdealBoundsOfItemIcon(overflow_id); - gfx::Rect last_bounds = shelf_view_->GetIdealBoundsOfItemIcon(last_id); + EXPECT_EQ(shelf_view_->GetIdealBoundsOfItemIcon(ShelfID(kAppListId)), + shelf_view_->GetAppListButton()->GetMirroredBounds()); + EXPECT_EQ(shelf_view_->GetIdealBoundsOfItemIcon(ShelfID(kBackButtonId)), + shelf_view_->GetBackButton()->GetMirroredBounds()); - // Check that all items have the same size and that the overflow items are - // identical whereas the first one does not match either of them. - EXPECT_EQ(first_bounds.size().ToString(), last_bounds.size().ToString()); - EXPECT_NE(first_bounds.ToString(), last_bounds.ToString()); - EXPECT_EQ(overflow_bounds.ToString(), last_bounds.ToString()); + // Just items in the overflow area return the overflow button's ideal bounds. + EXPECT_NE(bounds_1, test_api_->overflow_button()->GetMirroredBounds()); + EXPECT_TRUE(GetButtonByID(id_1)->GetMirroredBounds().Contains(bounds_1)); + EXPECT_EQ(bounds_2, test_api_->overflow_button()->GetMirroredBounds()); + EXPECT_EQ(bounds_3, test_api_->overflow_button()->GetMirroredBounds()); } // Checks that shelf view contents are considered in the correct drag group. @@ -2248,6 +2229,7 @@ ink_drop_->AnimateToState(ink_drop_state); } void SnapToActivated() override { ink_drop_->SnapToActivated(); } + void SnapToHidden() override { ink_drop_->SnapToHidden(); } void SetHovered(bool is_hovered) override { ink_drop_->SetHovered(is_hovered); }
diff --git a/ash/shell/toplevel_window.cc b/ash/shell/toplevel_window.cc index 7aa4bb1e..eb6ef46 100644 --- a/ash/shell/toplevel_window.cc +++ b/ash/shell/toplevel_window.cc
@@ -82,7 +82,7 @@ bounds->SetRect(10, 150, 300, 300); } WindowPositioner::GetBoundsAndShowStateForNewWindow( - nullptr, is_saved_bounds, *show_state, bounds, show_state); + is_saved_bounds, *show_state, bounds, show_state); return true; }
diff --git a/ash/system/bluetooth/bluetooth_feature_pod_controller.cc b/ash/system/bluetooth/bluetooth_feature_pod_controller.cc new file mode 100644 index 0000000..a640331f --- /dev/null +++ b/ash/system/bluetooth/bluetooth_feature_pod_controller.cc
@@ -0,0 +1,64 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ash/system/bluetooth/bluetooth_feature_pod_controller.h" + +#include "ash/resources/vector_icons/vector_icons.h" +#include "ash/shell.h" +#include "ash/strings/grit/ash_strings.h" +#include "ash/system/bluetooth/bluetooth_power_controller.h" +#include "ash/system/bluetooth/tray_bluetooth_helper.h" +#include "ash/system/tray/system_tray_notifier.h" +#include "ash/system/unified/feature_pod_button.h" +#include "ash/system/unified/unified_system_tray_controller.h" +#include "ui/base/l10n/l10n_util.h" + +namespace ash { + +BluetoothFeaturePodController::BluetoothFeaturePodController( + UnifiedSystemTrayController* tray_controller) + : tray_controller_(tray_controller) { + Shell::Get()->system_tray_notifier()->AddBluetoothObserver(this); +} + +BluetoothFeaturePodController::~BluetoothFeaturePodController() { + Shell::Get()->system_tray_notifier()->RemoveBluetoothObserver(this); +} + +FeaturePodButton* BluetoothFeaturePodController::CreateButton() { + DCHECK(!button_); + button_ = new FeaturePodButton(this); + button_->SetVectorIcon(kSystemMenuBluetoothIcon); + UpdateButton(); + return button_; +} + +void BluetoothFeaturePodController::OnPressed() { + tray_controller_->ShowBluetoothDetailedView(); +} + +void BluetoothFeaturePodController::UpdateButton() { + bool is_available = + Shell::Get()->tray_bluetooth_helper()->GetBluetoothAvailable(); + button_->SetVisible(is_available); + if (!is_available) + return; + + bool is_enabled = + Shell::Get()->tray_bluetooth_helper()->GetBluetoothEnabled(); + button_->SetToggled(is_enabled); + button_->SetLabel(l10n_util::GetStringUTF16( + is_enabled ? IDS_ASH_STATUS_TRAY_BLUETOOTH_ENABLED + : IDS_ASH_STATUS_TRAY_BLUETOOTH_DISABLED)); +} + +void BluetoothFeaturePodController::OnBluetoothRefresh() { + UpdateButton(); +} + +void BluetoothFeaturePodController::OnBluetoothDiscoveringChanged() { + UpdateButton(); +} + +} // namespace ash
diff --git a/ash/system/bluetooth/bluetooth_feature_pod_controller.h b/ash/system/bluetooth/bluetooth_feature_pod_controller.h new file mode 100644 index 0000000..9ec4f76 --- /dev/null +++ b/ash/system/bluetooth/bluetooth_feature_pod_controller.h
@@ -0,0 +1,44 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ASH_SYSTEM_BLUETOOTH_BLUETOOTH_FEATURE_POD_CONTROLLER_H_ +#define ASH_SYSTEM_BLUETOOTH_BLUETOOTH_FEATURE_POD_CONTROLLER_H_ + +#include "ash/system/bluetooth/bluetooth_observer.h" +#include "ash/system/unified/feature_pod_controller_base.h" +#include "base/macros.h" +#include "base/strings/string16.h" + +namespace ash { + +class UnifiedSystemTrayController; + +// Controller of a feature pod button of bluetooth. +class BluetoothFeaturePodController : public FeaturePodControllerBase, + public BluetoothObserver { + public: + BluetoothFeaturePodController(UnifiedSystemTrayController* tray_controller); + ~BluetoothFeaturePodController() override; + + // FeaturePodControllerBase: + FeaturePodButton* CreateButton() override; + void OnPressed() override; + + private: + void UpdateButton(); + + // BluetoothObserver: + void OnBluetoothRefresh() override; + void OnBluetoothDiscoveringChanged() override; + + // Unowned. + UnifiedSystemTrayController* const tray_controller_; + FeaturePodButton* button_ = nullptr; + + DISALLOW_COPY_AND_ASSIGN(BluetoothFeaturePodController); +}; + +} // namespace ash + +#endif // ASH_SYSTEM_BLUETOOTH_BLUETOOTH_FEATURE_POD_CONTROLLER_H_
diff --git a/ash/system/ime/tray_ime_chromeos.cc b/ash/system/ime/tray_ime_chromeos.cc index 6fa68805..07d80c2c 100644 --- a/ash/system/ime/tray_ime_chromeos.cc +++ b/ash/system/ime/tray_ime_chromeos.cc
@@ -159,14 +159,14 @@ DCHECK(ime_controller_); SystemTrayNotifier* tray_notifier = Shell::Get()->system_tray_notifier(); tray_notifier->AddVirtualKeyboardObserver(this); - tray_notifier->AddAccessibilityObserver(this); tray_notifier->AddIMEObserver(this); + Shell::Get()->accessibility_controller()->AddObserver(this); } TrayIME::~TrayIME() { + Shell::Get()->accessibility_controller()->RemoveObserver(this); SystemTrayNotifier* tray_notifier = Shell::Get()->system_tray_notifier(); tray_notifier->RemoveIMEObserver(this); - tray_notifier->RemoveAccessibilityObserver(this); tray_notifier->RemoveVirtualKeyboardObserver(this); }
diff --git a/ash/system/ime/tray_ime_chromeos.h b/ash/system/ime/tray_ime_chromeos.h index a3a2f43..d12c0b7 100644 --- a/ash/system/ime/tray_ime_chromeos.h +++ b/ash/system/ime/tray_ime_chromeos.h
@@ -7,8 +7,8 @@ #include <stddef.h> +#include "ash/accessibility/accessibility_observer.h" #include "ash/public/interfaces/ime_info.mojom.h" -#include "ash/system/accessibility_observer.h" #include "ash/system/ime/ime_observer.h" #include "ash/system/ime_menu/ime_list_view.h" #include "ash/system/tray/system_tray_item.h"
diff --git a/ash/system/power/power_button_controller.cc b/ash/system/power/power_button_controller.cc index b56c094..d174b410 100644 --- a/ash/system/power/power_button_controller.cc +++ b/ash/system/power/power_button_controller.cc
@@ -44,6 +44,8 @@ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; params.keep_on_top = true; + params.accept_events = true; + params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; params.name = "PowerButtonMenuWindow"; params.layer_type = ui::LAYER_SOLID_COLOR; @@ -332,6 +334,11 @@ menu_widget_->SetContentsView(new PowerButtonMenuScreenView()); menu_widget_->Show(); + // Hide cursor, but let it reappear if the mouse moves. + Shell* shell = Shell::Get(); + if (shell->cursor_manager()) + shell->cursor_manager()->HideCursor(); + static_cast<PowerButtonMenuScreenView*>(menu_widget_->GetContentsView()) ->ScheduleShowHideAnimation(true); }
diff --git a/ash/system/power/power_button_controller_unittest.cc b/ash/system/power/power_button_controller_unittest.cc index 0bbf66d2..417df99 100644 --- a/ash/system/power/power_button_controller_unittest.cc +++ b/ash/system/power/power_button_controller_unittest.cc
@@ -8,14 +8,17 @@ #include "ash/accessibility/test_accessibility_controller_client.h" #include "ash/media_controller.h" #include "ash/public/cpp/ash_switches.h" +#include "ash/public/cpp/config.h" #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/system/power/power_button_controller_test_api.h" +#include "ash/system/power/power_button_menu_view.h" #include "ash/system/power/power_button_test_base.h" #include "ash/test_media_client.h" #include "ash/touch/touch_devices_controller.h" #include "ash/wm/lock_state_controller_test_api.h" #include "ash/wm/test_session_state_animator.h" +#include "ash/wm/window_util.h" #include "base/command_line.h" #include "base/run_loop.h" #include "base/test/simple_test_tick_clock.h" @@ -24,6 +27,7 @@ #include "chromeos/dbus/power_manager/suspend.pb.h" #include "ui/events/event.h" #include "ui/events/test/event_generator.h" +#include "ui/views/widget/widget.h" using PowerManagerClient = chromeos::PowerManagerClient; @@ -815,4 +819,38 @@ EXPECT_FALSE(power_button_test_api_->IsMenuOpened()); } +// Tests that the menu is inactive by default. +TEST_F(PowerButtonControllerTest, InactivePowerMenuByDefault) { + aura::Window* window = CreateTestWindowInShellWithId(0); + wm::ActivateWindow(window); + ASSERT_EQ(window, wm::GetActiveWindow()); + + PressPowerButton(); + EXPECT_TRUE(power_button_test_api_->TriggerPowerButtonMenuTimeout()); + ReleasePowerButton(); + EXPECT_TRUE(power_button_test_api_->IsMenuOpened()); + EXPECT_EQ(window, wm::GetActiveWindow()); + EXPECT_FALSE( + wm::IsActiveWindow(power_button_test_api_->GetPowerButtonMenuView() + ->GetWidget() + ->GetNativeWindow())); +} + +// Tests that cursor is hidden after show the menu and should reappear if mouse +// moves. +TEST_F(PowerButtonControllerTest, HideCursorAfterShowMenu) { + // Cursor is hidden after show the menu. + ::wm::CursorManager* cursor_manager = Shell::Get()->cursor_manager(); + EXPECT_TRUE(cursor_manager->IsCursorVisible()); + PressPowerButton(); + EXPECT_TRUE(power_button_test_api_->TriggerPowerButtonMenuTimeout()); + ReleasePowerButton(); + EXPECT_TRUE(power_button_test_api_->IsMenuOpened()); + EXPECT_FALSE(cursor_manager->IsCursorVisible()); + + // Cursor reappears if mouse moves. + GenerateMouseMoveEvent(); + EXPECT_TRUE(cursor_manager->IsCursorVisible()); +} + } // namespace ash
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc index a4a73b2..c2c91e95 100644 --- a/ash/system/tray/system_tray.cc +++ b/ash/system/tray/system_tray.cc
@@ -270,7 +270,8 @@ tray_network_ = new TrayNetwork(this); AddTrayItem(base::WrapUnique(tray_network_)); AddTrayItem(std::make_unique<TrayVPN>(this)); - AddTrayItem(std::make_unique<TrayBluetooth>(this)); + tray_bluetooth_ = new TrayBluetooth(this); + AddTrayItem(base::WrapUnique(tray_bluetooth_)); tray_cast_ = new TrayCast(this); AddTrayItem(base::WrapUnique(tray_cast_)); screen_capture_tray_item_ = new ScreenCaptureTrayItem(this); @@ -401,6 +402,10 @@ return tray_audio_; } +TrayBluetooth* SystemTray::GetTrayBluetooth() const { + return tray_bluetooth_; +} + void SystemTray::CanSwitchAwayFromActiveUser( base::OnceCallback<void(bool)> callback) { // If neither screen sharing nor capturing is going on we can immediately
diff --git a/ash/system/tray/system_tray.h b/ash/system/tray/system_tray.h index 2124fb3..b9bfe99 100644 --- a/ash/system/tray/system_tray.h +++ b/ash/system/tray/system_tray.h
@@ -26,6 +26,7 @@ class SystemTrayItem; class TrayAccessibility; class TrayAudio; +class TrayBluetooth; class TrayCapsLock; class TrayCast; class TrayEnterprise; @@ -119,6 +120,8 @@ // Returns TrayAudio object if present or null otherwise. TrayAudio* GetTrayAudio() const; + // Returns TrayBluetooth object if present or null otherwise. + TrayBluetooth* GetTrayBluetooth() const; // Determines if it's ok to switch away from the currently active user. Screen // casting may block this (or at least throw up a confirmation dialog). Calls @@ -214,6 +217,7 @@ // These objects are not owned by this class. TrayAccessibility* tray_accessibility_ = nullptr; TrayAudio* tray_audio_ = nullptr; + TrayBluetooth* tray_bluetooth_ = nullptr; TrayCapsLock* tray_caps_lock_ = nullptr; TrayCast* tray_cast_ = nullptr; TrayEnterprise* tray_enterprise_ = nullptr;
diff --git a/ash/system/tray/system_tray_notifier.cc b/ash/system/tray/system_tray_notifier.cc index af479b69..0f0e5766 100644 --- a/ash/system/tray/system_tray_notifier.cc +++ b/ash/system/tray/system_tray_notifier.cc
@@ -4,7 +4,6 @@ #include "ash/system/tray/system_tray_notifier.h" -#include "ash/system/accessibility_observer.h" #include "ash/system/bluetooth/bluetooth_observer.h" #include "ash/system/date/clock_observer.h" #include "ash/system/ime/ime_observer.h" @@ -22,22 +21,6 @@ SystemTrayNotifier::~SystemTrayNotifier() = default; -void SystemTrayNotifier::AddAccessibilityObserver( - AccessibilityObserver* observer) { - accessibility_observers_.AddObserver(observer); -} - -void SystemTrayNotifier::RemoveAccessibilityObserver( - AccessibilityObserver* observer) { - accessibility_observers_.RemoveObserver(observer); -} - -void SystemTrayNotifier::NotifyAccessibilityStatusChanged( - AccessibilityNotificationVisibility notify) { - for (auto& observer : accessibility_observers_) - observer.OnAccessibilityStatusChanged(notify); -} - void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) { bluetooth_observers_.AddObserver(observer); }
diff --git a/ash/system/tray/system_tray_notifier.h b/ash/system/tray/system_tray_notifier.h index 0205752..4f4946e 100644 --- a/ash/system/tray/system_tray_notifier.h +++ b/ash/system/tray/system_tray_notifier.h
@@ -8,7 +8,6 @@ #include <string> #include "ash/ash_export.h" -#include "ash/public/cpp/accessibility_types.h" #include "base/callback_forward.h" #include "base/macros.h" #include "base/observer_list.h" @@ -17,7 +16,6 @@ namespace ash { -class AccessibilityObserver; class BluetoothObserver; class ClockObserver; class IMEObserver; @@ -39,12 +37,6 @@ SystemTrayNotifier(); ~SystemTrayNotifier(); - // Accessibility. - void AddAccessibilityObserver(AccessibilityObserver* observer); - void RemoveAccessibilityObserver(AccessibilityObserver* observer); - void NotifyAccessibilityStatusChanged( - AccessibilityNotificationVisibility notify); - // Bluetooth. void AddBluetoothObserver(BluetoothObserver* observer); void RemoveBluetoothObserver(BluetoothObserver* observer); @@ -107,7 +99,6 @@ void NotifyVirtualKeyboardSuppressionChanged(bool suppressed); private: - base::ObserverList<AccessibilityObserver> accessibility_observers_; base::ObserverList<BluetoothObserver> bluetooth_observers_; base::ObserverList<ClockObserver> clock_observers_; base::ObserverList<IMEObserver> ime_observers_;
diff --git a/ash/system/tray_accessibility.cc b/ash/system/tray_accessibility.cc index b1397a6..ff75729 100644 --- a/ash/system/tray_accessibility.cc +++ b/ash/system/tray_accessibility.cc
@@ -20,7 +20,6 @@ #include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray_controller.h" -#include "ash/system/tray/system_tray_notifier.h" #include "ash/system/tray/tray_details_view.h" #include "ash/system/tray/tray_item_more.h" #include "ash/system/tray/tray_popup_utils.h" @@ -480,11 +479,11 @@ previous_accessibility_state_(GetAccessibilityState()), show_a11y_menu_on_lock_screen_(true) { DCHECK(system_tray); - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); + Shell::Get()->accessibility_controller()->AddObserver(this); } TrayAccessibility::~TrayAccessibility() { - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this); + Shell::Get()->accessibility_controller()->RemoveObserver(this); } void TrayAccessibility::SetTrayIconVisible(bool visible) {
diff --git a/ash/system/tray_accessibility.h b/ash/system/tray_accessibility.h index 43aa6b9..99e010e 100644 --- a/ash/system/tray_accessibility.h +++ b/ash/system/tray_accessibility.h
@@ -8,7 +8,7 @@ #include <stdint.h> #include "ash/accessibility/accessibility_delegate.h" -#include "ash/system/accessibility_observer.h" +#include "ash/accessibility/accessibility_observer.h" #include "ash/system/tray/tray_details_view.h" #include "ash/system/tray/tray_image_item.h" #include "base/macros.h"
diff --git a/ash/system/unified/top_shortcuts_view.cc b/ash/system/unified/top_shortcuts_view.cc index b31787cb..941e73c 100644 --- a/ash/system/unified/top_shortcuts_view.cc +++ b/ash/system/unified/top_shortcuts_view.cc
@@ -15,10 +15,34 @@ #include "ash/system/unified/sign_out_button.h" #include "ash/system/unified/top_shortcut_button.h" #include "ash/system/unified/unified_system_tray_controller.h" +#include "ash/system/user/rounded_image_view.h" +#include "ui/gfx/paint_vector_icon.h" #include "ui/views/layout/box_layout.h" namespace ash { +namespace { + +views::View* CreateUserAvatarView() { + DCHECK(Shell::Get()); + const mojom::UserSession* const user_session = + Shell::Get()->session_controller()->GetUserSession(0); + + auto* image_view = new tray::RoundedImageView(kTrayItemSize / 2); + if (user_session->user_info->type == user_manager::USER_TYPE_GUEST) { + gfx::ImageSkia icon = + gfx::CreateVectorIcon(kSystemMenuGuestIcon, kMenuIconColor); + image_view->SetImage(icon, icon.size()); + } else { + image_view->SetImage(user_session->user_info->avatar, + gfx::Size(kTrayItemSize, kTrayItemSize)); + } + + return image_view; +} + +} // namespace + TopShortcutsView::TopShortcutsView(UnifiedSystemTrayController* controller) : controller_(controller) { DCHECK(controller_); @@ -28,6 +52,8 @@ kUnifiedTopShortcutSpacing); layout->set_cross_axis_alignment(views::BoxLayout::CROSS_AXIS_ALIGNMENT_END); + AddChildView(CreateUserAvatarView()); + // Show the buttons in this row as disabled if the user is at the login // screen, lock screen, or in a secondary account flow. The exception is // |power_button_| which is always shown as enabled.
diff --git a/ash/system/unified/unified_system_tray_bubble.cc b/ash/system/unified/unified_system_tray_bubble.cc index 3393506..6165fc8 100644 --- a/ash/system/unified/unified_system_tray_bubble.cc +++ b/ash/system/unified/unified_system_tray_bubble.cc
@@ -4,6 +4,7 @@ #include "ash/system/unified/unified_system_tray_bubble.h" +#include "ash/system/status_area_widget.h" #include "ash/system/tray/tray_constants.h" #include "ash/system/unified/unified_system_tray.h" #include "ash/system/unified/unified_system_tray_controller.h" @@ -12,7 +13,8 @@ namespace ash { UnifiedSystemTrayBubble::UnifiedSystemTrayBubble(UnifiedSystemTray* tray) - : controller_(std::make_unique<UnifiedSystemTrayController>()), + : controller_(std::make_unique<UnifiedSystemTrayController>( + tray->shelf()->GetStatusAreaWidget()->system_tray())), tray_(tray) { views::TrayBubbleView::InitParams init_params; init_params.anchor_alignment = views::TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM;
diff --git a/ash/system/unified/unified_system_tray_controller.cc b/ash/system/unified/unified_system_tray_controller.cc index cc76a145..e42c610 100644 --- a/ash/system/unified/unified_system_tray_controller.cc +++ b/ash/system/unified/unified_system_tray_controller.cc
@@ -8,8 +8,11 @@ #include "ash/metrics/user_metrics_recorder.h" #include "ash/session/session_controller.h" #include "ash/shell.h" +#include "ash/system/bluetooth/bluetooth_feature_pod_controller.h" +#include "ash/system/bluetooth/tray_bluetooth.h" #include "ash/system/night_light/night_light_feature_pod_controller.h" #include "ash/system/rotation/rotation_lock_feature_pod_controller.h" +#include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray_controller.h" #include "ash/system/unified/feature_pod_controller_base.h" #include "ash/system/unified/quiet_mode_feature_pod_controller.h" @@ -20,7 +23,9 @@ namespace ash { -UnifiedSystemTrayController::UnifiedSystemTrayController() = default; +UnifiedSystemTrayController::UnifiedSystemTrayController( + SystemTray* system_tray) + : system_tray_(system_tray) {} UnifiedSystemTrayController::~UnifiedSystemTrayController() = default; @@ -58,7 +63,18 @@ // TODO(tetsui): Implement. } +void UnifiedSystemTrayController::ShowBluetoothDetailedView() { + // TODO(tetsui): Implement UnifiedSystemTray's Bluetooth detailed view. + + // Initially create default view to set |default_bubble_height_|. + system_tray_->ShowDefaultView(BubbleCreationType::BUBBLE_CREATE_NEW, + true /* show_by_click */); + system_tray_->ShowDetailedView(system_tray_->GetTrayBluetooth(), 0, + BubbleCreationType::BUBBLE_USE_EXISTING); +} + void UnifiedSystemTrayController::InitFeaturePods() { + AddFeaturePodItem(std::make_unique<BluetoothFeaturePodController>(this)); AddFeaturePodItem(std::make_unique<QuietModeFeaturePodController>()); AddFeaturePodItem(std::make_unique<RotationLockFeaturePodController>()); AddFeaturePodItem(std::make_unique<NightLightFeaturePodController>()); @@ -67,7 +83,6 @@ // TODO(tetsui): Add more feature pod items in spec: // * NetworkFeaturePodController - // * BluetoothFeaturePodController } void UnifiedSystemTrayController::AddFeaturePodItem(
diff --git a/ash/system/unified/unified_system_tray_controller.h b/ash/system/unified/unified_system_tray_controller.h index 8b6a07bf..8d25d87 100644 --- a/ash/system/unified/unified_system_tray_controller.h +++ b/ash/system/unified/unified_system_tray_controller.h
@@ -13,12 +13,15 @@ namespace ash { class FeaturePodControllerBase; +class SystemTray; class UnifiedSystemTrayView; // Controller class of UnifiedSystemTrayView. Handles events of the view. class UnifiedSystemTrayController { public: - UnifiedSystemTrayController(); + // |system_tray| is used to show detailed views which are still not + // implemented on UnifiedSystemTray. + UnifiedSystemTrayController(SystemTray* system_tray); ~UnifiedSystemTrayController(); // Create the view. The created view is unowned. @@ -35,6 +38,9 @@ // Toggle expanded state of UnifiedSystemTrayView. Called from the view. void ToggleExpanded(); + // Show the detailed view of bluetooth. Called from the view. + void ShowBluetoothDetailedView(); + private: // Initialize feature pod controllers and their views. // If you want to add a new feature pod item, you have to add here. @@ -43,6 +49,11 @@ // Add the feature pod controller and its view. void AddFeaturePodItem(std::unique_ptr<FeaturePodControllerBase> controller); + // Only used to show detailed views which are still not implemented on + // UnifiedSystemTray. Unowned. + // TODO(tetsui): Remove reference to |system_tray|. + SystemTray* const system_tray_; + // Unowned. Owned by Views hierarchy. UnifiedSystemTrayView* unified_view_ = nullptr;
diff --git a/ash/touch/touch_devices_controller.cc b/ash/touch/touch_devices_controller.cc index fdbe7d0..84dac006 100644 --- a/ash/touch/touch_devices_controller.cc +++ b/ash/touch/touch_devices_controller.cc
@@ -4,13 +4,13 @@ #include "ash/touch/touch_devices_controller.h" +#include "ash/accessibility/accessibility_controller.h" #include "ash/public/cpp/accessibility_types.h" #include "ash/public/cpp/ash_pref_names.h" #include "ash/root_window_controller.h" #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/shell_delegate.h" -#include "ash/system/tray/system_tray_notifier.h" #include "base/metrics/histogram_macros.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_change_registrar.h" @@ -181,7 +181,7 @@ // Tap dragging is listed as a11y feature, so notifying a11y status changed. // TODO(warx): tap dragging is considered to be removed from a11y feature. // https://crbug.com/164273, https://crbug.com/724501. - Shell::Get()->system_tray_notifier()->NotifyAccessibilityStatusChanged( + Shell::Get()->accessibility_controller()->NotifyAccessibilityStatusChanged( A11Y_NOTIFICATION_NONE); if (!GetInputDeviceControllerClient())
diff --git a/ash/wallpaper/wallpaper_controller.cc b/ash/wallpaper/wallpaper_controller.cc index cd73d51b..9bfc10a 100644 --- a/ash/wallpaper/wallpaper_controller.cc +++ b/ash/wallpaper/wallpaper_controller.cc
@@ -931,18 +931,18 @@ switches::kAshDisableLoginDimAndBlur); } -void WallpaperController::SetUserWallpaperInfo(const AccountId& account_id, +bool WallpaperController::SetUserWallpaperInfo(const AccountId& account_id, const WallpaperInfo& info, bool is_ephemeral) { if (is_ephemeral) { ephemeral_users_wallpaper_info_[account_id] = info; - return; + return true; } PrefService* local_state = Shell::Get()->GetLocalStatePrefService(); // Local state can be null in tests. if (!local_state) - return; + return false; WallpaperInfo old_info; if (GetUserWallpaperInfo(account_id, &old_info, is_ephemeral)) { // Remove the color cache of the previous wallpaper if it exists. @@ -962,6 +962,7 @@ wallpaper_info_dict->SetInteger(kNewWallpaperTypeNodeName, info.type); wallpaper_update->SetWithoutPathExpansion(account_id.GetUserEmail(), std::move(wallpaper_info_dict)); + return true; } bool WallpaperController::GetUserWallpaperInfo(const AccountId& account_id, @@ -1013,13 +1014,13 @@ return true; } -void WallpaperController::InitializeUserWallpaperInfo( +bool WallpaperController::InitializeUserWallpaperInfo( const AccountId& account_id, bool is_ephemeral) { const wallpaper::WallpaperInfo info = { std::string(), wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, wallpaper::DEFAULT, base::Time::Now().LocalMidnight()}; - SetUserWallpaperInfo(account_id, info, is_ephemeral); + return SetUserWallpaperInfo(account_id, info, is_ephemeral); } void WallpaperController::SetArcWallpaper( @@ -1145,14 +1146,17 @@ gfx::ImageSkia online_wallpaper = gfx::ImageSkia::CreateFrom1xBitmap(image); if (online_wallpaper.isNull()) { - SetDefaultWallpaperImpl(user_info->account_id, user_info->type, - show_wallpaper); + LOG(ERROR) << "The client provided an empty wallpaper image."; return; } WallpaperInfo info = {url, layout, wallpaper::ONLINE, base::Time::Now().LocalMidnight()}; - SetUserWallpaperInfo(user_info->account_id, info, user_info->is_ephemeral); + if (!SetUserWallpaperInfo(user_info->account_id, info, + user_info->is_ephemeral)) { + LOG(ERROR) << "Setting user wallpaper info fails. This should never happen " + "except in tests."; + } if (show_wallpaper) ShowWallpaperImage(online_wallpaper, info, false /*preview_mode=*/); @@ -1175,10 +1179,12 @@ const user_manager::UserType type = user_info->type; RemoveUserWallpaper(std::move(user_info), wallpaper_files_id); - InitializeUserWallpaperInfo(account_id, is_ephemeral); - if (show_wallpaper) { - SetDefaultWallpaperImpl(account_id, type, true /*show_wallpaper=*/); + if (!InitializeUserWallpaperInfo(account_id, is_ephemeral)) { + LOG(ERROR) << "Initializing user wallpaper info fails. This should never " + "happen except in tests."; } + if (show_wallpaper) + SetDefaultWallpaperImpl(account_id, type, true /*show_wallpaper=*/); } void WallpaperController::SetCustomizedDefaultWallpaperPaths( @@ -1272,7 +1278,11 @@ return; info.layout = layout; - SetUserWallpaperInfo(user_info->account_id, info, user_info->is_ephemeral); + if (!SetUserWallpaperInfo(user_info->account_id, info, + user_info->is_ephemeral)) { + LOG(ERROR) << "Setting user wallpaper info fails. This should never happen " + "except in tests."; + } ShowUserWallpaper(std::move(user_info)); } @@ -1294,20 +1304,20 @@ const AccountId account_id = current_user_->account_id; const bool is_ephemeral = current_user_->is_ephemeral; // Guest user or regular user in ephemeral mode. - // TODO(wzang/xdai): Check if the wallpaper info for ephemeral users should - // be saved to local state. if ((is_ephemeral && current_user_->has_gaia_account) || current_user_->type == user_manager::USER_TYPE_GUEST) { - InitializeUserWallpaperInfo(account_id, is_ephemeral); + if (!InitializeUserWallpaperInfo(account_id, is_ephemeral)) + return; SetDefaultWallpaperImpl(account_id, current_user_->type, true /*show_wallpaper=*/); - LOG(ERROR) << "User is ephemeral or guest! Fallback to default wallpaper."; + VLOG(1) << "User is ephemeral. Fallback to default wallpaper."; return; } WallpaperInfo info; if (!GetUserWallpaperInfo(account_id, &info, is_ephemeral)) { - InitializeUserWallpaperInfo(account_id, is_ephemeral); + if (!InitializeUserWallpaperInfo(account_id, is_ephemeral)) + return; GetUserWallpaperInfo(account_id, &info, is_ephemeral); } @@ -1318,8 +1328,7 @@ } if (info.location.empty()) { - // Uses default built-in wallpaper when file is empty. Eventually, we - // will only ship one built-in wallpaper in ChromeOS image. + // Uses default wallpaper when file is empty. SetDefaultWallpaperImpl(account_id, current_user_->type, true /*show_wallpaper=*/); return; @@ -1685,6 +1694,18 @@ return; } + const std::string relative_path = + base::FilePath(wallpaper_files_id).Append(file_name).value(); + // User's custom wallpaper path is determined by relative path and the + // appropriate wallpaper resolution. + WallpaperInfo info = {relative_path, layout, type, + base::Time::Now().LocalMidnight()}; + if (!SetUserWallpaperInfo(user_info->account_id, info, + user_info->is_ephemeral)) { + LOG(ERROR) << "Setting user wallpaper info fails. This should never happen " + "except in tests."; + } + base::FilePath wallpaper_path = GetCustomWallpaperPath(WallpaperController::kOriginalWallpaperSubDir, wallpaper_files_id, file_name); @@ -1710,13 +1731,6 @@ layout, base::Passed(std::move(deep_copy)))); } - const std::string relative_path = - base::FilePath(wallpaper_files_id).Append(file_name).value(); - // User's custom wallpaper path is determined by relative path and the - // appropriate wallpaper resolution. - WallpaperInfo info = {relative_path, layout, type, - base::Time::Now().LocalMidnight()}; - SetUserWallpaperInfo(user_info->account_id, info, user_info->is_ephemeral); if (show_wallpaper) ShowWallpaperImage(image, info, false /*preview_mode=*/);
diff --git a/ash/wallpaper/wallpaper_controller.h b/ash/wallpaper/wallpaper_controller.h index 772cdbb..7e6161c 100644 --- a/ash/wallpaper/wallpaper_controller.h +++ b/ash/wallpaper/wallpaper_controller.h
@@ -307,8 +307,9 @@ bool IsWallpaperBlurred() const { return is_wallpaper_blurred_; } // Sets wallpaper info for |account_id| and saves it to local state if - // |is_ephemeral| is false. - void SetUserWallpaperInfo(const AccountId& account_id, + // |is_ephemeral| is false. Returns false if it fails (which happens if local + // state is not available). + bool SetUserWallpaperInfo(const AccountId& account_id, const wallpaper::WallpaperInfo& info, bool is_ephemeral); @@ -319,8 +320,8 @@ bool is_ephemeral) const; // Initializes wallpaper info for the user to default and saves it to local - // state if |is_ephemeral| is false. - void InitializeUserWallpaperInfo(const AccountId& account_id, + // state if |is_ephemeral| is false. Returns false if initialization fails. + bool InitializeUserWallpaperInfo(const AccountId& account_id, bool is_ephemeral); // TODO(crbug.com/776464): This method is a temporary workaround during the
diff --git a/ash/wallpaper/wallpaper_controller_unittest.cc b/ash/wallpaper/wallpaper_controller_unittest.cc index 3e9c173..f6c1fb3 100644 --- a/ash/wallpaper/wallpaper_controller_unittest.cc +++ b/ash/wallpaper/wallpaper_controller_unittest.cc
@@ -14,6 +14,7 @@ #include "ash/session/session_controller.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" +#include "ash/shell_test_api.h" #include "ash/test/ash_test_base.h" #include "ash/wallpaper/wallpaper_controller_observer.h" #include "ash/wallpaper/wallpaper_view.h" @@ -25,6 +26,7 @@ #include "base/strings/stringprintf.h" #include "base/task_scheduler/task_scheduler.h" #include "chromeos/chromeos_switches.h" +#include "components/prefs/testing_pref_service.h" #include "mojo/public/cpp/bindings/associated_binding.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" @@ -390,19 +392,19 @@ wallpaper::WallpaperInfo info = { relative_path, WALLPAPER_LAYOUT_CENTER_CROPPED, wallpaper::CUSTOMIZED, base::Time::Now().LocalMidnight()}; - controller_->SetUserWallpaperInfo(account_id, info, - false /*is_ephemeral=*/); + ASSERT_TRUE(controller_->SetUserWallpaperInfo(account_id, info, + false /*is_ephemeral=*/)); } // Simulates setting a custom wallpaper by directly setting the wallpaper // info. void SimulateSettingCustomWallpaper(const AccountId& account_id) { - controller_->SetUserWallpaperInfo( + ASSERT_TRUE(controller_->SetUserWallpaperInfo( account_id, wallpaper::WallpaperInfo("dummy_file_location", WALLPAPER_LAYOUT_CENTER, wallpaper::CUSTOMIZED, base::Time::Now().LocalMidnight()), - false /*is_ephemeral=*/); + false /*is_ephemeral=*/)); } // Initializes default wallpaper paths "*default_*file" and writes JPEG @@ -1190,21 +1192,20 @@ } TEST_F(WallpaperControllerTest, IgnoreWallpaperRequestWhenPolicyIsEnforced) { + SetBypassDecode(); gfx::ImageSkia image = CreateImage(640, 480, kWallpaperColor); SimulateUserLogin(user_1); - // Simulate setting a policy wallpaper by setting the wallpaper info. - // TODO(crbug.com/776464): Replace this with a real |SetPolicyWallpaper| call. - wallpaper::WallpaperInfo policy_wallpaper_info( - "dummy_file_location", WALLPAPER_LAYOUT_CENTER, wallpaper::POLICY, - base::Time::Now().LocalMidnight()); - controller_->SetUserWallpaperInfo(account_id_1, policy_wallpaper_info, - false /*is_ephemeral=*/); + // Set a policy wallpaper for the user. Verify the user is policy controlled. + controller_->SetPolicyWallpaper(InitializeUser(account_id_1), + wallpaper_files_id_1, + std::string() /*data=*/); + RunAllTasksUntilIdle(); EXPECT_TRUE( controller_->IsPolicyControlled(account_id_1, false /*is_ephemeral=*/)); // Verify that |SetCustomWallpaper| doesn't set wallpaper when policy is - // enforced, and |account_id|'s wallpaper info is not updated. + // enforced, and the user wallpaper info is not updated. controller_->SetCustomWallpaper( InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1, WALLPAPER_LAYOUT_CENTER, *image.bitmap(), false /*preview_mode=*/); @@ -1213,10 +1214,16 @@ wallpaper::WallpaperInfo wallpaper_info; EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info, false /*is_ephemeral=*/)); + wallpaper::WallpaperInfo policy_wallpaper_info( + base::FilePath(wallpaper_files_id_1) + .Append("policy-controlled.jpeg") + .value(), + wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, wallpaper::POLICY, + base::Time::Now().LocalMidnight()); EXPECT_EQ(wallpaper_info, policy_wallpaper_info); // Verify that |SetOnlineWallpaper| doesn't set wallpaper when policy is - // enforced, and |account_id|'s wallpaper info is not updated. + // enforced, and the user wallpaper info is not updated. controller_->SetOnlineWallpaper(InitializeUser(account_id_1), *image.bitmap(), "dummy_url", WALLPAPER_LAYOUT_CENTER, true /*show_wallpaper=*/); @@ -1227,7 +1234,7 @@ EXPECT_EQ(wallpaper_info, policy_wallpaper_info); // Verify that |SetDefaultWallpaper| doesn't set wallpaper when policy is - // enforced, and |account_id|'s wallpaper info is not updated. + // enforced, and the user wallpaper info is not updated. controller_->SetDefaultWallpaper(InitializeUser(account_id_1), wallpaper_files_id_1, true /*show_wallpaper=*/); @@ -1904,4 +1911,73 @@ EXPECT_EQ(user_wallpaper_info, sync_wallpaper_info); } +// A test wallpaper controller client class. +class TestWallpaperControllerClient : public mojom::WallpaperControllerClient { + public: + TestWallpaperControllerClient() : binding_(this) {} + ~TestWallpaperControllerClient() override = default; + + int ready_to_set_wallpaper_count() const { + return ready_to_set_wallpaper_count_; + } + + mojom::WallpaperControllerClientPtr CreateInterfacePtr() { + mojom::WallpaperControllerClientPtr ptr; + binding_.Bind(mojo::MakeRequest(&ptr)); + return ptr; + } + + // mojom::WallpaperControllerClient: + void OnReadyToSetWallpaper() override { ++ready_to_set_wallpaper_count_; } + void OpenWallpaperPicker() override {} + void OnFirstWallpaperAnimationFinished() override {} + + private: + int ready_to_set_wallpaper_count_ = 0; + mojo::Binding<mojom::WallpaperControllerClient> binding_; + + DISALLOW_COPY_AND_ASSIGN(TestWallpaperControllerClient); +}; + +// Tests for cases when local state is not available. +class WallpaperControllerDisableLocalStateTest + : public WallpaperControllerTest { + public: + WallpaperControllerDisableLocalStateTest() = default; + ~WallpaperControllerDisableLocalStateTest() override = default; + + void SetUp() override { + disable_provide_local_state(); + WallpaperControllerTest::SetUp(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(WallpaperControllerDisableLocalStateTest); +}; + +TEST_F(WallpaperControllerDisableLocalStateTest, IgnoreShowUserWallpaper) { + TestWallpaperControllerClient client; + controller_->SetClientForTesting(client.CreateInterfacePtr()); + SimulateUserLogin(user_1); + + // When local state is not available, verify |ShowUserWallpaper| request is + // ignored. + controller_->ShowUserWallpaper(InitializeUser(account_id_1)); + RunAllTasksUntilIdle(); + EXPECT_EQ(0, GetWallpaperCount()); + EXPECT_EQ(0, client.ready_to_set_wallpaper_count()); + + // Make local state available, verify |ShowUserWallpaper| successfully shows + // the wallpaper, and |OnReadyToSetWallpaper| is invoked. + std::unique_ptr<TestingPrefServiceSimple> local_state = + std::make_unique<TestingPrefServiceSimple>(); + Shell::RegisterLocalStatePrefs(local_state->registry()); + ShellTestApi().OnLocalStatePrefServiceInitialized(std::move(local_state)); + + controller_->ShowUserWallpaper(InitializeUser(account_id_1)); + RunAllTasksUntilIdle(); + EXPECT_EQ(1, GetWallpaperCount()); + EXPECT_EQ(1, client.ready_to_set_wallpaper_count()); +} + } // namespace ash
diff --git a/ash/wm/overview/window_grid.cc b/ash/wm/overview/window_grid.cc index 290ec6b..c2ba25f9 100644 --- a/ash/wm/overview/window_grid.cc +++ b/ash/wm/overview/window_grid.cc
@@ -173,21 +173,28 @@ label_container_->SetVisible(visible); } - bool IsLabelVisible() const { return label_container_->visible(); } + gfx::Rect GetLabelBounds() const { + return label_container_->GetBoundsInScreen(); + } - protected: - // views::View: - void Layout() override { - background_view_->SetBoundsRect(GetLocalBounds()); - + // ShieldView takes up the whole workspace since it changes opacity of the + // whole wallpaper. The bounds of the grid may be smaller in some cases of + // splitview. The label should be centered in the bounds of the grid. + void SetGridBounds(const gfx::Rect& bounds) { const int label_width = label_->GetPreferredSize().width() + 2 * kNoItemsIndicatorHorizontalPaddingDp; - gfx::Rect label_container_bounds = GetLocalBounds(); + gfx::Rect label_container_bounds = bounds; label_container_bounds.ClampToCenteredSize( gfx::Size(label_width, kNoItemsIndicatorHeightDp)); label_container_->SetBoundsRect(label_container_bounds); } + bool IsLabelVisible() const { return label_container_->visible(); } + + protected: + // views::View: + void Layout() override { background_view_->SetBoundsRect(GetLocalBounds()); } + private: // Owned by views heirarchy. views::View* background_view_ = nullptr; @@ -509,6 +516,8 @@ window_list_.push_back( std::make_unique<WindowSelectorItem>(window, window_selector_, this)); window_list_.back()->PrepareForOverview(); + if (shield_view_) + shield_view_->SetLabelVisibility(false); PositionWindows(/*animate=*/true); } @@ -524,6 +533,8 @@ window_state_observer_.Remove( wm::GetWindowState(selector_item->GetWindow())); window_list_.erase(iter); + if (shield_view_) + shield_view_->SetLabelVisibility(empty()); } } @@ -555,6 +566,8 @@ void WindowGrid::SetBoundsAndUpdatePositions(const gfx::Rect& bounds) { bounds_ = bounds; + if (shield_view_) + shield_view_->SetGridBounds(bounds_); PositionWindows(/*animate=*/true); } @@ -562,6 +575,8 @@ const gfx::Rect& bounds, WindowSelectorItem* ignored_item) { bounds_ = bounds; + if (shield_view_) + shield_view_->SetGridBounds(bounds_); PositionWindows(/*animate=*/true, ignored_item); } @@ -672,6 +687,13 @@ return shield_view_ && shield_view_->IsLabelVisible(); } +gfx::Rect WindowGrid::GetNoItemsIndicatorLabelBoundsForTesting() const { + if (!shield_view_) + return gfx::Rect(); + + return shield_view_->GetLabelBounds(); +} + void WindowGrid::SetWindowListAnimationStates( WindowSelectorItem* selected_item, WindowSelector::OverviewTransition transition) { @@ -771,6 +793,7 @@ shield_view_ = new ShieldView(); shield_view_->SetBackgroundColor(shield_color); shield_view_->SetLabelVisibility(empty()); + shield_view_->SetGridBounds(bounds_); shield_widget_->SetContentsView(shield_view_); shield_widget_->SetOpacity(initial_opacity); }
diff --git a/ash/wm/overview/window_grid.h b/ash/wm/overview/window_grid.h index 8a0fa3f..0eed255 100644 --- a/ash/wm/overview/window_grid.h +++ b/ash/wm/overview/window_grid.h
@@ -162,6 +162,8 @@ bool IsNoItemsIndicatorLabelVisibleForTesting(); + gfx::Rect GetNoItemsIndicatorLabelBoundsForTesting() const; + WindowSelector* window_selector() { return window_selector_; } void set_window_animation_observer(
diff --git a/ash/wm/overview/window_selector_item.cc b/ash/wm/overview/window_selector_item.cc index bab1bb2..61b5ff0 100644 --- a/ash/wm/overview/window_selector_item.cc +++ b/ash/wm/overview/window_selector_item.cc
@@ -1116,7 +1116,7 @@ if (icon && !icon->size().IsEmpty()) { image_view = new views::ImageView(); image_view->SetImage(gfx::ImageSkiaOperations::CreateResizedImage( - *icon, skia::ImageOperations::RESIZE_GOOD, kIconSize)); + *icon, skia::ImageOperations::RESIZE_BEST, kIconSize)); image_view->SetSize(kIconSize); } }
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index 0a629fe..ec5b04f 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc
@@ -19,6 +19,7 @@ #include "ash/public/cpp/window_properties.h" #include "ash/screen_util.h" #include "ash/shelf/shelf.h" +#include "ash/shelf/shelf_constants.h" #include "ash/shelf/shelf_view_test_api.h" #include "ash/shell.h" #include "ash/shell_test_api.h" @@ -2060,6 +2061,53 @@ ->IsNoItemsIndicatorLabelVisibleForTesting()); } +// Verify that the overview no windows indicator position is as expected. +TEST_F(WindowSelectorTest, OverviewNoWindowsIndicatorPosition) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kAshEnableNewOverviewUi); + + UpdateDisplay("400x300"); + // Midpoint of height minus shelf. + const int expected_y = (300 - kShelfSize) / 2; + + // Helper to check points. Uses EXPECT_NEAR on each coordinate to account for + // rounding. + auto check_point = [](const gfx::Point& expected, const gfx::Point& actual) { + EXPECT_NEAR(expected.x(), actual.x(), 1); + EXPECT_NEAR(expected.y(), actual.y(), 1); + }; + + ToggleOverview(); + ASSERT_TRUE(window_selector()); + + // Verify that originally the label is in the center of the workspace. + WindowGrid* grid = window_selector()->grid_list_for_testing()[0].get(); + check_point(gfx::Point(200, expected_y), + grid->GetNoItemsIndicatorLabelBoundsForTesting().CenterPoint()); + + // Verify that when grid bounds are on the left, the label is centered on the + // left side of the workspace. + grid->SetBoundsAndUpdatePositions(gfx::Rect(0, 0, 200, 300 - kShelfSize)); + check_point(gfx::Point(100, expected_y), + grid->GetNoItemsIndicatorLabelBoundsForTesting().CenterPoint()); + + // Verify that when grid bounds are on the right, the label is centered on the + // right side of the workspace. + grid->SetBoundsAndUpdatePositions(gfx::Rect(200, 0, 200, 300 - kShelfSize)); + check_point(gfx::Point(300, expected_y), + grid->GetNoItemsIndicatorLabelBoundsForTesting().CenterPoint()); + + // Verify that after rotating the display, the label is centered in the + // workspace 300x(400-shelf). + display::Screen* screen = display::Screen::GetScreen(); + const display::Display& display = screen->GetPrimaryDisplay(); + display_manager()->SetDisplayRotation( + display.id(), display::Display::ROTATE_90, + display::Display::RotationSource::ACTIVE); + check_point(gfx::Point(150, (400 - kShelfSize) / 2), + grid->GetNoItemsIndicatorLabelBoundsForTesting().CenterPoint()); +} + // Verify that when opening overview mode with multiple displays, the no items // indicator appears on the grid(s) if it has no windows. TEST_F(WindowSelectorTest, OverviewNoWindowsIndicatorMultiDisplay) {
diff --git a/ash/wm/window_positioner.cc b/ash/wm/window_positioner.cc index 880eaa2..340eba8 100644 --- a/ash/wm/window_positioner.cc +++ b/ash/wm/window_positioner.cc
@@ -206,40 +206,30 @@ // static void WindowPositioner::GetBoundsAndShowStateForNewWindow( - const aura::Window* new_window, bool is_saved_bounds, ui::WindowShowState show_state_in, gfx::Rect* bounds_in_out, ui::WindowShowState* show_state_out) { - // Always open new window in the target display. - aura::Window* target = Shell::GetRootWindowForNewWindows(); + aura::Window* root_window = Shell::GetRootWindowForNewWindows(); + aura::Window* top_window = GetReferenceWindow(root_window, nullptr, nullptr); - aura::Window* top_window = GetReferenceWindow(target, nullptr, nullptr); - // Our window should not have any impact if we are already on top. - if (top_window == new_window) - top_window = nullptr; - - // If there is no valid other window we take and adjust the passed coordinates + // If there is no valid window we take and adjust the passed coordinates // and show state. if (!top_window) { gfx::Rect work_area = display::Screen::GetScreen() - ->GetDisplayNearestWindow(target) + ->GetDisplayNearestWindow(root_window) .work_area(); - bounds_in_out->AdjustToFit(work_area); - // Use adjusted saved bounds, if there is one. - if (is_saved_bounds) - return; - if (show_state_in == ui::SHOW_STATE_DEFAULT) { + // If there is no window and no saved bounds, assume first run. + if (!is_saved_bounds && show_state_in == ui::SHOW_STATE_DEFAULT) { const bool maximize_first_window_on_first_run = Shell::Get()->shell_delegate()->IsForceMaximizeOnFirstRun(); // We want to always open maximized on "small screens" or when policy // tells us to. const bool set_maximized = - ((work_area.width() <= GetForceMaximizedWidthLimit() || - maximize_first_window_on_first_run) && - (!new_window || !wm::GetWindowState(new_window)->IsFullscreen())); + work_area.width() <= GetForceMaximizedWidthLimit() || + maximize_first_window_on_first_run; if (set_maximized) *show_state_out = ui::SHOW_STATE_MAXIMIZED; @@ -268,7 +258,7 @@ } if (is_saved_bounds || has_restore_bounds) { gfx::Rect work_area = display::Screen::GetScreen() - ->GetDisplayNearestWindow(target) + ->GetDisplayNearestWindow(root_window) .work_area(); bounds_in_out->AdjustToFit(work_area); // Use adjusted saved bounds or restore bounds, if there is one.
diff --git a/ash/wm/window_positioner.h b/ash/wm/window_positioner.h index e0aa78e..d1c9c86 100644 --- a/ash/wm/window_positioner.h +++ b/ash/wm/window_positioner.h
@@ -29,14 +29,9 @@ static int GetForceMaximizedWidthLimit(); // Computes and returns the bounds and show state for new window - // based on the parameter passed AND existing windows. |window| is - // the one this function will generate a bounds for and used to - // exclude the self window in making decision how to position the - // window. |window| can be (and in most case) NULL. - // |is_saved_bounds| indicates the |bounds_in_out| is the saved - // bounds. + // based on the parameter passed AND existing windows. |is_saved_bounds| + // indicates the |bounds_in_out| is the saved bounds. static void GetBoundsAndShowStateForNewWindow( - const aura::Window* new_window, bool is_saved_bounds, ui::WindowShowState show_state_in, gfx::Rect* bounds_in_out,
diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc index 6408120..045a30c 100644 --- a/ash/wm/window_positioner_unittest.cc +++ b/ash/wm/window_positioner_unittest.cc
@@ -157,7 +157,7 @@ delegate->SetForceMaximizeOnFirstRun(true); WindowPositioner::GetBoundsAndShowStateForNewWindow( - nullptr, false, ui::SHOW_STATE_DEFAULT, &bounds_in_out, &show_state_out); + false, ui::SHOW_STATE_DEFAULT, &bounds_in_out, &show_state_out); EXPECT_EQ(show_state_out, ui::SHOW_STATE_MAXIMIZED); } @@ -176,7 +176,7 @@ delegate->SetForceMaximizeOnFirstRun(true); WindowPositioner::GetBoundsAndShowStateForNewWindow( - nullptr, false, ui::SHOW_STATE_DEFAULT, &bounds_in_out, &show_state_out); + false, ui::SHOW_STATE_DEFAULT, &bounds_in_out, &show_state_out); EXPECT_EQ(show_state_out, ui::SHOW_STATE_MAXIMIZED); }
diff --git a/ash/wm/workspace/backdrop_controller.cc b/ash/wm/workspace/backdrop_controller.cc index f7b2944..18d13a38 100644 --- a/ash/wm/workspace/backdrop_controller.cc +++ b/ash/wm/workspace/backdrop_controller.cc
@@ -11,7 +11,6 @@ #include "ash/public/cpp/app_types.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" -#include "ash/system/tray/system_tray_notifier.h" #include "ash/wm/window_util.h" #include "ash/wm/workspace/backdrop_delegate.h" #include "base/auto_reset.h" @@ -68,11 +67,11 @@ : container_(container), in_restacking_(false) { DCHECK(container_); Shell::Get()->AddShellObserver(this); - Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); + Shell::Get()->accessibility_controller()->AddObserver(this); } BackdropController::~BackdropController() { - Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this); + Shell::Get()->accessibility_controller()->RemoveObserver(this); Shell::Get()->RemoveShellObserver(this); // TODO: animations won't work right with mus: http://crbug.com/548396. Hide();
diff --git a/ash/wm/workspace/backdrop_controller.h b/ash/wm/workspace/backdrop_controller.h index f4687ae..bfd72f0 100644 --- a/ash/wm/workspace/backdrop_controller.h +++ b/ash/wm/workspace/backdrop_controller.h
@@ -7,8 +7,8 @@ #include <memory> +#include "ash/accessibility/accessibility_observer.h" #include "ash/shell_observer.h" -#include "ash/system/accessibility_observer.h" #include "base/macros.h" namespace aura {
diff --git a/base/BUILD.gn b/base/BUILD.gn index 75f9b9026..03dad38 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn
@@ -2240,7 +2240,6 @@ "process/memory_unittest_mac.mm", "process/process_info_unittest.cc", "process/process_metrics_unittest.cc", - "process/process_metrics_unittest_ios.cc", "process/process_unittest.cc", "process/process_util_unittest.cc", "profiler/stack_sampling_profiler_unittest.cc",
diff --git a/base/android/java/src/org/chromium/base/CollectionUtil.java b/base/android/java/src/org/chromium/base/CollectionUtil.java index 38d96f5..6093380 100644 --- a/base/android/java/src/org/chromium/base/CollectionUtil.java +++ b/base/android/java/src/org/chromium/base/CollectionUtil.java
@@ -57,6 +57,14 @@ return map; } + public static boolean[] booleanListToBooleanArray(@NonNull List<Boolean> list) { + boolean[] array = new boolean[list.size()]; + for (int i = 0; i < list.size(); i++) { + array[i] = list.get(i); + } + return array; + } + public static int[] integerListToIntArray(@NonNull List<Integer> list) { int[] array = new int[list.size()]; for (int i = 0; i < list.size(); i++) { @@ -88,4 +96,4 @@ worker.onResult((Map.Entry<K, V>) entry); } } -} \ No newline at end of file +}
diff --git a/base/android/jni_generator/jni_exception_list.gni b/base/android/jni_generator/jni_exception_list.gni index a990cc2..e3ce93a 100644 --- a/base/android/jni_generator/jni_exception_list.gni +++ b/base/android/jni_generator/jni_exception_list.gni
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") jni_exception_files = [ "//base/android/java/src/org/chromium/base/library_loader/LegacyLinker.java",
diff --git a/base/logging.cc b/base/logging.cc index 7db189f..20550a7b 100644 --- a/base/logging.cc +++ b/base/logging.cc
@@ -101,6 +101,11 @@ #include <android/log.h> #endif +#if defined(OS_FUCHSIA) +#include <zircon/process.h> +#include <zircon/syscalls.h> +#endif + namespace logging { namespace { @@ -161,6 +166,11 @@ int32_t CurrentProcessId() { #if defined(OS_WIN) return GetCurrentProcessId(); +#elif defined(OS_FUCHSIA) + zx_info_handle_basic_t basic = {}; + zx_object_get_info(zx_process_self(), ZX_INFO_HANDLE_BASIC, &basic, + sizeof(basic), nullptr, nullptr); + return basic.koid; #elif defined(OS_POSIX) return getpid(); #endif @@ -171,6 +181,9 @@ return GetTickCount(); #elif defined(OS_MACOSX) return mach_absolute_time(); +#elif defined(OS_FUCHSIA) + return zx_clock_get(ZX_CLOCK_MONOTONIC) / + static_cast<zx_time_t>(base::Time::kNanosecondsPerMicrosecond); #elif defined(OS_NACL) // NaCl sadly does not have _POSIX_TIMERS enabled in sys/features.h // So we have to use clock() for now.
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc index 790767c7..8e3a21b 100644 --- a/base/metrics/field_trial.cc +++ b/base/metrics/field_trial.cc
@@ -981,10 +981,11 @@ } // static -void FieldTrialList::AddObserver(Observer* observer) { +bool FieldTrialList::AddObserver(Observer* observer) { if (!global_) - return; + return false; global_->observer_list_->AddObserver(observer); + return true; } // static
diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h index c8e479e..819c06e6 100644 --- a/base/metrics/field_trial.h +++ b/base/metrics/field_trial.h
@@ -614,8 +614,9 @@ // Add an observer to be notified when a field trial is irrevocably committed // to being part of some specific field_group (and hence the group_name is - // also finalized for that field_trial). - static void AddObserver(Observer* observer); + // also finalized for that field_trial). Returns false and does nothing if + // there is no FieldTrialList singleton. + static bool AddObserver(Observer* observer); // Remove an observer. static void RemoveObserver(Observer* observer);
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h index dedd142..7150815 100644 --- a/base/process/process_metrics.h +++ b/base/process/process_metrics.h
@@ -135,9 +135,6 @@ // convenience wrapper for CreateProcessMetrics(). static std::unique_ptr<ProcessMetrics> CreateCurrentProcessMetrics(); - // Returns the current working set size, in bytes. On Linux, this returns - // the resident set size. - size_t GetWorkingSetSize() const; // Returns private and sharedusage, in bytes. Private bytes is the amount of // memory currently allocated to a process that cannot be shared. Returns // false on platform specific error conditions. Note: |private_bytes| @@ -154,6 +151,12 @@ // function is somewhat expensive on Windows (a few ms per process). bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const; +#if defined(OS_LINUX) || defined(OS_ANDROID) + // Resident Set Size is a Linux/Android specific memory concept. Do not + // attempt to extend this to other platforms. + BASE_EXPORT size_t GetRSS() const; +#endif + #if defined(OS_MACOSX) // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This // is more efficient on Mac OS X, as the two can be retrieved with a single
diff --git a/base/process/process_metrics_freebsd.cc b/base/process/process_metrics_freebsd.cc index abd2b35..1f9e4b6 100644 --- a/base/process/process_metrics_freebsd.cc +++ b/base/process/process_metrics_freebsd.cc
@@ -26,7 +26,8 @@ return WrapUnique(new ProcessMetrics(process)); } -size_t ProcessMetrics::GetWorkingSetSize() const { +namespace { +size_t GetWorkingSetSize() { struct kinfo_proc info; int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_ }; size_t length = sizeof(info); @@ -36,6 +37,7 @@ return info.ki_rssize * getpagesize(); } +} // namespace bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes, size_t* shared_bytes) const {
diff --git a/base/process/process_metrics_fuchsia.cc b/base/process/process_metrics_fuchsia.cc index daedbd8..5cad1fb 100644 --- a/base/process/process_metrics_fuchsia.cc +++ b/base/process/process_metrics_fuchsia.cc
@@ -30,11 +30,6 @@ return 0.0; } -size_t ProcessMetrics::GetWorkingSetSize() const { - NOTIMPLEMENTED(); // TODO(fuchsia): https://crbug.com/706592. - return 0; -} - bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const { NOTIMPLEMENTED(); // TODO(fuchsia): https://crbug.com/706592. return false;
diff --git a/base/process/process_metrics_ios.cc b/base/process/process_metrics_ios.cc index 6ede765..794304f7 100644 --- a/base/process/process_metrics_ios.cc +++ b/base/process/process_metrics_ios.cc
@@ -15,19 +15,6 @@ namespace base { -namespace { - -bool GetTaskInfo(task_basic_info_64* task_info_data) { - mach_msg_type_number_t count = TASK_BASIC_INFO_64_COUNT; - kern_return_t kr = task_info(mach_task_self(), - TASK_BASIC_INFO_64, - reinterpret_cast<task_info_t>(task_info_data), - &count); - return kr == KERN_SUCCESS; -} - -} // namespace - ProcessMetrics::ProcessMetrics(ProcessHandle process) {} ProcessMetrics::~ProcessMetrics() {} @@ -43,13 +30,6 @@ return 0; } -size_t ProcessMetrics::GetWorkingSetSize() const { - task_basic_info_64 task_info_data; - if (!GetTaskInfo(&task_info_data)) - return 0; - return task_info_data.resident_size; -} - size_t GetMaxFds() { static const rlim_t kSystemDefaultMaxFds = 256; rlim_t max_fds;
diff --git a/base/process/process_metrics_linux.cc b/base/process/process_metrics_linux.cc index ace6ee18..e388fe30 100644 --- a/base/process/process_metrics_linux.cc +++ b/base/process/process_metrics_linux.cc
@@ -211,8 +211,7 @@ return WrapUnique(new ProcessMetrics(process)); } -// On Linux, return RSS. -size_t ProcessMetrics::GetWorkingSetSize() const { +size_t ProcessMetrics::GetRSS() const { return internal::ReadProcStatsAndGetFieldAsSizeT(process_, internal::VM_RSS) * getpagesize(); }
diff --git a/base/process/process_metrics_mac.cc b/base/process/process_metrics_mac.cc index fc8e9805..0a8112bd 100644 --- a/base/process/process_metrics_mac.cc +++ b/base/process/process_metrics_mac.cc
@@ -132,13 +132,6 @@ return WrapUnique(new ProcessMetrics(process, port_provider)); } -size_t ProcessMetrics::GetWorkingSetSize() const { - size_t resident_bytes = 0; - if (!GetMemoryBytes(nullptr, nullptr, &resident_bytes, nullptr)) - return 0; - return resident_bytes; -} - bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes, size_t* shared_bytes) const { return GetMemoryBytes(private_bytes, shared_bytes, nullptr, nullptr);
diff --git a/base/process/process_metrics_openbsd.cc b/base/process/process_metrics_openbsd.cc index 3bc5c8fb..5a700dd 100644 --- a/base/process/process_metrics_openbsd.cc +++ b/base/process/process_metrics_openbsd.cc
@@ -21,7 +21,8 @@ return WrapUnique(new ProcessMetrics(process)); } -size_t ProcessMetrics::GetWorkingSetSize() const { +namespace { +size_t GetWorkingSetSize() { struct kinfo_proc info; size_t length; int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, process_, @@ -37,6 +38,7 @@ return info.p_vm_rssize * getpagesize(); } +} // namespace bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes, size_t* shared_bytes) const {
diff --git a/base/process/process_metrics_unittest_ios.cc b/base/process/process_metrics_unittest_ios.cc deleted file mode 100644 index 22bd97e7..0000000 --- a/base/process/process_metrics_unittest_ios.cc +++ /dev/null
@@ -1,17 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "base/process/process_metrics.h" - -#include <memory> - -#include "testing/gtest/include/gtest/gtest.h" - -TEST(ProcessMetricsTestIos, Memory) { - std::unique_ptr<base::ProcessMetrics> process_metrics( - base::ProcessMetrics::CreateProcessMetrics( - base::GetCurrentProcessHandle())); - - ASSERT_NE(0u, process_metrics->GetWorkingSetSize()); -}
diff --git a/base/process/process_metrics_win.cc b/base/process/process_metrics_win.cc index 01fb28a..e3b053bd 100644 --- a/base/process/process_metrics_win.cc +++ b/base/process/process_metrics_win.cc
@@ -46,15 +46,6 @@ return WrapUnique(new ProcessMetrics(process)); } -// Returns the current working set size, in bytes. -size_t ProcessMetrics::GetWorkingSetSize() const { - PROCESS_MEMORY_COUNTERS pmc; - if (GetProcessMemoryInfo(process_.Get(), &pmc, sizeof(pmc))) { - return pmc.WorkingSetSize; - } - return 0; -} - bool ProcessMetrics::GetMemoryBytes(size_t* private_bytes, size_t* shared_bytes) const { // PROCESS_MEMORY_COUNTERS_EX is not supported until XP SP2.
diff --git a/base/stl_util.h b/base/stl_util.h index 186bf12b..6d47bc3a 100644 --- a/base/stl_util.h +++ b/base/stl_util.h
@@ -21,6 +21,7 @@ #include <vector> #include "base/logging.h" +#include "base/optional.h" namespace base { @@ -336,6 +337,17 @@ const typename Collection::const_iterator end_; }; +// Helper for returning the optional value's address, or nullptr. +template <class T> +T* OptionalOrNullptr(base::Optional<T>& optional) { + return optional.has_value() ? &optional.value() : nullptr; +} + +template <class T> +const T* OptionalOrNullptr(const base::Optional<T>& optional) { + return optional.has_value() ? &optional.value() : nullptr; +} + } // namespace base #endif // BASE_STL_UTIL_H_
diff --git a/base/stl_util_unittest.cc b/base/stl_util_unittest.cc index 8d7364f..be4a736 100644 --- a/base/stl_util_unittest.cc +++ b/base/stl_util_unittest.cc
@@ -438,5 +438,14 @@ EXPECT_TRUE(ContainsValue(allowed_chars_including_nul, 0)); } +TEST(STLUtilTest, OptionalOrNullptr) { + Optional<float> optional; + EXPECT_EQ(nullptr, base::OptionalOrNullptr(optional)); + + optional = 0.1f; + EXPECT_EQ(&optional.value(), base::OptionalOrNullptr(optional)); + EXPECT_NE(nullptr, base::OptionalOrNullptr(optional)); +} + } // namespace } // namespace base
diff --git a/base/win/core_winrt_util.cc b/base/win/core_winrt_util.cc index 9ae2d35..7a30490 100644 --- a/base/win/core_winrt_util.cc +++ b/base/win/core_winrt_util.cc
@@ -6,7 +6,7 @@ namespace { -void* LoadComBaseFunction(const char* function_name) { +FARPROC LoadComBaseFunction(const char* function_name) { static HMODULE const handle = ::LoadLibrary(L"combase.dll"); return handle ? ::GetProcAddress(handle, function_name) : nullptr; }
diff --git a/base/win/scoped_hstring.cc b/base/win/scoped_hstring.cc index 335a494b..89d1f49 100644 --- a/base/win/scoped_hstring.cc +++ b/base/win/scoped_hstring.cc
@@ -15,7 +15,7 @@ static bool g_load_succeeded = false; -void* LoadComBaseFunction(const char* function_name) { +FARPROC LoadComBaseFunction(const char* function_name) { static HMODULE const handle = ::LoadLibrary(L"combase.dll"); return handle ? ::GetProcAddress(handle, function_name) : nullptr; }
diff --git a/build/android/gyp/javac.py b/build/android/gyp/javac.py index 02c3af37..e184925 100755 --- a/build/android/gyp/javac.py +++ b/build/android/gyp/javac.py
@@ -23,8 +23,6 @@ ERRORPRONE_WARNINGS_TO_TURN_OFF = [ # TODO(crbug.com/801210): Follow steps in bug. 'SynchronizeOnNonFinalField', - # TODO(crbug.com/801268): Follow steps in bug. - 'NarrowingCompoundAssignment', # TODO(crbug.com/802073): Follow steps in bug. 'TypeParameterUnusedInFormals', # TODO(crbug.com/802075): Follow steps in bug. @@ -98,6 +96,7 @@ 'FloatingPointLiteralPrecision', 'JavaLangClash', 'MissingOverride', + 'NarrowingCompoundAssignment', 'ParameterName', 'StaticQualifiedUsingExpression', 'UseCorrectAssertInTests',
diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni index c957abc..8f95457e 100644 --- a/build/config/linux/pkg_config.gni +++ b/build/config/linux/pkg_config.gni
@@ -57,7 +57,7 @@ # Pass the sysroot if we're using one (it requires the CPU arch also). pkg_config_args += [ "-s", - rebase_path(sysroot, root_build_dir), + rebase_path(sysroot), "-a", current_cpu, ]
diff --git a/build/fuchsia/runner_v2/device_target.py b/build/fuchsia/runner_v2/device_target.py index f76b4049..b2c4b141 100644 --- a/build/fuchsia/runner_v2/device_target.py +++ b/build/fuchsia/runner_v2/device_target.py
@@ -40,6 +40,7 @@ self._host = host if port: self._port = port + self._new_instance = False def __Discover(self, node_name): """Returns the IP address and port of a Fuchsia instance discovered on
diff --git a/build/fuchsia/runner_v2/run_package.py b/build/fuchsia/runner_v2/run_package.py index 56428c3..f55493c 100644 --- a/build/fuchsia/runner_v2/run_package.py +++ b/build/fuchsia/runner_v2/run_package.py
@@ -22,7 +22,7 @@ def _Deploy(target, output_dir, archive_path): """Converts the FAR archive at |archive_path| into a Fuchsia package - and deploys it to |target|'s blobstore. If |incremental| is set, + and deploys it to |target|'s blobstore. If target.IsNewInstance() is not set, then the remote target's blobstore is queried and only the changed blobs are copied. @@ -71,7 +71,7 @@ existing_blobs = set() if not target.IsNewInstance(): logging.debug('Querying the target blobstore\'s state.') - ls = target.RunCommandPiped(['ls', '/blobstore'], stdout=subprocess.PIPE) + ls = target.RunCommandPiped(['ls', '/blob'], stdout=subprocess.PIPE) for blob in ls.stdout: existing_blobs.add(blob.strip()) ls.wait() @@ -123,7 +123,6 @@ 'rm', '/tmp/meta.far']) - if result != 0: raise Exception('Deployment failed.')
diff --git a/build/fuchsia/update_sdk.py b/build/fuchsia/update_sdk.py index 0940cf14..a32ae21 100755 --- a/build/fuchsia/update_sdk.py +++ b/build/fuchsia/update_sdk.py
@@ -13,7 +13,7 @@ import tarfile import tempfile -SDK_HASH = '5863a831c2b23451a2552fa7bb0e2cd94a0327b2' +SDK_HASH = 'c277a8a3c81b8012cfe03bff945cf15f945dfd63' REPOSITORY_ROOT = os.path.abspath(os.path.join( os.path.dirname(__file__), '..', '..'))
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index 7f4474a..a1d67f8 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -277,6 +277,8 @@ "trees/element_id.h", "trees/frame_rate_counter.cc", "trees/frame_rate_counter.h", + "trees/frame_token_allocator.cc", + "trees/frame_token_allocator.h", "trees/image_animation_controller.cc", "trees/image_animation_controller.h", "trees/latency_info_swap_promise.cc",
diff --git a/cc/paint/paint_filter.h b/cc/paint/paint_filter.h index 162559c..12e3a54 100644 --- a/cc/paint/paint_filter.h +++ b/cc/paint/paint_filter.h
@@ -8,6 +8,7 @@ #include "base/containers/stack_container.h" #include "base/logging.h" #include "base/optional.h" +#include "base/stl_util.h" #include "cc/paint/paint_export.h" #include "cc/paint/paint_flags.h" #include "cc/paint/paint_image.h" @@ -98,7 +99,7 @@ return str.c_str(); } const CropRect* crop_rect() const { - return crop_rect_ ? &*crop_rect_ : nullptr; + return base::OptionalOrNullptr(crop_rect_); } virtual size_t SerializedSize() const = 0;
diff --git a/cc/paint/paint_op_reader.cc b/cc/paint/paint_op_reader.cc index d06f79f4..4dd9ba7 100644 --- a/cc/paint/paint_op_reader.cc +++ b/cc/paint/paint_op_reader.cc
@@ -7,6 +7,7 @@ #include <stddef.h> #include <algorithm> +#include "base/stl_util.h" #include "cc/paint/image_transfer_cache_entry.h" #include "cc/paint/paint_flags.h" #include "cc/paint/paint_image_builder.h" @@ -666,7 +667,7 @@ return; filter->reset(new ColorFilterPaintFilter(std::move(color_filter), std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadBlurPaintFilter( @@ -685,7 +686,7 @@ return; filter->reset(new BlurPaintFilter(sigma_x, sigma_y, tile_mode, std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadDropShadowPaintFilter( @@ -714,7 +715,7 @@ return; filter->reset(new DropShadowPaintFilter(dx, dy, sigma_x, sigma_y, color, shadow_mode, std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadMagnifierPaintFilter( @@ -730,7 +731,7 @@ if (!valid_) return; filter->reset(new MagnifierPaintFilter(src_rect, inset, std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadComposePaintFilter( @@ -762,7 +763,7 @@ return; filter->reset(new AlphaThresholdPaintFilter( region, inner_min, outer_max, std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadXfermodePaintFilter( @@ -784,7 +785,7 @@ filter->reset(new XfermodePaintFilter(blend_mode, std::move(background), std::move(foreground), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadArithmeticPaintFilter( @@ -808,7 +809,7 @@ return; filter->reset(new ArithmeticPaintFilter( k1, k2, k3, k4, enforce_pm_color, std::move(background), - std::move(foreground), crop_rect ? &*crop_rect : nullptr)); + std::move(foreground), base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadMatrixConvolutionPaintFilter( @@ -848,7 +849,7 @@ static_cast<MatrixConvolutionPaintFilter::TileMode>(tile_mode_int); filter->reset(new MatrixConvolutionPaintFilter( kernel_size, kernel.data(), gain, bias, kernel_offset, tile_mode, - convolve_alpha, std::move(input), crop_rect ? &*crop_rect : nullptr)); + convolve_alpha, std::move(input), base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadDisplacementMapEffectPaintFilter( @@ -883,7 +884,7 @@ channel_y_int); filter->reset(new DisplacementMapEffectPaintFilter( channel_x, channel_y, scale, std::move(displacement), std::move(color), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadImagePaintFilter( @@ -937,7 +938,7 @@ return; filter->reset(new MergePaintFilter(inputs.data(), static_cast<int>(input_count), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadMorphologyPaintFilter( @@ -961,7 +962,7 @@ static_cast<MorphologyPaintFilter::MorphType>(morph_type_int); filter->reset(new MorphologyPaintFilter(morph_type, radius_x, radius_y, std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadOffsetPaintFilter( @@ -977,7 +978,7 @@ if (!valid_) return; filter->reset(new OffsetPaintFilter(dx, dy, std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadTilePaintFilter( @@ -1022,7 +1023,7 @@ static_cast<TurbulencePaintFilter::TurbulenceType>(turbulence_type_int); filter->reset(new TurbulencePaintFilter( turbulence_type, base_frequency_x, base_frequency_y, num_octaves, seed, - &tile_size, crop_rect ? &*crop_rect : nullptr)); + &tile_size, base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadPaintFlagsPaintFilter( @@ -1034,7 +1035,7 @@ if (!valid_) return; filter->reset( - new PaintFlagsPaintFilter(flags, crop_rect ? &*crop_rect : nullptr)); + new PaintFlagsPaintFilter(flags, base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadMatrixPaintFilter( @@ -1083,7 +1084,7 @@ static_cast<PaintFilter::LightingType>(lighting_type_int); filter->reset(new LightingDistantPaintFilter( lighting_type, direction, light_color, surface_scale, kconstant, - shininess, std::move(input), crop_rect ? &*crop_rect : nullptr)); + shininess, std::move(input), base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadLightingPointPaintFilter( @@ -1114,7 +1115,7 @@ static_cast<PaintFilter::LightingType>(lighting_type_int); filter->reset(new LightingPointPaintFilter( lighting_type, location, light_color, surface_scale, kconstant, shininess, - std::move(input), crop_rect ? &*crop_rect : nullptr)); + std::move(input), base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::ReadLightingSpotPaintFilter( @@ -1153,7 +1154,7 @@ filter->reset(new LightingSpotPaintFilter( lighting_type, location, target, specular_exponent, cutoff_angle, light_color, surface_scale, kconstant, shininess, std::move(input), - crop_rect ? &*crop_rect : nullptr)); + base::OptionalOrNullptr(crop_rect))); } void PaintOpReader::Read(sk_sp<PaintRecord>* record) {
diff --git a/cc/paint/paint_shader.cc b/cc/paint/paint_shader.cc index 104ada8..dccf2ca3 100644 --- a/cc/paint/paint_shader.cc +++ b/cc/paint/paint_shader.cc
@@ -288,7 +288,7 @@ points, colors_.data(), positions_.empty() ? nullptr : positions_.data(), static_cast<int>(colors_.size()), tx_, flags_, - local_matrix_ ? &*local_matrix_ : nullptr); + base::OptionalOrNullptr(local_matrix_)); break; } case Type::kRadialGradient: @@ -296,26 +296,26 @@ center_, start_radius_, colors_.data(), positions_.empty() ? nullptr : positions_.data(), static_cast<int>(colors_.size()), tx_, flags_, - local_matrix_ ? &*local_matrix_ : nullptr); + base::OptionalOrNullptr(local_matrix_)); break; case Type::kTwoPointConicalGradient: cached_shader_ = SkGradientShader::MakeTwoPointConical( start_point_, start_radius_, end_point_, end_radius_, colors_.data(), positions_.empty() ? nullptr : positions_.data(), static_cast<int>(colors_.size()), tx_, flags_, - local_matrix_ ? &*local_matrix_ : nullptr); + base::OptionalOrNullptr(local_matrix_)); break; case Type::kSweepGradient: cached_shader_ = SkGradientShader::MakeSweep( center_.x(), center_.y(), colors_.data(), positions_.empty() ? nullptr : positions_.data(), static_cast<int>(colors_.size()), tx_, start_degrees_, end_degrees_, - flags_, local_matrix_ ? &*local_matrix_ : nullptr); + flags_, base::OptionalOrNullptr(local_matrix_)); break; case Type::kImage: if (image_) { cached_shader_ = image_.GetSkImage()->makeShader( - tx_, ty_, local_matrix_ ? &*local_matrix_ : nullptr); + tx_, ty_, base::OptionalOrNullptr(local_matrix_)); } break; case Type::kPaintRecord: { @@ -328,7 +328,7 @@ case ScalingBehavior::kRasterAtScale: cached_shader_ = SkShader::MakePictureShader( std::move(picture), tx_, ty_, - local_matrix_ ? &*local_matrix_ : nullptr, nullptr); + base::OptionalOrNullptr(local_matrix_), nullptr); break; // For fixed scale, we create an image shader with an image backed by // the picture. @@ -338,7 +338,7 @@ nullptr, nullptr, SkImage::BitDepth::kU8, SkColorSpace::MakeSRGB()); cached_shader_ = image->makeShader( - tx_, ty_, local_matrix_ ? &*local_matrix_ : nullptr); + tx_, ty_, base::OptionalOrNullptr(local_matrix_)); break; } }
diff --git a/cc/paint/paint_shader.h b/cc/paint/paint_shader.h index 9a61b84..4c1bae1 100644 --- a/cc/paint/paint_shader.h +++ b/cc/paint/paint_shader.h
@@ -9,6 +9,7 @@ #include <vector> #include "base/optional.h" +#include "base/stl_util.h" #include "cc/paint/paint_export.h" #include "cc/paint/paint_image.h" #include "third_party/skia/include/core/SkImage.h" @@ -115,7 +116,7 @@ } const gfx::SizeF* tile_scale() const { - return tile_scale_ ? &*tile_scale_ : nullptr; + return base::OptionalOrNullptr(tile_scale_); } const sk_sp<PaintRecord>& paint_record() const { return record_; } bool GetRasterizationTileRect(const SkMatrix& ctm, SkRect* tile_rect) const;
diff --git a/cc/raster/playback_image_provider.cc b/cc/raster/playback_image_provider.cc index 557b421..b2ace4d 100644 --- a/cc/raster/playback_image_provider.cc +++ b/cc/raster/playback_image_provider.cc
@@ -20,7 +20,7 @@ PlaybackImageProvider::PlaybackImageProvider( ImageDecodeCache* cache, const gfx::ColorSpace& target_color_space, - base::Optional<Settings> settings) + base::Optional<Settings>&& settings) : cache_(cache), target_color_space_(target_color_space), settings_(std::move(settings)) { @@ -70,7 +70,10 @@ } PlaybackImageProvider::Settings::Settings() = default; -PlaybackImageProvider::Settings::Settings(const Settings& other) = default; +PlaybackImageProvider::Settings::Settings(PlaybackImageProvider::Settings&&) = + default; PlaybackImageProvider::Settings::~Settings() = default; +PlaybackImageProvider::Settings& PlaybackImageProvider::Settings::operator=( + PlaybackImageProvider::Settings&&) = default; } // namespace cc
diff --git a/cc/raster/playback_image_provider.h b/cc/raster/playback_image_provider.h index 67974f3..a33092d 100644 --- a/cc/raster/playback_image_provider.h +++ b/cc/raster/playback_image_provider.h
@@ -20,8 +20,10 @@ public: struct CC_EXPORT Settings { Settings(); - Settings(const Settings& other); + Settings(const Settings&) = delete; + Settings(Settings&&); ~Settings(); + Settings& operator=(Settings&&); // The set of image ids to skip during raster. PaintImageIdFlatSet images_to_skip; @@ -34,7 +36,7 @@ // If no settings are provided, all images are skipped during rasterization. PlaybackImageProvider(ImageDecodeCache* cache, const gfx::ColorSpace& target_color_space, - base::Optional<Settings> settings); + base::Optional<Settings>&& settings); ~PlaybackImageProvider() override; PlaybackImageProvider(PlaybackImageProvider&& other);
diff --git a/cc/raster/playback_image_provider_unittest.cc b/cc/raster/playback_image_provider_unittest.cc index 0206999d..40036e8 100644 --- a/cc/raster/playback_image_provider_unittest.cc +++ b/cc/raster/playback_image_provider_unittest.cc
@@ -85,7 +85,8 @@ settings.emplace(); settings->images_to_skip = {skip_image.stable_id()}; - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); SkIRect rect = SkIRect::MakeWH(10, 10); SkMatrix matrix = SkMatrix::I(); @@ -99,7 +100,8 @@ base::Optional<PlaybackImageProvider::Settings> settings; settings.emplace(); - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); { SkRect rect = SkRect::MakeWH(10, 10); @@ -127,7 +129,8 @@ settings.emplace(); settings->image_to_current_frame_index = image_to_frame; - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); SkIRect rect = SkIRect::MakeWH(10, 10); SkMatrix matrix = SkMatrix::I(); @@ -143,7 +146,8 @@ base::Optional<PlaybackImageProvider::Settings> settings; settings.emplace(); - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); { SkIRect rect = SkIRect::MakeWH(10, 10); @@ -174,7 +178,8 @@ MockDecodeCache cache; base::Optional<PlaybackImageProvider::Settings> settings; settings.emplace(); - PlaybackImageProvider provider(&cache, gfx::ColorSpace(), settings); + PlaybackImageProvider provider(&cache, gfx::ColorSpace(), + std::move(settings)); { SkIRect rect = SkIRect::MakeWH(10, 10); SkMatrix matrix = SkMatrix::I();
diff --git a/cc/trees/frame_token_allocator.cc b/cc/trees/frame_token_allocator.cc new file mode 100644 index 0000000..4f6ec1cf --- /dev/null +++ b/cc/trees/frame_token_allocator.cc
@@ -0,0 +1,26 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/trees/frame_token_allocator.h" + +namespace cc { + +uint32_t FrameTokenAllocator::GetOrAllocateFrameToken() { + if (frame_token_allocated_) + return frame_token_; + frame_token_allocated_ = true; + + // TODO(jonross) we will want to have a wrapping strategy to handle overflow. + // We will also want to confirm this looping behaviour in processes which + // receive the token. + return ++frame_token_; +} + +uint32_t FrameTokenAllocator::GetFrameTokenForSubmission() { + uint32_t result = frame_token_allocated_ ? frame_token_ : 0; + frame_token_allocated_ = false; + return result; +} + +} // namespace cc
diff --git a/cc/trees/frame_token_allocator.h b/cc/trees/frame_token_allocator.h new file mode 100644 index 0000000..1bb978d6 --- /dev/null +++ b/cc/trees/frame_token_allocator.h
@@ -0,0 +1,52 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CC_TREES_FRAME_TOKEN_ALLOCATOR_H_ +#define CC_TREES_FRAME_TOKEN_ALLOCATOR_H_ + +#include <stdint.h> + +#include "base/macros.h" +#include "cc/cc_export.h" + +namespace cc { + +// For some compositor frame submissions, there is additional work which a frame +// embedder wishes to perform only after the frame has been processed by the +// display compositor. +// +// For this a FrameToken is sent both with the compositor frame submission, as +// well as with messages to the embedder. +// +// However for any given frame there are multiple possible sources which may +// wish to increment the FrameToken. FrameTokenAllocator is a shared source of +// these tokens, only ever increasing the token once during a given frame +// submission. +class CC_EXPORT FrameTokenAllocator { + public: + FrameTokenAllocator() = default; + virtual ~FrameTokenAllocator() = default; + + // During frame submission the first call to this allocates and returns a new + // frame token. All subsequent calls return the current frame token. + uint32_t GetOrAllocateFrameToken(); + + // Gets the token for the current frame submission, signifying the end of + // frame submission. Or 0 is no token was allocated. The next call to + // GetOrAllocateFrameToken will lead to the generation of a new frame token. + uint32_t GetFrameTokenForSubmission(); + + private: + // True if a frame token is allocated during the current frame submission. + bool frame_token_allocated_ = false; + + // The current frame token. + uint32_t frame_token_ = 0; + + DISALLOW_COPY_AND_ASSIGN(FrameTokenAllocator); +}; + +} // namespace cc + +#endif // CC_TREES_FRAME_TOKEN_ALLOCATOR_H_
diff --git a/cc/trees/latency_info_swap_promise.cc b/cc/trees/latency_info_swap_promise.cc index 3dcaf1e..6ebf5352 100644 --- a/cc/trees/latency_info_swap_promise.cc +++ b/cc/trees/latency_info_swap_promise.cc
@@ -33,7 +33,9 @@ LatencyInfoSwapPromise::~LatencyInfoSwapPromise() = default; -void LatencyInfoSwapPromise::WillSwap(viz::CompositorFrameMetadata* metadata) { +void LatencyInfoSwapPromise::WillSwap( + viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) { DCHECK(!latency_.terminated()); metadata->latency_info.push_back(latency_); }
diff --git a/cc/trees/latency_info_swap_promise.h b/cc/trees/latency_info_swap_promise.h index 2b23d67..bdccb3eb5 100644 --- a/cc/trees/latency_info_swap_promise.h +++ b/cc/trees/latency_info_swap_promise.h
@@ -19,7 +19,8 @@ ~LatencyInfoSwapPromise() override; void DidActivate() override {} - void WillSwap(viz::CompositorFrameMetadata* metadata) override; + void WillSwap(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) override; void DidSwap() override; DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override; void OnCommit() override;
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 9249a549..47d7e414 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -65,6 +65,7 @@ #include "cc/trees/draw_property_utils.h" #include "cc/trees/effect_node.h" #include "cc/trees/frame_rate_counter.h" +#include "cc/trees/frame_token_allocator.h" #include "cc/trees/image_animation_controller.h" #include "cc/trees/latency_info_swap_promise_monitor.h" #include "cc/trees/layer_tree_frame_sink.h" @@ -1914,7 +1915,7 @@ frame->use_default_lower_bound_deadline); metadata.activation_dependencies = std::move(frame->activation_dependencies); - active_tree()->FinishSwapPromises(&metadata); + active_tree()->FinishSwapPromises(&metadata, &frame_token_allocator_); if (render_frame_metadata_observer_) { RenderFrameMetadata render_frame_metadata = MakeRenderFrameMetadata(); @@ -1975,6 +1976,10 @@ base::StringPrintf("Compositing.%s.CompositorFrame.Quads", client_name), total_quad_count); } + + compositor_frame.metadata.frame_token = + frame_token_allocator_.GetFrameTokenForSubmission(); + layer_tree_frame_sink_->SubmitCompositorFrame(std::move(compositor_frame)); // Clears the list of swap promises after calling DidSwap on each of them to @@ -3741,7 +3746,7 @@ void LayerTreeHostImpl::SetRenderFrameObserver( std::unique_ptr<RenderFrameMetadataObserver> observer) { render_frame_metadata_observer_ = std::move(observer); - render_frame_metadata_observer_->BindToCurrentThread(); + render_frame_metadata_observer_->BindToCurrentThread(&frame_token_allocator_); } InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index b5c412e..04ae04f 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -35,6 +35,7 @@ #include "cc/tiles/decoded_image_tracker.h" #include "cc/tiles/image_decode_cache.h" #include "cc/tiles/tile_manager.h" +#include "cc/trees/frame_token_allocator.h" #include "cc/trees/layer_tree_frame_sink_client.h" #include "cc/trees/layer_tree_mutator.h" #include "cc/trees/layer_tree_settings.h" @@ -981,6 +982,7 @@ // Provides RenderFrameMetadata to the Browser process upon the submission of // each CompositorFrame. std::unique_ptr<RenderFrameMetadataObserver> render_frame_metadata_observer_; + FrameTokenAllocator frame_token_allocator_; // Maps from presentation_token set on CF to the source frame that requested // it. Presentation tokens are requested if the active tree has
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 1c86533..3e03138 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -56,6 +56,7 @@ #include "cc/trees/layer_tree_host_common.h" #include "cc/trees/layer_tree_impl.h" #include "cc/trees/mutator_host.h" +#include "cc/trees/render_frame_metadata_observer.h" #include "cc/trees/scroll_node.h" #include "cc/trees/single_thread_proxy.h" #include "cc/trees/transform_node.h" @@ -2177,6 +2178,81 @@ } } +TEST_F(LayerTreeHostImplTest, ViewportScrollbarGeometry) { + // Tests for correct behavior of solid color scrollbars on unscrollable pages + // under tricky fractional scale/size issues. + + // Nexus 6 viewport size. + const gfx::Size viewport_size(412, 604); + + // The content size of a non-scrollable page we'd expect given Android's + // behavior of a 980px layout width on non-mobile pages (often ceiled to 981 + // due to fractions resulting from DSF). Due to floating point error, + // viewport_size.height() / minimum_scale ~= 1438.165 < 1439. Ensure we snap + // correctly and err on the side of not showing the scrollbars. + const gfx::Size content_size(981, 1439); + const float minimum_scale = + viewport_size.width() / static_cast<float>(content_size.width()); + + // Since the page is unscrollable, the outer viewport matches the content + // size. + const gfx::Size outer_viewport_size = content_size; + + SolidColorScrollbarLayerImpl* v_scrollbar; + SolidColorScrollbarLayerImpl* h_scrollbar; + + // Setup + { + LayerTreeSettings settings = DefaultSettings(); + CreateHostImpl(settings, CreateLayerTreeFrameSink()); + LayerTreeImpl* active_tree = host_impl_->active_tree(); + active_tree->PushPageScaleFromMainThread(1.f, minimum_scale, 4.f); + + CreateBasicVirtualViewportLayers(viewport_size, content_size); + + // When Chrome on Android loads a non-mobile page, it resizes the main + // frame (outer viewport) such that it matches the width of the content, + // preventing horizontal scrolling. Replicate that behavior here. + host_impl_->OuterViewportScrollLayer()->SetScrollable(outer_viewport_size); + LayerImpl* outer_clip = + host_impl_->OuterViewportScrollLayer()->test_properties()->parent; + outer_clip->SetBounds(outer_viewport_size); + + // Add scrollbars. They will always exist - even if unscrollable - but their + // visibility will be determined by whether the content can be scrolled. + { + std::unique_ptr<SolidColorScrollbarLayerImpl> v_scrollbar_unique = + SolidColorScrollbarLayerImpl::Create(active_tree, 400, VERTICAL, 10, + 0, false, true); + std::unique_ptr<SolidColorScrollbarLayerImpl> h_scrollbar_unique = + SolidColorScrollbarLayerImpl::Create(active_tree, 401, HORIZONTAL, 10, + 0, false, true); + v_scrollbar = v_scrollbar_unique.get(); + h_scrollbar = h_scrollbar_unique.get(); + + LayerImpl* scroll = active_tree->OuterViewportScrollLayer(); + LayerImpl* root = active_tree->InnerViewportContainerLayer(); + v_scrollbar_unique->SetScrollElementId(scroll->element_id()); + h_scrollbar_unique->SetScrollElementId(scroll->element_id()); + root->test_properties()->AddChild(std::move(v_scrollbar_unique)); + root->test_properties()->AddChild(std::move(h_scrollbar_unique)); + } + + host_impl_->active_tree()->BuildPropertyTreesForTesting(); + host_impl_->active_tree()->DidBecomeActive(); + } + + // Zoom out to the minimum scale. The scrollbars shoud not be scrollable. + host_impl_->active_tree()->SetPageScaleOnActiveTree(0.f); + EXPECT_FALSE(v_scrollbar->CanScrollOrientation()); + EXPECT_FALSE(h_scrollbar->CanScrollOrientation()); + + // Zoom in a little and confirm that they're now scrollable. + host_impl_->active_tree()->SetPageScaleOnActiveTree(minimum_scale * 1.05f); + EXPECT_TRUE(v_scrollbar->CanScrollOrientation()); + EXPECT_TRUE(h_scrollbar->CanScrollOrientation()); +} + TEST_F(LayerTreeHostImplTest, ViewportScrollOrder) { LayerTreeSettings settings = DefaultSettings(); CreateHostImpl(settings, CreateLayerTreeFrameSink()); @@ -13852,5 +13928,143 @@ WhiteListedTouchActionTestHelper(2.654f, 0.678f); } +// Test implementation of a SwapPromise which will always attempt to increment +// the frame token during WillSwap. +class FrameTokenAdvancingSwapPromise : public SwapPromise { + public: + FrameTokenAdvancingSwapPromise() {} + ~FrameTokenAdvancingSwapPromise() override {} + + void DidActivate() override {} + void WillSwap(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) override { + frame_token_allocator->GetOrAllocateFrameToken(); + } + void DidSwap() override {} + DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override { + return SwapPromise::DidNotSwapAction::BREAK_PROMISE; + } + int64_t TraceId() const override { return 42; } + + private: + DISALLOW_COPY_AND_ASSIGN(FrameTokenAdvancingSwapPromise); +}; + +// Test implementation of RenderFrameMetadataObserver which can optionally +// increment the frame token during OnRenderFrameSubmission. +class TestRenderFrameMetadataObserver : public RenderFrameMetadataObserver { + public: + explicit TestRenderFrameMetadataObserver(bool increment_counter) + : increment_counter_(increment_counter) {} + ~TestRenderFrameMetadataObserver() override {} + + void BindToCurrentThread( + FrameTokenAllocator* frame_token_allocator) override { + frame_token_allocator_ = frame_token_allocator; + } + void OnRenderFrameSubmission(RenderFrameMetadata metadata) override { + if (increment_counter_) + frame_token_allocator_->GetOrAllocateFrameToken(); + } + + private: + FrameTokenAllocator* frame_token_allocator_; + bool increment_counter_; + DISALLOW_COPY_AND_ASSIGN(TestRenderFrameMetadataObserver); +}; + +// Tests that SwapPromises and RenderFrameMetadataObservers can increment the +// frame token when frames are being drawn. Furthermore verifies that when there +// are multiple attempts to increment the frame token during the same draw, that +// the token only ever increments by one. +TEST_F(LayerTreeHostImplTest, FrameTokenAllocation) { + SetupScrollAndContentsLayers(gfx::Size(100, 100)); + host_impl_->active_tree()->BuildPropertyTreesForTesting(); + host_impl_->SetViewportSize(gfx::Size(50, 50)); + + uint32_t expected_frame_token = 0u; + auto* fake_layer_tree_frame_sink = + static_cast<FakeLayerTreeFrameSink*>(host_impl_->layer_tree_frame_sink()); + + // No SwapPromise or RenderFrameMetadataObserver + { + DrawFrame(); + const viz::CompositorFrameMetadata& metadata = + fake_layer_tree_frame_sink->last_sent_frame()->metadata; + // With no token advancing we should receive the default of 0. + EXPECT_EQ(expected_frame_token, metadata.frame_token); + } + + // Just a SwapPromise no RenderFrameMetataObsever + { + std::vector<std::unique_ptr<SwapPromise>> promises; + promises.push_back(std::make_unique<FrameTokenAdvancingSwapPromise>()); + host_impl_->active_tree()->PassSwapPromises(std::move(promises)); + + host_impl_->SetViewportDamage(gfx::Rect(10, 10)); + DrawFrame(); + const viz::CompositorFrameMetadata& metadata = + fake_layer_tree_frame_sink->last_sent_frame()->metadata; + // SwapPromise should advance the token count by one. + EXPECT_EQ(++expected_frame_token, metadata.frame_token); + } + + // Just a RenderFrameMetadataObserver which does not advance the counter. + { + host_impl_->SetRenderFrameObserver( + std::make_unique<TestRenderFrameMetadataObserver>(false)); + host_impl_->SetViewportDamage(gfx::Rect(10, 10)); + DrawFrame(); + + const viz::CompositorFrameMetadata& metadata = + fake_layer_tree_frame_sink->last_sent_frame()->metadata; + // With no token advancing we should receive the default of 0. + EXPECT_EQ(0u, metadata.frame_token); + } + + // A SwapPromise which advances, and a RenderFrameMetadataObserver which does + // not advance the counter. + { + std::vector<std::unique_ptr<SwapPromise>> promises; + promises.push_back(std::make_unique<FrameTokenAdvancingSwapPromise>()); + host_impl_->active_tree()->PassSwapPromises(std::move(promises)); + + host_impl_->SetViewportDamage(gfx::Rect(10, 10)); + DrawFrame(); + const viz::CompositorFrameMetadata& metadata = + fake_layer_tree_frame_sink->last_sent_frame()->metadata; + // SwapPromise should advance the token count by one. + EXPECT_EQ(++expected_frame_token, metadata.frame_token); + } + + // Both a SwapPromise and a RenderFrameMetadataObserver which try to advance + // the counter. + { + std::vector<std::unique_ptr<SwapPromise>> promises; + promises.push_back(std::make_unique<FrameTokenAdvancingSwapPromise>()); + host_impl_->active_tree()->PassSwapPromises(std::move(promises)); + + host_impl_->SetRenderFrameObserver( + std::make_unique<TestRenderFrameMetadataObserver>(true)); + host_impl_->SetViewportDamage(gfx::Rect(10, 10)); + DrawFrame(); + const viz::CompositorFrameMetadata& metadata = + fake_layer_tree_frame_sink->last_sent_frame()->metadata; + // Even with both sources trying to advance the frame token, it should + // only increment by one. + EXPECT_EQ(++expected_frame_token, metadata.frame_token); + } + + // Just a RenderFrameMetadataObserver which advances the counter + { + host_impl_->SetViewportDamage(gfx::Rect(10, 10)); + DrawFrame(); + const viz::CompositorFrameMetadata& metadata = + fake_layer_tree_frame_sink->last_sent_frame()->metadata; + // The RenderFrameMetadataObserver should advance the counter by one. + EXPECT_EQ(++expected_frame_token, metadata.frame_token); + } +} + } // namespace } // namespace cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index f1b0754..8a69a87 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -5327,7 +5327,8 @@ result_->did_activate_called = true; } - void WillSwap(viz::CompositorFrameMetadata* metadata) override { + void WillSwap(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) override { base::AutoLock lock(result_->lock); EXPECT_FALSE(result_->did_swap_called); EXPECT_FALSE(result_->did_not_swap_called);
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc index 472e9464..b5b2da7 100644 --- a/cc/trees/layer_tree_impl.cc +++ b/cc/trees/layer_tree_impl.cc
@@ -209,17 +209,18 @@ gfx::ScrollOffset current_offset = scroll_tree.current_scroll_offset(scrolling_element_id); gfx::SizeF scrolling_size(scroll_node->bounds); - gfx::SizeF bounds_size(scroll_tree.container_bounds(scroll_node->id)); + gfx::Size bounds_size(scroll_tree.container_bounds(scroll_node->id)); bool is_viewport_scrollbar = scroll_node->scrolls_inner_viewport || scroll_node->scrolls_outer_viewport; if (is_viewport_scrollbar) { + gfx::SizeF viewport_bounds(bounds_size); if (scroll_node->scrolls_inner_viewport && OuterViewportScrollLayer()) { // Add offset and bounds contribution of outer viewport. current_offset += OuterViewportScrollLayer()->CurrentScrollOffset(); gfx::SizeF outer_viewport_bounds(scroll_tree.container_bounds( OuterViewportScrollLayer()->scroll_tree_index())); - bounds_size.SetToMin(outer_viewport_bounds); + viewport_bounds.SetToMin(outer_viewport_bounds); // The scrolling size is only determined by the outer viewport. scroll_node = scroll_tree.FindNodeFromElementId( @@ -230,9 +231,10 @@ current_offset += InnerViewportScrollLayer()->CurrentScrollOffset(); gfx::SizeF inner_viewport_bounds(scroll_tree.container_bounds( InnerViewportScrollLayer()->scroll_tree_index())); - bounds_size.SetToMin(inner_viewport_bounds); + viewport_bounds.SetToMin(inner_viewport_bounds); } - bounds_size.Scale(1 / current_page_scale_factor()); + viewport_bounds.Scale(1 / current_page_scale_factor()); + bounds_size = ToCeiledSize(viewport_bounds); } for (auto* scrollbar : ScrollbarsFor(scrolling_element_id)) { @@ -1591,11 +1593,13 @@ new_swap_promises.clear(); } -void LayerTreeImpl::FinishSwapPromises(viz::CompositorFrameMetadata* metadata) { +void LayerTreeImpl::FinishSwapPromises( + viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) { for (const auto& swap_promise : swap_promise_list_) - swap_promise->WillSwap(metadata); + swap_promise->WillSwap(metadata, frame_token_allocator); for (const auto& swap_promise : pinned_swap_promise_list_) - swap_promise->WillSwap(metadata); + swap_promise->WillSwap(metadata, frame_token_allocator); } void LayerTreeImpl::ClearSwapPromises() {
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h index 4352049..5dda067 100644 --- a/cc/trees/layer_tree_impl.h +++ b/cc/trees/layer_tree_impl.h
@@ -446,7 +446,8 @@ std::vector<std::unique_ptr<SwapPromise>> new_swap_promises); void AppendSwapPromises( std::vector<std::unique_ptr<SwapPromise>> new_swap_promises); - void FinishSwapPromises(viz::CompositorFrameMetadata* metadata); + void FinishSwapPromises(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator); void ClearSwapPromises(); void BreakSwapPromises(SwapPromise::DidNotSwapReason reason);
diff --git a/cc/trees/layer_tree_impl_unittest.cc b/cc/trees/layer_tree_impl_unittest.cc index 36c37b3..ad61715 100644 --- a/cc/trees/layer_tree_impl_unittest.cc +++ b/cc/trees/layer_tree_impl_unittest.cc
@@ -2286,7 +2286,9 @@ ~PersistentSwapPromise() override = default; void DidActivate() override {} - MOCK_METHOD1(WillSwap, void(viz::CompositorFrameMetadata* metadata)); + MOCK_METHOD2(WillSwap, + void(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator)); MOCK_METHOD0(DidSwap, void()); DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override { @@ -2305,7 +2307,8 @@ ~NotPersistentSwapPromise() override = default; void DidActivate() override {} - void WillSwap(viz::CompositorFrameMetadata* metadata) override {} + void WillSwap(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) override {} void DidSwap() override {} DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override { @@ -2343,9 +2346,9 @@ for (size_t i = 0; i < persistent_promises.size(); ++i) { SCOPED_TRACE(testing::Message() << "While checking case #" << i); ASSERT_TRUE(persistent_promises[i]); - EXPECT_CALL(*persistent_promises[i], WillSwap(testing::_)); + EXPECT_CALL(*persistent_promises[i], WillSwap(testing::_, testing::_)); } - host_impl().active_tree()->FinishSwapPromises(nullptr); + host_impl().active_tree()->FinishSwapPromises(nullptr, nullptr); } TEST_F(LayerTreeImplTest, NotPersistentSwapPromisesAreDroppedWhenSwapFails) {
diff --git a/cc/trees/render_frame_metadata_observer.h b/cc/trees/render_frame_metadata_observer.h index 9f95fe58..90491d7 100644 --- a/cc/trees/render_frame_metadata_observer.h +++ b/cc/trees/render_frame_metadata_observer.h
@@ -11,6 +11,8 @@ namespace cc { +class FrameTokenAllocator; + // Observes RenderFrameMetadata associated with the submission of a frame. // LayerTreeHostImpl will create the metadata when submitting a CompositorFrame. // @@ -22,7 +24,8 @@ // Binds on the current thread. This should only be called from the compositor // thread. - virtual void BindToCurrentThread() = 0; + virtual void BindToCurrentThread( + FrameTokenAllocator* frame_token_allocator) = 0; // Notification of the RendarFrameMetadata for the frame being submitted to // the display compositor.
diff --git a/cc/trees/swap_promise.h b/cc/trees/swap_promise.h index 81ec7cd0..c56b071 100644 --- a/cc/trees/swap_promise.h +++ b/cc/trees/swap_promise.h
@@ -12,6 +12,8 @@ namespace cc { +class FrameTokenAllocator; + // When a change to the compositor's state/invalidation/whatever happens, a // Swap Promise can be inserted into LayerTreeHost/LayerTreeImpl, to track // whether the compositor's reply to the new state/invaliadtion/whatever is @@ -61,7 +63,8 @@ virtual ~SwapPromise() {} virtual void DidActivate() = 0; - virtual void WillSwap(viz::CompositorFrameMetadata* metadata) = 0; + virtual void WillSwap(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) = 0; virtual void DidSwap() = 0; // Return |KEEP_ACTIVE| if this promise should remain active (should not be // broken by the owner).
diff --git a/cc/trees/swap_promise_manager_unittest.cc b/cc/trees/swap_promise_manager_unittest.cc index 59bd0980..f95b353 100644 --- a/cc/trees/swap_promise_manager_unittest.cc +++ b/cc/trees/swap_promise_manager_unittest.cc
@@ -31,7 +31,8 @@ ~MockSwapPromise() override = default; void DidActivate() override {} - void WillSwap(viz::CompositorFrameMetadata* metadata) override {} + void WillSwap(viz::CompositorFrameMetadata* metadata, + FrameTokenAllocator* frame_token_allocator) override {} void DidSwap() override {} DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override { return DidNotSwapAction::BREAK_PROMISE;
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index d898d3b..7deb3509 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn
@@ -17,7 +17,7 @@ import("//chrome/common/features.gni") import("//chrome/process_version_rc_template.gni") import("//components/nacl/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//ppapi/features/features.gni") import("//third_party/WebKit/public/public_features.gni")
diff --git a/chrome/VERSION b/chrome/VERSION index d3849b1d..cbf123c1 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=67 MINOR=0 -BUILD=3366 +BUILD=3367 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index fa87f83..c7407aa 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -12,7 +12,7 @@ import("//chrome/common/features.gni") import("//chrome/process_version_rc_template.gni") # For branding_file_path. import("//components/feed/features.gni") # For disabling Feed library. -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//testing/test.gni") import("//third_party/icu/config.gni") import("//third_party/protobuf/proto_library.gni")
diff --git a/chrome/android/java/res/layout/custom_tabs_toolbar.xml b/chrome/android/java/res/layout/custom_tabs_toolbar.xml index 4e48591..1e282760 100644 --- a/chrome/android/java/res/layout/custom_tabs_toolbar.xml +++ b/chrome/android/java/res/layout/custom_tabs_toolbar.xml
@@ -66,6 +66,7 @@ android:layout_height="match_parent" android:layout_marginEnd="42dp" android:layout_gravity="center_vertical|end" + android:gravity="center_vertical" android:orientation="horizontal" /> <org.chromium.chrome.browser.widget.TintedImageButton android:id="@+id/menu_button"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 9f1be0f..732f25f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -398,6 +398,8 @@ final long begin = SystemClock.elapsedRealtime(); TraceEvent.begin("onCreate->setContentView()"); + SelectionPopupController.setShouldGetReadbackViewFromWindowAndroid(); + enableHardwareAcceleration(); setLowEndTheme(); int controlContainerLayoutId = getControlContainerLayoutId(); @@ -1260,8 +1262,6 @@ getLayoutInflater().inflate(R.layout.bottom_sheet, coordinator); mBottomSheet = coordinator.findViewById(R.id.bottom_sheet); mBottomSheet.init(coordinator, this); - mBottomSheet.setTabModelSelector(mTabModelSelector); - mBottomSheet.setFullscreenManager(mFullscreenManager); mFadingBackgroundView = (FadingBackgroundView) findViewById(R.id.fading_focus_target); mBottomSheet.addObserver(new EmptyBottomSheetObserver() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java index 6c37fbbf..de3e1ac 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java
@@ -5,6 +5,7 @@ package org.chromium.chrome.browser; import android.app.Activity; +import android.view.View; import org.chromium.chrome.browser.infobar.InfoBarIdentifier; import org.chromium.chrome.browser.infobar.SimpleConfirmInfoBarBuilder; @@ -27,6 +28,16 @@ } @Override + public View getReadbackView() { + assert getActivity().get() instanceof ChromeActivity; + + ChromeActivity chromeActivity = (ChromeActivity) getActivity().get(); + return chromeActivity.getCompositorViewHolder() == null + ? null + : chromeActivity.getCompositorViewHolder().getActiveSurfaceView(); + } + + @Override protected void logUMAOnRequestPermissionDenied(String permission) { Activity activity = getActivity().get(); if (activity instanceof WebApkActivity
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java index ebdf1d0..08c032a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java
@@ -716,6 +716,8 @@ List<Integer> orientations = new ArrayList<>(); List<Long> themeColors = new ArrayList<>(); List<Long> backgroundColors = new ArrayList<>(); + List<Long> lastUpdateCheckTimesMs = new ArrayList<>(); + List<Boolean> relaxUpdates = new ArrayList<>(); Context context = ContextUtils.getApplicationContext(); PackageManager packageManager = context.getPackageManager(); @@ -739,6 +741,18 @@ orientations.add(webApkInfo.orientation()); themeColors.add(webApkInfo.themeColor()); backgroundColors.add(webApkInfo.backgroundColor()); + + WebappDataStorage storage = + WebappRegistry.getInstance().getWebappDataStorage(webApkInfo.id()); + long lastUpdateCheckTimeMsForStorage = 0; + boolean relaxUpdatesForStorage = false; + if (storage != null) { + lastUpdateCheckTimeMsForStorage = + storage.getLastCheckForWebManifestUpdateTimeMs(); + relaxUpdatesForStorage = storage.shouldRelaxUpdates(); + } + lastUpdateCheckTimesMs.add(lastUpdateCheckTimeMsForStorage); + relaxUpdates.add(relaxUpdatesForStorage); } } } @@ -751,12 +765,15 @@ CollectionUtil.integerListToIntArray(displayModes), CollectionUtil.integerListToIntArray(orientations), CollectionUtil.longListToLongArray(themeColors), - CollectionUtil.longListToLongArray(backgroundColors)); + CollectionUtil.longListToLongArray(backgroundColors), + CollectionUtil.longListToLongArray(lastUpdateCheckTimesMs), + CollectionUtil.booleanListToBooleanArray(relaxUpdates)); } private static native void nativeOnWebappDataStored(long callbackPointer); private static native void nativeOnWebApksRetrieved(long callbackPointer, String[] names, String[] shortNames, String[] packageName, int[] shellApkVersions, int[] versionCodes, String[] uris, String[] scopes, String[] manifestUrls, String[] manifestStartUrls, - int[] displayModes, int[] orientations, long[] themeColors, long[] backgroundColors); + int[] displayModes, int[] orientations, long[] themeColors, long[] backgroundColors, + long[] lastUpdateCheckTimesMs, boolean[] relaxUpdates); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java index 57a9e41..a74dbfd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManager.java
@@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable; import android.view.Surface; +import android.view.View; /** * Manages Surface(s), and SurfaceView(s) when necessary, for the compositor. @@ -63,4 +64,9 @@ * Set the visibility of the Managed SurfaceViews. */ void setVisibility(int visibility); + + /** + * Gets the active {@link SurfaceView}. + */ + View getActiveSurfaceView(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java index 082912f..50834a1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorSurfaceManagerImpl.java
@@ -346,6 +346,11 @@ mOpaque.surfaceView.setVisibility(visibility); } + @Override + public View getActiveSurfaceView() { + return mOwnedByClient == null ? null : mOwnedByClient.surfaceView; + } + /** * Return the SurfaceState for |holder|, or null if it isn't either. */
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java index 5ba81191..1060101 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorView.java
@@ -150,6 +150,13 @@ } /** + * @return The active {@link SurfaceView} of this compositor. + */ + public View getActiveSurfaceView() { + return mCompositorSurfaceManager.getActiveSurfaceView(); + } + + /** * Should be called for cleanup when the CompositorView instance is no longer used. */ public void shutDown() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java index b817b47..e0d4f63 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java
@@ -396,6 +396,13 @@ return mCompositorView; } + /** + * @return The active {@link SurfaceView} of the Compositor. + */ + public View getActiveSurfaceView() { + return mCompositorView.getActiveSurfaceView(); + } + private Tab getCurrentTab() { if (mLayoutManager == null || mTabModelSelector == null) return null; Tab currentTab = mTabModelSelector.getCurrentTab();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java index 7146a438..ff03367 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/StackLayout.java
@@ -69,8 +69,14 @@ private static final int DRAG_DIRECTION_HORIZONTAL = 1; private static final int DRAG_DIRECTION_VERTICAL = 2; - private enum SwipeMode { NONE, SEND_TO_STACK, SWITCH_STACK } + @IntDef({SWIPE_MODE_NONE, SWIPE_MODE_SEND_TO_STACK, SWIPE_MODE_SWITCH_STACK}) + @Retention(RetentionPolicy.SOURCE) + public @interface SwipeMode {} + private static final int SWIPE_MODE_NONE = 0; + private static final int SWIPE_MODE_SEND_TO_STACK = 1; + private static final int SWIPE_MODE_SWITCH_STACK = 2; + private static final int INVALID_STACK_INDEX = -1; public static final int NORMAL_STACK_INDEX = 0; public static final int INCOGNITO_STACK_INDEX = 1; @@ -128,7 +134,8 @@ @DragDirection private int mDragDirection = DRAG_DIRECTION_NONE; - private SwipeMode mInputMode = SwipeMode.NONE; + @SwipeMode + private int mInputMode = SWIPE_MODE_NONE; private float mLastOnDownX; private float mLastOnDownY; private long mLastOnDownTimeStamp; @@ -148,7 +155,11 @@ private static final int LAYOUTTAB_ASYNCHRONOUS_INITIALIZATION_BATCH_SIZE = 4; private boolean mDelayedLayoutTabInitRequired; - private Boolean mTemporarySelectedStack; + /** + * Temporarily stores the index of the selected tab stack. This is used to set the currently + * selected stack in TabModelSelector once the stack-switching animation finishes. + */ + private int mTemporarySelectedStack = INVALID_STACK_INDEX; // Orientation Variables private PortraitViewport mCachedPortraitViewport; @@ -188,7 +199,8 @@ @Override public void drag(float x, float y, float dx, float dy, float tx, float ty) { - SwipeMode oldInputMode = mInputMode; + @SwipeMode + int oldInputMode = mInputMode; long time = time(); float amountX = dx; float amountY = dy; @@ -197,16 +209,16 @@ if (mDragDirection == DRAG_DIRECTION_HORIZONTAL) amountY = 0; if (mDragDirection == DRAG_DIRECTION_VERTICAL) amountX = 0; - if (oldInputMode == SwipeMode.SEND_TO_STACK && mInputMode == SwipeMode.SWITCH_STACK) { + if (oldInputMode == SWIPE_MODE_SEND_TO_STACK && mInputMode == SWIPE_MODE_SWITCH_STACK) { mStacks.get(getTabStackIndex()).onUpOrCancel(time); - } else if (oldInputMode == SwipeMode.SWITCH_STACK - && mInputMode == SwipeMode.SEND_TO_STACK) { + } else if (oldInputMode == SWIPE_MODE_SWITCH_STACK + && mInputMode == SWIPE_MODE_SEND_TO_STACK) { onUpOrCancel(time); } - if (mInputMode == SwipeMode.SEND_TO_STACK) { + if (mInputMode == SWIPE_MODE_SEND_TO_STACK) { mStacks.get(getTabStackIndex()).drag(time, x, y, amountX, amountY); - } else if (mInputMode == SwipeMode.SWITCH_STACK) { + } else if (mInputMode == SWIPE_MODE_SWITCH_STACK) { scrollStacks(getOrientation() == Orientation.PORTRAIT ? amountX : amountY); } } @@ -231,14 +243,14 @@ float vx = velocityX; float vy = velocityY; - if (mInputMode == SwipeMode.NONE) { + if (mInputMode == SWIPE_MODE_NONE) { mInputMode = computeInputMode( time, x, y, vx * SWITCH_STACK_FLING_DT, vy * SWITCH_STACK_FLING_DT); } - if (mInputMode == SwipeMode.SEND_TO_STACK) { + if (mInputMode == SWIPE_MODE_SEND_TO_STACK) { mStacks.get(getTabStackIndex()).fling(time, x, y, vx, vy); - } else if (mInputMode == SwipeMode.SWITCH_STACK) { + } else if (mInputMode == SWIPE_MODE_SWITCH_STACK) { final float velocity = getOrientation() == Orientation.PORTRAIT ? vx : vy; final float origin = getOrientation() == Orientation.PORTRAIT ? x : y; final float max = @@ -271,7 +283,7 @@ mClicked = false; finishScrollStacks(); mStacks.get(getTabStackIndex()).onUpOrCancel(time); - mInputMode = SwipeMode.NONE; + mInputMode = SWIPE_MODE_NONE; } private long time() { @@ -380,10 +392,10 @@ */ protected int getTabStackIndex(int tabId) { if (tabId == Tab.INVALID_TAB_ID) { - boolean incognito = mTemporarySelectedStack != null - ? mTemporarySelectedStack - : mTabModelSelector.isIncognitoSelected(); - return incognito ? INCOGNITO_STACK_INDEX : NORMAL_STACK_INDEX; + if (mTemporarySelectedStack != INVALID_STACK_INDEX) return mTemporarySelectedStack; + + return mTabModelSelector.isIncognitoSelected() ? INCOGNITO_STACK_INDEX + : NORMAL_STACK_INDEX; } else { return TabModelUtils.getTabById(mTabModelSelector.getModel(true), tabId) != null ? 1 : 0; @@ -580,9 +592,9 @@ @Override protected void onAnimationFinished() { mFlingFromModelChange = false; - if (mTemporarySelectedStack != null) { - mTabModelSelector.selectModel(mTemporarySelectedStack); - mTemporarySelectedStack = null; + if (mTemporarySelectedStack != INVALID_STACK_INDEX) { + mTabModelSelector.selectModel(mTemporarySelectedStack == INCOGNITO_STACK_INDEX); + mTemporarySelectedStack = INVALID_STACK_INDEX; } if (mStackAnimationCount == 0) super.onAnimationFinished(); if (mNewTabLayoutTab != null) { @@ -795,8 +807,8 @@ * @param dy The y displacement happening this frame. * @return The input mode to select. */ - private SwipeMode computeInputMode(long time, float x, float y, float dx, float dy) { - if (!mStacks.get(1).isDisplayable()) return SwipeMode.SEND_TO_STACK; + private @SwipeMode int computeInputMode(long time, float x, float y, float dx, float dy) { + if (!mStacks.get(1).isDisplayable()) return SWIPE_MODE_SEND_TO_STACK; int currentIndex = getTabStackIndex(); // When a drag starts, lock the drag into being either horizontal or vertical until the @@ -813,7 +825,7 @@ if ((mDragDirection == DRAG_DIRECTION_VERTICAL) ^ (getOrientation() == Orientation.LANDSCAPE)) { - return SwipeMode.SEND_TO_STACK; + return SWIPE_MODE_SEND_TO_STACK; } float relativeX = mLastOnDownX - (x + dx); @@ -832,10 +844,10 @@ if ((currentIndex == 0) ^ (switchDelta > 0) ^ isRtlPortraitMode) { // Dragging in a direction the stack cannot switch. Pass the drag to the Stack, which // will treat it as intending to discard a tab. - return SwipeMode.SEND_TO_STACK; + return SWIPE_MODE_SEND_TO_STACK; } else { // Interpret the drag as intending to switch between tab stacks. - return SwipeMode.SWITCH_STACK; + return SWIPE_MODE_SWITCH_STACK; } } @@ -1005,9 +1017,9 @@ addToAnimation(this, Property.STACK_SNAP, mRenderedScrollOffset, target, duration, 0); } else { setProperty(Property.STACK_SNAP, target); - if (mTemporarySelectedStack != null) { - mTabModelSelector.selectModel(mTemporarySelectedStack); - mTemporarySelectedStack = null; + if (mTemporarySelectedStack != INVALID_STACK_INDEX) { + mTabModelSelector.selectModel(mTemporarySelectedStack == INCOGNITO_STACK_INDEX); + mTemporarySelectedStack = INVALID_STACK_INDEX; } } } @@ -1118,7 +1130,7 @@ */ public boolean setActiveStackState(boolean isIncognito) { if (isIncognito == mTabModelSelector.isIncognitoSelected()) return false; - mTemporarySelectedStack = isIncognito; + mTemporarySelectedStack = isIncognito ? INCOGNITO_STACK_INDEX : NORMAL_STACK_INDEX; return true; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java index 273b9a66..ea379c0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java
@@ -252,8 +252,8 @@ float oldVelocityY = mScrollerY.mCurrVelocity; if (Math.signum(velocityX) == Math.signum(oldVelocityX) && Math.signum(velocityY) == Math.signum(oldVelocityY)) { - velocityX += oldVelocityX; - velocityY += oldVelocityY; + velocityX = (int) (velocityX + oldVelocityX); + velocityY = (int) (velocityY + oldVelocityY); } } @@ -411,7 +411,7 @@ final float tInf = SPLINE_TIME[index]; final float tSup = SPLINE_TIME[index + 1]; final float timeCoef = tInf + (x - xInf) / (xSup - xInf) * (tSup - tInf); - mDuration *= timeCoef; + mDuration = (int) (mDuration * timeCoef); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java index de7c23a3..861c9558 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/overlays/strip/StripLayoutHelper.java
@@ -393,7 +393,7 @@ float delta = calculateOffsetToMakeTabVisible(tab, true, true, true); // During this resize, mMinScrollOffset will be changing, so the scroll effect // cannot be properly animated. Jump to the new scroll offset instead. - mScrollOffset += delta; + mScrollOffset = (int) (mScrollOffset + delta); } updateStrip(); @@ -1631,7 +1631,7 @@ if (shouldAnimate && !mAnimationsDisabledForTesting) { mScroller.startScroll(mScrollOffset, 0, (int) delta, 0, time, EXPAND_DURATION_MS); } else { - mScrollOffset += delta; + mScrollOffset = (int) (mScrollOffset + delta); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OWNERS index dfbf44bd0..4dc4436f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OWNERS +++ b/chrome/android/java/src/org/chromium/chrome/browser/download/ui/OWNERS
@@ -1,4 +1,2 @@ -set noparent - dtrainor@chromium.org twellington@chromium.org
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java index 7ebb139..b3ada0a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/externalauth/ExternalAuthUtils.java
@@ -9,7 +9,6 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; -import android.os.AsyncTask; import android.os.Binder; import android.os.StrictMode; import android.os.SystemClock; @@ -19,7 +18,6 @@ import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GoogleApiAvailability; -import org.chromium.base.Callback; import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.ThreadUtils; @@ -248,31 +246,6 @@ } /** - * Same as {@link #canUseFirstPartyGooglePlayServices(UserRecoverableErrorHandler)}, - * but completes the task in the background to avoid any potentially slow calls blocking the - * UI thread. - * @param userRecoverableErrorHandler How to handle user-recoverable errors from Google - * Play Services; must be non-null. - * @param callback Callback to receive whether or not first party Play Services are available. - */ - public void canUseFirstPartyGooglePlayServices( - UserRecoverableErrorHandler userRecoverableErrorHandler, Callback<Boolean> callback) { - new AsyncTask<Void, Void, Boolean>() { - @Override - protected Boolean doInBackground(Void... voids) { - return canUseGooglePlayServices(userRecoverableErrorHandler) - && isChromeGoogleSigned(); - } - - @Override - protected void onPostExecute(Boolean canUseFirstPartyGooglePlayServices) { - callback.onResult(canUseFirstPartyGooglePlayServices); - } - } - .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); - } - - /** * Record the result of a connection attempt. The default implementation records via a UMA * histogram. * @param resultCode the result from {@link #checkGooglePlayServicesAvailable(Context)}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/infobar/OWNERS index 9ec990e..982256d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/OWNERS +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/OWNERS
@@ -1,4 +1,3 @@ -set noparent mdjones@chromium.org per-file AppBannerInfoBar*=dominickn@chromium.org
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java index e2320de..a408760 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeBrowserInitializer.java
@@ -35,6 +35,7 @@ import org.chromium.chrome.browser.ChromeApplication; import org.chromium.chrome.browser.ChromeStrictMode; import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.ClassRegister; import org.chromium.chrome.browser.FileProviderHelper; import org.chromium.chrome.browser.crash.LogcatExtractionRunnable; import org.chromium.chrome.browser.download.DownloadManagerService; @@ -377,6 +378,7 @@ AppHooks.get().registerPolicyProviders(CombinedPolicyProvider.get()); SpeechRecognition.initialize(mApplication); + ClassRegister.get().registerContentClassFactory(); } private void onFinishNativeInitialization() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/locale/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/locale/OWNERS index f017f94..93e990a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/locale/OWNERS +++ b/chrome/android/java/src/org/chromium/chrome/browser/locale/OWNERS
@@ -1,3 +1,5 @@ +# This restriction is in place due to the complicated compliance regulations +# around this code. set noparent tedchoc@chromium.org
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java index b64515ec..15f7c62 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -46,8 +46,8 @@ import android.view.ViewStub; import android.view.inputmethod.InputMethodManager; import android.widget.FrameLayout; +import android.widget.FrameLayout.LayoutParams; import android.widget.ImageView; -import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; @@ -161,7 +161,6 @@ protected TintedImageButton mDeleteButton; protected TintedImageButton mMicButton; protected UrlBar mUrlBar; - private LinearLayout mUrlActionContainer; /** A handle to the bottom sheet for chrome home. */ protected BottomSheet mBottomSheet; @@ -722,8 +721,6 @@ mSuggestionListAdapter = new OmniboxResultsAdapter(getContext(), this, mSuggestionItems); mMicButton = (TintedImageButton) findViewById(R.id.mic_button); - - mUrlActionContainer = (LinearLayout) findViewById(R.id.url_action_container); } @Override @@ -1502,11 +1499,39 @@ } /** + * @return The margin to be applied to the URL bar based on the buttons currently visible next + * to it, used to avoid text overlapping the buttons and vice versa. + */ + protected int getUrlContainerMarginEnd() { + // When Chrome Home is enabled, the URL actions container slides out of view during the + // URL defocus animation. Adding margin during this animation creates a hole. + boolean addMarginForActionsContainer = + mBottomSheet == null || !mUrlFocusChangeInProgress || isUrlBarFocused(); + + int urlContainerMarginEnd = 0; + if (addMarginForActionsContainer) { + int urlContainerChildIndex = indexOfChild(mUrlBar); + assert urlContainerChildIndex != -1; + + for (int i = urlContainerChildIndex + 1; i < getChildCount(); i++) { + View childView = getChildAt(i); + if (childView.getVisibility() != GONE) { + LayoutParams childLayoutParams = (LayoutParams) childView.getLayoutParams(); + urlContainerMarginEnd = Math.max(urlContainerMarginEnd, + childLayoutParams.width + + ApiCompatibilityUtils.getMarginStart(childLayoutParams) + + ApiCompatibilityUtils.getMarginEnd(childLayoutParams)); + } + } + } + return urlContainerMarginEnd; + } + + /** * Updates the layout params for the location bar start aligned views. */ protected void updateLayoutParams() { int startMargin = 0; - int urlContainerChildIndex = -1; for (int i = 0; i < getChildCount(); i++) { View childView = getChildAt(i); if (childView.getVisibility() != GONE) { @@ -1515,10 +1540,8 @@ ApiCompatibilityUtils.setMarginStart(childLayoutParams, startMargin); childView.setLayoutParams(childLayoutParams); } - if (childView == mUrlBar) { - urlContainerChildIndex = i; - break; - } + if (childView == mUrlBar) break; + int widthMeasureSpec; int heightMeasureSpec; if (childLayoutParams.width == LayoutParams.WRAP_CONTENT) { @@ -1546,25 +1569,7 @@ } } - // When Chrome Home is enabled, the URL actions container slides out of view during the - // URL defocus animation. Adding margin during this animation creates a hole. - boolean addMarginForActionsContainer = - (mBottomSheet == null || !mUrlFocusChangeInProgress || mUrlHasFocus) - && mUrlActionContainer != null && mUrlActionContainer.getVisibility() != GONE; - int urlContainerMarginEnd = 0; - if (addMarginForActionsContainer) { - for (int i = 0; i < mUrlActionContainer.getChildCount(); i++) { - View button = mUrlActionContainer.getChildAt(i); - LinearLayout.LayoutParams buttonLayoutParams = - (LinearLayout.LayoutParams) button.getLayoutParams(); - if (button.getVisibility() != GONE) { - urlContainerMarginEnd += buttonLayoutParams.width - + ApiCompatibilityUtils.getMarginStart(buttonLayoutParams) - + ApiCompatibilityUtils.getMarginEnd(buttonLayoutParams); - } - } - } - + int urlContainerMarginEnd = getUrlContainerMarginEnd(); LayoutParams urlLayoutParams = (LayoutParams) mUrlBar.getLayoutParams(); if (ApiCompatibilityUtils.getMarginEnd(urlLayoutParams) != urlContainerMarginEnd) { ApiCompatibilityUtils.setMarginEnd(urlLayoutParams, urlContainerMarginEnd);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java index 31e1f006..06475ca 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
@@ -16,6 +16,7 @@ import android.view.WindowManager; import android.view.animation.Interpolator; import android.widget.FrameLayout; +import android.widget.LinearLayout; import org.chromium.base.ApiCompatibilityUtils; import org.chromium.chrome.R; @@ -55,12 +56,15 @@ private Runnable mKeyboardResizeModeTask; private ObjectAnimator mOmniboxBackgroundAnimator; private boolean mCloseSheetOnBackButton; + private LinearLayout mUrlActionContainer; /** * Constructor used to inflate from XML. */ public LocationBarPhone(Context context, AttributeSet attrs) { super(context, attrs); + + mUrlActionContainer = (LinearLayout) findViewById(R.id.url_action_container); } @Override @@ -401,4 +405,27 @@ mIncognitoBadge = null; } } + + @Override + protected int getUrlContainerMarginEnd() { + assert mUrlActionContainer != null; + boolean addMarginForActionsContainer = + (mBottomSheet == null || !mUrlFocusChangeInProgress || isUrlBarFocused()) + && mUrlActionContainer.getVisibility() != GONE; + int urlContainerMarginEnd = 0; + + if (addMarginForActionsContainer) { + for (int i = 0; i < mUrlActionContainer.getChildCount(); i++) { + View button = mUrlActionContainer.getChildAt(i); + LinearLayout.LayoutParams buttonLayoutParams = + (LinearLayout.LayoutParams) button.getLayoutParams(); + if (button.getVisibility() != GONE) { + urlContainerMarginEnd += buttonLayoutParams.width + + ApiCompatibilityUtils.getMarginStart(buttonLayoutParams) + + ApiCompatibilityUtils.getMarginEnd(buttonLayoutParams); + } + } + } + return urlContainerMarginEnd; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java index 7c2d4b9..2308fb8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java
@@ -771,8 +771,9 @@ if (mIsBottomPopup) { // In Chrome Home, the full URL is showing at all times; give the scroll // view a max height so long URLs don't consume the entire screen. - dialogMaxHeight -= - mContext.getResources().getDimension(R.dimen.min_touch_target_size); + dialogMaxHeight = (int) (dialogMaxHeight + - mContext.getResources().getDimension( + R.dimen.min_touch_target_size)); } heightMeasureSpec =
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java b/chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java index 1d329f5..e1d9ec1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java
@@ -166,7 +166,7 @@ // whereby the tab is obscured so modals don't pop up on top of (e.g.) the tab switcher or // the three-dot menu. final BottomSheet bottomSheet = activity.getBottomSheet(); - if (bottomSheet == null || !bottomSheet.isVisible()) { + if (bottomSheet == null || !bottomSheet.isSheetOpen()) { showDialog(); } else { bottomSheet.addObserver(new EmptyBottomSheetObserver() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/BitmapUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/BitmapUtils.java index 2301079..5b5e25b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/BitmapUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/BitmapUtils.java
@@ -100,13 +100,13 @@ if (width < size) { float scale = (float) size / width; width = size; - height *= scale; + height = (int) (height * scale); } if (height < size) { float scale = (float) size / height; height = size; - width *= scale; + width = (int) (width * scale); } return Bitmap.createScaledBitmap(bitmap, width, height, true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java index 396e5fc..f8c51d9a4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/datareduction/DataReductionSiteBreakdownView.java
@@ -232,8 +232,10 @@ mTableLayout.addView(row, i + 1); } else { numRemainingSites++; - everythingElseDataUsage += mDataUseItems.get(i).getDataUsed(); - everythingElseDataSavings += mDataUseItems.get(i).getDataSaved(); + everythingElseDataUsage = + (int) (everythingElseDataUsage + mDataUseItems.get(i).getDataUsed()); + everythingElseDataSavings = + (int) (everythingElseDataSavings + mDataUseItems.get(i).getDataSaved()); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/OWNERS index f017f94..93e990a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/OWNERS +++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/OWNERS
@@ -1,3 +1,5 @@ +# This restriction is in place due to the complicated compliance regulations +# around this code. set noparent tedchoc@chromium.org
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java index 57cbc29..f20e424a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/util/FeatureUtilities.java
@@ -269,6 +269,14 @@ } /** + * Resets whether Chrome modern design is enabled for tests. After this is called, the next + * call to #isChromeModernDesignEnabled() will retrieve the value from shared preferences. + */ + public static void resetChromeModernDesignEnabledForTests() { + sIsChromeModernDesignEnabled = null; + } + + /** * @return Whether Chrome modern design is enabled. This returns true if Chrome Home is enabled. */ @CalledByNative
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java index 286e4cc..2c300aa 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/util/MathUtils.java
@@ -126,8 +126,8 @@ float scale = Math.max( (float) targetWidth / dimensions[0], (float) targetHeight / dimensions[1]); - dimensions[0] *= scale; - dimensions[1] *= scale; + dimensions[0] = (int) (dimensions[0] * scale); + dimensions[1] = (int) (dimensions[1] * scale); return scale; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java index 34d7415..af29eab8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java
@@ -94,8 +94,8 @@ outPosition[1] = 0; if (rootView == null || childView == rootView) return; while (childView != null) { - outPosition[0] += childView.getX(); - outPosition[1] += childView.getY(); + outPosition[0] = (int) (outPosition[0] + childView.getX()); + outPosition[1] = (int) (outPosition[1] + childView.getY()); if (childView.getParent() == rootView) break; childView = (View) childView.getParent(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/OWNERS index 05bc2345..7fb6ea3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/OWNERS +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/OWNERS
@@ -1,5 +1,3 @@ -set noparent - file://chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VR_JAVA_OWNERS # COMPONENT: UI>Browser>VR
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCompositorSurfaceManager.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCompositorSurfaceManager.java index 2a592627..c47e3244 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCompositorSurfaceManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrCompositorSurfaceManager.java
@@ -7,6 +7,7 @@ import android.graphics.drawable.Drawable; import android.support.annotation.IntDef; import android.view.Surface; +import android.view.View; import org.chromium.chrome.browser.compositor.CompositorSurfaceManager; @@ -103,4 +104,9 @@ @Override public void setVisibility(int visibility) {} + + @Override + public View getActiveSurfaceView() { + return null; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApi.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApi.java index af2f6e8..a7c6814 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApi.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApi.java
@@ -87,4 +87,9 @@ * Closes this DaydreamApi instance. */ void close(); + + /** + * Launch the Daydream Settings Activity. + */ + void launchGvrSettings(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApiImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApiImpl.java index 78ad63af..d524c328 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApiImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrDaydreamApiImpl.java
@@ -13,6 +13,7 @@ import com.google.vr.ndk.base.DaydreamApi; import com.google.vr.ndk.base.GvrApi; +import com.google.vr.ndk.base.GvrUiLayout; import org.chromium.base.Log; import org.chromium.ui.base.WindowAndroid; @@ -140,6 +141,15 @@ } @Override + public void launchGvrSettings() { + Activity activity = WindowAndroid.activityFromContext(mContext); + if (activity == null) { + throw new IllegalStateException("Activity is null"); + } + GvrUiLayout.launchOrInstallGvrApp(activity); + } + + @Override public void close() { if (mDaydreamApi == null) return; mDaydreamApi.close();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrFirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrFirstRunActivity.java index 2c1a30f..5c432da 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrFirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrFirstRunActivity.java
@@ -49,17 +49,22 @@ // here ensures that this never happens for users running the latest version of VrCore. wrapper.setVrModeEnabled(this, true); mApi = wrapper.createVrDaydreamApi(this); - if (!mApi.isDaydreamCurrentViewer()) { - showFre(); - return; - } - // Show DOFF with a timeout so that this activity has enough time to be the active VR app. - new Handler().postDelayed(new Runnable() { - @Override - public void run() { - mApi.exitFromVr(VrShellDelegate.EXIT_VR_RESULT, new Intent()); + try { + if (!mApi.isDaydreamCurrentViewer()) { + showFre(); + return; } - }, SHOW_DOFF_TIMEOUT_MS); + // Show DOFF with a timeout so that this activity has enough time to be the active VR + // app. + new Handler().postDelayed(new Runnable() { + @Override + public void run() { + mApi.exitFromVr(VrShellDelegate.EXIT_VR_RESULT, new Intent()); + } + }, SHOW_DOFF_TIMEOUT_MS); + } finally { + mApi.close(); + } } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java index 630e7d2a..ee78d098 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java
@@ -184,6 +184,7 @@ private boolean mAutopresentWebVr; // If set to true, we attempt to enter VR mode when the activity is resumed. private boolean mEnterVrOnStartup; + private boolean mExitCctOnStartup; private boolean mInternalIntentUsedToStartVr; @@ -196,6 +197,9 @@ // Gets run when the user exits VR mode by clicking the 'x' button or system UI back button. private Runnable mCloseButtonListener; + // Gets run when the user exits VR mode by clicking the Gear button. + private Runnable mSettingsButtonListener; + private static final List<VrModeObserver> sVrModeObservers = new ArrayList<>(); /** @@ -437,6 +441,7 @@ && activitySupportsVrBrowsing(activity)) { registerDaydreamIntent(api, activity); } + api.close(); } } .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); @@ -456,6 +461,7 @@ VrDaydreamApi api = wrapper.createVrDaydreamApi(activity); if (api == null) return; unregisterDaydreamIntent(api); + api.close(); } public static void onMultiWindowModeChanged(boolean isInMultiWindowMode) { @@ -1318,6 +1324,7 @@ protected void onResume() { if (DEBUG_LOGS) Log.i(TAG, "onResume"); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) return; + if (maybeCloseVrCct()) return; if (mNeedsAnimationCancel) { // At least on some devices, like the Samsung S8+, a Window animation is run after our // Activity is shown that fades between a stale screenshot from before pausing to the @@ -1460,6 +1467,7 @@ } private void onStart() { + if (maybeCloseVrCct()) return; mStopped = false; if (mDonSucceeded) setWindowModeForVr(); if (mInVr && !mVrDaydreamApi.isInVrSession()) shutdownVr(true, false); @@ -1471,6 +1479,14 @@ assert !mCancellingEntryAnimation; } + private boolean maybeCloseVrCct() { + if (!mExitCctOnStartup) return false; + mVrDaydreamApi.launchVrHomescreen(); + assert mActivity instanceof CustomTabActivity; + ((CustomTabActivity) mActivity).finishAndClose(false); + return true; + } + private boolean onBackPressedInternal() { if (mVrSupportLevel == VrSupportLevel.VR_NOT_AVAILABLE) return false; cancelPendingVrEntry(); @@ -1646,10 +1662,14 @@ mCloseButtonListener = new Runnable() { @Override public void run() { - if (!startedForAutopresentation) { - shutdownVr(true /* disableVrMode */, true /* stayingInChrome */); - return; - } + // Avoid launching DD home when we shutdown VR. + mAutopresentWebVr = false; + + shutdownVr(true /* disableVrMode */, + !startedForAutopresentation /* stayingInChrome */); + + if (!startedForAutopresentation) return; + // We override the default behavior of the close button because we may stay in // Chrome after exiting VR. This is not true for auto-presented content and we want // to do what Daydream does for other VR apps by default (which is currently to open @@ -1658,13 +1678,35 @@ homeIntent.addCategory(Intent.CATEGORY_HOME); homeIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); mActivity.startActivity(homeIntent); - return; + + ((CustomTabActivity) mActivity).finishAndClose(false); } }; return mCloseButtonListener; } /** + * Returns the callback for the user-triggered close button to exit VR mode. + */ + /* package */ Runnable getVrSettingsButtonListener() { + if (mSettingsButtonListener != null) return mSettingsButtonListener; + final boolean startedForAutopresentation = mAutopresentWebVr; + mSettingsButtonListener = new Runnable() { + @Override + public void run() { + // Avoid launching DD home when we shutdown VR. + mAutopresentWebVr = false; + + shutdownVr(true /* disableVrMode */, false /* stayingInChrome */); + + if (startedForAutopresentation) mExitCctOnStartup = true; + mVrDaydreamApi.launchGvrSettings(); + } + }; + return mSettingsButtonListener; + } + + /** * Returns true if finishing auto-presentation was handled. */ private boolean handleFinishAutopresentation() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java index b6b42c66..dc7e69f0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java
@@ -166,6 +166,7 @@ setPresentationView(mPresentationView); getUiLayout().setCloseButtonListener(mDelegate.getVrCloseButtonListener()); + getUiLayout().setSettingsButtonListener(mDelegate.getVrSettingsButtonListener()); if (mVrBrowsingEnabled) injectVrHostedUiView();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java index fbb056f..78a5662 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkUpdateManager.java
@@ -106,8 +106,8 @@ @WebApkUpdateReason int updateReason = needsUpdate(mInfo, fetchedInfo, primaryIconUrl, badgeIconUrl); boolean needsUpgrade = (updateReason != WebApkUpdateReason.NONE); - Log.v(TAG, "Got Manifest: " + gotManifest); - Log.v(TAG, "WebAPK upgrade needed: " + needsUpgrade); + Log.i(TAG, "Got Manifest: " + gotManifest); + Log.i(TAG, "WebAPK upgrade needed: " + needsUpgrade); // If the Web Manifest was not found and an upgrade is requested, stop fetching Web // Manifests as the user navigates to avoid sending multiple WebAPK update requests. In @@ -190,7 +190,7 @@ /** Sends update request to the WebAPK Server. Should be called when WebAPK is not running. */ public void updateWhileNotRunning(final Runnable callback) { - Log.v(TAG, "Update now"); + Log.i(TAG, "Update now"); WebApkUpdateCallback callbackRunner = (result, relaxUpdates) -> { onFinishedUpdate(result, relaxUpdates); callback.run();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java index f828afb..8af8584e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappDataStorage.java
@@ -422,7 +422,7 @@ * Returns the completion time, in milliseconds, of the last check for whether the WebAPK's Web * Manifest was updated. This time needs to be set when the WebAPK is registered. */ - private long getLastCheckForWebManifestUpdateTimeMs() { + public long getLastCheckForWebManifestUpdateTimeMs() { return mPreferences.getLong(KEY_LAST_CHECK_WEB_MANIFEST_UPDATE_TIME, TIMESTAMP_INVALID); } @@ -493,7 +493,7 @@ } /** Returns whether we should check for updates less frequently. */ - private boolean shouldRelaxUpdates() { + public boolean shouldRelaxUpdates() { return mPreferences.getBoolean(KEY_RELAX_UPDATES, false); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java index 869d373..74bf9b4b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
@@ -639,13 +639,6 @@ } /** - * @param tabModelSelector A TabModelSelector for getting the current tab and activity. - */ - public void setTabModelSelector(TabModelSelector tabModelSelector) { - mTabModelSelector = tabModelSelector; - } - - /** * @param layoutManager The {@link LayoutManagerChrome} used to show and hide overview mode. */ public void setLayoutManagerChrome(LayoutManagerChrome layoutManager) { @@ -653,14 +646,6 @@ } /** - * @param fullscreenManager Chrome's fullscreen manager for information about toolbar offsets. - */ - public void setFullscreenManager(ChromeFullscreenManager fullscreenManager) { - mFullscreenManager = fullscreenManager; - getIphBubbleController().setFullscreenManager(fullscreenManager); - } - - /** * @return Whether or not the toolbar Android View is hidden due to being scrolled off-screen. */ @VisibleForTesting @@ -685,6 +670,10 @@ * @param activity The activity displaying the bottom sheet. */ public void init(View root, ChromeActivity activity) { + mTabModelSelector = activity.getTabModelSelector(); + mFullscreenManager = activity.getFullscreenManager(); + + getIphBubbleController().setFullscreenManager(mFullscreenManager); mToolbarHolder = (TouchRestrictingFrameLayout) findViewById(R.id.bottom_sheet_toolbar_container); mDefaultToolbarView = mToolbarHolder.findViewById(R.id.bottom_sheet_toolbar); @@ -803,7 +792,7 @@ } }); - mActivity.getFullscreenManager().addListener(new FullscreenListener() { + mFullscreenManager.addListener(new FullscreenListener() { @Override public void onToggleOverlayVideoMode(boolean enabled) { if (isSheetOpen()) setSheetState(SHEET_STATE_PEEK, false); @@ -1165,10 +1154,11 @@ // the correct toolbar height and container height are not know until those views are // inflated. The other views are a specific DP distance from the top and bottom and are // also updated. - mStateRatios[0] = (mToolbarHeight + mToolbarShadowHeight) / mContainerHeight; - mStateRatios[1] = HALF_HEIGHT_RATIO; + mStateRatios[SHEET_STATE_PEEK] = (mToolbarHeight + mToolbarShadowHeight) / mContainerHeight; + mStateRatios[SHEET_STATE_HALF] = HALF_HEIGHT_RATIO; // The max height ratio will be greater than 1 to account for the toolbar shadow. - mStateRatios[2] = (mContainerHeight + mToolbarShadowHeight) / mContainerHeight; + mStateRatios[SHEET_STATE_FULL] = + (mContainerHeight + mToolbarShadowHeight) / mContainerHeight; if (mCurrentState == SHEET_STATE_HALF && isSmallScreen()) { setSheetState(SHEET_STATE_FULL, false); @@ -1277,7 +1267,7 @@ */ @VisibleForTesting public float getPeekRatio() { - return mStateRatios[0]; + return mStateRatios[SHEET_STATE_PEEK]; } /** @@ -1285,7 +1275,7 @@ */ @VisibleForTesting public float getHalfRatio() { - return mStateRatios[1]; + return mStateRatios[SHEET_STATE_HALF]; } /** @@ -1293,7 +1283,7 @@ */ @VisibleForTesting public float getFullRatio() { - return mStateRatios[2]; + return mStateRatios[SHEET_STATE_FULL]; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java index 07ecd95..7166036 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
@@ -662,8 +662,10 @@ ViewUtils.getRelativeDrawPosition(rootView, selectedItemView, outPosition); // Center the star's start position over the icon in the middle of the button. - outPosition[0] += selectedItemView.getWidth() / 2.f - starFull.getIntrinsicWidth() / 2.f; - outPosition[1] += selectedItemView.getHeight() / 2.f - starFull.getIntrinsicHeight() / 2.f; + outPosition[0] = (int) (outPosition[0] + + (selectedItemView.getWidth() / 2.f - starFull.getIntrinsicWidth() / 2.f)); + outPosition[1] = (int) (outPosition[1] + + (selectedItemView.getHeight() / 2.f - starFull.getIntrinsicHeight() / 2.f)); for (int i = 0; i < 5; i++) { MagicStar star = new MagicStar(getContext(), outPosition[0], outPosition[1], 100 * i,
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java index 2615843..d4e5a82 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/bookmarks/BookmarkTest.java
@@ -19,6 +19,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestRule; import org.junit.runner.RunWith; import org.chromium.base.ActivityState; @@ -44,6 +45,7 @@ import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.chrome.test.util.MenuUtils; import org.chromium.chrome.test.util.RenderTestRule; +import org.chromium.chrome.test.util.browser.ChromeModernDesign; import org.chromium.components.bookmarks.BookmarkId; import org.chromium.components.bookmarks.BookmarkType; import org.chromium.content.browser.test.util.TouchCommon; @@ -69,6 +71,9 @@ @Rule public RenderTestRule mRenderTestRule = new RenderTestRule(); + @Rule + public TestRule mChromeModernDesignStateRule = new ChromeModernDesign.Processor(); + private static final String TEST_PAGE_URL_GOOGLE = "/chrome/test/data/android/google.html"; private static final String TEST_PAGE_TITLE_GOOGLE = "The Google"; private static final String TEST_PAGE_TITLE_GOOGLE2 = "Google"; @@ -382,6 +387,7 @@ @Test @MediumTest @Feature({"RenderTest"}) + @ChromeModernDesign.Enable public void testBookmarkFolderIcon() throws Exception { BookmarkPromoHeader.forcePromoStateForTests(BookmarkPromoHeader.PromoState.PROMO_NONE); addFolder(TEST_FOLDER_TITLE);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java index c7b3733..d77bee1 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
@@ -1559,6 +1559,7 @@ @Test @SmallTest @Feature({"ContextualSearch"}) + @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.LOLLIPOP, message = "crbug.com/818897") public void testLongPressGestureFollowedByTapDoesntSelect() throws InterruptedException, TimeoutException { longPressNode("intelligence"); @@ -2186,9 +2187,9 @@ @Test @LargeTest @Feature({"ContextualSearch"}) + @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.LOLLIPOP, message = "crbug.com/818897") public void testTapALot() throws InterruptedException, TimeoutException { - // TODO(donnd): bump up to 50 or 100 once Mojo race fixed. See https://crbug.com/818897. - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 50; i++) { clickToTriggerPrefetch(); assertSearchTermRequested(); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java index c887d00..359b906 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/firstrun/FirstRunIntegrationTest.java
@@ -68,15 +68,12 @@ @SmallTest public void testGenericViewIntentGoesToFirstRun() { final String asyncClassName = ChromeLauncherActivity.class.getName(); - runFirstRunRedirectTestForActivity(asyncClassName, new Runnable() { - @Override - public void run() { - final Context context = InstrumentationRegistry.getTargetContext(); - Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://test.com")); - intent.setPackage(context.getPackageName()); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); - } + runFirstRunRedirectTestForActivity(asyncClassName, () -> { + final Context context = InstrumentationRegistry.getTargetContext(); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://test.com")); + intent.setPackage(context.getPackageName()); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); }); } @@ -84,15 +81,12 @@ @SmallTest public void testRedirectCustomTabActivityToFirstRun() { final String asyncClassName = ChromeLauncherActivity.class.getName(); - runFirstRunRedirectTestForActivity(asyncClassName, new Runnable() { - @Override - public void run() { - Context context = InstrumentationRegistry.getTargetContext(); - CustomTabsIntent customTabIntent = new CustomTabsIntent.Builder().build(); - customTabIntent.intent.setPackage(context.getPackageName()); - customTabIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - customTabIntent.launchUrl(context, Uri.parse("http://test.com")); - } + runFirstRunRedirectTestForActivity(asyncClassName, () -> { + Context context = InstrumentationRegistry.getTargetContext(); + CustomTabsIntent customTabIntent = new CustomTabsIntent.Builder().build(); + customTabIntent.intent.setPackage(context.getPackageName()); + customTabIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + customTabIntent.launchUrl(context, Uri.parse("http://test.com")); }); } @@ -100,15 +94,12 @@ @SmallTest public void testRedirectChromeTabbedActivityToFirstRun() { final String asyncClassName = ChromeTabbedActivity.class.getName(); - runFirstRunRedirectTestForActivity(asyncClassName, new Runnable() { - @Override - public void run() { - final Context context = InstrumentationRegistry.getTargetContext(); - Intent intent = new Intent(); - intent.setClassName(context, asyncClassName); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); - } + runFirstRunRedirectTestForActivity(asyncClassName, () -> { + final Context context = InstrumentationRegistry.getTargetContext(); + Intent intent = new Intent(); + intent.setClassName(context, asyncClassName); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); }); } @@ -116,15 +107,12 @@ @SmallTest public void testRedirectSearchActivityToFirstRun() { final String asyncClassName = SearchActivity.class.getName(); - runFirstRunRedirectTestForActivity(asyncClassName, new Runnable() { - @Override - public void run() { - final Context context = InstrumentationRegistry.getTargetContext(); - Intent intent = new Intent(); - intent.setClassName(context, asyncClassName); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); - } + runFirstRunRedirectTestForActivity(asyncClassName, () -> { + final Context context = InstrumentationRegistry.getTargetContext(); + Intent intent = new Intent(); + intent.setClassName(context, asyncClassName); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); }); } @@ -348,13 +336,10 @@ } }); - ThreadUtils.runOnUiThread(new Runnable() { - @Override - public void run() { - Button button = (Button) activity.findViewById(id); - Assert.assertNotNull(message, button); - button.performClick(); - } + ThreadUtils.runOnUiThread(() -> { + Button button = (Button) activity.findViewById(id); + Assert.assertNotNull(message, button); + button.performClick(); }); } }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java index fd867f55..f47bb38 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/history/HistoryActivityTest.java
@@ -33,6 +33,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestRule; import org.junit.runner.RunWith; import org.chromium.base.ThreadUtils; @@ -56,6 +57,7 @@ import org.chromium.chrome.browser.widget.selection.SelectableItemViewHolder; import org.chromium.chrome.browser.widget.selection.SelectionDelegate.SelectionObserver; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.util.browser.ChromeModernDesign; import org.chromium.chrome.test.util.browser.signin.SigninTestUtil; import org.chromium.chrome.test.util.browser.sync.SyncTestUtil; import org.chromium.components.signin.ChromeSigninController; @@ -78,6 +80,9 @@ public IntentsTestRule<HistoryActivity> mActivityTestRule = new IntentsTestRule<>(HistoryActivity.class, false, false); + @Rule + public TestRule mChromeModernDesignStateRule = new ChromeModernDesign.Processor(); + private static class TestObserver extends RecyclerView.AdapterDataObserver implements SelectionObserver<HistoryItem>, SignInStateObserver, PrefObserver { public final CallbackHelper onChangedCallback = new CallbackHelper(); @@ -411,6 +416,7 @@ @Test @SmallTest + @ChromeModernDesign.Enable public void testSearchView() throws Exception { final HistoryManagerToolbar toolbar = mHistoryManager.getToolbarForTests(); View toolbarShadow = mHistoryManager.getSelectableListLayout().getToolbarShadowForTests(); @@ -432,7 +438,7 @@ // The selection should be cleared when a search is started. mTestObserver.onSelectionCallback.waitForCallback(callCount, 1); Assert.assertFalse(mHistoryManager.getSelectionDelegateForTests().isSelectionEnabled()); - Assert.assertEquals(View.VISIBLE, toolbarShadow.getVisibility()); + Assert.assertEquals(View.GONE, toolbarShadow.getVisibility()); Assert.assertEquals(View.VISIBLE, toolbarSearchView.getVisibility()); // Select an item and assert that the search view is no longer showing. @@ -444,7 +450,7 @@ // Clear the selection and assert that the search view is showing again. toggleItemSelection(2); Assert.assertFalse(mHistoryManager.getSelectionDelegateForTests().isSelectionEnabled()); - Assert.assertEquals(View.VISIBLE, toolbarShadow.getVisibility()); + Assert.assertEquals(View.GONE, toolbarShadow.getVisibility()); Assert.assertEquals(View.VISIBLE, toolbarSearchView.getVisibility()); // Close the search view.
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java index 62c6df9..b67b05fb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
@@ -19,10 +19,15 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; +import org.junit.rules.MethodRule; import org.junit.rules.TestRule; import org.junit.runner.RunWith; import org.chromium.base.ThreadUtils; +import org.chromium.base.test.params.MethodParamAnnotationRule; +import org.chromium.base.test.params.ParameterAnnotations; +import org.chromium.base.test.params.ParameterSet; +import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.DisableIf; @@ -45,12 +50,13 @@ import org.chromium.chrome.browser.tabmodel.EmptyTabModelObserver; import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; -import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.ChromeTabUtils; import org.chromium.chrome.test.util.NewTabPageTestUtils; import org.chromium.chrome.test.util.OmniboxTestUtils; import org.chromium.chrome.test.util.RenderTestRule; +import org.chromium.chrome.test.util.browser.ChromeModernDesign; import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils; @@ -69,6 +75,7 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.concurrent.Callable; @@ -79,7 +86,8 @@ /** * Tests for the native android New Tab Page. */ -@RunWith(ChromeJUnit4ClassRunner.class) +@RunWith(ParameterizedRunner.class) +@ParameterAnnotations.UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class) @CommandLineFlags.Add(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE) @DisableFeatures("NetworkPrediction") @RetryOnFailure @@ -94,8 +102,19 @@ new RenderTestRule("chrome/test/data/android/render_tests"); @Rule + public MethodRule mMethodParamAnnotationProcessor = new MethodParamAnnotationRule(); + + @Rule + public ChromeModernDesign.Processor mChromeModernProcessor = new ChromeModernDesign.Processor(); + + @Rule public TestRule mFeatureRule = new Features.InstrumentationProcessor(); + @ParameterAnnotations.MethodParameter("Modern") + private static List<ParameterSet> sMethodParamModern = + Arrays.asList(new ParameterSet().value(false).name("DisableChromeModern"), + new ParameterSet().value(true).name("EnableChromeModern")); + private static final String TEST_PAGE = "/chrome/test/data/android/navigate/simple.html"; private Tab mTab; @@ -106,6 +125,18 @@ private EmbeddedTestServer mTestServer; private List<SiteSuggestion> mSiteSuggestions; + @ParameterAnnotations.UseMethodParameterBefore("Modern") + public void setupModernDesign(boolean enabled) { + mChromeModernProcessor.setPrefs(enabled); + + if (enabled) mRenderTestRule.setVariantPrefix("modern"); + } + + @ParameterAnnotations.UseMethodParameterAfter("Modern") + public void teardownModernDesign(boolean enabled) { + mChromeModernProcessor.clearTestState(); + } + @Before public void setUp() throws Exception { // Disable peeking card animation. @@ -162,7 +193,8 @@ @Test @MediumTest @Feature({"NewTabPage", "RenderTest"}) - public void testRender() throws IOException { + @ParameterAnnotations.UseMethodParameter("Modern") + public void testRender(boolean modern) throws IOException { InstrumentationRegistry.getInstrumentation().waitForIdleSync(); RenderTestRule.sanitize(mNtp.getView()); mRenderTestRule.render(mTileGridLayout, "most_visited");
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java index fd7ab749..bbaaad8 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java
@@ -23,7 +23,7 @@ import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.RenderTestRule; -import org.chromium.chrome.test.util.browser.ChromeHome; +import org.chromium.chrome.test.util.browser.ChromeModernDesign; import java.io.IOException; @@ -42,7 +42,7 @@ public RenderTestRule mRenderTestRule = new RenderTestRule(); @Rule - public TestRule mChromeHomeStateRule = new ChromeHome.Processor(); + public TestRule mChromeModernDesignStateRule = new ChromeModernDesign.Processor(); private FrameLayout mContentView; @@ -59,8 +59,8 @@ @Test @MediumTest @Feature({"Cards", "RenderTest"}) - @ChromeHome.Disable - public void testNewTabPageAppearance() throws IOException { + @ChromeModernDesign.Disable + public void testNewTabPageAppearance_Normal() throws IOException { SectionList sectionList = null; // The SectionList is only used if the item is clicked on. ViewHolder viewHolder = new ViewHolder(mContentView, sectionList); @@ -70,11 +70,24 @@ } @Test + @MediumTest + @Feature({"Cards", "RenderTest"}) + @ChromeModernDesign.Enable + public void testNewTabPageAppearance_Modern() throws IOException { + SectionList sectionList = null; // The SectionList is only used if the item is clicked on. + ViewHolder viewHolder = new ViewHolder(mContentView, sectionList); + + renderAtHour(viewHolder, 9, "modern-morning"); + renderAtHour(viewHolder, 14, "modern-afternoon"); + renderAtHour(viewHolder, 20, "modern-evening"); + } + + @Test //@MediumTest //@Feature({"Cards", "RenderTest"}) - // crbug.com/780555 + // https://crbug.com/780555, re-enable with https://crbug.com/816922 @DisabledTest - @ChromeHome.Enable + @ChromeModernDesign.Enable public void testChromeHomeAppearance() throws IOException { renderAtHour(new ViewHolder(mContentView, null), 0, "modern"); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java index 06ac73d..ef1c18a 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java
@@ -28,12 +28,16 @@ import org.chromium.base.Callback; import org.chromium.base.DiscardableReferencePool; import org.chromium.base.ThreadUtils; +import org.chromium.base.test.params.ParameterAnnotations.ClassParameter; import org.chromium.base.test.params.ParameterAnnotations.UseRunnerDelegate; +import org.chromium.base.test.params.ParameterSet; +import org.chromium.base.test.params.ParameterizedRunner; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.UrlUtils; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.favicon.IconType; import org.chromium.chrome.browser.favicon.LargeIconBridge; @@ -60,9 +64,10 @@ import org.chromium.chrome.browser.widget.displaystyle.UiConfig; import org.chromium.chrome.browser.widget.displaystyle.VerticalDisplayStyle; import org.chromium.chrome.test.ChromeActivityTestRule; -import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeJUnit4RunnerDelegate; import org.chromium.chrome.test.util.RenderTestRule; +import org.chromium.chrome.test.util.browser.ChromeModernDesign; +import org.chromium.chrome.test.util.browser.Features; import org.chromium.chrome.test.util.browser.compositor.layouts.DisableChromeAnimations; import org.chromium.chrome.test.util.browser.suggestions.DummySuggestionsEventReporter; import org.chromium.chrome.test.util.browser.suggestions.FakeSuggestionsSource; @@ -71,16 +76,23 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Locale; /** * Tests for the appearance of Article Snippets. */ -@RunWith(ChromeJUnit4ClassRunner.class) +@RunWith(ParameterizedRunner.class) @UseRunnerDelegate(ChromeJUnit4RunnerDelegate.class) @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +@ChromeModernDesign.Disable public class ArticleSnippetsTest { + @ClassParameter + private static List<ParameterSet> sClassParams = + Arrays.asList(new ParameterSet().value(false).name("DisableNTPModernLayout"), + new ParameterSet().value(true).name("EnableNTPModernLayout")); + @Rule public SuggestionsDependenciesRule mSuggestionsDeps = new SuggestionsDependenciesRule(); @@ -92,6 +104,12 @@ public RenderTestRule mRenderTestRule = new RenderTestRule(); @Rule + public TestRule mChromeModernDesignStateRule = new ChromeModernDesign.Processor(); + + @Rule + public TestRule mFeaturesProcessor = new Features.InstrumentationProcessor(); + + @Rule public TestRule mDisableChromeAnimations = new DisableChromeAnimations(); private SuggestionsUiDelegate mUiDelegate; @@ -111,8 +129,21 @@ private long mTimestamp; + private final boolean mEnableNTPModernLayout; + + public ArticleSnippetsTest(boolean enableNTPModernLayout) { + mEnableNTPModernLayout = enableNTPModernLayout; + } + @Before public void setUp() throws Exception { + if (mEnableNTPModernLayout) { + Features.getInstance().enable(ChromeFeatureList.NTP_MODERN_LAYOUT); + mRenderTestRule.setVariantPrefix("modern"); + } else { + Features.getInstance().disable(ChromeFeatureList.NTP_MODERN_LAYOUT); + } + mActivityTestRule.startMainActivityOnBlankPage(); mThumbnailProvider = new MockThumbnailProvider(); mSnippetsSource = new FakeSuggestionsSource();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java index b5a58137..f8f1382 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java
@@ -27,6 +27,7 @@ import org.junit.Rule; import org.junit.Test; +import org.junit.rules.TestRule; import org.junit.runner.RunWith; import org.chromium.base.ApiCompatibilityUtils; @@ -53,7 +54,7 @@ import org.chromium.chrome.test.ChromeTabbedActivityTestRule; import org.chromium.chrome.test.util.NewTabPageTestUtils; import org.chromium.chrome.test.util.RenderTestRule; -import org.chromium.chrome.test.util.browser.ChromeHome; +import org.chromium.chrome.test.util.browser.ChromeModernDesign; import org.chromium.chrome.test.util.browser.Features.DisableFeatures; import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils; import org.chromium.chrome.test.util.browser.offlinepages.FakeOfflinePageBridge; @@ -82,7 +83,7 @@ public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); @Rule - public ChromeHome.Processor mChromeHomeStateRule = new ChromeHome.Processor(); + public TestRule mChromeModernDesignStateRule = new ChromeModernDesign.Processor(); @Rule public SuggestionsDependenciesRule mSuggestionsDeps = new SuggestionsDependenciesRule(); @@ -163,6 +164,7 @@ @Test @MediumTest @Feature({"NewTabPage", "RenderTest"}) + @ChromeModernDesign.Disable public void testTileGridAppearance() throws Exception { NewTabPage ntp = setUpFakeDataToShowOnNtp(/*homePagePosition=*/2, FAKE_MOST_VISITED_URLS.length); @@ -173,7 +175,7 @@ //@MediumTest @DisabledTest(message = "crbug.com/771648") @Feature({"NewTabPage", "RenderTest"}) - @ChromeHome.Enable + @ChromeModernDesign.Enable public void testModernTileGridAppearance_Full() throws IOException, InterruptedException { View tileGridLayout = renderTiles(makeSuggestions(FAKE_MOST_VISITED_URLS.length)); @@ -195,7 +197,7 @@ //@MediumTest @DisabledTest(message = "crbug.com/771648") @Feature({"NewTabPage", "RenderTest"}) - @ChromeHome.Disable + @ChromeModernDesign.Disable public void testTileGridAppearance_Full() throws IOException, InterruptedException { View tileGridLayout = renderTiles(makeSuggestions(FAKE_MOST_VISITED_URLS.length)); @@ -218,7 +220,7 @@ @DisabledTest(message = "crbug.com/771648") @RetryOnFailure @Feature({"NewTabPage", "RenderTest"}) - @ChromeHome.Enable + @ChromeModernDesign.Enable public void testModernTileGridAppearance_Two() throws IOException, InterruptedException { View tileGridLayout = renderTiles(makeSuggestions(2)); @@ -234,7 +236,7 @@ @DisabledTest(message = "crbug.com/771648") @RetryOnFailure @Feature({"NewTabPage", "RenderTest"}) - @ChromeHome.Disable + @ChromeModernDesign.Disable public void testTileGridAppearance_Two() throws IOException, InterruptedException { View tileGridLayout = renderTiles(makeSuggestions(2)); @@ -245,11 +247,10 @@ mRenderTestRule.render(tileGridLayout, "two_tiles_grid_landscape"); } - @DisabledTest(message = "https://crbug.com/805160") @Test @MediumTest @Feature({"NewTabPage", "RenderTest"}) - @ChromeHome.Enable + @ChromeModernDesign.Enable public void testTileAppearanceModern() throws IOException, InterruptedException, TimeoutException { List<SiteSuggestion> suggestions = makeSuggestions(2); @@ -265,7 +266,7 @@ @Test @MediumTest @Feature({"NewTabPage", "RenderTest"}) - @ChromeHome.Disable + @ChromeModernDesign.Disable public void testTileAppearanceClassic() throws IOException, InterruptedException, TimeoutException { List<SiteSuggestion> suggestions = makeSuggestions(2);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/EmulatedVrController.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/EmulatedVrController.java index f2578a511..10b4b20 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/EmulatedVrController.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/EmulatedVrController.java
@@ -112,31 +112,56 @@ * @param steps the number of intermediate steps to send while scrolling * @param speed how long to wait between steps in the scroll, with higher * numbers resulting in a faster scroll + * @param fling whether fling scrolling is allowed. Enabling this more closely emulates how a + * user will scroll, but is less precise, so only enable if you actually need it. */ - public void scroll(ScrollDirection direction, int steps, int speed) { + public void scroll(ScrollDirection direction, int steps, int speed, boolean fling) { float startX, startY, endX, endY; + // We need to perform the scroll over a shorter area of the touchpad in order for flinging + // to work properly. + // TODO(https://crbug.com/820281): Figure out why this is the case - not fling scrolling + // because we're using more of the touchpad doesn't make sense. + float offset = fling ? 0.5f : 0.1f; startX = startY = endX = endY = 0.5f; switch (direction) { case UP: - startY = 0.1f; + startY = offset; endY = 0.9f; break; case DOWN: startY = 0.9f; - endY = 0.1f; + endY = offset; break; case LEFT: - startX = 0.1f; + startX = offset; endX = 0.9f; break; case RIGHT: startX = 0.9f; - endX = 0.1f; + endX = offset; break; default: Assert.fail("Unknown scroll direction enum given"); } performLinearTouchpadMovement(startX, startY, endX, endY, steps, speed); + // There's technically nothing that prevents fling scrolling if fling is set to false, but + // we have yet to find any combination of steps and speed that results in a fling with the + // larger scroll area that setting fling to false uses. As an added precaution, assume that + // a fling occurred and cancel it immediately if we're not supposed to be flinging. + if (!fling) cancelFlingScroll(); + } + + /** + * Touches then releases the touchpad to cancel fling scroll. + */ + public void cancelFlingScroll() { + // Arbitrary amount of delay to both ensure that the touchpad press is properly registered + // and long enough that we don't accidentally trigger any functionality bound to quick + // touchpad taps if there is any. + int delay = 500; + long simulatedDelay = TimeUnit.MILLISECONDS.toNanos(delay); + long timestamp = mApi.touchEvent.startTouchSequence(0.5f, 0.5f, simulatedDelay, delay); + mApi.touchEvent.endTouchSequence(0.5f, 0.5f, timestamp, simulatedDelay, delay); } /**
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellControllerInputTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellControllerInputTest.java index 05b55fd..0f993ab 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellControllerInputTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/VrShellControllerInputTest.java
@@ -7,6 +7,7 @@ import static org.chromium.chrome.browser.vr_shell.VrTestFramework.PAGE_LOAD_TIMEOUT_S; import static org.chromium.chrome.browser.vr_shell.VrTestFramework.POLL_CHECK_INTERVAL_LONG_MS; import static org.chromium.chrome.browser.vr_shell.VrTestFramework.POLL_TIMEOUT_LONG_MS; +import static org.chromium.chrome.browser.vr_shell.VrTestFramework.POLL_TIMEOUT_SHORT_MS; import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_DEVICE_DAYDREAM; import static org.chromium.chrome.test.util.ChromeRestriction.RESTRICTION_TYPE_VIEWER_DAYDREAM; @@ -35,6 +36,7 @@ import org.chromium.content_public.browser.WebContents; import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicInteger; /** * End-to-end tests for Daydream controller input while in the VR browser. @@ -49,10 +51,25 @@ public ChromeTabbedActivityVrTestRule mVrTestRule = new ChromeTabbedActivityVrTestRule(); private VrTestFramework mVrTestFramework; + private EmulatedVrController mController; @Before public void setUp() throws Exception { mVrTestFramework = new VrTestFramework(mVrTestRule); + VrTransitionUtils.forceEnterVr(); + VrTransitionUtils.waitForVrEntry(POLL_TIMEOUT_LONG_MS); + mController = new EmulatedVrController(mVrTestRule.getActivity()); + mController.recenterView(); + } + + private void waitForPageToBeScrollable(final ContentViewCore cvc) { + CriteriaHelper.pollUiThread(new Criteria() { + @Override + public boolean isSatisfied() { + return cvc.computeVerticalScrollRange() > cvc.getContainerView().getHeight() + && cvc.computeHorizontalScrollRange() > cvc.getContainerView().getWidth(); + } + }, POLL_TIMEOUT_LONG_MS, POLL_CHECK_INTERVAL_LONG_MS); } /** @@ -62,79 +79,137 @@ @Test @MediumTest public void testControllerScrolling() throws InterruptedException { - // Load page in VR and make sure the controller is pointed at the content quad mVrTestRule.loadUrl( VrTestFramework.getHtmlTestFile("test_controller_scrolling"), PAGE_LOAD_TIMEOUT_S); - VrTransitionUtils.forceEnterVr(); - VrTransitionUtils.waitForVrEntry(POLL_TIMEOUT_LONG_MS); - EmulatedVrController controller = new EmulatedVrController(mVrTestRule.getActivity()); - final ContentViewCore cvc = - mVrTestRule.getActivity().getActivityTab().getActiveContentViewCore(); final WebContents wc = mVrTestRule.getActivity().getActivityTab().getWebContents(); Coordinates coord = Coordinates.createFor(wc); - controller.recenterView(); - - // Wait for the page to be scrollable - CriteriaHelper.pollUiThread(new Criteria() { - @Override - public boolean isSatisfied() { - return cvc.computeVerticalScrollRange() > cvc.getContainerView().getHeight() - && cvc.computeHorizontalScrollRange() > cvc.getContainerView().getWidth(); - } - }, POLL_TIMEOUT_LONG_MS, POLL_CHECK_INTERVAL_LONG_MS); + waitForPageToBeScrollable( + mVrTestRule.getActivity().getActivityTab().getActiveContentViewCore()); // Test that scrolling down works - int startScrollPoint = coord.getScrollXPixInt(); + int startScrollPoint = coord.getScrollYPixInt(); // Arbitrary, but valid values to scroll smoothly int scrollSteps = 20; int scrollSpeed = 60; - controller.scroll(EmulatedVrController.ScrollDirection.DOWN, scrollSteps, scrollSpeed); + mController.scroll(EmulatedVrController.ScrollDirection.DOWN, scrollSteps, scrollSpeed, + /* fling */ false); // We need this second scroll down, otherwise the horizontal scrolling becomes flaky + // This actually seems to not be an issue in this test case anymore, but still occurs in + // the fling scroll test, so keep around here as an extra precaution. // TODO(bsheedy): Figure out why this is the case - controller.scroll(EmulatedVrController.ScrollDirection.DOWN, scrollSteps, scrollSpeed); + mController.scroll(EmulatedVrController.ScrollDirection.DOWN, scrollSteps, scrollSpeed, + /* fling */ false); int endScrollPoint = coord.getScrollYPixInt(); Assert.assertTrue("Controller was able to scroll down", startScrollPoint < endScrollPoint); // Test that scrolling up works startScrollPoint = endScrollPoint; - controller.scroll(EmulatedVrController.ScrollDirection.UP, scrollSteps, scrollSpeed); + mController.scroll(EmulatedVrController.ScrollDirection.UP, scrollSteps, scrollSpeed, + /* fling */ false); endScrollPoint = coord.getScrollYPixInt(); Assert.assertTrue("Controller was able to scroll up", startScrollPoint > endScrollPoint); // Test that scrolling right works startScrollPoint = coord.getScrollXPixInt(); - controller.scroll(EmulatedVrController.ScrollDirection.RIGHT, scrollSteps, scrollSpeed); + mController.scroll(EmulatedVrController.ScrollDirection.RIGHT, scrollSteps, scrollSpeed, + /* fling */ false); endScrollPoint = coord.getScrollXPixInt(); Assert.assertTrue("Controller was able to scroll right", startScrollPoint < endScrollPoint); // Test that scrolling left works startScrollPoint = endScrollPoint; - controller.scroll(EmulatedVrController.ScrollDirection.LEFT, scrollSteps, scrollSpeed); + mController.scroll(EmulatedVrController.ScrollDirection.LEFT, scrollSteps, scrollSpeed, + /* fling */ false); endScrollPoint = coord.getScrollXPixInt(); Assert.assertTrue("Controller was able to scroll left", startScrollPoint > endScrollPoint); } /** + * Verifies that fling scrolling works on the Daydream controller's touchpad. + */ + @Test + @MediumTest + public void testControllerFlingScrolling() throws InterruptedException { + mVrTestRule.loadUrl( + VrTestFramework.getHtmlTestFile("test_controller_scrolling"), PAGE_LOAD_TIMEOUT_S); + final WebContents wc = mVrTestRule.getActivity().getActivityTab().getWebContents(); + Coordinates coord = Coordinates.createFor(wc); + waitForPageToBeScrollable( + mVrTestRule.getActivity().getActivityTab().getActiveContentViewCore()); + + // Arbitrary, but valid values to trigger fling scrolling + int scrollSteps = 2; + int scrollSpeed = 40; + + // Test fling scrolling down + mController.scroll(EmulatedVrController.ScrollDirection.DOWN, scrollSteps, scrollSpeed, + /* fling */ true); + final AtomicInteger endScrollPoint = new AtomicInteger(coord.getScrollYPixInt()); + // Check that we continue to scroll past wherever we were when we let go of the touchpad + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return coord.getScrollYPixInt() > endScrollPoint.get(); + } + }, POLL_TIMEOUT_SHORT_MS, POLL_CHECK_INTERVAL_LONG_MS); + mController.cancelFlingScroll(); + + // Test fling scrolling up + mController.scroll(EmulatedVrController.ScrollDirection.UP, scrollSteps, scrollSpeed, + /* fling */ true); + endScrollPoint.set(coord.getScrollYPixInt()); + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return coord.getScrollYPixInt() < endScrollPoint.get(); + } + }, POLL_TIMEOUT_SHORT_MS, POLL_CHECK_INTERVAL_LONG_MS); + mController.cancelFlingScroll(); + // Horizontal scrolling becomes flaky if the scroll bar is at the top when we try to scroll + // horizontally, so scroll down a bit to ensure that isn't the case. + mController.scroll(EmulatedVrController.ScrollDirection.DOWN, 10, 60, + /* fling */ false); + + // Test fling scrolling right + mController.scroll(EmulatedVrController.ScrollDirection.RIGHT, scrollSteps, scrollSpeed, + /* fling */ true); + endScrollPoint.set(coord.getScrollXPixInt()); + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return coord.getScrollXPixInt() > endScrollPoint.get(); + } + }, POLL_TIMEOUT_SHORT_MS, POLL_CHECK_INTERVAL_LONG_MS); + mController.cancelFlingScroll(); + + // Test fling scrolling left + mController.scroll(EmulatedVrController.ScrollDirection.LEFT, scrollSteps, scrollSpeed, + /* fling */ true); + endScrollPoint.set(coord.getScrollXPixInt()); + CriteriaHelper.pollInstrumentationThread(new Criteria() { + @Override + public boolean isSatisfied() { + return coord.getScrollXPixInt() < endScrollPoint.get(); + } + }, POLL_TIMEOUT_SHORT_MS, POLL_CHECK_INTERVAL_LONG_MS); + } + + /** * Verifies that controller clicks in the VR browser are properly registered on the webpage. * This is done by clicking on a link on the page and ensuring that it causes a navigation. */ @Test @MediumTest public void testControllerClicksRegisterOnWebpage() throws InterruptedException { - // Load page in VR and make sure the controller is pointed at the content quad mVrTestRule.loadUrl( VrTestFramework.getHtmlTestFile("test_controller_clicks_register_on_webpage"), PAGE_LOAD_TIMEOUT_S); - VrTransitionUtils.forceEnterVr(); - VrTransitionUtils.waitForVrEntry(POLL_TIMEOUT_LONG_MS); - EmulatedVrController controller = new EmulatedVrController(mVrTestRule.getActivity()); - controller.recenterView(); // pressReleaseTouchpadButton() appears to be flaky for clicking on things, as sometimes // it happens too fast for Chrome to register. So, manually press and release with a delay - controller.sendClickButtonToggleEvent(); + mController.sendClickButtonToggleEvent(); SystemClock.sleep(50); - controller.sendClickButtonToggleEvent(); + mController.sendClickButtonToggleEvent(); ChromeTabUtils.waitForTabPageLoaded(mVrTestRule.getActivity().getActivityTab(), VrTestFramework.getHtmlTestFile("test_navigation_2d_page")); } @@ -149,16 +224,13 @@ public void testAppButtonExitsFullscreen() throws InterruptedException, TimeoutException { mVrTestFramework.loadUrlAndAwaitInitialization( VrTestFramework.getHtmlTestFile("test_navigation_2d_page"), PAGE_LOAD_TIMEOUT_S); - VrTransitionUtils.forceEnterVr(); - VrTransitionUtils.waitForVrEntry(POLL_TIMEOUT_LONG_MS); // Enter fullscreen DOMUtils.clickNode(mVrTestFramework.getFirstTabCvc(), "fullscreen", false /* goThroughRootAndroidView */); VrTestFramework.waitOnJavaScriptStep(mVrTestFramework.getFirstTabWebContents()); Assert.assertTrue(DOMUtils.isFullscreen(mVrTestFramework.getFirstTabWebContents())); - EmulatedVrController controller = new EmulatedVrController(mVrTestRule.getActivity()); - controller.pressReleaseAppButton(); + mController.pressReleaseAppButton(); CriteriaHelper.pollInstrumentationThread(new Criteria() { @Override public boolean isSatisfied() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/mock/MockVrDaydreamApi.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/mock/MockVrDaydreamApi.java index a5f1b85b..ef2f2c3 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/mock/MockVrDaydreamApi.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/mock/MockVrDaydreamApi.java
@@ -105,4 +105,7 @@ public boolean isInVrSession() { return true; } + + @Override + public void launchGvrSettings() {} }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/TransitionUtils.java b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/TransitionUtils.java index 318f0d1..7fa3974 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/TransitionUtils.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/vr_shell/util/TransitionUtils.java
@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.vr_shell.TestFramework; import org.chromium.chrome.browser.vr_shell.TestVrShellDelegate; import org.chromium.chrome.browser.vr_shell.VrClassesWrapperImpl; +import org.chromium.chrome.browser.vr_shell.VrDaydreamApi; import org.chromium.chrome.browser.vr_shell.VrIntentUtils; import org.chromium.chrome.browser.vr_shell.VrShellDelegate; import org.chromium.chrome.browser.vr_shell.VrTestFramework; @@ -215,7 +216,9 @@ ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { - wrapper.createVrDaydreamApi(activity).launchInVr(intent); + VrDaydreamApi api = wrapper.createVrDaydreamApi(activity); + api.launchInVr(intent); + api.close(); } }); }
diff --git a/chrome/android/profiles/newest.txt b/chrome/android/profiles/newest.txt index 77d1b73..9d09a9d0 100644 --- a/chrome/android/profiles/newest.txt +++ b/chrome/android/profiles/newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-67.0.3365.0_rc-r1.afdo.bz2 \ No newline at end of file +chromeos-chrome-amd64-67.0.3366.0_rc-r1.afdo.bz2 \ No newline at end of file
diff --git a/chrome/app/android/DEPS b/chrome/app/android/DEPS index 6a58d29..759e95e 100644 --- a/chrome/app/android/DEPS +++ b/chrome/app/android/DEPS
@@ -4,7 +4,7 @@ "+content/browser/media/android/browser_media_player_manager.h", ], "chrome_jni_onload.cc": [ - "+device/vr/features/features.h", + "+device/vr/buildflags/buildflags.h", "+third_party/gvr-android-sdk" ], -} \ No newline at end of file +}
diff --git a/chrome/app/android/chrome_jni_onload.cc b/chrome/app/android/chrome_jni_onload.cc index 1e8097d..3479cff 100644 --- a/chrome/app/android/chrome_jni_onload.cc +++ b/chrome/app/android/chrome_jni_onload.cc
@@ -9,7 +9,7 @@ #include "base/android/jni_utils.h" #include "chrome/app/android/chrome_android_initializer.h" #include "content/public/app/content_jni_onload.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_VR) #include "third_party/gvr-android-sdk/display_synchronizer_jni.h"
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp index d147f5cc..87d4002c8 100644 --- a/chrome/app/chromeos_strings.grdp +++ b/chrome/app/chromeos_strings.grdp
@@ -322,10 +322,10 @@ <ph name="LINE_BREAKS"><br/><br/></ph> Removing your device while it is in use may cause data loss. Please wait until the operation is over, then eject the device using the Files app. </message> - <message name="IDS_FILE_BROWSER_UNMOUNT_PROVIDED_FAILED" desc="Title of the error dialog when unmount operation for a volume provided by an extension failed."> - <ph name="BEGIN_BOLD"><b></ph>Cannot unmount volume<ph name="END_BOLD"></b></ph> + <message name="IDS_FILE_BROWSER_UNMOUNT_PROVIDED_FAILED" desc="Title of the error dialog when unmount operation for a volume provided by an extension failed. One of the most typical use case is an archive (i.e. ZIP) file mounted as a virtual disk. However, arbitrary Chrome apps can mount volumes. So we should not assume this is an archive file."> + <ph name="BEGIN_BOLD"><b></ph>Can't disconnect from an archive or virtual disk<ph name="END_BOLD"></b></ph> <ph name="LINE_BREAKS"><br/><br/></ph> - The volume is busy. Please close all the opened files from it, then try again later. + Close all files on the archive or virtual disk, then try again. </message> <message name="IDS_FILE_BROWSER_MOUNT_ARCHIVE" desc="Title of the action for mounting an archive file to work with its contents."> Open @@ -888,16 +888,16 @@ Album </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_AUDIO_INFO" desc="Category label for audio file info."> - Audio Info + Audio info </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_CODEC" desc="Label for video codec."> Codec </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_CREATED_BY" desc="Label for who created the file."> - Created By + Created by </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_CREATION_TIME" desc="Label for file creation time."> - Created Time + Created time </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_DIMENSION" desc="Label for image dimensions."> Dimensions @@ -906,10 +906,10 @@ Duration </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_EXIF_DEVICE_MODEL" desc="Label for the device model which created the image."> - Device Model + Device model </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_EXIF_DEVICE_SETTINGS" desc="Label for the device settings (exif's F number, exposure time, focal length and ISO speed rating) metadata."> - Device Settings + Device settings </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_EXIF_GEOGRAPHY" desc="Label for the latitude and the longitude where the image was taken."> Geography @@ -917,20 +917,20 @@ <message name="IDS_FILE_BROWSER_METADATA_BOX_FILE_PATH" desc="Label for file path."> Path </message> - <message name="IDS_FILE_BROWSER_METADATA_BOX_FILE_SIZE" desc="Label fo file size."> + <message name="IDS_FILE_BROWSER_METADATA_BOX_FILE_SIZE" desc="Label for file size."> Size </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_FRAME_RATE" desc="Label for video frame rate."> - Frame Rate + Frame rate </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_GENERAL_INFO" desc="Category label for general file info."> - General Info + General info </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_GENRE" desc="Label for audio genre."> Genre </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_IMAGE_INFO" desc="Category label for image file info."> - Image Info + Image info </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_MEDIA_ARTIST" desc="Label for media artist."> Artist @@ -942,13 +942,13 @@ Title </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_MODIFICATION_TIME" desc="Label for file modification time."> - Modified Time + Modified time </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_MODIFIED_BY" desc="Label for who modified the file."> - Modified By + Modified by </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_PAGE_COUNT" desc="Label for pdf page count."> - Page Count + Page count </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_SOURCE" desc="Label for the device used to capture the image."> Source @@ -957,10 +957,10 @@ Track </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_VIDEO_INFO" desc="Category label for video file info."> - Video Info + Video info </message> <message name="IDS_FILE_BROWSER_METADATA_BOX_YEAR_RECORDED" desc="Label for audio recorded year."> - Year Recorded + Year recorded </message> <message name="IDS_FILE_BROWSER_CALCULATING_SIZE" desc="Message informing the user that total items size is being calculated."> Calculating size @@ -4817,7 +4817,7 @@ <message name="IDS_SCREENSHOT_NOTIFICATION_BUTTON_COPY_TO_CLIPBOARD" desc="The button label for the screenshot notification which copies the screenshot image to clipboard on click."> Copy to clipboard </message> - <message name="IDS_SCREENSHOT_NOTIFICATION_BUTTON_ANNOTATE" desc="The label for the screenshot notification button that opens the note-taking app to annotate the screenhsot."> + <message name="IDS_SCREENSHOT_NOTIFICATION_BUTTON_ANNOTATE" desc="The label for the screenshot notification button that opens the note-taking app to annotate the screenshot."> Annotate image </message>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 8f0b8b20..321a0c4 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -3120,6 +3120,9 @@ <message name="IDS_SETTINGS_TURN_OFF_SYNC_DIALOG_CHECKBOX" desc="The text to display next to the checkbox of the dialog to turn off sync, asking users if they want to clear these data from the device."> Clear bookmarks, history, passwords, and more from this device </message> + <message name="IDS_SETTINGS_SYNC_SETTINGS_SAVED_TOAST_LABEL" desc="The notification shown to user after they saved sync settings, and sync is now started."> + Settings saved. Sync started. + </message> </if> <message name="IDS_SETTINGS_SYNC_OVERVIEW" desc="The message that appears in the options dialog when sync has not been set up by the user.">
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index 3f6090c..2e4d080 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd
@@ -87,15 +87,17 @@ </if> <structure type="chrome_scaled_image" name="IDR_COOKIES" file="common/cookies.png" /> <structure type="chrome_scaled_image" name="IDR_COOKIE_STORAGE_ICON" file="common/cookie_storage.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM_LEFT" file="common/developer_mode_highlight_bottom_left.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM" file="common/developer_mode_highlight_bottom.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM_RIGHT" file="common/developer_mode_highlight_bottom_right.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_CENTER" file="common/developer_mode_highlight_center.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_LEFT" file="common/developer_mode_highlight_left.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_RIGHT" file="common/developer_mode_highlight_right.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_TOP_LEFT" file="common/developer_mode_highlight_top_left.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_TOP" file="common/developer_mode_highlight_top.png" /> - <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_TOP_RIGHT" file="common/developer_mode_highlight_top_right.png" /> + <if expr="is_macosx"> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM_LEFT" file="common/developer_mode_highlight_bottom_left.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM" file="common/developer_mode_highlight_bottom.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_BOTTOM_RIGHT" file="common/developer_mode_highlight_bottom_right.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_CENTER" file="common/developer_mode_highlight_center.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_LEFT" file="common/developer_mode_highlight_left.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_RIGHT" file="common/developer_mode_highlight_right.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_TOP_LEFT" file="common/developer_mode_highlight_top_left.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_TOP" file="common/developer_mode_highlight_top.png" /> + <structure type="chrome_scaled_image" name="IDR_DEVELOPER_MODE_HIGHLIGHT_TOP_RIGHT" file="common/developer_mode_highlight_top_right.png" /> + </if> <if expr="chromeos"> <structure type="chrome_scaled_image" name="IDR_DEVICE_DISABLED" file="cros/device_disabled.png" /> </if>
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index c2c2832d..56e8b3d 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -15,8 +15,8 @@ import("//components/os_crypt/features.gni") import("//components/signin/features.gni") import("//components/spellcheck/spellcheck_build_features.gni") -import("//device/vr/features/features.gni") -import("//extensions/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//net/features.gni") import("//ppapi/features/features.gni") @@ -868,8 +868,6 @@ "overlay/overlay_window.h", "page_load_metrics/browser_page_track_decider.cc", "page_load_metrics/browser_page_track_decider.h", - "page_load_metrics/experiments/delay_navigation_throttle.cc", - "page_load_metrics/experiments/delay_navigation_throttle.h", "page_load_metrics/metrics_navigation_throttle.cc", "page_load_metrics/metrics_navigation_throttle.h", "page_load_metrics/metrics_web_contents_observer.cc", @@ -886,8 +884,6 @@ "page_load_metrics/observers/css_scanning_page_load_metrics_observer.h", "page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc", "page_load_metrics/observers/data_reduction_proxy_metrics_observer.h", - "page_load_metrics/observers/delay_navigation_page_load_metrics_observer.cc", - "page_load_metrics/observers/delay_navigation_page_load_metrics_observer.h", "page_load_metrics/observers/document_write_page_load_metrics_observer.cc", "page_load_metrics/observers/document_write_page_load_metrics_observer.h", "page_load_metrics/observers/from_gws_page_load_metrics_observer.cc", @@ -1755,8 +1751,8 @@ "//device/geolocation", "//device/usb/mojo", "//device/usb/public/mojom", - "//device/vr/features", - "//extensions/features", + "//device/vr/buildflags", + "//extensions/buildflags", "//google_apis", "//gpu/config", "//media", @@ -2601,6 +2597,8 @@ "resource_coordinator/background_tab_navigation_throttle.h", "resource_coordinator/discard_metrics_lifecycle_unit_observer.cc", "resource_coordinator/discard_metrics_lifecycle_unit_observer.h", + "resource_coordinator/discard_metrics_util.cc", + "resource_coordinator/discard_metrics_util.h", "resource_coordinator/discard_reason.h", "resource_coordinator/lifecycle_unit.cc", "resource_coordinator/lifecycle_unit.h", @@ -2634,6 +2632,8 @@ "resource_coordinator/tab_manager_web_contents_data.h", "resource_coordinator/tab_metrics_logger.cc", "resource_coordinator/tab_metrics_logger.h", + "resource_coordinator/tab_stats.cc", + "resource_coordinator/tab_stats.h", "resource_coordinator/time.cc", "resource_coordinator/time.h", "search/iframe_source.cc",
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 43838c3..848151f 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS
@@ -26,11 +26,11 @@ "+device/geolocation", "+device/media_transfer_protocol", "+device/usb", - "+device/vr/features/features.h", + "+device/vr/buildflags/buildflags.h", "+extensions/browser", "+extensions/common", "+extensions/components/javascript_dialog_extensions_client", - "+extensions/features", + "+extensions/buildflags", "+extensions/grit", "+extensions/test", "+google/cacheinvalidation", # Sync invalidation API protobuf files.
diff --git a/chrome/browser/OWNERS b/chrome/browser/OWNERS index b8cb883..5b2f6db 100644 --- a/chrome/browser/OWNERS +++ b/chrome/browser/OWNERS
@@ -87,7 +87,7 @@ per-file shell_integration_win*=gab@chromium.org per-file shell_integration_win*=grt@chromium.org -per-file shell_integration_linux*=erg@chromium.org +per-file shell_integration_linux*=thomasanderson@chromium.org per-file site_details*=creis@chromium.org per-file site_details*=nasko@chromium.org
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index ae240d1b..0a34f526 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -96,8 +96,8 @@ #include "content/public/common/content_switches.h" #include "content/public/common/feature_h264_with_openh264_ffmpeg.h" #include "device/base/features.h" -#include "device/vr/features/features.h" -#include "extensions/features/features.h" +#include "device/vr/buildflags/buildflags.h" +#include "extensions/buildflags/buildflags.h" #include "google_apis/drive/drive_switches.h" #include "gpu/config/gpu_switches.h" #include "media/audio/audio_features.h" @@ -1841,7 +1841,8 @@ #if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) {"enable-native-notifications", flag_descriptions::kNotificationsNativeFlagName, - flag_descriptions::kNotificationsNativeFlagDescription, kOsMac | kOsLinux, + flag_descriptions::kNotificationsNativeFlagDescription, + kOsMac | kOsLinux | kOsWin, FEATURE_VALUE_TYPE(features::kNativeNotifications)}, #endif // ENABLE_NATIVE_NOTIFICATIONS #if defined(OS_ANDROID) @@ -3582,7 +3583,7 @@ {"ash-enable-display-move-window-accels", flag_descriptions::kAshEnableDisplayMoveWindowAccelsName, flag_descriptions::kAshEnableDisplayMoveWindowAccelsDescription, kOsCrOS, - SINGLE_VALUE_TYPE(ash::switches::kAshEnableDisplayMoveWindowAccels)}, + FEATURE_VALUE_TYPE(ash::features::kDisplayMoveWindowAccels)}, {"ash-enable-keyboard-shortcut-viewer", flag_descriptions::kAshEnableKeyboardShortcutViewerName,
diff --git a/chrome/browser/android/DEPS b/chrome/browser/android/DEPS index cc1bb3a..ce6b4aa6 100644 --- a/chrome/browser/android/DEPS +++ b/chrome/browser/android/DEPS
@@ -9,7 +9,7 @@ "+components/toolbar", "+components/viz/common/gpu/context_provider.h", "+components/web_contents_delegate_android", - "+device/vr/features/features.h", + "+device/vr/buildflags/buildflags.h", "+sandbox/linux/seccomp-bpf/sandbox_bpf.h", "+sandbox/linux/seccomp-bpf-helpers", "+sandbox/sandbox_features.h",
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc index 9a66e6d5..e923fc5 100644 --- a/chrome/browser/android/shortcut_helper.cc +++ b/chrome/browser/android/shortcut_helper.cc
@@ -15,6 +15,7 @@ #include "base/guid.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" +#include "base/time/time.h" #include "chrome/browser/android/webapk/chrome_webapk_host.h" #include "chrome/browser/android/webapk/webapk_install_service.h" #include "chrome/browser/android/webapk/webapk_metrics.h" @@ -361,7 +362,9 @@ const JavaParamRef<jintArray>& jdisplay_modes, const JavaParamRef<jintArray>& jorientations, const JavaParamRef<jlongArray>& jtheme_colors, - const JavaParamRef<jlongArray>& jbackground_colors) { + const JavaParamRef<jlongArray>& jbackground_colors, + const JavaParamRef<jlongArray>& jlast_update_check_times_ms, + const JavaParamRef<jbooleanArray>& jrelax_updates) { DCHECK(jcallback_pointer); std::vector<std::string> names; base::android::AppendJavaStringArrayToStringVector(env, jnames, &names); @@ -395,6 +398,12 @@ std::vector<int64_t> background_colors; base::android::JavaLongArrayToInt64Vector(env, jbackground_colors, &background_colors); + std::vector<int64_t> last_update_check_times_ms; + base::android::JavaLongArrayToInt64Vector(env, jlast_update_check_times_ms, + &last_update_check_times_ms); + std::vector<bool> relax_updates; + base::android::JavaBooleanArrayToBoolVector(env, jrelax_updates, + &relax_updates); DCHECK(short_names.size() == names.size()); DCHECK(short_names.size() == package_names.size()); @@ -408,6 +417,8 @@ DCHECK(short_names.size() == orientations.size()); DCHECK(short_names.size() == theme_colors.size()); DCHECK(short_names.size() == background_colors.size()); + DCHECK(short_names.size() == last_update_check_times_ms.size()); + DCHECK(short_names.size() == relax_updates.size()); std::vector<WebApkInfo> webapk_list; webapk_list.reserve(short_names.size()); @@ -419,7 +430,9 @@ std::move(manifest_start_urls[i]), static_cast<blink::WebDisplayMode>(display_modes[i]), static_cast<blink::WebScreenOrientationLockType>(orientations[i]), - theme_colors[i], background_colors[i])); + theme_colors[i], background_colors[i], + base::Time::FromJavaTime(last_update_check_times_ms[i]), + relax_updates[i])); } ShortcutHelper::WebApkInfoCallback* webapk_list_callback =
diff --git a/chrome/browser/android/vr/BUILD.gn b/chrome/browser/android/vr/BUILD.gn index 9e82639..196f56fd 100644 --- a/chrome/browser/android/vr/BUILD.gn +++ b/chrome/browser/android/vr/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/android/rules.gni") import("//chrome/common/features.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//testing/test.gni") assert(enable_vr)
diff --git a/chrome/browser/android/vr/vr_controller.cc b/chrome/browser/android/vr/vr_controller.cc index 28b7aaf..eb6a07a 100644 --- a/chrome/browser/android/vr/vr_controller.cc +++ b/chrome/browser/android/vr/vr_controller.cc
@@ -145,6 +145,55 @@ return pad; } +device::mojom::XRInputSourceStatePtr VrController::GetInputSourceState() { + device::mojom::XRInputSourceStatePtr state = + device::mojom::XRInputSourceState::New(); + + // Only one controller is supported, so the source id can be static. + state->source_id = 1; + + // Set the primary button state. + state->primary_input_pressed = + controller_state_->GetButtonState(GVR_CONTROLLER_BUTTON_CLICK); + + if (ButtonUpHappened(GVR_CONTROLLER_BUTTON_CLICK)) { + state->primary_input_clicked = true; + } + + state->description = device::mojom::XRInputSourceDescription::New(); + + // It's a handheld pointing device. + state->description->pointer_origin = device::mojom::XRPointerOrigin::HAND; + + // Controller uses an arm model. + state->description->emulated_position = true; + + // Set handedness. + switch (handedness_) { + case GVR_CONTROLLER_LEFT_HANDED: + state->description->handedness = device::mojom::XRHandedness::LEFT; + break; + case GVR_CONTROLLER_RIGHT_HANDED: + state->description->handedness = device::mojom::XRHandedness::RIGHT; + break; + default: + state->description->handedness = device::mojom::XRHandedness::NONE; + break; + } + + // Get the grip transform + gfx::Transform grip; + GetTransform(&grip); + state->grip = grip; + + // Set the pointer offset from the grip transform. + gfx::Transform pointer; + GetRelativePointerTransform(&pointer); + state->description->pointer_offset = pointer; + + return state; +} + bool VrController::IsTouching() { return controller_state_->IsTouching(); } @@ -209,17 +258,31 @@ out->matrix().postTranslate(position.x, position.y, position.z); } +void VrController::GetRelativePointerTransform(gfx::Transform* out) const { + *out = gfx::Transform(); + out->RotateAboutXAxis(-kErgoAngleOffset * 180.0f / base::kPiFloat); + out->Translate3d(0, 0, -kLaserStartDisplacement); +} + +void VrController::GetPointerTransform(gfx::Transform* out) const { + gfx::Transform controller; + GetTransform(&controller); + + GetRelativePointerTransform(out); + out->ConcatTransform(controller); +} + float VrController::GetOpacity() const { return alpha_value_; } gfx::Point3F VrController::GetPointerStart() const { - gfx::Vector3dF pointer_direction{0.0f, -sin(kErgoAngleOffset), - -cos(kErgoAngleOffset)}; - gfx::Transform rotation_mat(Orientation()); - rotation_mat.TransformVector(&pointer_direction); - return Position() + - gfx::ScaleVector3d(pointer_direction, kLaserStartDisplacement); + gfx::Transform pointer_transform; + GetPointerTransform(&pointer_transform); + + gfx::Point3F pointer_position; + pointer_transform.TransformPoint(&pointer_position); + return pointer_position; } bool VrController::TouchDownHappened() {
diff --git a/chrome/browser/android/vr/vr_controller.h b/chrome/browser/android/vr/vr_controller.h index c2023fd..49dd3fd 100644 --- a/chrome/browser/android/vr/vr_controller.h +++ b/chrome/browser/android/vr/vr_controller.h
@@ -12,6 +12,7 @@ #include "base/time/time.h" #include "chrome/browser/vr/platform_controller.h" #include "device/vr/android/gvr/gvr_gamepad_data_provider.h" +#include "device/vr/public/mojom/vr_service.mojom.h" #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr_types.h" #include "ui/gfx/geometry/point3_f.h" #include "ui/gfx/geometry/quaternion.h" @@ -50,6 +51,7 @@ void OnPause(); device::GvrGamepadData GetGamepadData(); + device::mojom::XRInputSourceStatePtr GetInputSourceState(); // Called once per frame to update controller state. void UpdateState(const gvr::Mat4f& head_direction); @@ -65,6 +67,8 @@ gfx::Quaternion Orientation() const; gfx::Point3F Position() const; void GetTransform(gfx::Transform* out) const; + void GetRelativePointerTransform(gfx::Transform* out) const; + void GetPointerTransform(gfx::Transform* out) const; float GetOpacity() const; gfx::Point3F GetPointerStart() const;
diff --git a/chrome/browser/android/vr/vr_shell.cc b/chrome/browser/android/vr/vr_shell.cc index 740f86e5..fe445647 100644 --- a/chrome/browser/android/vr/vr_shell.cc +++ b/chrome/browser/android/vr/vr_shell.cc
@@ -415,6 +415,10 @@ } else { pending_cardboard_trigger_ = touched; } + + PostToGlThread(FROM_HERE, + base::BindOnce(&VrShellGl::OnTriggerEvent, + gl_thread_->GetVrShellGl(), touched)); } void VrShell::OnPause(JNIEnv* env, const JavaParamRef<jobject>& obj) {
diff --git a/chrome/browser/android/vr/vr_shell_gl.cc b/chrome/browser/android/vr/vr_shell_gl.cc index 185d5ae..38146ecc 100644 --- a/chrome/browser/android/vr/vr_shell_gl.cc +++ b/chrome/browser/android/vr/vr_shell_gl.cc
@@ -452,6 +452,8 @@ // direct-draw-to-shared-buffer optimization. DVLOG(1) << "preserveDrawingBuffer=" << present_options->preserve_drawing_buffer; + + report_webxr_input_ = present_options->webxr_input; } void VrShellGl::OnSwapContents(int new_content_id) { @@ -1573,6 +1575,17 @@ device::GvrDelegate::GetVRPosePtrWithNeckModel(gvr_api_.get(), &head_mat, prediction_nanos); + if (report_webxr_input_) { + std::vector<device::mojom::XRInputSourceStatePtr> input_states; + + device::mojom::XRInputSourceStatePtr input_state = + cardboard_ ? GetGazeInputSourceState() + : controller_->GetInputSourceState(); + + input_states.push_back(std::move(input_state)); + pose->input_state = std::move(input_states); + } + webvr_head_pose_[frame_index % kPoseRingBufferSize] = head_mat; webvr_frame_oustanding_[frame_index % kPoseRingBufferSize] = true; webvr_time_pose_[frame_index % kPoseRingBufferSize] = base::TimeTicks::Now(); @@ -1596,6 +1609,42 @@ binding_.Close(); } +device::mojom::XRInputSourceStatePtr VrShellGl::GetGazeInputSourceState() { + device::mojom::XRInputSourceStatePtr state = + device::mojom::XRInputSourceState::New(); + + // Only one gaze input source to worry about, so it can have a static id. + state->source_id = 1; + + // Report any trigger state changes made since the last call and reset the + // state here. + state->primary_input_pressed = cardboard_trigger_pressed_; + state->primary_input_clicked = cardboard_trigger_clicked_; + cardboard_trigger_clicked_ = false; + + state->description = device::mojom::XRInputSourceDescription::New(); + + // It's a gaze-cursor-based device. + state->description->pointer_origin = device::mojom::XRPointerOrigin::HEAD; + state->description->emulated_position = true; + + // No implicit handedness + state->description->handedness = device::mojom::XRHandedness::NONE; + + // Pointer and grip transforms are omitted since this is a gaze-based source. + + return state; +} + +void VrShellGl::OnTriggerEvent(bool pressed) { + if (pressed) { + cardboard_trigger_pressed_ = true; + } else if (cardboard_trigger_pressed_) { + cardboard_trigger_pressed_ = false; + cardboard_trigger_clicked_ = true; + } +} + void VrShellGl::AcceptDoffPromptForTesting() { ui_->AcceptDoffPromptForTesting(); }
diff --git a/chrome/browser/android/vr/vr_shell_gl.h b/chrome/browser/android/vr/vr_shell_gl.h index 6e31b116..1539d0e 100644 --- a/chrome/browser/android/vr/vr_shell_gl.h +++ b/chrome/browser/android/vr/vr_shell_gl.h
@@ -82,7 +82,7 @@ void Initialize(); void InitializeGl(gfx::AcceleratedWidget window); - void OnTriggerEvent(); + void OnTriggerEvent(bool pressed); void OnPause(); void OnResume(); void OnExitPresent(); @@ -188,6 +188,8 @@ void ClosePresentationBindings(); + device::mojom::XRInputSourceStatePtr GetGazeInputSourceState(); + // samplerExternalOES texture data for WebVR content image. int webvr_texture_id_ = 0; @@ -256,6 +258,9 @@ bool daydream_support_; bool is_exiting_ = false; bool content_paused_; + bool report_webxr_input_ = false; + bool cardboard_trigger_pressed_ = false; + bool cardboard_trigger_clicked_ = false; std::unique_ptr<VrController> controller_;
diff --git a/chrome/browser/android/webapk/webapk_info.cc b/chrome/browser/android/webapk/webapk_info.cc index 2b4735c..a8218ee 100644 --- a/chrome/browser/android/webapk/webapk_info.cc +++ b/chrome/browser/android/webapk/webapk_info.cc
@@ -18,7 +18,9 @@ blink::WebDisplayMode display, blink::WebScreenOrientationLockType orientation, int64_t theme_color, - int64_t background_color) + int64_t background_color, + base::Time last_update_check_time, + bool relax_updates) : name(std::move(name)), short_name(std::move(short_name)), package_name(std::move(package_name)), @@ -31,7 +33,9 @@ display(display), orientation(orientation), theme_color(theme_color), - background_color(background_color) {} + background_color(background_color), + last_update_check_time(last_update_check_time), + relax_updates(relax_updates) {} WebApkInfo::~WebApkInfo() {}
diff --git a/chrome/browser/android/webapk/webapk_info.h b/chrome/browser/android/webapk/webapk_info.h index be0edae4..55d65bc 100644 --- a/chrome/browser/android/webapk/webapk_info.h +++ b/chrome/browser/android/webapk/webapk_info.h
@@ -8,6 +8,7 @@ #include <string> #include "base/macros.h" +#include "base/time/time.h" #include "content/public/common/manifest.h" #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScreenOrientationLockType.h" @@ -30,7 +31,9 @@ blink::WebDisplayMode display, blink::WebScreenOrientationLockType orientation, int64_t theme_color, - int64_t background_color); + int64_t background_color, + base::Time last_update_check_time, + bool relax_updates); ~WebApkInfo(); WebApkInfo& operator=(WebApkInfo&& other); @@ -59,6 +62,8 @@ blink::WebScreenOrientationLockType orientation; int64_t theme_color; int64_t background_color; + base::Time last_update_check_time; + bool relax_updates; private: DISALLOW_COPY_AND_ASSIGN(WebApkInfo);
diff --git a/chrome/browser/apps/BUILD.gn b/chrome/browser/apps/BUILD.gn index 57db69cd..4b97e511 100644 --- a/chrome/browser/apps/BUILD.gn +++ b/chrome/browser/apps/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions)
diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc index d0816f3..e315914 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc
@@ -17,7 +17,7 @@ #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/omnibox/browser/autocomplete_classifier.h" #include "components/omnibox/browser/autocomplete_controller.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_system_provider.h"
diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc index 77516cd9..bd4c870 100644 --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -42,7 +42,7 @@ #include "content/public/browser/service_worker_context.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/traffic_annotation/network_traffic_annotation.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/autocomplete/keyword_extensions_delegate_impl.h b/chrome/browser/autocomplete/keyword_extensions_delegate_impl.h index 14a3cec6..a54ac40e 100644 --- a/chrome/browser/autocomplete/keyword_extensions_delegate_impl.h +++ b/chrome/browser/autocomplete/keyword_extensions_delegate_impl.h
@@ -19,7 +19,7 @@ #include "components/omnibox/browser/keyword_provider.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if !BUILDFLAG(ENABLE_EXTENSIONS) #error "Should not be included when extensions are disabled"
diff --git a/chrome/browser/autocomplete/shortcuts_backend_factory.cc b/chrome/browser/autocomplete/shortcuts_backend_factory.cc index 2db05a2..bb971b81 100644 --- a/chrome/browser/autocomplete/shortcuts_backend_factory.cc +++ b/chrome/browser/autocomplete/shortcuts_backend_factory.cc
@@ -15,7 +15,7 @@ #include "components/omnibox/browser/shortcuts_backend.h" #include "components/omnibox/browser/shortcuts_constants.h" #include "components/prefs/pref_service.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h"
diff --git a/chrome/browser/autocomplete/shortcuts_provider_extension_unittest.cc b/chrome/browser/autocomplete/shortcuts_provider_extension_unittest.cc index 20b17ae90..a1a5a19d 100644 --- a/chrome/browser/autocomplete/shortcuts_provider_extension_unittest.cc +++ b/chrome/browser/autocomplete/shortcuts_provider_extension_unittest.cc
@@ -23,7 +23,7 @@ #include "components/omnibox/browser/shortcuts_backend.h" #include "components/omnibox/browser/shortcuts_provider_test_util.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 64d48d1..e3602ee 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc
@@ -20,7 +20,7 @@ #include "chrome/common/url_constants.h" #include "components/url_formatter/url_fixer.h" #include "content/public/common/content_features.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" bool FixupBrowserAboutURL(GURL* url, content::BrowserContext* browser_context) {
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 96decee6..0417fb60 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc
@@ -70,7 +70,6 @@ #include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/printing/print_preview_dialog_controller.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/shell_integration.h" #include "chrome/browser/status_icons/status_tray.h" @@ -125,8 +124,8 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/network_connection_tracker.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "media/media_features.h" #include "net/socket/client_socket_pool_manager.h" #include "net/url_request/url_request_context_getter.h" @@ -834,12 +833,8 @@ resource_coordinator::TabManager* BrowserProcessImpl::GetTabManager() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) - if (!tab_manager_) { + if (!tab_manager_) tab_manager_ = std::make_unique<resource_coordinator::TabManager>(); - tab_lifecycle_unit_source_ = - std::make_unique<resource_coordinator::TabLifecycleUnitSource>(); - tab_lifecycle_unit_source_->AddObserver(tab_manager_.get()); - } return tab_manager_.get(); #else return nullptr;
diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index af5f47f2..7b54688e 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h
@@ -26,7 +26,7 @@ #include "components/keep_alive_registry/keep_alive_state_observer.h" #include "components/nacl/common/buildflags.h" #include "components/prefs/pref_change_registrar.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/features/features.h" #include "printing/features/features.h" @@ -66,10 +66,6 @@ class PolicyService; } // namespace policy -namespace resource_coordinator { -class TabLifecycleUnitSource; -} - // Real implementation of BrowserProcess that creates and returns the services. class BrowserProcessImpl : public BrowserProcess, public KeepAliveStateObserver { @@ -362,8 +358,6 @@ // Any change to this #ifdef must be reflected as well in // chrome/browser/resource_coordinator/tab_manager_browsertest.cc std::unique_ptr<resource_coordinator::TabManager> tab_manager_; - std::unique_ptr<resource_coordinator::TabLifecycleUnitSource> - tab_lifecycle_unit_source_; #endif shell_integration::DefaultWebClientState cached_default_web_client_state_ =
diff --git a/chrome/browser/browsing_data/browsing_data_file_system_helper.cc b/chrome/browser/browsing_data/browsing_data_file_system_helper.cc index cddc3c91c..3e72246 100644 --- a/chrome/browser/browsing_data/browsing_data_file_system_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_file_system_helper.cc
@@ -13,7 +13,7 @@ #include "base/sequenced_task_runner.h" #include "chrome/browser/browsing_data/browsing_data_helper.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "storage/browser/fileapi/file_system_context.h" #include "storage/browser/fileapi/file_system_quota_util.h" #include "storage/common/fileapi/file_system_types.h"
diff --git a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc index 54bef78d..c32f0bf 100644 --- a/chrome/browser/browsing_data/browsing_data_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_helper_unittest.cc
@@ -6,8 +6,8 @@ #include "base/macros.h" #include "chrome/common/url_constants.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" #include "url/url_constants.h"
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h index e63fba4e..0e83b0f0 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h
@@ -24,7 +24,7 @@ #include "components/search_engines/template_url_service.h" #include "content/public/browser/browsing_data_remover.h" #include "content/public/browser/browsing_data_remover_delegate.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/features/features.h"
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc index e86f5a7..6cc132b 100644 --- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc +++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_factory.cc
@@ -21,7 +21,7 @@ #include "chrome/browser/web_data_service_factory.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "content/public/browser/browser_context.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if defined(OS_ANDROID) #include "chrome/browser/offline_pages/offline_page_model_factory.h"
diff --git a/chrome/browser/browsing_data/cookies_tree_model.cc b/chrome/browser/browsing_data/cookies_tree_model.cc index d2c1630..edfc0cc2 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.cc +++ b/chrome/browser/browsing_data/cookies_tree_model.cc
@@ -23,7 +23,7 @@ #include "chrome/grit/theme_resources.h" #include "components/content_settings/core/browser/cookie_settings.h" #include "content/public/common/url_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/cookies/canonical_cookie.h" #include "net/url_request/url_request_context.h"
diff --git a/chrome/browser/browsing_data/cookies_tree_model.h b/chrome/browser/browsing_data/cookies_tree_model.h index 243b05f..707bb9b 100644 --- a/chrome/browser/browsing_data/cookies_tree_model.h +++ b/chrome/browser/browsing_data/cookies_tree_model.h
@@ -30,7 +30,7 @@ #include "chrome/browser/browsing_data/browsing_data_shared_worker_helper.h" #include "chrome/browser/browsing_data/local_data_container.h" #include "components/content_settings/core/common/content_settings.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/ssl/channel_id_store.h" #include "ui/base/models/tree_node_model.h"
diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc index 3a5377e..f3bf5e9 100644 --- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc +++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc
@@ -33,7 +33,7 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_types.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/browsing_data/counters/browsing_data_counter_factory.cc b/chrome/browser/browsing_data/counters/browsing_data_counter_factory.cc index 13d84f7..e05bfdb 100644 --- a/chrome/browser/browsing_data/counters/browsing_data_counter_factory.cc +++ b/chrome/browser/browsing_data/counters/browsing_data_counter_factory.cc
@@ -29,7 +29,7 @@ #include "components/browsing_data/core/pref_names.h" #include "components/history/core/browser/web_history_service.h" #include "components/password_manager/core/browser/password_store.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/browsing_data/counters/hosted_apps_counter.h"
diff --git a/chrome/browser/browsing_data/counters/browsing_data_counter_utils_unittest.cc b/chrome/browser/browsing_data/counters/browsing_data_counter_utils_unittest.cc index 5ee052d..7f87d4e1 100644 --- a/chrome/browser/browsing_data/counters/browsing_data_counter_utils_unittest.cc +++ b/chrome/browser/browsing_data/counters/browsing_data_counter_utils_unittest.cc
@@ -14,7 +14,7 @@ #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/browsing_data/counters/downloads_counter_browsertest.cc b/chrome/browser/browsing_data/counters/downloads_counter_browsertest.cc index 108f6783..a5f4723 100644 --- a/chrome/browser/browsing_data/counters/downloads_counter_browsertest.cc +++ b/chrome/browser/browsing_data/counters/downloads_counter_browsertest.cc
@@ -22,7 +22,7 @@ #include "components/history/core/browser/download_row.h" #include "components/prefs/pref_service.h" #include "content/public/browser/download_manager.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/common/extension.h"
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 0c56758..7d5f59f 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc
@@ -160,6 +160,7 @@ #include "components/variations/service/variations_service.h" #include "components/variations/synthetic_trials_active_group_id_provider.h" #include "components/variations/variations_associated_data.h" +#include "components/variations/variations_crash_keys.h" #include "components/variations/variations_http_header_provider.h" #include "components/variations/variations_switches.h" #include "components/version_info/version_info.h" @@ -175,8 +176,8 @@ #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" #include "content/public/common/service_manager_connection.h" -#include "device/vr/features/features.h" -#include "extensions/features/features.h" +#include "device/vr/buildflags/buildflags.h" +#include "extensions/buildflags/buildflags.h" #include "media/base/localized_strings.h" #include "media/media_features.h" #include "net/base/net_module.h" @@ -908,6 +909,7 @@ cc::switches::kEnableGpuBenchmarking, switches::kEnableFeatures, switches::kDisableFeatures, unforceable_field_trials, variation_ids, std::move(feature_list), &browser_field_trials_); + variations::InitCrashKeys(); // Initialize FieldTrialSynchronizer system. This is a singleton and is used // for posting tasks via base::Bind. Its deleted when it goes out of scope.
diff --git a/chrome/browser/chrome_browser_main_mac.mm b/chrome/browser/chrome_browser_main_mac.mm index 1fbbb77..0aeb2820 100644 --- a/chrome/browser/chrome_browser_main_mac.mm +++ b/chrome/browser/chrome_browser_main_mac.mm
@@ -75,10 +75,6 @@ } int ChromeBrowserMainPartsMac::PreEarlyInitialization() { - const int result = ChromeBrowserMainPartsPosix::PreEarlyInitialization(); - if (result != content::RESULT_CODE_NORMAL_EXIT) - return result; - if (base::mac::WasLaunchedAsLoginItemRestoreState()) { base::CommandLine* singleton_command_line = base::CommandLine::ForCurrentProcess(); @@ -103,11 +99,13 @@ // If ui_task is not NULL, the app is actually a browser_test. if (!parameters().ui_task) { // The browser process only wants to support the language Cocoa will use, - // so force the app locale to be overriden with that value. + // so force the app locale to be overriden with that value. This must + // happen before the ResourceBundle is loaded, which happens in + // ChromeBrowserMainParts::PreEarlyInitialization(). l10n_util::OverrideLocaleWithCocoaLocale(); } - return content::RESULT_CODE_NORMAL_EXIT; + return ChromeBrowserMainPartsPosix::PreEarlyInitialization(); } void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index a4fa0e0..73c416d 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc
@@ -52,6 +52,7 @@ #include "chrome/browser/win/browser_util.h" #include "chrome/browser/win/chrome_elf_init.h" #include "chrome/chrome_watcher/chrome_watcher_main_api.h" +#include "chrome/common/channel_info.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_paths.h" @@ -72,6 +73,7 @@ #include "components/crash/content/app/crash_export_thunks.h" #include "components/crash/content/app/dump_hung_process_with_ptype.h" #include "components/crash/core/common/crash_key.h" +#include "components/version_info/channel.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_switches.h" @@ -493,7 +495,7 @@ static crash_reporter::CrashKeyString<32> update_cohort_name("cohort-name"); update_cohort_name.Set(base::UTF16ToUTF8(details.update_cohort_name())); - if (details.channel().find(L"canary") == 0) { + if (chrome::GetChannel() == version_info::Channel::CANARY) { content::RenderProcessHost::SetHungRendererAnalysisFunction( &DumpHungRendererProcessImpl); }
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index dc9f90b..f1e7159df 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -58,7 +58,6 @@ #include "chrome/browser/nacl_host/nacl_browser_delegate_impl.h" #include "chrome/browser/net_benchmarking.h" #include "chrome/browser/notifications/platform_notification_service_impl.h" -#include "chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.h" #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" #include "chrome/browser/password_manager/chrome_password_manager_client.h" @@ -223,7 +222,7 @@ #include "content/public/common/web_preferences.h" #include "device/usb/public/mojom/chooser_service.mojom.h" #include "device/usb/public/mojom/device_manager.mojom.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "google_apis/gaia/gaia_urls.h" #include "google_apis/google_api_keys.h" #include "gpu/config/gpu_switches.h" @@ -3491,11 +3490,6 @@ throttles.push_back(std::move(supervised_user_nav_throttle)); #endif - std::unique_ptr<content::NavigationThrottle> delay_navigation_throttle = - DelayNavigationThrottle::MaybeCreateThrottleFor(handle); - if (delay_navigation_throttle) - throttles.push_back(std::move(delay_navigation_throttle)); - content::WebContents* web_contents = handle->GetWebContents(); if (auto* subresource_filter_client = ChromeSubresourceFilterClient::FromWebContents(web_contents)) {
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index b07fc3c..fa4c647c 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -21,7 +21,7 @@ #include "chrome/browser/chrome_service.h" #include "content/public/browser/content_browser_client.h" #include "content/public/common/resource_type.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/features/features.h" #include "services/network/public/mojom/network_service.mojom.h"
diff --git a/chrome/browser/chrome_notification_types.h b/chrome/browser/chrome_notification_types.h index baaa3be..b47d21cb 100644 --- a/chrome/browser/chrome_notification_types.h +++ b/chrome/browser/chrome_notification_types.h
@@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_ #include "build/build_config.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/notification_types.h"
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index c49df1d..5d9a50c 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -5,7 +5,7 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//chromeos/assistant/assistant.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//printing/features/features.gni") import("//services/service_manager/public/service_manifest.gni") @@ -985,6 +985,10 @@ "login/screens/controller_pairing_screen_view.cc", "login/screens/controller_pairing_screen_view.h", "login/screens/core_oobe_view.h", + "login/screens/demo_setup_screen.cc", + "login/screens/demo_setup_screen.h", + "login/screens/demo_setup_screen_view.cc", + "login/screens/demo_setup_screen_view.h", "login/screens/device_disabled_screen.cc", "login/screens/device_disabled_screen.h", "login/screens/device_disabled_screen_view.h",
diff --git a/chrome/browser/chromeos/accessibility/accessibility_manager.cc b/chrome/browser/chromeos/accessibility/accessibility_manager.cc index ce83160..f896cc62 100644 --- a/chrome/browser/chromeos/accessibility/accessibility_manager.cc +++ b/chrome/browser/chromeos/accessibility/accessibility_manager.cc
@@ -11,13 +11,13 @@ #include <utility> #include <vector> +#include "ash/accessibility/accessibility_controller.h" #include "ash/accessibility/accessibility_focus_ring_controller.h" #include "ash/public/cpp/ash_pref_names.h" #include "ash/public/interfaces/constants.mojom.h" #include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/sticky_keys/sticky_keys_controller.h" -#include "ash/system/tray/system_tray_notifier.h" #include "base/callback.h" #include "base/callback_helpers.h" #include "base/command_line.h" @@ -372,8 +372,9 @@ return; // Update system tray menu visibility. - ash::Shell::Get()->system_tray_notifier()->NotifyAccessibilityStatusChanged( - ash::A11Y_NOTIFICATION_NONE); + ash::Shell::Get() + ->accessibility_controller() + ->NotifyAccessibilityStatusChanged(ash::A11Y_NOTIFICATION_NONE); } void AccessibilityManager::EnableLargeCursor(bool enabled) { @@ -1089,8 +1090,9 @@ // own updates to avoid race conditions (pref updates are asynchronous between // chrome and ash). if (details.notification_type == ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER) { - ash::Shell::Get()->system_tray_notifier()->NotifyAccessibilityStatusChanged( - details.notify); + ash::Shell::Get() + ->accessibility_controller() + ->NotifyAccessibilityStatusChanged(details.notify); } }
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc index 4a90e9d6..7332100 100644 --- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc +++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.cc
@@ -318,9 +318,8 @@ ->GetHost() ->GetRootTransform(); float scale_factor = ash::GetScaleFactorForTransform(transform); - web_contents->RequestAXTreeSnapshot(base::Bind( - &RequestVoiceInteractionStructureCallback, - base::Passed(std::move(callback)), + web_contents->RequestAXTreeSnapshot(base::BindOnce( + &RequestVoiceInteractionStructureCallback, std::move(callback), gfx::ConvertRectToPixel(scale_factor, browser->window()->GetBounds()), web_contents->GetLastCommittedURL().spec(), web_contents->GetTitle())); }
diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service_browsertest.cc b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service_browsertest.cc index d1744e7..d86144c 100644 --- a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service_browsertest.cc +++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service_browsertest.cc
@@ -58,7 +58,7 @@ ui_test_utils::NavigateToURL(browser(), url); auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents(); AXTreeSnapshotWaiter waiter; - web_contents->RequestAXTreeSnapshot(base::Bind( + web_contents->RequestAXTreeSnapshot(base::BindOnce( &AXTreeSnapshotWaiter::ReceiveSnapshot, base::Unretained(&waiter))); waiter.Wait(); auto node = ui::AXSnapshotNodeAndroid::Create(waiter.snapshot(), false);
diff --git a/chrome/browser/chromeos/login/app_launch_signin_screen.cc b/chrome/browser/chromeos/login/app_launch_signin_screen.cc index d3014fe4..3a88f9f 100644 --- a/chrome/browser/chromeos/login/app_launch_signin_screen.cc +++ b/chrome/browser/chromeos/login/app_launch_signin_screen.cc
@@ -108,6 +108,10 @@ NOTREACHED(); } +void AppLaunchSigninScreen::ShowDemoModeSetupScreen() { + NOTREACHED(); +} + void AppLaunchSigninScreen::ShowKioskEnableScreen() { NOTREACHED(); }
diff --git a/chrome/browser/chromeos/login/app_launch_signin_screen.h b/chrome/browser/chromeos/login/app_launch_signin_screen.h index 959a4a0..aacdb9f8 100644 --- a/chrome/browser/chromeos/login/app_launch_signin_screen.h +++ b/chrome/browser/chromeos/login/app_launch_signin_screen.h
@@ -64,6 +64,7 @@ void ResyncUserData() override; void ShowEnterpriseEnrollmentScreen() override; void ShowEnableDebuggingScreen() override; + void ShowDemoModeSetupScreen() override; void ShowKioskEnableScreen() override; void ShowKioskAutolaunchScreen() override; void ShowUpdateRequiredScreen() override;
diff --git a/chrome/browser/chromeos/login/demo_setup_browsertest.cc b/chrome/browser/chromeos/login/demo_setup_browsertest.cc new file mode 100644 index 0000000..6904053 --- /dev/null +++ b/chrome/browser/chromeos/login/demo_setup_browsertest.cc
@@ -0,0 +1,60 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/command_line.h" +#include "chrome/browser/chromeos/login/login_manager_test.h" +#include "chrome/browser/chromeos/login/screens/demo_setup_screen.h" +#include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" +#include "chrome/browser/chromeos/login/ui/login_display_host.h" +#include "chrome/browser/chromeos/login/wizard_controller.h" +#include "chromeos/chromeos_switches.h" +#include "content/public/test/browser_test_utils.h" + +namespace chromeos { + +// Basic tests for demo mode setup flow. +class DemoSetupTest : public LoginManagerTest { + public: + DemoSetupTest() : LoginManagerTest(false) {} + ~DemoSetupTest() override = default; + + // LoginTestManager: + void SetUpCommandLine(base::CommandLine* command_line) override { + LoginManagerTest::SetUpCommandLine(command_line); + command_line->AppendSwitch(chromeos::switches::kEnableDemoMode); + } + + void ShowDemoSetupScreen() { + LoginDisplayHost::default_host()->StartWizard( + OobeScreen::SCREEN_OOBE_DEMO_SETUP); + OobeScreenWaiter(OobeScreen::SCREEN_OOBE_DEMO_SETUP).Wait(); + ASSERT_NE(nullptr, GetDemoSetupScreen()); + } + + DemoSetupScreen* GetDemoSetupScreen() { + return static_cast<DemoSetupScreen*>( + WizardController::default_controller()->screen_manager()->GetScreen( + OobeScreen::SCREEN_OOBE_ENROLLMENT)); + } + + bool IsDemoSetupShown() { + return js_checker().GetBool( + "!document.querySelector('#demo-setup').hidden"); + } + + private: + bool JSExecute(const std::string& script) { + return content::ExecuteScript(web_contents(), script); + } + + DISALLOW_COPY_AND_ASSIGN(DemoSetupTest); +}; + +IN_PROC_BROWSER_TEST_F(DemoSetupTest, ShowDemoSetupScreen) { + EXPECT_FALSE(IsDemoSetupShown()); + ASSERT_NO_FATAL_FAILURE(ShowDemoSetupScreen()); + EXPECT_TRUE(IsDemoSetupShown()); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 4272471..6be8ab96 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -192,6 +192,11 @@ !session_manager::SessionManager::Get()->IsSessionStarted(); } +bool DemoModeEnabled() { + return base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kEnableDemoMode); +} + void RecordPasswordChangeFlow(LoginPasswordChangeFlow flow) { UMA_HISTOGRAM_ENUMERATION("Login.PasswordChangeFlow", flow, LOGIN_PASSWORD_CHANGE_FLOW_COUNT); @@ -688,6 +693,11 @@ ShowEnableDebuggingScreen(); } +void ExistingUserController::OnStartDemoModeSetupScreen() { + if (DemoModeEnabled()) + ShowDemoModeSetupScreen(); +} + void ExistingUserController::OnStartKioskEnableScreen() { KioskAppManager::Get()->GetConsumerKioskAutoLaunchStatus(base::Bind( &ExistingUserController::OnConsumerKioskAutoLaunchCheckCompleted, @@ -773,6 +783,10 @@ host_->StartWizard(OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING); } +void ExistingUserController::ShowDemoModeSetupScreen() { + host_->StartWizard(OobeScreen::SCREEN_OOBE_DEMO_SETUP); +} + void ExistingUserController::ShowKioskEnableScreen() { host_->StartWizard(OobeScreen::SCREEN_KIOSK_ENABLE); }
diff --git a/chrome/browser/chromeos/login/existing_user_controller.h b/chrome/browser/chromeos/login/existing_user_controller.h index 1b636e3..0f80374 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.h +++ b/chrome/browser/chromeos/login/existing_user_controller.h
@@ -99,6 +99,7 @@ void OnSigninScreenReady() override; void OnStartEnterpriseEnrollment() override; void OnStartEnableDebuggingScreen() override; + void OnStartDemoModeSetupScreen() override; void OnStartKioskEnableScreen() override; void OnStartKioskAutolaunchScreen() override; void ResetAutoLoginTimer() override; @@ -208,6 +209,9 @@ // Shows "enable developer features" screen. void ShowEnableDebuggingScreen(); + // Shows demo mode setup screen. + void ShowDemoModeSetupScreen(); + // Shows kiosk feature enable screen. void ShowKioskEnableScreen();
diff --git a/chrome/browser/chromeos/login/lock/webui_screen_locker.cc b/chrome/browser/chromeos/login/lock/webui_screen_locker.cc index ffa4a9f..bc82b45c 100644 --- a/chrome/browser/chromeos/login/lock/webui_screen_locker.cc +++ b/chrome/browser/chromeos/login/lock/webui_screen_locker.cc
@@ -323,6 +323,10 @@ NOTREACHED(); } +void WebUIScreenLocker::OnStartDemoModeSetupScreen() { + NOTREACHED(); +} + void WebUIScreenLocker::OnStartKioskEnableScreen() { NOTREACHED(); }
diff --git a/chrome/browser/chromeos/login/lock/webui_screen_locker.h b/chrome/browser/chromeos/login/lock/webui_screen_locker.h index 065dcc56..b92b62c 100644 --- a/chrome/browser/chromeos/login/lock/webui_screen_locker.h +++ b/chrome/browser/chromeos/login/lock/webui_screen_locker.h
@@ -94,6 +94,7 @@ void OnSigninScreenReady() override; void OnStartEnterpriseEnrollment() override; void OnStartEnableDebuggingScreen() override; + void OnStartDemoModeSetupScreen() override; void OnStartKioskEnableScreen() override; void OnStartKioskAutolaunchScreen() override; void ShowWrongHWIDScreen() override;
diff --git a/chrome/browser/chromeos/login/oobe_screen.cc b/chrome/browser/chromeos/login/oobe_screen.cc index c03bc82..f11e4b6 100644 --- a/chrome/browser/chromeos/login/oobe_screen.cc +++ b/chrome/browser/chromeos/login/oobe_screen.cc
@@ -55,6 +55,7 @@ "oobe", // SCREEN_SPECIAL_OOBE "test:nowindow", // SCREEN_TEST_NO_WINDOW "sync-consent", // SCREEN_SYNC_CONSENT + "demo-setup", // SCREEN_OOBE_DEMO_SETUP "unknown", // SCREEN_UNKNOWN };
diff --git a/chrome/browser/chromeos/login/oobe_screen.h b/chrome/browser/chromeos/login/oobe_screen.h index 76ab949..0a3f1ee4 100644 --- a/chrome/browser/chromeos/login/oobe_screen.h +++ b/chrome/browser/chromeos/login/oobe_screen.h
@@ -58,6 +58,7 @@ SCREEN_TEST_NO_WINDOW, SCREEN_SYNC_CONSENT, + SCREEN_OOBE_DEMO_SETUP, SCREEN_UNKNOWN // This must always be the last element. };
diff --git a/chrome/browser/chromeos/login/screens/demo_setup_screen.cc b/chrome/browser/chromeos/login/screens/demo_setup_screen.cc new file mode 100644 index 0000000..be0b238 --- /dev/null +++ b/chrome/browser/chromeos/login/screens/demo_setup_screen.cc
@@ -0,0 +1,60 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/login/screens/demo_setup_screen.h" + +#include "chrome/browser/chromeos/login/screen_manager.h" +#include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" + +namespace { + +constexpr const char kUserActionOnlineSetup[] = "online-setup"; +constexpr const char kUserActionOfflineSetup[] = "offline-setup"; +constexpr const char kUserActionClose[] = "close-setup"; + +} // namespace + +namespace chromeos { + +DemoSetupScreen::DemoSetupScreen(BaseScreenDelegate* base_screen_delegate, + DemoSetupScreenView* view) + : BaseScreen(base_screen_delegate, OobeScreen::SCREEN_OOBE_DEMO_SETUP), + view_(view) { + DCHECK(view_); + view_->Bind(this); +} + +DemoSetupScreen::~DemoSetupScreen() { + if (view_) + view_->Bind(nullptr); +} + +void DemoSetupScreen::Show() { + if (view_) + view_->Show(); +} + +void DemoSetupScreen::Hide() { + if (view_) + view_->Hide(); +} + +void DemoSetupScreen::OnUserAction(const std::string& action_id) { + if (action_id == kUserActionOnlineSetup) { + NOTIMPLEMENTED(); + } else if (action_id == kUserActionOfflineSetup) { + NOTIMPLEMENTED(); + } else if (action_id == kUserActionClose) { + Finish(ScreenExitCode::DEMO_MODE_SETUP_CLOSED); + } else { + BaseScreen::OnUserAction(action_id); + } +} + +void DemoSetupScreen::OnViewDestroyed(DemoSetupScreenView* view) { + if (view_ == view) + view_ = nullptr; +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/login/screens/demo_setup_screen.h b/chrome/browser/chromeos/login/screens/demo_setup_screen.h new file mode 100644 index 0000000..ba69bbf --- /dev/null +++ b/chrome/browser/chromeos/login/screens/demo_setup_screen.h
@@ -0,0 +1,40 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_DEMO_SETUP_SCREEN_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_DEMO_SETUP_SCREEN_H_ + +#include "chrome/browser/chromeos/login/screens/base_screen.h" +#include "chrome/browser/chromeos/login/screens/demo_setup_screen_view.h" + +namespace chromeos { + +class BaseScreenDelegate; + +// Controlls demo mode setup. The screen can be shown during OOBE. It allows +// user to setup retail demo mode on the device. +class DemoSetupScreen : public BaseScreen { + public: + DemoSetupScreen(BaseScreenDelegate* base_screen_delegate, + DemoSetupScreenView* view); + ~DemoSetupScreen() override; + + // BaseScreen: + void Show() override; + void Hide() override; + void OnUserAction(const std::string& action_id) override; + + // Called when view is being destroyed. If Screen is destroyed earlier + // then it has to call Bind(nullptr). + void OnViewDestroyed(DemoSetupScreenView* view); + + private: + DemoSetupScreenView* view_; + + DISALLOW_COPY_AND_ASSIGN(DemoSetupScreen); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_DEMO_SETUP_SCREEN_H_
diff --git a/chrome/browser/chromeos/login/screens/demo_setup_screen_view.cc b/chrome/browser/chromeos/login/screens/demo_setup_screen_view.cc new file mode 100644 index 0000000..4745e076 --- /dev/null +++ b/chrome/browser/chromeos/login/screens/demo_setup_screen_view.cc
@@ -0,0 +1,11 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/login/screens/demo_setup_screen_view.h" + +namespace chromeos { + +DemoSetupScreenView::~DemoSetupScreenView() = default; + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/login/screens/demo_setup_screen_view.h b/chrome/browser/chromeos/login/screens/demo_setup_screen_view.h new file mode 100644 index 0000000..86850bf --- /dev/null +++ b/chrome/browser/chromeos/login/screens/demo_setup_screen_view.h
@@ -0,0 +1,33 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_DEMO_SETUP_SCREEN_VIEW_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_DEMO_SETUP_SCREEN_VIEW_H_ + +#include "chrome/browser/chromeos/login/oobe_screen.h" + +namespace chromeos { + +class DemoSetupScreen; + +// Interface of the demo mode setup screen view. +class DemoSetupScreenView { + public: + constexpr static OobeScreen kScreenId = OobeScreen::SCREEN_OOBE_DEMO_SETUP; + + virtual ~DemoSetupScreenView(); + + // Shows the contents of the screen. + virtual void Show() = 0; + + // Hides the contents of the screen. + virtual void Hide() = 0; + + // Sets view and screen. + virtual void Bind(DemoSetupScreen* screen) = 0; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_DEMO_SETUP_SCREEN_VIEW_H_
diff --git a/chrome/browser/chromeos/login/screens/mock_demo_setup_screen.cc b/chrome/browser/chromeos/login/screens/mock_demo_setup_screen.cc new file mode 100644 index 0000000..e98e962 --- /dev/null +++ b/chrome/browser/chromeos/login/screens/mock_demo_setup_screen.cc
@@ -0,0 +1,33 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/chromeos/login/screens/mock_demo_setup_screen.h" + +using ::testing::AtLeast; +using ::testing::NotNull; + +namespace chromeos { + +MockDemoSetupScreen::MockDemoSetupScreen( + BaseScreenDelegate* base_screen_delegate, + DemoSetupScreenView* view) + : DemoSetupScreen(base_screen_delegate, view) {} + +MockDemoSetupScreen::~MockDemoSetupScreen() = default; + +MockDemoSetupScreenView::MockDemoSetupScreenView() { + EXPECT_CALL(*this, MockBind(NotNull())).Times(AtLeast(1)); +} + +MockDemoSetupScreenView::~MockDemoSetupScreenView() { + if (screen_) + screen_->OnViewDestroyed(this); +} + +void MockDemoSetupScreenView::Bind(DemoSetupScreen* screen) { + screen_ = screen; + MockBind(screen); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/login/screens/mock_demo_setup_screen.h b/chrome/browser/chromeos/login/screens/mock_demo_setup_screen.h new file mode 100644 index 0000000..d914ace --- /dev/null +++ b/chrome/browser/chromeos/login/screens/mock_demo_setup_screen.h
@@ -0,0 +1,38 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_DEMO_SETUP_SCREEN_H_ +#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_DEMO_SETUP_SCREEN_H_ + +#include "chrome/browser/chromeos/login/screens/demo_setup_screen.h" +#include "chrome/browser/chromeos/login/screens/demo_setup_screen_view.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace chromeos { + +class MockDemoSetupScreen : public DemoSetupScreen { + public: + MockDemoSetupScreen(BaseScreenDelegate* base_screen_delegate, + DemoSetupScreenView* view); + ~MockDemoSetupScreen() override; +}; + +class MockDemoSetupScreenView : public DemoSetupScreenView { + public: + MockDemoSetupScreenView(); + ~MockDemoSetupScreenView() override; + + MOCK_METHOD0(Show, void()); + MOCK_METHOD0(Hide, void()); + MOCK_METHOD1(MockBind, void(DemoSetupScreen* screen)); + + void Bind(DemoSetupScreen* screen) override; + + private: + DemoSetupScreen* screen_; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_MOCK_DEMO_SETUP_SCREEN_H_
diff --git a/chrome/browser/chromeos/login/screens/screen_exit_code.cc b/chrome/browser/chromeos/login/screens/screen_exit_code.cc index e7d637b..df933270 100644 --- a/chrome/browser/chromeos/login/screens/screen_exit_code.cc +++ b/chrome/browser/chromeos/login/screens/screen_exit_code.cc
@@ -72,6 +72,8 @@ return "WAIT_FOR_CONTAINER_READY_ERROR"; case ScreenExitCode::SYNC_CONSENT_FINISHED: return "SYNC_CONSENT_FINISHED"; + case ScreenExitCode::DEMO_MODE_SETUP_CLOSED: + return "DEMO_MODE_SETUP_CLOSED"; case ScreenExitCode::EXIT_CODES_COUNT: default: NOTREACHED();
diff --git a/chrome/browser/chromeos/login/screens/screen_exit_code.h b/chrome/browser/chromeos/login/screens/screen_exit_code.h index c217633d..049a71e 100644 --- a/chrome/browser/chromeos/login/screens/screen_exit_code.h +++ b/chrome/browser/chromeos/login/screens/screen_exit_code.h
@@ -57,6 +57,7 @@ WAIT_FOR_CONTAINER_READY_FINISHED = 30, WAIT_FOR_CONTAINER_READY_ERROR = 31, SYNC_CONSENT_FINISHED = 32, + DEMO_MODE_SETUP_CLOSED = 33, EXIT_CODES_COUNT // not a real code, must be the last };
diff --git a/chrome/browser/chromeos/login/session/chrome_session_manager.cc b/chrome/browser/chromeos/login/session/chrome_session_manager.cc index 5527618..21db990c 100644 --- a/chrome/browser/chromeos/login/session/chrome_session_manager.cc +++ b/chrome/browser/chromeos/login/session/chrome_session_manager.cc
@@ -40,6 +40,7 @@ #include "components/signin/core/account_id/account_id.h" #include "components/user_manager/user_manager.h" #include "components/user_manager/user_names.h" +#include "components/user_manager/user_type.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/notification_service.h" #include "content/public/common/content_switches.h" @@ -119,9 +120,13 @@ if (lock_screen_apps::StateController::IsEnabled()) lock_screen_apps::StateController::Get()->SetPrimaryProfile(user_profile); - // The |AppInstallEventLogManagerWrapper| manages its own lifetime and - // self-destructs on logout. - policy::AppInstallEventLogManagerWrapper::CreateForProfile(user_profile); + if (user->GetType() == user_manager::USER_TYPE_REGULAR) { + // App install logs are uploaded via the user's communication channel with + // the management server. This channel exists for regular users only. + // The |AppInstallEventLogManagerWrapper| manages its own lifetime and + // self-destructs on logout. + policy::AppInstallEventLogManagerWrapper::CreateForProfile(user_profile); + } arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(user_profile); #if BUILDFLAG(ENABLE_CROS_ASSISTANT)
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index 0ac7603..dabc18e 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -1358,9 +1358,13 @@ if (lock_screen_apps::StateController::IsEnabled()) lock_screen_apps::StateController::Get()->SetPrimaryProfile(profile); - // The |AppInstallEventLogManagerWrapper| manages its own lifetime and - // self-destructs on logout. - policy::AppInstallEventLogManagerWrapper::CreateForProfile(profile); + if (user->GetType() == user_manager::USER_TYPE_REGULAR) { + // App install logs are uploaded via the user's communication channel with + // the management server. This channel exists for regular users only. + // The |AppInstallEventLogManagerWrapper| manages its own lifetime and + // self-destructs on logout. + policy::AppInstallEventLogManagerWrapper::CreateForProfile(profile); + } arc::ArcServiceLauncher::Get()->OnPrimaryUserProfilePrepared(profile); #if BUILDFLAG(ENABLE_CROS_ASSISTANT)
diff --git a/chrome/browser/chromeos/login/ui/login_display.h b/chrome/browser/chromeos/login/ui/login_display.h index f6370a0..376b24d 100644 --- a/chrome/browser/chromeos/login/ui/login_display.h +++ b/chrome/browser/chromeos/login/ui/login_display.h
@@ -68,6 +68,9 @@ // Called when the user requests enable developer features screen. virtual void OnStartEnableDebuggingScreen() = 0; + // Called when the user requests demo mode setup screen. + virtual void OnStartDemoModeSetupScreen() = 0; + // Called when the user requests kiosk enable screen. virtual void OnStartKioskEnableScreen() = 0;
diff --git a/chrome/browser/chromeos/login/ui/login_display_webui.cc b/chrome/browser/chromeos/login/ui/login_display_webui.cc index 6c06492..9a52633 100644 --- a/chrome/browser/chromeos/login/ui/login_display_webui.cc +++ b/chrome/browser/chromeos/login/ui/login_display_webui.cc
@@ -241,6 +241,11 @@ delegate_->OnStartEnableDebuggingScreen(); } +void LoginDisplayWebUI::ShowDemoModeSetupScreen() { + if (delegate_) + delegate_->OnStartDemoModeSetupScreen(); +} + void LoginDisplayWebUI::ShowKioskEnableScreen() { if (delegate_) delegate_->OnStartKioskEnableScreen();
diff --git a/chrome/browser/chromeos/login/ui/login_display_webui.h b/chrome/browser/chromeos/login/ui/login_display_webui.h index db0a2ce..3e6bb17 100644 --- a/chrome/browser/chromeos/login/ui/login_display_webui.h +++ b/chrome/browser/chromeos/login/ui/login_display_webui.h
@@ -67,6 +67,7 @@ void CancelUserAdding() override; void ShowEnterpriseEnrollmentScreen() override; void ShowEnableDebuggingScreen() override; + void ShowDemoModeSetupScreen() override; void ShowKioskEnableScreen() override; void ShowKioskAutolaunchScreen() override; void ShowUpdateRequiredScreen() override;
diff --git a/chrome/browser/chromeos/login/ui/login_feedback.cc b/chrome/browser/chromeos/login/ui/login_feedback.cc index edccb57..335bf9c 100644 --- a/chrome/browser/chromeos/login/ui/login_feedback.cc +++ b/chrome/browser/chromeos/login/ui/login_feedback.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/chromeos/login/ui/login_feedback.h" +#include <utility> #include <vector> #include "base/bind.h" @@ -22,9 +23,9 @@ #include "extensions/browser/app_window/app_window.h" #include "extensions/browser/app_window/app_window_registry.h" #include "extensions/browser/extension_host.h" +#include "extensions/browser/extension_registry.h" +#include "extensions/browser/extension_registry_observer.h" #include "extensions/browser/extension_system.h" -#include "extensions/browser/process_manager.h" -#include "extensions/browser/process_manager_observer.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "ui/aura/window.h" @@ -43,83 +44,58 @@ return extension_service->component_loader(); } -extensions::ProcessManager* GetProcessManager( - content::BrowserContext* context) { - return extensions::ProcessManager::Get(context); -} +} // namespace // Ensures that the feedback extension is loaded on the signin profile and // invokes the callback when the extension is ready to use. Unload the // extension and delete itself when the extension's background page shuts down. -class FeedbackExtensionLoader : public extensions::ProcessManagerObserver, - public content::WebContentsObserver { +class FeedbackExtensionLoader : public extensions::ExtensionRegistryObserver { public: - // Loads the feedback extension on the given profile and invokes - // |on_ready_callback| when it is ready. - static void Load(Profile* profile, const base::Closure& on_ready_callback); - - private: explicit FeedbackExtensionLoader(Profile* profile); ~FeedbackExtensionLoader() override; - void Initialize(); + // Loads the feedback extension on the given profile and invokes + // |on_ready_callback| when it is ready. + void Load(base::OnceClosure on_ready_callback); - void AddOnReadyCallback(const base::Closure& on_ready_callback); - void RunOnReadyCallbacks(); + private: + // extensions::ExtensionRegistryObserver overrides: + void OnExtensionLoaded(content::BrowserContext* browser_context, + const extensions::Extension* extension) override; - // extensions::ProcessManagerObserver - void OnBackgroundHostCreated(extensions::ExtensionHost* host) override; - void OnBackgroundHostClose(const std::string& extension_id) override; - - // content::WebContentsObserver - void DocumentOnLoadCompletedInMainFrame() override; + void RunOnReadyCallback(); Profile* const profile_; - std::vector<base::Closure> on_ready_callbacks_; - bool ready_ = false; + + // Extension registry for the login profile lives till the login profile is + // destructed. This will always happen after the signin screen web UI has + // been destructed (which destructs us in the process). Hence this pointer + // will outlive us. + extensions::ExtensionRegistry* extension_registry_; + + base::OnceClosure on_ready_callback_; DISALLOW_COPY_AND_ASSIGN(FeedbackExtensionLoader); }; -// Current live instance of FeedbackExtensionLoader. -FeedbackExtensionLoader* instance = nullptr; - -// static -void FeedbackExtensionLoader::Load(Profile* profile, - const base::Closure& on_ready_callback) { - if (instance == nullptr) { - instance = new FeedbackExtensionLoader(profile); - instance->Initialize(); - } - - DCHECK_EQ(instance->profile_, profile); - DCHECK(!on_ready_callback.is_null()); - instance->AddOnReadyCallback(on_ready_callback); -} - FeedbackExtensionLoader::FeedbackExtensionLoader(Profile* profile) - : profile_(profile) {} + : profile_(profile), + extension_registry_(extensions::ExtensionRegistry::Get(profile)) {} FeedbackExtensionLoader::~FeedbackExtensionLoader() { - DCHECK_EQ(instance, this); - instance = nullptr; - - GetProcessManager(profile_)->RemoveObserver(this); + extension_registry_->RemoveObserver(this); GetComponentLoader(profile_)->Remove(extension_misc::kFeedbackExtensionId); } -void FeedbackExtensionLoader::Initialize() { - extensions::ProcessManager* pm = GetProcessManager(profile_); - pm->AddObserver(this); - extensions::ExtensionHost* const host = - pm->GetBackgroundHostForExtension(extension_misc::kFeedbackExtensionId); - if (host) { - OnBackgroundHostCreated(host); - if (!host->host_contents()->IsLoading()) - DocumentOnLoadCompletedInMainFrame(); +void FeedbackExtensionLoader::Load(base::OnceClosure on_ready_callback) { + DCHECK(!on_ready_callback.is_null()); + on_ready_callback_ = std::move(on_ready_callback); + if (extension_registry_->enabled_extensions().Contains( + extension_misc::kFeedbackExtensionId)) { + RunOnReadyCallback(); return; } - + extension_registry_->AddObserver(this); extensions::ComponentLoader* component_loader = GetComponentLoader(profile_); if (!component_loader->Exists(extension_misc::kFeedbackExtensionId)) { component_loader->Add(IDR_FEEDBACK_MANIFEST, @@ -127,40 +103,20 @@ } } -void FeedbackExtensionLoader::AddOnReadyCallback( - const base::Closure& on_ready_callback) { - on_ready_callbacks_.push_back(on_ready_callback); - if (ready_) - RunOnReadyCallbacks(); +void FeedbackExtensionLoader::RunOnReadyCallback() { + DCHECK(!on_ready_callback_.is_null()); + std::move(on_ready_callback_).Run(); + extension_registry_->RemoveObserver(this); } -void FeedbackExtensionLoader::RunOnReadyCallbacks() { - std::vector<base::Closure> callbacks; - callbacks.swap(on_ready_callbacks_); - - for (const auto& callback : callbacks) - callback.Run(); +void FeedbackExtensionLoader::OnExtensionLoaded( + content::BrowserContext* browser_context, + const extensions::Extension* extension) { + if (extension->id() == extension_misc::kFeedbackExtensionId) { + RunOnReadyCallback(); + } } -void FeedbackExtensionLoader::OnBackgroundHostCreated( - extensions::ExtensionHost* host) { - if (host->extension_id() == extension_misc::kFeedbackExtensionId) - Observe(host->host_contents()); -} - -void FeedbackExtensionLoader::OnBackgroundHostClose( - const std::string& extension_id) { - if (extension_id == extension_misc::kFeedbackExtensionId) - delete this; -} - -void FeedbackExtensionLoader::DocumentOnLoadCompletedInMainFrame() { - ready_ = true; - RunOnReadyCallbacks(); -} - -} // namespace - //////////////////////////////////////////////////////////////////////////////// // LoginFeedback::FeedbackWindowHandler @@ -232,9 +188,9 @@ LoginFeedback::~LoginFeedback() {} void LoginFeedback::Request(const std::string& description, - const base::Closure& finished_callback) { + base::OnceClosure finished_callback) { description_ = description; - finished_callback_ = finished_callback; + finished_callback_ = std::move(finished_callback); feedback_window_handler_.reset(new FeedbackWindowHandler(this)); // Do not call EnsureFeedbackUI() immediately. Otherwise, event listener is @@ -242,9 +198,10 @@ // EventRouter::DispatchEventWithLazyListener() which possibly causes a race // condition. - FeedbackExtensionLoader::Load( - profile_, - base::Bind(&LoginFeedback::EnsureFeedbackUI, weak_factory_.GetWeakPtr())); + feedback_extension_loader_ = + std::make_unique<FeedbackExtensionLoader>(profile_); + feedback_extension_loader_->Load(base::BindOnce( + &LoginFeedback::EnsureFeedbackUI, weak_factory_.GetWeakPtr())); } void LoginFeedback::EnsureFeedbackUI() { @@ -268,7 +225,7 @@ void LoginFeedback::OnFeedbackFinished() { if (!finished_callback_.is_null()) - finished_callback_.Run(); + std::move(finished_callback_).Run(); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/ui/login_feedback.h b/chrome/browser/chromeos/login/ui/login_feedback.h index 607c1a1..a534e1a 100644 --- a/chrome/browser/chromeos/login/ui/login_feedback.h +++ b/chrome/browser/chromeos/login/ui/login_feedback.h
@@ -16,6 +16,8 @@ namespace chromeos { +class FeedbackExtensionLoader; + // Show the feedback UI to collect a feedback on the login screen. Note that // it dynamically loads/unloads the feedback extension on the signin profile. class LoginFeedback { @@ -27,7 +29,7 @@ // will be invoked when the feedback UI is closed, either cancel or send the // feedback. void Request(const std::string& description, - const base::Closure& finished_callback); + base::OnceClosure finished_callback); private: // Makes the feedback UI windows on top of login screen and watches when @@ -42,10 +44,12 @@ Profile* const profile_; std::string description_; - base::Closure finished_callback_; + base::OnceClosure finished_callback_; std::unique_ptr<FeedbackWindowHandler> feedback_window_handler_; + std::unique_ptr<FeedbackExtensionLoader> feedback_extension_loader_; + base::WeakPtrFactory<LoginFeedback> weak_factory_; DISALLOW_COPY_AND_ASSIGN(LoginFeedback);
diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.cc b/chrome/browser/chromeos/login/ui/webui_login_view.cc index 4399491..c0570b66 100644 --- a/chrome/browser/chromeos/login/ui/webui_login_view.cc +++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
@@ -90,6 +90,7 @@ const char kAccelNameAppLaunchNetworkConfig[] = "app_launch_network_config"; const char kAccelNameBootstrappingSlave[] = "bootstrapping_slave"; const char kAccelNameDemoMode[] = "demo_mode"; +const char kAccelSendFeedback[] = "send_feedback"; // A class to change arrow key traversal behavior when it's alive. class ScopedArrowKeyTraversal { @@ -179,6 +180,9 @@ accel_map_[ui::Accelerator( ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = kAccelNameDemoMode; + accel_map_[ui::Accelerator(ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN)] = + kAccelSendFeedback; + for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) { if (!ash_util::IsRunningInMash()) { // To make reset accelerator work while system tray is open, register it
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 3dbaa06..6a5e6cb 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -38,6 +38,7 @@ #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/hwid_checker.h" #include "chrome/browser/chromeos/login/screens/arc_terms_of_service_screen.h" +#include "chrome/browser/chromeos/login/screens/demo_setup_screen.h" #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h" #include "chrome/browser/chromeos/login/screens/enable_debugging_screen.h" #include "chrome/browser/chromeos/login/screens/encryption_migration_screen.h" @@ -393,6 +394,9 @@ return new EnrollmentScreen(this, oobe_ui_->GetEnrollmentScreenView()); } else if (screen == OobeScreen::SCREEN_OOBE_RESET) { return new chromeos::ResetScreen(this, oobe_ui_->GetResetView()); + } else if (screen == OobeScreen::SCREEN_OOBE_DEMO_SETUP) { + return new chromeos::DemoSetupScreen(this, + oobe_ui_->GetDemoSetupScreenView()); } else if (screen == OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING) { return new EnableDebuggingScreen(this, oobe_ui_->GetEnableDebuggingScreenView()); @@ -533,6 +537,12 @@ StartEnrollmentScreen(false); } +void WizardController::ShowDemoModeSetupScreen() { + VLOG(1) << "Showing demo mode setup screen."; + UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_DEMO_SETUP); + SetCurrentScreen(GetScreen(OobeScreen::SCREEN_OOBE_DEMO_SETUP)); +} + void WizardController::ShowResetScreen() { VLOG(1) << "Showing reset screen."; UpdateStatusAreaVisibilityForScreen(OobeScreen::SCREEN_OOBE_RESET); @@ -941,6 +951,10 @@ weak_factory_.GetWeakPtr())); } +void WizardController::OnDemoSetupClosed() { + ShowLoginScreen(LoginScreenContext()); +} + void WizardController::OnOobeFlowFinished() { if (is_in_session_oobe_) { host_->SetStatusAreaVisible(true); @@ -1085,7 +1099,7 @@ void WizardController::SetCurrentScreenSmooth(BaseScreen* new_current, bool use_smoothing) { - VLOG(1) << "SetCurrentScreenrSmooth: " + VLOG(1) << "SetCurrentScreenSmooth: " << GetOobeScreenName(new_current->screen_id()); if (current_screen_ == new_current || new_current == nullptr || oobe_ui_ == nullptr) { @@ -1171,6 +1185,8 @@ ShowEnableDebuggingScreen(); } else if (screen == OobeScreen::SCREEN_OOBE_ENROLLMENT) { ShowEnrollmentScreen(); + } else if (screen == OobeScreen::SCREEN_OOBE_DEMO_SETUP) { + ShowDemoModeSetupScreen(); } else if (screen == OobeScreen::SCREEN_TERMS_OF_SERVICE) { ShowTermsOfServiceScreen(); } else if (screen == OobeScreen::SCREEN_SYNC_CONSENT) { @@ -1329,6 +1345,9 @@ case ScreenExitCode::SYNC_CONSENT_FINISHED: ShowArcTermsOfServiceScreen(); break; + case ScreenExitCode::DEMO_MODE_SETUP_CLOSED: + OnDemoSetupClosed(); + break; default: NOTREACHED(); }
diff --git a/chrome/browser/chromeos/login/wizard_controller.h b/chrome/browser/chromeos/login/wizard_controller.h index 8d5e6f1..f39b30b2 100644 --- a/chrome/browser/chromeos/login/wizard_controller.h +++ b/chrome/browser/chromeos/login/wizard_controller.h
@@ -141,6 +141,7 @@ void ShowUserImageScreen(); void ShowEulaScreen(); void ShowEnrollmentScreen(); + void ShowDemoModeSetupScreen(); void ShowResetScreen(); void ShowKioskAutolaunchScreen(); void ShowEnableDebuggingScreen(); @@ -188,6 +189,7 @@ void OnVoiceInteractionValuePropAccepted(); void OnControllerPairingFinished(); void OnAutoEnrollmentCheckCompleted(); + void OnDemoSetupClosed(); void OnWaitForContainerReadyFinished(); void OnOobeFlowFinished();
diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index 7e84714..5ca169d 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc
@@ -26,6 +26,7 @@ #include "chrome/browser/chromeos/login/screens/device_disabled_screen.h" #include "chrome/browser/chromeos/login/screens/error_screen.h" #include "chrome/browser/chromeos/login/screens/hid_detection_screen.h" +#include "chrome/browser/chromeos/login/screens/mock_demo_setup_screen.h" #include "chrome/browser/chromeos/login/screens/mock_device_disabled_screen_view.h" #include "chrome/browser/chromeos/login/screens/mock_enable_debugging_screen.h" #include "chrome/browser/chromeos/login/screens/mock_eula_screen.h" @@ -434,6 +435,8 @@ MOCK(mock_enable_debugging_screen_, OobeScreen::SCREEN_OOBE_ENABLE_DEBUGGING, MockEnableDebuggingScreen, MockEnableDebuggingScreenView); + MOCK(mock_demo_setup_screen_, OobeScreen::SCREEN_OOBE_DEMO_SETUP, + MockDemoSetupScreen, MockDemoSetupScreenView); device_disabled_screen_view_.reset(new MockDeviceDisabledScreenView); wizard_controller->screen_manager() ->screens_[OobeScreen::SCREEN_DEVICE_DISABLED] = @@ -572,6 +575,8 @@ mock_wrong_hwid_screen_; MockOutShowHide<MockEnableDebuggingScreen, MockEnableDebuggingScreenView>* mock_enable_debugging_screen_; + MockOutShowHide<MockDemoSetupScreen, MockDemoSetupScreenView>* + mock_demo_setup_screen_; std::unique_ptr<MockDeviceDisabledScreenView> device_disabled_screen_view_; private: @@ -1245,6 +1250,32 @@ CheckCurrentScreen(OobeScreen::SCREEN_OOBE_NETWORK); } +class WizardControllerDemoSetupTest : public WizardControllerFlowTest { + protected: + WizardControllerDemoSetupTest() = default; + + // InProcessBrowserTest: + void SetUpCommandLine(base::CommandLine* command_line) override { + WizardControllerFlowTest::SetUpCommandLine(command_line); + command_line->AppendSwitch(chromeos::switches::kEnableDemoMode); + } + + private: + DISALLOW_COPY_AND_ASSIGN(WizardControllerDemoSetupTest); +}; + +IN_PROC_BROWSER_TEST_F(WizardControllerDemoSetupTest, + CloseDemoSetupShouldShowSignIn) { + LoginDisplayHost::default_host()->StartSignInScreen(LoginScreenContext()); + EXPECT_NE(nullptr, ExistingUserController::current_controller()); + + ExistingUserController::current_controller()->OnStartDemoModeSetupScreen(); + CheckCurrentScreen(OobeScreen::SCREEN_OOBE_DEMO_SETUP); + + OnExit(*mock_demo_setup_screen_, ScreenExitCode::DEMO_MODE_SETUP_CLOSED); + EXPECT_NE(nullptr, ExistingUserController::current_controller()); +} + class WizardControllerOobeResumeTest : public WizardControllerTest { protected: WizardControllerOobeResumeTest() {} @@ -1343,7 +1374,7 @@ // TODO(updowndota): Add tests for Voice Interaction OptIn flow. // TODO(alemate): Add tests for Sync Consent UI. -static_assert(static_cast<int>(ScreenExitCode::EXIT_CODES_COUNT) == 33, +static_assert(static_cast<int>(ScreenExitCode::EXIT_CODES_COUNT) == 34, "tests for new control flow are missing"); } // namespace chromeos
diff --git a/chrome/browser/chromeos/policy/app_install_event_log.cc b/chrome/browser/chromeos/policy/app_install_event_log.cc index 1b829e12..39f8bf4c 100644 --- a/chrome/browser/chromeos/policy/app_install_event_log.cc +++ b/chrome/browser/chromeos/policy/app_install_event_log.cc
@@ -20,7 +20,7 @@ namespace policy { namespace { -static const int64_t kLogFileVersion = 2; +static const int64_t kLogFileVersion = 3; static const ssize_t kMaxLogs = 1024; } // namespace
diff --git a/chrome/browser/chromeos/policy/app_install_event_log_collector.h b/chrome/browser/chromeos/policy/app_install_event_log_collector.h index 21b45d5..1d64679a 100644 --- a/chrome/browser/chromeos/policy/app_install_event_log_collector.h +++ b/chrome/browser/chromeos/policy/app_install_event_log_collector.h
@@ -37,9 +37,12 @@ event) = 0; // Adds a log entry for |package|. The |event|'s timestamp is set to the - // current time if not set yet. + // current time if not set yet. If |gather_disk_space_info| is |true|, + // information about total and free disk space is gathered in the background + // and added to |event| before adding it to the log. virtual void Add( const std::string& package, + bool gather_disk_space_info, std::unique_ptr<enterprise_management::AppInstallReportLogEvent> event) = 0;
diff --git a/chrome/browser/chromeos/policy/app_install_event_log_collector_unittest.cc b/chrome/browser/chromeos/policy/app_install_event_log_collector_unittest.cc index 8345720..58630f49 100644 --- a/chrome/browser/chromeos/policy/app_install_event_log_collector_unittest.cc +++ b/chrome/browser/chromeos/policy/app_install_event_log_collector_unittest.cc
@@ -50,6 +50,7 @@ } void Add(const std::string& package, + bool add_disk_space_info, std::unique_ptr<em::AppInstallReportLogEvent> event) override { ++add_count_; last_event_ = *event;
diff --git a/chrome/browser/chromeos/policy/app_install_event_logger.cc b/chrome/browser/chromeos/policy/app_install_event_logger.cc index 8e595f3..527b5e4 100644 --- a/chrome/browser/chromeos/policy/app_install_event_logger.cc +++ b/chrome/browser/chromeos/policy/app_install_event_logger.cc
@@ -4,16 +4,25 @@ #include "chrome/browser/chromeos/policy/app_install_event_logger.h" +#include <stdint.h> + #include <algorithm> #include <iterator> +#include "base/bind.h" +#include "base/files/file_path.h" #include "base/json/json_reader.h" +#include "base/location.h" +#include "base/sys_info.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" #include "base/time/time.h" #include "base/values.h" #include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/policy/profile_policy_connector_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chromeos/disks/disk_mount_manager.h" #include "components/arc/arc_prefs.h" #include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_namespace.h" @@ -87,6 +96,29 @@ return difference; } +std::unique_ptr<em::AppInstallReportLogEvent> AddDiskSpaceInfoToEvent( + std::unique_ptr<em::AppInstallReportLogEvent> event) { + for (const auto& disk : + chromeos::disks::DiskMountManager::GetInstance()->disks()) { + if (!disk.second->IsStatefulPartition()) { + continue; + } + const base::FilePath stateful_path(disk.second->mount_path()); + const int64_t stateful_total = + base::SysInfo::AmountOfTotalDiskSpace(stateful_path); + if (stateful_total >= 0) { + event->set_stateful_total(stateful_total); + } + const int64_t stateful_free = + base::SysInfo::AmountOfFreeDiskSpace(stateful_path); + if (stateful_free >= 0) { + event->set_stateful_free(stateful_free); + } + break; + } + return event; +} + void EnsureTimestampSet(em::AppInstallReportLogEvent* event) { if (!event->has_timestamp()) { event->set_timestamp( @@ -94,11 +126,12 @@ } } -em::AppInstallReportLogEvent CreateEvent( +std::unique_ptr<em::AppInstallReportLogEvent> CreateEvent( em::AppInstallReportLogEvent::EventType type) { - em::AppInstallReportLogEvent event; - EnsureTimestampSet(&event); - event.set_event_type(type); + std::unique_ptr<em::AppInstallReportLogEvent> event = + std::make_unique<em::AppInstallReportLogEvent>(); + EnsureTimestampSet(event.get()); + event->set_event_type(type); return event; } @@ -106,10 +139,11 @@ AppInstallEventLogger::AppInstallEventLogger(Delegate* delegate, Profile* profile) - : delegate_(delegate), profile_(profile) { + : delegate_(delegate), profile_(profile), weak_factory_(this) { if (!arc::IsArcAllowedForProfile(profile_)) { - delegate_->Add(GetPackagesFromPref(arc::prefs::kArcPushInstallAppsPending), - CreateEvent(em::AppInstallReportLogEvent::CANCELED)); + AddForSetOfPackages( + GetPackagesFromPref(arc::prefs::kArcPushInstallAppsPending), + CreateEvent(em::AppInstallReportLogEvent::CANCELED)); Clear(profile_); return; } @@ -156,15 +190,21 @@ void AppInstallEventLogger::AddForAllPackages( std::unique_ptr<em::AppInstallReportLogEvent> event) { EnsureTimestampSet(event.get()); - delegate_->Add(GetPackagesFromPref(arc::prefs::kArcPushInstallAppsPending), - *event); + AddForSetOfPackages( + GetPackagesFromPref(arc::prefs::kArcPushInstallAppsPending), + std::move(event)); } void AppInstallEventLogger::Add( const std::string& package, + bool gather_disk_space_info, std::unique_ptr<em::AppInstallReportLogEvent> event) { EnsureTimestampSet(event.get()); - delegate_->Add({package}, *event); + if (gather_disk_space_info) { + AddForSetOfPackagesWithDiskSpaceInfo({package}, std::move(event)); + } else { + AddForSetOfPackages({package}, std::move(event)); + } } void AppInstallEventLogger::OnPolicyUpdated(const policy::PolicyNamespace& ns, @@ -206,8 +246,8 @@ previous_pending, GetDifference(requested_in_arc_, pending_in_arc)); const std::set<std::string> removed = GetDifference(previous_pending, current_pending); - // TODO(bartfab): Add SystemState. - delegate_->Add(removed, CreateEvent(em::AppInstallReportLogEvent::SUCCESS)); + AddForSetOfPackagesWithDiskSpaceInfo( + removed, CreateEvent(em::AppInstallReportLogEvent::SUCCESS)); if (removed.empty()) { return; @@ -274,10 +314,10 @@ GetDifference(current_requested, previous_requested); const std::set<std::string> removed = GetDifference(previous_pending, current_requested); - // TODO: Add SystemState. - delegate_->Add(added, - CreateEvent(em::AppInstallReportLogEvent::SERVER_REQUEST)); - delegate_->Add(removed, CreateEvent(em::AppInstallReportLogEvent::CANCELED)); + AddForSetOfPackagesWithDiskSpaceInfo( + added, CreateEvent(em::AppInstallReportLogEvent::SERVER_REQUEST)); + AddForSetOfPackages(removed, + CreateEvent(em::AppInstallReportLogEvent::CANCELED)); const std::set<std::string> current_pending = GetDifference( current_requested, GetDifference(previous_requested, previous_pending)); @@ -296,4 +336,20 @@ } } +void AppInstallEventLogger::AddForSetOfPackagesWithDiskSpaceInfo( + const std::set<std::string>& packages, + std::unique_ptr<em::AppInstallReportLogEvent> event) { + base::PostTaskWithTraitsAndReplyWithResult( + FROM_HERE, {base::MayBlock()}, + base::BindOnce(&AddDiskSpaceInfoToEvent, std::move(event)), + base::BindOnce(&AppInstallEventLogger::AddForSetOfPackages, + weak_factory_.GetWeakPtr(), packages)); +} + +void AppInstallEventLogger::AddForSetOfPackages( + const std::set<std::string>& packages, + std::unique_ptr<em::AppInstallReportLogEvent> event) { + delegate_->Add(packages, *event); +} + } // namespace policy
diff --git a/chrome/browser/chromeos/policy/app_install_event_logger.h b/chrome/browser/chromeos/policy/app_install_event_logger.h index e72b3a0..ea51a2f 100644 --- a/chrome/browser/chromeos/policy/app_install_event_logger.h +++ b/chrome/browser/chromeos/policy/app_install_event_logger.h
@@ -10,6 +10,7 @@ #include <string> #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "chrome/browser/chromeos/arc/policy/arc_policy_bridge.h" #include "chrome/browser/chromeos/policy/app_install_event_log_collector.h" #include "components/policy/core/common/policy_service.h" @@ -78,6 +79,7 @@ std::unique_ptr<enterprise_management::AppInstallReportLogEvent> event) override; void Add(const std::string& package, + bool gather_disk_space_info, std::unique_ptr<enterprise_management::AppInstallReportLogEvent> event) override; @@ -113,6 +115,17 @@ // and updates the |log_collector_|. void EvaluatePolicy(const policy::PolicyMap& policy, bool initial); + // Adds information about total and free disk space to |event|, then adds + // |event| to the log for every app in |packages|. + void AddForSetOfPackagesWithDiskSpaceInfo( + const std::set<std::string>& packages, + std::unique_ptr<enterprise_management::AppInstallReportLogEvent> event); + + // Adds |event| to the log for every app in |packages|. + void AddForSetOfPackages( + const std::set<std::string>& packages, + std::unique_ptr<enterprise_management::AppInstallReportLogEvent> event); + // The delegate that events are forwarded to for inclusion in the log. Delegate* const delegate_; @@ -131,6 +144,9 @@ // app push-install requests. std::unique_ptr<AppInstallEventLogCollector> log_collector_; + // Weak factory used to reference |this| from background tasks. + base::WeakPtrFactory<AppInstallEventLogger> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(AppInstallEventLogger); };
diff --git a/chrome/browser/chromeos/policy/app_install_event_logger_unittest.cc b/chrome/browser/chromeos/policy/app_install_event_logger_unittest.cc index c5cd402..9a6a2f6 100644 --- a/chrome/browser/chromeos/policy/app_install_event_logger_unittest.cc +++ b/chrome/browser/chromeos/policy/app_install_event_logger_unittest.cc
@@ -4,34 +4,261 @@ #include "chrome/browser/chromeos/policy/app_install_event_logger.h" +#include <stdint.h> + +#include "base/test/scoped_task_environment.h" +#include "base/time/time.h" #include "base/values.h" #include "chrome/test/base/testing_profile.h" +#include "chromeos/dbus/cros_disks_client.h" +#include "chromeos/disks/disk_mount_manager.h" +#include "chromeos/disks/mock_disk_mount_manager.h" #include "components/arc/arc_prefs.h" +#include "components/policy/proto/device_management_backend.pb.h" #include "components/prefs/pref_service.h" #include "content/public/test/test_browser_thread_bundle.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using AppInstallEventLoggerTest = testing::Test; +using testing::Mock; +using testing::_; + +namespace em = enterprise_management; namespace policy { +namespace { + +constexpr char kStatefulMountPath[] = "/mnt/stateful_partition"; +constexpr char kPackageName[] = "com.example.app"; +const int kTimestamp = 123456; + +MATCHER_P(MatchProto, expected, "matches protobuf") { + return arg.SerializePartialAsString() == expected.SerializePartialAsString(); +} + +MATCHER_P(MatchEventExceptTimestamp, expected, "event matches") { + em::AppInstallReportLogEvent actual_event; + actual_event.MergeFrom(arg); + actual_event.clear_timestamp(); + + em::AppInstallReportLogEvent expected_event; + expected_event.MergeFrom(expected); + expected_event.clear_timestamp(); + + return actual_event.SerializePartialAsString() == + expected_event.SerializePartialAsString(); +} + +ACTION_TEMPLATE(SaveTimestamp, + HAS_1_TEMPLATE_PARAMS(int, k), + AND_1_VALUE_PARAMS(out)) { + *out = testing::get<k>(args).timestamp(); +}; + +int64_t GetCurrentTimestamp() { + return (base::Time::Now() - base::Time::UnixEpoch()).InMicroseconds(); +} + +class MockAppInstallEventLoggerDelegate + : public AppInstallEventLogger::Delegate { + public: + MockAppInstallEventLoggerDelegate() = default; + + MOCK_METHOD2(Add, + void(const std::set<std::string>& packages, + const em::AppInstallReportLogEvent& event)); + + private: + DISALLOW_COPY_AND_ASSIGN(MockAppInstallEventLoggerDelegate); +}; + +} // namespace + +class AppInstallEventLoggerTest : public testing::Test { + protected: + AppInstallEventLoggerTest() + : scoped_task_environment_( + base::test::ScopedTaskEnvironment::MainThreadType::UI, + base::test::ScopedTaskEnvironment::ExecutionMode::QUEUED) {} + + void SetUp() override { + disk_mount_manager_ = new chromeos::disks::MockDiskMountManager; + chromeos::disks::DiskMountManager::InitializeForTesting( + disk_mount_manager_); + disk_mount_manager_->CreateDiskEntryForMountDevice( + chromeos::disks::DiskMountManager::MountPointInfo( + "/dummy/device/usb", kStatefulMountPath, + chromeos::MOUNT_TYPE_DEVICE, chromeos::disks::MOUNT_CONDITION_NONE), + "device_id", "device_label", "vendor", "product", + chromeos::DEVICE_TYPE_UNKNOWN, 1 << 20 /* total_size_in_bytes */, + false /* is_parent */, false /* has_media */, true /* on_boot_device */, + true /* on_removable_device */, "ext4"); + } + + void TearDown() override { + logger_.reset(); + scoped_task_environment_.RunUntilIdle(); + chromeos::disks::DiskMountManager::Shutdown(); + } + + // Runs |function|, verifies that the expected event is added to the logs for + // all apps in |packages| and its timestamp is set to the time at which the + // |function| is run. + template <typename T> + void RunAndVerifyAdd(T function, const std::set<std::string>& packages) { + Mock::VerifyAndClearExpectations(&delegate_); + + int64_t timestamp = 0; + EXPECT_CALL(delegate_, Add(packages, MatchEventExceptTimestamp(event_))) + .WillOnce(SaveTimestamp<1>(×tamp)); + const int64_t before = GetCurrentTimestamp(); + function(); + const int64_t after = GetCurrentTimestamp(); + Mock::VerifyAndClearExpectations(&delegate_); + + EXPECT_LE(before, timestamp); + EXPECT_GE(after, timestamp); + } + + void CreateLogger() { + event_.set_event_type(em::AppInstallReportLogEvent::CANCELED); + RunAndVerifyAdd( + [&]() { + logger_ = + std::make_unique<AppInstallEventLogger>(&delegate_, &profile_); + }, + {}); + event_.set_event_type(em::AppInstallReportLogEvent::SUCCESS); + } + + base::test::ScopedTaskEnvironment scoped_task_environment_; + content::TestBrowserThreadBundle browser_thread_bundle_; + TestingProfile profile_; + // Owned by chromeos::disks::DiskMountManager. + chromeos::disks::MockDiskMountManager* disk_mount_manager_ = nullptr; + + MockAppInstallEventLoggerDelegate delegate_; + + em::AppInstallReportLogEvent event_; + + std::unique_ptr<AppInstallEventLogger> logger_; + + private: + DISALLOW_COPY_AND_ASSIGN(AppInstallEventLoggerTest); +}; + // Store lists of apps for which push-install has been requested and is still // pending. Clear all data related to app-install event log collection. Verify // that the lists are cleared. TEST_F(AppInstallEventLoggerTest, Clear) { - content::TestBrowserThreadBundle browser_thread_bundle; - TestingProfile profile; base::ListValue list; list.AppendString("test"); - profile.GetPrefs()->Set(arc::prefs::kArcPushInstallAppsRequested, list); - profile.GetPrefs()->Set(arc::prefs::kArcPushInstallAppsPending, list); - AppInstallEventLogger::Clear(&profile); - EXPECT_TRUE(profile.GetPrefs() + profile_.GetPrefs()->Set(arc::prefs::kArcPushInstallAppsRequested, list); + profile_.GetPrefs()->Set(arc::prefs::kArcPushInstallAppsPending, list); + AppInstallEventLogger::Clear(&profile_); + EXPECT_TRUE(profile_.GetPrefs() ->FindPreference(arc::prefs::kArcPushInstallAppsRequested) ->IsDefaultValue()); - EXPECT_TRUE(profile.GetPrefs() + EXPECT_TRUE(profile_.GetPrefs() ->FindPreference(arc::prefs::kArcPushInstallAppsPending) ->IsDefaultValue()); } +// Adds an event with a timestamp. Verifies that the event is added to the log +// and the timestamp is not changed. +TEST_F(AppInstallEventLoggerTest, Add) { + CreateLogger(); + + event_.set_timestamp(kTimestamp); + std::unique_ptr<em::AppInstallReportLogEvent> event = + std::make_unique<em::AppInstallReportLogEvent>(); + event->MergeFrom(event_); + + EXPECT_CALL(delegate_, + Add(std::set<std::string>{kPackageName}, MatchProto(event_))); + logger_->Add(kPackageName, false /* gather_disk_space_info */, + std::move(event)); +} + +// Adds an event without a timestamp. Verifies that the event is added to the +// log and the timestamp is set to the current time. +TEST_F(AppInstallEventLoggerTest, AddSetsTimestamp) { + CreateLogger(); + + std::unique_ptr<em::AppInstallReportLogEvent> event = + std::make_unique<em::AppInstallReportLogEvent>(); + event->MergeFrom(event_); + + RunAndVerifyAdd( + [&]() { + logger_->Add(kPackageName, false /* gather_disk_space_info */, + std::move(event)); + }, + {kPackageName}); +} + +// Adds an event with a timestamp, requesting that disk space information be +// added to it. Verifies that a background task is posted that consults the disk +// mount manager. Then, verifies that after the background task has run, the +// event is added. +// +// It is not possible to test that disk size information is retrieved correctly +// as a mounted stateful partition cannot be simulated in unit tests. +TEST_F(AppInstallEventLoggerTest, AddSetsDiskSpaceInfo) { + CreateLogger(); + + event_.set_timestamp(kTimestamp); + std::unique_ptr<em::AppInstallReportLogEvent> event = + std::make_unique<em::AppInstallReportLogEvent>(); + event->MergeFrom(event_); + + EXPECT_CALL(*disk_mount_manager_, disks()).Times(0); + EXPECT_CALL(delegate_, Add(_, _)).Times(0); + logger_->Add(kPackageName, true /* gather_disk_space_info */, + std::move(event)); + Mock::VerifyAndClearExpectations(disk_mount_manager_); + Mock::VerifyAndClearExpectations(&delegate_); + + EXPECT_CALL(*disk_mount_manager_, disks()); + EXPECT_CALL(delegate_, + Add(std::set<std::string>{kPackageName}, MatchProto(event_))); + scoped_task_environment_.RunUntilIdle(); +} + +// Adds an event without a timestamp, requesting that disk space information be +// added to it. Verifies that a background task is posted that consults the disk +// mount manager. Then, verifies that after the background task has run, the +// event is added and its timestamp is set to the current time before posting +// the background task. +// +// It is not possible to test that disk size information is retrieved correctly +// as a mounted stateful partition cannot be simulated in unit tests. +TEST_F(AppInstallEventLoggerTest, AddSetsTimestampAndDiskSpaceInfo) { + CreateLogger(); + + std::unique_ptr<em::AppInstallReportLogEvent> event = + std::make_unique<em::AppInstallReportLogEvent>(); + event->MergeFrom(event_); + + EXPECT_CALL(*disk_mount_manager_, disks()).Times(0); + EXPECT_CALL(delegate_, Add(_, _)).Times(0); + const int64_t before = GetCurrentTimestamp(); + logger_->Add(kPackageName, true /* gather_disk_space_info */, + std::move(event)); + const int64_t after = GetCurrentTimestamp(); + Mock::VerifyAndClearExpectations(disk_mount_manager_); + Mock::VerifyAndClearExpectations(&delegate_); + + int64_t timestamp = 0; + EXPECT_CALL(*disk_mount_manager_, disks()); + EXPECT_CALL(delegate_, Add(std::set<std::string>{kPackageName}, + MatchEventExceptTimestamp(event_))) + .WillOnce(SaveTimestamp<1>(×tamp)); + scoped_task_environment_.RunUntilIdle(); + + EXPECT_LE(before, timestamp); + EXPECT_GE(after, timestamp); +} + } // namespace policy
diff --git a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc index e25c16a8..50e2219 100644 --- a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc +++ b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
@@ -1668,7 +1668,10 @@ CloseDetailMenu(); } -IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, CheckMenuVisibilityOnDetailMenu) { +// Flaky failures of IsHelpAvailableOnDetailMenu(). Possible race condition +// with session state. https://crbug.com/819987 +IN_PROC_BROWSER_TEST_P(TrayAccessibilityTest, + DISABLED_CheckMenuVisibilityOnDetailMenu) { // Except help & settings, others should be kept the same // in LOGIN | NOT LOGIN | LOCKED. https://crbug.com/632107. EXPECT_TRUE(CreateDetailedMenu());
diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chrome/browser/content_settings/host_content_settings_map_factory.cc index 2e8e6856..07ebea6a6 100644 --- a/chrome/browser/content_settings/host_content_settings_map_factory.cc +++ b/chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -14,7 +14,7 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_service.h"
diff --git a/chrome/browser/devtools/BUILD.gn b/chrome/browser/devtools/BUILD.gn index 882a367..dd7f4e8e 100644 --- a/chrome/browser/devtools/BUILD.gn +++ b/chrome/browser/devtools/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") if (!is_android) { import("//build/config/features.gni")
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc index 5ab37f0..70a78d9f 100644 --- a/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -58,7 +58,7 @@ #include "content/public/browser/download_manager.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/page_navigator.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/filename_util.h" #include "net/base/mime_util.h" #include "ppapi/features/features.h"
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h index eaeaf1e..dbe1bbcf 100644 --- a/chrome/browser/download/chrome_download_manager_delegate.h +++ b/chrome/browser/download/chrome_download_manager_delegate.h
@@ -28,7 +28,7 @@ #include "content/public/browser/download_manager_delegate.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if defined(OS_ANDROID) #include "chrome/browser/android/download/download_location_dialog_bridge.h"
diff --git a/chrome/browser/download/download_core_service.h b/chrome/browser/download/download_core_service.h index af9c275..d825c09 100644 --- a/chrome/browser/download/download_core_service.h +++ b/chrome/browser/download/download_core_service.h
@@ -9,7 +9,7 @@ #include "base/macros.h" #include "components/keyed_service/core/keyed_service.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" class ChromeDownloadManagerDelegate; class DownloadHistory;
diff --git a/chrome/browser/download/download_core_service_factory.cc b/chrome/browser/download/download_core_service_factory.cc index e367198..87bed6c4 100644 --- a/chrome/browser/download/download_core_service_factory.cc +++ b/chrome/browser/download/download_core_service_factory.cc
@@ -6,6 +6,7 @@ #include "chrome/browser/download/download_core_service_impl.h" #include "chrome/browser/history/history_service_factory.h" +#include "chrome/browser/notifications/notification_display_service_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" @@ -27,6 +28,7 @@ "DownloadCoreService", BrowserContextDependencyManager::GetInstance()) { DependsOn(HistoryServiceFactory::GetInstance()); + DependsOn(NotificationDisplayServiceFactory::GetInstance()); } DownloadCoreServiceFactory::~DownloadCoreServiceFactory() {}
diff --git a/chrome/browser/download/download_core_service_impl.cc b/chrome/browser/download/download_core_service_impl.cc index 1cf0ad6..9bbec58 100644 --- a/chrome/browser/download/download_core_service_impl.cc +++ b/chrome/browser/download/download_core_service_impl.cc
@@ -15,7 +15,7 @@ #include "chrome/browser/profiles/profile.h" #include "components/history/core/browser/history_service.h" #include "content/public/browser/download_manager.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/api/downloads/downloads_api.h"
diff --git a/chrome/browser/download/download_core_service_impl.h b/chrome/browser/download/download_core_service_impl.h index cfe642d..8401838 100644 --- a/chrome/browser/download/download_core_service_impl.h +++ b/chrome/browser/download/download_core_service_impl.h
@@ -11,7 +11,7 @@ #include "base/macros.h" #include "chrome/browser/download/download_core_service.h" #include "components/keyed_service/core/keyed_service.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" class ChromeDownloadManagerDelegate; class DownloadHistory;
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc index 7cd09a2..c01c5af 100644 --- a/chrome/browser/download/download_history.cc +++ b/chrome/browser/download/download_history.cc
@@ -41,7 +41,7 @@ #include "components/history/core/browser/history_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_manager.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/api/downloads/downloads_api.h"
diff --git a/chrome/browser/download/download_history_unittest.cc b/chrome/browser/download/download_history_unittest.cc index eade47f..83a0888 100644 --- a/chrome/browser/download/download_history_unittest.cc +++ b/chrome/browser/download/download_history_unittest.cc
@@ -23,7 +23,7 @@ #include "content/public/test/mock_download_manager.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc index 03ca8ad..167b9f6 100644 --- a/chrome/browser/download/download_target_determiner.cc +++ b/chrome/browser/download/download_target_determiner.cc
@@ -30,8 +30,8 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_item_utils.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "net/base/filename_util.h" #include "ppapi/features/features.h" #include "third_party/WebKit/public/common/mime_util/mime_util.h"
diff --git a/chrome/browser/download/download_target_determiner_unittest.cc b/chrome/browser/download/download_target_determiner_unittest.cc index 019a34f..07895cbe 100644 --- a/chrome/browser/download/download_target_determiner_unittest.cc +++ b/chrome/browser/download/download_target_determiner_unittest.cc
@@ -48,7 +48,7 @@ #include "content/public/test/mock_download_item.h" #include "content/public/test/test_renderer_host.h" #include "content/public/test/web_contents_tester.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/mime_util.h" #include "ppapi/features/features.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/chrome/browser/download/notification/download_item_notification.cc b/chrome/browser/download/notification/download_item_notification.cc index 281be8b..ba3b46c 100644 --- a/chrome/browser/download/notification/download_item_notification.cc +++ b/chrome/browser/download/notification/download_item_notification.cc
@@ -321,6 +321,9 @@ } void DownloadItemNotification::CloseNotification() { + if (closed_) + return; + NotificationDisplayServiceFactory::GetForProfile(profile())->Close( NotificationHandler::Type::TRANSIENT, GetNotificationId()); } @@ -348,6 +351,17 @@ bool bump_priority) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + if (item_->GetState() == download::DownloadItem::CANCELLED) { + // Confirms that a download is cancelled by user action. + DCHECK(item_->GetLastReason() == + download::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED || + item_->GetLastReason() == + download::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN); + + CloseNotification(); + return; + } + DownloadItemModel model(item_); DownloadCommands command(item_); @@ -382,14 +396,9 @@ notification_->set_progress(100); break; case download::DownloadItem::CANCELLED: - // Confirms that a download is cancelled by user action. - DCHECK(item_->GetLastReason() == - download::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED || - item_->GetLastReason() == - download::DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN); - - CloseNotification(); - return; // Skips the remaining since the notification has closed. + // Handled above. + NOTREACHED(); + return; case download::DownloadItem::INTERRUPTED: // Shows a notifiation as progress type once so the visible content will // be updated. (same as the case of type = COMPLETE)
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index 7aeaf46..2fbe7a4 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -6,7 +6,7 @@ import("//build/config/ui.gni") import("//chrome/common/features.gni") import("//components/nacl/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//rlz/features/features.gni") @@ -866,9 +866,9 @@ "//extensions:extensions_resources", "//extensions/browser", "//extensions/browser/api:api_registration", + "//extensions/buildflags", "//extensions/common", "//extensions/common/api", - "//extensions/features", "//extensions/strings", "//google_apis", "//media:media_features",
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index de706f7d..b8604ff 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -571,18 +571,10 @@ // Initialize default window bounds according to window type. if (window_type == Browser::TYPE_TABBED || window_type == Browser::TYPE_POPUP) { - // Try to position the new browser relative to its originating - // browser window. The call offsets the bounds by kWindowTilePixels - // (defined in WindowSizer to be 10). - // - // NOTE(rafaelw): It's ok if GetCurrentBrowser() returns NULL here. - // GetBrowserWindowBounds will default to saved "default" values for - // the app. - ui::WindowShowState show_state = ui::SHOW_STATE_DEFAULT; + ui::WindowShowState ignored_show_state = ui::SHOW_STATE_DEFAULT; WindowSizer::GetBrowserWindowBoundsAndShowState( - std::string(), gfx::Rect(), - ChromeExtensionFunctionDetails(this).GetCurrentBrowser(), - &window_bounds, &show_state); + std::string(), gfx::Rect(), nullptr, &window_bounds, + &ignored_show_state); } // Any part of the bounds can optionally be set by the caller.
diff --git a/chrome/browser/extensions/api/tabs/tabs_test.cc b/chrome/browser/extensions/api/tabs/tabs_test.cc index abb1c3a..82fa8cf 100644 --- a/chrome/browser/extensions/api/tabs/tabs_test.cc +++ b/chrome/browser/extensions/api/tabs/tabs_test.cc
@@ -77,10 +77,7 @@ class ExtensionTabsTest : public PlatformAppBrowserTest { public: - ExtensionTabsTest() : scoped_set_tick_clock_for_testing_(&test_clock_) { - // Start with a non-null time. - test_clock_.Advance(base::TimeDelta::FromSeconds(1)); - } + ExtensionTabsTest() : scoped_set_tick_clock_for_testing_(&test_clock_) {} // Fast-forward time until no tab is protected from being discarded for having // recently been used.
diff --git a/chrome/browser/extensions/bookmark_app_navigation_throttle_browsertest.cc b/chrome/browser/extensions/bookmark_app_navigation_throttle_browsertest.cc index 72cf8c1..b4525424 100644 --- a/chrome/browser/extensions/bookmark_app_navigation_throttle_browsertest.cc +++ b/chrome/browser/extensions/bookmark_app_navigation_throttle_browsertest.cc
@@ -12,7 +12,9 @@ #include "chrome/browser/extensions/extension_browsertest.h" #include "chrome/browser/extensions/launch_util.h" #include "chrome/browser/prerender/prerender_manager.h" +#include "chrome/browser/profiles/profile_io_data.h" #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h" +#include "chrome/browser/ssl/cert_verifier_browser_test.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/extensions/app_launch_params.h" @@ -28,6 +30,7 @@ #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/render_frame_host.h" +#include "content/public/common/content_switches.h" #include "content/public/common/context_menu_params.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_frame_navigation_observer.h" @@ -37,6 +40,7 @@ #include "extensions/browser/notification_types.h" #include "extensions/common/constants.h" #include "net/base/escape.h" +#include "net/cert/mock_cert_verifier.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "net/test/embedded_test_server/http_request.h" @@ -421,13 +425,22 @@ const char kInScopeUrlPath[] = "/in_scope/other.html"; const char kOutOfScopeUrlPath[] = "/out_of_scope/index.html"; +const base::FilePath::CharType kDocRoot[] = + FILE_PATH_LITERAL("chrome/test/data"); + class BookmarkAppNavigationThrottleBaseBrowserTest : public ExtensionBrowserTest { public: + BookmarkAppNavigationThrottleBaseBrowserTest() + : https_server_(net::EmbeddedTestServer::TYPE_HTTPS), + mock_cert_verifier_(), + cert_verifier_(&mock_cert_verifier_) {} + void SetUp() override { + https_server_.AddDefaultHandlers(base::FilePath(kDocRoot)); // Register a request handler that will return empty pages. Tests are // responsible for adding elements and firing events on these empty pages. - embedded_test_server()->RegisterRequestHandler( + https_server_.RegisterRequestHandler( base::BindRepeating([](const HttpRequest& request) { // Let the default request handlers handle redirections. if (request.GetURL().path() == "/server-redirect" || @@ -444,9 +457,25 @@ ExtensionBrowserTest::SetUp(); } + void SetUpInProcessBrowserTestFixture() override { + ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); + ProfileIOData::SetCertVerifierForTesting(&mock_cert_verifier_); + } + + void TearDownInProcessBrowserTestFixture() override { + ExtensionBrowserTest::TearDownInProcessBrowserTestFixture(); + ProfileIOData::SetCertVerifierForTesting(nullptr); + } + + void SetUpCommandLine(base::CommandLine* command_line) override { + command_line->AppendSwitch(switches::kUseMockCertVerifierForTesting); + } + void SetUpOnMainThread() override { ExtensionBrowserTest::SetUpOnMainThread(); host_resolver()->AddRule("*", "127.0.0.1"); + // By default, all SSL cert checks are valid. Can be overriden in tests. + cert_verifier_.set_default_result(net::OK); } void InstallTestBookmarkApp() { @@ -458,15 +487,13 @@ } const Extension* InstallTestBookmarkApp(const std::string& app_host) { - if (!embedded_test_server()->Started()) { - CHECK(embedded_test_server()->Start()); + if (!https_server_.Started()) { + CHECK(https_server_.Start()); } WebApplicationInfo web_app_info; - web_app_info.app_url = - embedded_test_server()->GetURL(app_host, kAppUrlPath); - web_app_info.scope = - embedded_test_server()->GetURL(app_host, kAppScopePath); + web_app_info.app_url = https_server_.GetURL(app_host, kAppUrlPath); + web_app_info.scope = https_server_.GetURL(app_host, kAppScopePath); web_app_info.title = base::UTF8ToUTF16("Test app"); web_app_info.description = base::UTF8ToUTF16("Test description"); web_app_info.open_as_window = true; @@ -479,14 +506,13 @@ const Extension* InstallImmediateRedirectingApp( const std::string& target_host, const std::string& target_path) { - EXPECT_TRUE(embedded_test_server()->Start()); - const GURL target_url = - embedded_test_server()->GetURL(target_host, target_path); + EXPECT_TRUE(https_server_.Start()); + const GURL target_url = https_server_.GetURL(target_host, target_path); WebApplicationInfo web_app_info; - web_app_info.app_url = embedded_test_server()->GetURL( - kAppUrlHost, CreateServerRedirect(target_url)); - web_app_info.scope = embedded_test_server()->GetURL(kAppUrlHost, "/"); + web_app_info.app_url = + https_server_.GetURL(kAppUrlHost, CreateServerRedirect(target_url)); + web_app_info.scope = https_server_.GetURL(kAppUrlHost, "/"); web_app_info.title = base::UTF8ToUTF16("Redirecting Test app"); web_app_info.description = base::UTF8ToUTF16("Test description"); web_app_info.open_as_window = true; @@ -495,7 +521,7 @@ } Browser* OpenTestBookmarkApp() { - GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + GURL app_url = https_server_.GetURL(kAppUrlHost, kAppUrlPath); auto observer = GetTestNavigationObserver(app_url); Browser* app_browser = LaunchAppBrowser(test_bookmark_app_); observer->WaitForNavigationFinished(); @@ -514,8 +540,7 @@ // Navigates the browser's current active tab to the test app's URL. It does // not open a new app window. void NavigateToTestAppURL() { - const GURL app_url = - embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server_.GetURL(kAppUrlHost, kAppUrlPath); NavigateParams params(browser(), app_url, ui::PAGE_TRANSITION_TYPED); ASSERT_TRUE(TestTabActionDoesNotOpenAppWindow( app_url, base::BindOnce(&NavigateToURLWrapper, ¶ms))); @@ -761,15 +786,26 @@ } GURL GetLaunchingPageURL() { - return embedded_test_server()->GetURL(kLaunchingPageHost, - kLaunchingPagePath); + return https_server_.GetURL(kLaunchingPageHost, kLaunchingPagePath); } const base::HistogramTester& global_histogram() { return histogram_tester_; } const Extension* test_bookmark_app() { return test_bookmark_app_; } + const net::EmbeddedTestServer& https_server() { return https_server_; } + + CertVerifierBrowserTest::CertVerifier& mock_cert_verifier() { + return cert_verifier_; + } + private: + net::EmbeddedTestServer https_server_; + net::MockCertVerifier mock_cert_verifier_; + // Similar to net::MockCertVerifier, but also updates the CertVerifier + // used by the NetworkService. This is needed for when tests run with + // the NetworkService enabled. + CertVerifierBrowserTest::CertVerifier cert_verifier_; const Extension* test_bookmark_app_; base::HistogramTester histogram_tester_; }; @@ -803,7 +839,7 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionDoesNotOpenAppWindow( app_url, base::BindOnce(&ClickLinkAndWait, @@ -822,7 +858,7 @@ feature_list.InitWithFeatures({}, {features::kDesktopPWAsLinkCapturing}); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionDoesNotOpenAppWindow( app_url, base::BindOnce(&ClickLinkAndWait, @@ -851,8 +887,7 @@ MainFrameNavigations) { InstallTestBookmarkApp(); - GURL target_url = - embedded_test_server()->GetURL(kAppUrlHost, std::get<0>(GetParam())); + GURL target_url = https_server().GetURL(kAppUrlHost, std::get<0>(GetParam())); ui::PageTransition transition = std::get<1>(GetParam()); NavigateParams params(browser(), target_url, transition); @@ -863,8 +898,7 @@ } if (ui::PageTransitionCoreTypeIs(ui::PAGE_TRANSITION_LINK, transition) && - target_url == - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath)) { + target_url == https_server().GetURL(kAppUrlHost, kInScopeUrlPath)) { TestTabActionOpensAppWindow(target_url, base::BindOnce(&NavigateToURLAndWait, ¶ms)); } else { @@ -891,7 +925,7 @@ InsertIFrame(initial_tab); content::RenderFrameHost* iframe = GetIFrame(initial_tab); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); NavigateParams params(browser(), app_url, ui::PAGE_TRANSITION_LINK); params.frame_tree_node_id = iframe->GetFrameTreeNodeId(); @@ -928,7 +962,7 @@ } content::RenderFrameHost* iframe = GetIFrame(initial_tab); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); NavigateParams params(browser(), app_url, ui::PAGE_TRANSITION_LINK); params.frame_tree_node_id = iframe->GetFrameTreeNodeId(); @@ -951,7 +985,7 @@ LinkNavigationFromAddressBar) { InstallTestBookmarkApp(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); // Fake a navigation with a TRANSITION_LINK core type and a // TRANSITION_FROM_ADDRESS_BAR qualifier. This matches the transition that // results from pasting a URL into the address and navigating to it. @@ -977,8 +1011,7 @@ // Navigate to an in-scope URL to generate a link navigation that didn't // get intercepted. The navigation won't get intercepted because the target // URL is in-scope of the app for the current URL. - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kInScopeUrlPath); ASSERT_TRUE(TestTabActionDoesNotOpenAppWindow( in_scope_url, base::BindOnce(&ClickLinkAndWait, @@ -988,7 +1021,7 @@ // Navigate to an out-of-scope URL. { const GURL out_of_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kOutOfScopeUrlPath); + https_server().GetURL(kAppUrlHost, kOutOfScopeUrlPath); NavigateParams params(browser(), out_of_scope_url, ui::PAGE_TRANSITION_TYPED); ASSERT_TRUE(TestTabActionDoesNotOpenAppWindow( @@ -1024,7 +1057,7 @@ NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionDoesNotOpenAppWindow( app_url, base::BindOnce(&ClickLinkAndWait, @@ -1043,7 +1076,7 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionOpensAppWindow( app_url, base::BindOnce(&ClickLinkAndWait, @@ -1063,7 +1096,7 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionOpensAppWindow( app_url, base::BindOnce(&ClickLinkAndWait, @@ -1083,7 +1116,7 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlPath); TestTabActionOpensBackgroundTab( app_url, base::BindOnce(&ClickLinkWithModifiersAndWait, @@ -1103,9 +1136,9 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); - const GURL redirecting_url = embedded_test_server()->GetURL( - kLaunchingPageHost, CreateServerRedirect(app_url)); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); + const GURL redirecting_url = + https_server().GetURL(kLaunchingPageHost, CreateServerRedirect(app_url)); TestTabActionOpensAppWindow( app_url, base::BindOnce(&ClickLinkAndWaitForURL, @@ -1125,9 +1158,9 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); - const GURL redirecting_url = embedded_test_server()->GetURL( - kLaunchingPageHost, CreateServerRedirect(app_url)); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); + const GURL redirecting_url = + https_server().GetURL(kLaunchingPageHost, CreateServerRedirect(app_url)); TestTabActionOpensAppWindow( app_url, base::BindOnce(&ClickLinkAndWaitForURL, @@ -1154,9 +1187,9 @@ int num_tabs = browser()->tab_strip_model()->count(); size_t num_browsers = chrome::GetBrowserCount(profile()); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); - const GURL redirecting_url = embedded_test_server()->GetURL( - kLaunchingPageHost, CreateClientRedirect(app_url)); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); + const GURL redirecting_url = + https_server().GetURL(kLaunchingPageHost, CreateClientRedirect(app_url)); ClickLinkAndWaitForURL(browser()->tab_strip_model()->GetActiveWebContents(), redirecting_url, app_url, LinkTarget::SELF, GetParam()); @@ -1191,9 +1224,9 @@ int num_tabs = browser()->tab_strip_model()->count(); size_t num_browsers = chrome::GetBrowserCount(profile()); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); - const GURL redirecting_url = embedded_test_server()->GetURL( - kLaunchingPageHost, CreateClientRedirect(app_url)); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); + const GURL redirecting_url = + https_server().GetURL(kLaunchingPageHost, CreateClientRedirect(app_url)); ClickLinkAndWaitForURL(browser()->tab_strip_model()->GetActiveWebContents(), redirecting_url, app_url, LinkTarget::BLANK, GetParam()); @@ -1225,8 +1258,7 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kInScopeUrlPath); TestTabActionOpensAppWindow( in_scope_url, base::BindOnce(&ClickLinkAndWait, @@ -1247,7 +1279,7 @@ NavigateToLaunchingPage(); const GURL out_of_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kOutOfScopeUrlPath); + https_server().GetURL(kAppUrlHost, kOutOfScopeUrlPath); TestTabActionDoesNotOpenAppWindow( out_of_scope_url, base::BindOnce(&ClickLinkAndWait, @@ -1284,7 +1316,7 @@ ASSERT_TRUE(result); }, browser()->tab_strip_model()->GetActiveWebContents(), - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath))); + https_server().GetURL(kAppUrlHost, kInScopeUrlPath))); ExpectNavigationResultHistogramEquals( global_histogram(), @@ -1312,7 +1344,7 @@ ASSERT_TRUE(result); }, browser()->tab_strip_model()->GetActiveWebContents(), - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath))); + https_server().GetURL(kAppUrlHost, kInScopeUrlPath))); // Fetch requests don't go through our NavigationHandle. ExpectNavigationResultHistogramEquals(global_histogram(), {}); @@ -1325,7 +1357,7 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionOpensBackgroundTab( app_url, base::BindOnce(&ExecuteContextMenuLinkCommandAndWait, @@ -1345,7 +1377,7 @@ InstallTestBookmarkApp(); NavigateToLaunchingPage(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionOpensForegroundWindow( app_url, base::BindOnce(&ExecuteContextMenuLinkCommandAndWait, @@ -1366,7 +1398,7 @@ Browser* app_browser = OpenTestBookmarkApp(); base::HistogramTester scoped_histogram; - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestAppActionOpensForegroundTab( app_browser, app_url, base::BindOnce(&ExecuteContextMenuLinkCommandAndWait, @@ -1392,8 +1424,7 @@ browser()->tab_strip_model()->GetActiveWebContents(); GURL initial_url = initial_tab->GetLastCommittedURL(); - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kInScopeUrlPath); auto observer = GetTestNavigationObserver(in_scope_url); content::ContextMenuParams params; params.page_url = initial_url; @@ -1428,8 +1459,7 @@ Browser* incognito_browser = CreateIncognitoBrowser(); NavigateToLaunchingPage(incognito_browser); - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kInScopeUrlPath); TestActionDoesNotOpenAppWindow( incognito_browser, in_scope_url, base::BindOnce( @@ -1449,13 +1479,12 @@ // Navigate to out-of-scope URL. Shouldn't open a new window. const GURL out_of_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kOutOfScopeUrlPath); + https_server().GetURL(kAppUrlHost, kOutOfScopeUrlPath); NavigateParams params(browser(), out_of_scope_url, ui::PAGE_TRANSITION_TYPED); ASSERT_TRUE(TestTabActionDoesNotOpenAppWindow( out_of_scope_url, base::BindOnce(&NavigateToURLWrapper, ¶ms))); - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionOpensAppWindow( in_scope_url, base::BindOnce(&ClickLinkAndWait, @@ -1477,13 +1506,12 @@ // Navigate to out-of-scope URL. Shouldn't open a new window. const GURL out_of_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kOutOfScopeUrlPath); + https_server().GetURL(kAppUrlHost, kOutOfScopeUrlPath); NavigateParams params(browser(), out_of_scope_url, ui::PAGE_TRANSITION_TYPED); ASSERT_TRUE(TestTabActionDoesNotOpenAppWindow( out_of_scope_url, base::BindOnce(&NavigateToURLWrapper, ¶ms))); - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); TestTabActionOpensAppWindow( in_scope_url, base::BindOnce(&ClickLinkAndWait, @@ -1504,8 +1532,7 @@ NavigateToTestAppURL(); base::HistogramTester scoped_histogram; - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kInScopeUrlPath); TestTabActionDoesNotOpenAppWindow( in_scope_url, base::BindOnce(&ClickLinkAndWait, @@ -1532,8 +1559,7 @@ NavigateToTestAppURL(); // Call window.open() with |target_url|. - const GURL target_url = - embedded_test_server()->GetURL(GetParam(), kAppUrlPath); + const GURL target_url = https_server().GetURL(GetParam(), kAppUrlPath); TestTabActionOpensAppWindowWithOpener( target_url, base::BindOnce(&WindowOpenAndWait, @@ -1555,8 +1581,7 @@ app_browser->tab_strip_model()->GetActiveWebContents(); // Call window.open() with |target_url|. - const GURL target_url = - embedded_test_server()->GetURL(GetParam(), kAppUrlPath); + const GURL target_url = https_server().GetURL(GetParam(), kAppUrlPath); TestAppActionOpensAppWindowWithOpener( app_browser, target_url, base::BindOnce(&WindowOpenAndWait, app_web_contents, target_url)); @@ -1579,12 +1604,12 @@ content::WebContents* current_tab = browser()->tab_strip_model()->GetActiveWebContents(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); EXPECT_EQ(WindowAccessResult::CAN_ACCESS, CanChildWindowAccessOpener(current_tab, app_url)); const GURL other_app_url = - embedded_test_server()->GetURL(kOtherAppUrlHost, kAppUrlPath); + https_server().GetURL(kOtherAppUrlHost, kAppUrlPath); EXPECT_EQ(WindowAccessResult::CANNOT_ACCESS, CanChildWindowAccessOpener(current_tab, other_app_url)); } @@ -1601,12 +1626,12 @@ content::WebContents* app_web_contents = app_browser->tab_strip_model()->GetActiveWebContents(); - const GURL app_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + const GURL app_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); EXPECT_EQ(WindowAccessResult::CAN_ACCESS, CanChildWindowAccessOpener(app_web_contents, app_url)); const GURL other_app_url = - embedded_test_server()->GetURL(kOtherAppUrlHost, kAppUrlPath); + https_server().GetURL(kOtherAppUrlHost, kAppUrlPath); EXPECT_EQ(WindowAccessResult::CANNOT_ACCESS, CanChildWindowAccessOpener(app_web_contents, other_app_url)); } @@ -1627,7 +1652,7 @@ const GURL app_url = AppLaunchInfo::GetFullLaunchURL(app); NavigateParams params(browser(), app_url, ui::PAGE_TRANSITION_AUTO_BOOKMARK); TestTabActionDoesNotOpenAppWindow( - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath), + https_server().GetURL(kAppUrlHost, kInScopeUrlPath), base::BindOnce(&NavigateToURLWrapper, ¶ms)); // The first AUTO_BOOKMARK navigation is the one we triggered and the second @@ -1795,7 +1820,7 @@ if (start_url_path == kLaunchingPagePath) start_url = GetLaunchingPageURL(); else - start_url = embedded_test_server()->GetURL(kAppUrlHost, kAppUrlPath); + start_url = https_server().GetURL(kAppUrlHost, kAppUrlPath); NavigateParams params(current_browser, start_url, ui::PAGE_TRANSITION_TYPED); @@ -1808,8 +1833,7 @@ } // If the submit method is GET then add an query params. - GURL target_url = - embedded_test_server()->GetURL(kAppUrlHost, target_url_path); + GURL target_url = https_server().GetURL(kAppUrlHost, target_url_path); if (request_type == net::URLFetcher::RequestType::GET) { target_url = AddTestQueryParam(target_url); } @@ -1906,8 +1930,7 @@ size_t num_browsers = chrome::GetBrowserCount(profile()); base::HistogramTester scoped_histogram; - const GURL in_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kInScopeUrlPath); + const GURL in_scope_url = https_server().GetURL(kAppUrlHost, kInScopeUrlPath); ClickLinkAndWait(app_web_contents, in_scope_url, LinkTarget::SELF, std::get<1>(GetParam())); @@ -1933,7 +1956,7 @@ const base::HistogramTester scoped_histogram; const GURL out_of_scope_url = - embedded_test_server()->GetURL(kAppUrlHost, kOutOfScopeUrlPath); + https_server().GetURL(kAppUrlHost, kOutOfScopeUrlPath); TestAppActionOpensForegroundTab( app_browser, out_of_scope_url, base::BindOnce(&ClickLinkAndWait,
diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index a2b8d70c..421bb87 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h
@@ -34,10 +34,10 @@ #include "extensions/browser/install_flag.h" #include "extensions/browser/process_manager.h" #include "extensions/browser/uninstall_reason.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" #include "extensions/common/manifest.h" -#include "extensions/features/features.h" #if !BUILDFLAG(ENABLE_EXTENSIONS) #error "Extensions must be enabled"
diff --git a/chrome/browser/extensions/extension_tabs_apitest.cc b/chrome/browser/extensions/extension_tabs_apitest.cc index fc730b01..36c8b46 100644 --- a/chrome/browser/extensions/extension_tabs_apitest.cc +++ b/chrome/browser/extensions/extension_tabs_apitest.cc
@@ -231,7 +231,13 @@ ASSERT_TRUE(RunExtensionTest("tabs/host_permission")) << message_; } -IN_PROC_BROWSER_TEST_F(ExtensionApiTabTest, UpdateWindowResize) { +// Flaky on Windows and Linux. http://crbug.com/820110. +#if defined(OS_WIN) || defined(OS_LINUX) +#define MAYBE_UpdateWindowResize DISABLED_UpdateWindowResize +#else +#define MAYBE_UpdateWindowResize UpdateWindowResize +#endif +IN_PROC_BROWSER_TEST_F(ExtensionApiTabTest, MAYBE_UpdateWindowResize) { ASSERT_TRUE(RunExtensionTest("window_update/resize")) << message_; }
diff --git a/chrome/browser/extensions/extension_view.h b/chrome/browser/extensions/extension_view.h index dfccc94..9018f5c 100644 --- a/chrome/browser/extensions/extension_view.h +++ b/chrome/browser/extensions/extension_view.h
@@ -47,7 +47,7 @@ const content::NativeWebKeyboardEvent& event) = 0; // Method for the ExtensionHost to notify that the extension page has loaded. - virtual void DidStopLoading() = 0; + virtual void OnLoaded() = 0; }; } // namespace extensions
diff --git a/chrome/browser/extensions/extension_view_host.cc b/chrome/browser/extensions/extension_view_host.cc index 1fbf673..b7e5e1b 100644 --- a/chrome/browser/extensions/extension_view_host.cc +++ b/chrome/browser/extensions/extension_view_host.cc
@@ -114,7 +114,7 @@ // ExtensionHost overrides: void ExtensionViewHost::OnDidStopFirstLoad() { - view_->DidStopLoading(); + view_->OnLoaded(); } void ExtensionViewHost::LoadInitialURL() {
diff --git a/chrome/browser/favicon/content_favicon_driver_browsertest.cc b/chrome/browser/favicon/content_favicon_driver_browsertest.cc index ee935355..b661c55 100644 --- a/chrome/browser/favicon/content_favicon_driver_browsertest.cc +++ b/chrome/browser/favicon/content_favicon_driver_browsertest.cc
@@ -4,6 +4,8 @@ #include "components/favicon/content/content_favicon_driver.h" +#include <set> + #include "base/command_line.h" #include "base/location.h" #include "base/macros.h" @@ -27,10 +29,9 @@ #include "components/favicon/core/favicon_service.h" #include "components/network_session_configurator/common/network_switches.h" #include "content/public/browser/navigation_handle.h" -#include "content/public/browser/resource_dispatcher_host.h" -#include "content/public/browser/resource_dispatcher_host_delegate.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/test/browser_test_utils.h" +#include "content/public/test/url_loader_interceptor.h" #include "net/base/load_flags.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" @@ -46,46 +47,41 @@ using testing::ElementsAre; -// Tracks whether the URL passed to the constructor is requested and whether -// the request bypasses the cache. -class TestResourceDispatcherHostDelegate - : public content::ResourceDispatcherHostDelegate { +// Tracks which URLs are loaded and whether the requests bypass the cache. +class TestURLLoaderInterceptor { public: - explicit TestResourceDispatcherHostDelegate(const GURL& url) - : url_(url), was_requested_(false), bypassed_cache_(false) {} - ~TestResourceDispatcherHostDelegate() override {} + TestURLLoaderInterceptor() + : interceptor_( + base::BindRepeating(&TestURLLoaderInterceptor::InterceptURLRequest, + base::Unretained(this))) {} + + bool was_loaded(const GURL& url) const { + return intercepted_urls_.find(url) != intercepted_urls_.end(); + } + + bool did_bypass_cache(const GURL& url) const { + return bypass_cache_urls_.find(url) != bypass_cache_urls_.end(); + } void Reset() { - was_requested_ = false; - bypassed_cache_ = false; - } - - // Resturns whether |url_| was requested. - bool was_requested() const { return was_requested_; } - - // Returns whether any of the requests bypassed the HTTP cache. - bool bypassed_cache() const { return bypassed_cache_; } - - private: - void RequestBeginning(net::URLRequest* request, - content::ResourceContext* resource_context, - content::AppCacheService* appcache_service, - content::ResourceType resource_type, - std::vector<std::unique_ptr<content::ResourceThrottle>>* - throttles) override { - if (request->url() == url_) { - was_requested_ = true; - if (request->load_flags() & net::LOAD_BYPASS_CACHE) - bypassed_cache_ = true; - } + intercepted_urls_.clear(); + bypass_cache_urls_.clear(); } private: - GURL url_; - bool was_requested_; - bool bypassed_cache_; + bool InterceptURLRequest( + content::URLLoaderInterceptor::RequestParams* params) { + intercepted_urls_.insert(params->url_request.url); + if (params->url_request.load_flags & net::LOAD_BYPASS_CACHE) + bypass_cache_urls_.insert(params->url_request.url); + return false; + } - DISALLOW_COPY_AND_ASSIGN(TestResourceDispatcherHostDelegate); + std::set<GURL> intercepted_urls_; + std::set<GURL> bypass_cache_urls_; + content::URLLoaderInterceptor interceptor_; + + DISALLOW_COPY_AND_ASSIGN(TestURLLoaderInterceptor); }; // Waits for the following the finish: @@ -261,10 +257,7 @@ GURL url = embedded_test_server()->GetURL("/favicon/page_with_favicon.html"); GURL icon_url = embedded_test_server()->GetURL("/favicon/icon.png"); - std::unique_ptr<TestResourceDispatcherHostDelegate> delegate( - new TestResourceDispatcherHostDelegate(icon_url)); - content::ResourceDispatcherHost::Get()->SetDelegate(delegate.get()); - + TestURLLoaderInterceptor url_loader_interceptor; // Initial visit in order to populate the cache. { PendingTaskWaiter waiter(web_contents()); @@ -273,9 +266,9 @@ ui_test_utils::BROWSER_TEST_NONE); waiter.Wait(); } - ASSERT_TRUE(delegate->was_requested()); - EXPECT_FALSE(delegate->bypassed_cache()); - delegate->Reset(); + ASSERT_TRUE(url_loader_interceptor.was_loaded(icon_url)); + EXPECT_FALSE(url_loader_interceptor.did_bypass_cache(icon_url)); + url_loader_interceptor.Reset(); ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); @@ -288,8 +281,8 @@ ui_test_utils::BROWSER_TEST_NONE); waiter.Wait(); } - EXPECT_FALSE(delegate->bypassed_cache()); - delegate->Reset(); + EXPECT_FALSE(url_loader_interceptor.did_bypass_cache(icon_url)); + url_loader_interceptor.Reset(); // A reload ignoring the cache should refetch the favicon from the website. { @@ -297,8 +290,8 @@ chrome::ExecuteCommand(browser(), IDC_RELOAD_BYPASSING_CACHE); waiter.Wait(); } - ASSERT_TRUE(delegate->was_requested()); - EXPECT_TRUE(delegate->bypassed_cache()); + ASSERT_TRUE(url_loader_interceptor.was_loaded(icon_url)); + EXPECT_TRUE(url_loader_interceptor.did_bypass_cache(icon_url)); } // Test that favicon mappings are removed if the page initially lists a favicon @@ -393,9 +386,7 @@ GURL url = embedded_test_server()->GetURL("/favicon/page_with_manifest.html"); GURL icon_url = embedded_test_server()->GetURL("/favicon/icon.png"); - std::unique_ptr<TestResourceDispatcherHostDelegate> delegate( - new TestResourceDispatcherHostDelegate(icon_url)); - content::ResourceDispatcherHost::Get()->SetDelegate(delegate.get()); + TestURLLoaderInterceptor url_loader_interceptor; PendingTaskWaiter waiter(web_contents()); ui_test_utils::NavigateToURLWithDisposition( @@ -404,12 +395,12 @@ waiter.Wait(); #if defined(OS_ANDROID) - EXPECT_TRUE(delegate->was_requested()); + EXPECT_TRUE(url_loader_interceptor.was_loaded(icon_url)); EXPECT_NE(nullptr, GetFaviconForPageURL(url, favicon_base::IconType::kWebManifestIcon) .bitmap_data); #else - EXPECT_FALSE(delegate->was_requested()); + EXPECT_FALSE(url_loader_interceptor.was_loaded(icon_url)); #endif } @@ -707,9 +698,7 @@ web_contents()->SetDelegate(&console_observer); // Observe if the favicon URL is requested. - std::unique_ptr<TestResourceDispatcherHostDelegate> delegate( - new TestResourceDispatcherHostDelegate(favicon_url)); - content::ResourceDispatcherHost::Get()->SetDelegate(delegate.get()); + TestURLLoaderInterceptor url_interceptor; PendingTaskWaiter waiter(web_contents()); ui_test_utils::NavigateToURL(browser(), favicon_page); @@ -720,7 +709,7 @@ base::MatchPattern(console_observer.message(), "*insecure favicon*")); EXPECT_TRUE(base::MatchPattern(console_observer.message(), "*request has been blocked*")); - EXPECT_FALSE(delegate->was_requested()); + EXPECT_FALSE(url_interceptor.was_loaded(favicon_url)); } // Checks that a favicon loaded over HTTPS is allowed on a secure page. @@ -737,13 +726,11 @@ "/favicon/page_with_favicon_by_url.html?url=" + favicon_url.spec()); // Observe if the favicon URL is requested. - std::unique_ptr<TestResourceDispatcherHostDelegate> delegate( - new TestResourceDispatcherHostDelegate(favicon_url)); - content::ResourceDispatcherHost::Get()->SetDelegate(delegate.get()); + TestURLLoaderInterceptor url_interceptor; PendingTaskWaiter waiter(web_contents()); ui_test_utils::NavigateToURL(browser(), favicon_page); waiter.Wait(); - EXPECT_TRUE(delegate->was_requested()); + EXPECT_TRUE(url_interceptor.was_loaded(favicon_url)); }
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index cf64a675..64c57a5 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -11,7 +11,7 @@ #include "build/buildflag.h" #include "chrome/common/buildflags.h" #include "components/nacl/common/buildflags.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #include "media/media_features.h" // This file declares strings used in chrome://flags. These messages are not
diff --git a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc index 2d8f3e1..cecf90c 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/geolocation/geolocation_permission_context_extensions.h" #include "base/callback.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/permissions/permission_request_id.h"
diff --git a/chrome/browser/geolocation/geolocation_permission_context_extensions.h b/chrome/browser/geolocation/geolocation_permission_context_extensions.h index e0a15a7..bf96695 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_extensions.h +++ b/chrome/browser/geolocation/geolocation_permission_context_extensions.h
@@ -8,7 +8,7 @@ #include "base/callback_forward.h" #include "base/macros.h" #include "components/content_settings/core/common/content_settings.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" namespace content { class WebContents;
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc index 44e074b..711c7949 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -52,7 +52,7 @@ #include "content/public/test/test_renderer_host.h" #include "content/public/test/test_utils.h" #include "content/public/test/web_contents_tester.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_ANDROID)
diff --git a/chrome/browser/history/profile_based_browsing_history_driver.cc b/chrome/browser/history/profile_based_browsing_history_driver.cc index 161a7cb..e92b72ef 100644 --- a/chrome/browser/history/profile_based_browsing_history_driver.cc +++ b/chrome/browser/history/profile_based_browsing_history_driver.cc
@@ -13,7 +13,7 @@ #include "chrome/common/pref_names.h" #include "components/browsing_data/core/history_notice_utils.h" #include "components/prefs/pref_service.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/activity_log/activity_log.h"
diff --git a/chrome/browser/interstitials/chrome_metrics_helper.cc b/chrome/browser/interstitials/chrome_metrics_helper.cc index f5d1333..41585e9b 100644 --- a/chrome/browser/interstitials/chrome_metrics_helper.cc +++ b/chrome/browser/interstitials/chrome_metrics_helper.cc
@@ -10,7 +10,7 @@ #include "chrome/common/buildflags.h" #include "components/history/core/browser/history_service.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_CAPTIVE_PORTAL_DETECTION) #include "chrome/browser/ssl/captive_portal_metrics_recorder.h"
diff --git a/chrome/browser/interstitials/chrome_metrics_helper.h b/chrome/browser/interstitials/chrome_metrics_helper.h index 58a9355..caed2b8 100644 --- a/chrome/browser/interstitials/chrome_metrics_helper.h +++ b/chrome/browser/interstitials/chrome_metrics_helper.h
@@ -10,7 +10,7 @@ #include "base/macros.h" #include "chrome/common/buildflags.h" #include "components/security_interstitials/core/metrics_helper.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/gurl.h" namespace content {
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 9681e1a..e056fc9 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc
@@ -64,7 +64,7 @@ #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/user_agent.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/cert/caching_cert_verifier.h" #include "net/cert/cert_verifier.h" #include "net/cert/cert_verify_proc.h"
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index 686caa6..05be580 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h
@@ -29,7 +29,7 @@ #include "components/ssl_config/ssl_config_service_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread_delegate.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/network_change_notifier.h" #include "net/nqe/network_quality_estimator.h" #include "services/network/public/mojom/network_service.mojom.h"
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc index 15b11d2..c81c6ea 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -82,7 +82,7 @@ #include "content/public/common/browser_side_navigation_policy.h" #include "content/public/common/content_features.h" #include "content/public/common/previews_state.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/host_port_pair.h" #include "net/base/ip_endpoint.h" #include "net/base/load_flags.h"
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h index 0220979d..7fc0506 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h
@@ -16,7 +16,7 @@ #include "chrome/browser/external_protocol/external_protocol_handler.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" #include "content/public/common/previews_state.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" class DownloadRequestLimiter;
diff --git a/chrome/browser/media/android/router/media_router_dialog_controller_android.cc b/chrome/browser/media/android/router/media_router_dialog_controller_android.cc index 9d0db80a..bca7a62 100644 --- a/chrome/browser/media/android/router/media_router_dialog_controller_android.cc +++ b/chrome/browser/media/android/router/media_router_dialog_controller_android.cc
@@ -21,7 +21,7 @@ #include "content/public/browser/presentation_request.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #include "jni/ChromeMediaRouterDialogController_jni.h" DEFINE_WEB_CONTENTS_USER_DATA_KEY(
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc index 3cbaf94c..20f1aa5 100644 --- a/chrome/browser/media/encrypted_media_browsertest.cc +++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -385,6 +385,17 @@ expected_title); } +#if BUILDFLAG(USE_PROPRIETARY_CODECS) + void TestMP4EncryptionPlayback(const std::string& key_system, + const std::string& media_file, + const std::string& expected_title) { + // MP4 playback is only supported with MSE. + RunEncryptedMediaTest(kDefaultEmePlayer, media_file, kMP4VideoOnly, + key_system, SrcType::MSE, kNoSessionToLoad, false, + PlayCount::ONCE, expected_title); + } +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) + protected: void SetUpCommandLine(base::CommandLine* command_line) override { EncryptedMediaTestBase::SetUpCommandLine(command_line); @@ -653,6 +664,15 @@ TestSimplePlayback("bear-640x360-v_frag-cenc.mp4", kMP4VideoOnly); } +IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_MDAT) { + // MP4 without MSE is not support yet, http://crbug.com/170793. + if (CurrentSourceType() != SrcType::MSE) { + DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; + return; + } + TestSimplePlayback("bear-640x360-v_frag-cenc-mdat.mp4", kMP4VideoOnly); +} + IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_VideoOnly_MP4_VP9) { // MP4 without MSE is not support yet, http://crbug.com/170793. if (CurrentSourceType() != SrcType::MSE) { @@ -827,4 +847,32 @@ EXPECT_EQ(3, num_received_message_types); } +#if BUILDFLAG(USE_PROPRIETARY_CODECS) +// ClearKey key system is covered in +// content/browser/media/encrypted_media_browsertest.cc. +IN_PROC_BROWSER_TEST_F(EncryptedMediaTestExperimentalCdmInterface, + Playback_Encryption_CENC) { + TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cenc.mp4", media::kEnded); +} + +IN_PROC_BROWSER_TEST_F(EncryptedMediaTestExperimentalCdmInterface, + Playback_Encryption_CBC1) { + TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cbc1.mp4", media::kError); +} + +IN_PROC_BROWSER_TEST_F(EncryptedMediaTestExperimentalCdmInterface, + Playback_Encryption_CENS) { + TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cens.mp4", media::kError); +} + +IN_PROC_BROWSER_TEST_F(EncryptedMediaTestExperimentalCdmInterface, + Playback_Encryption_CBCS) { + TestMP4EncryptionPlayback(kExternalClearKeyKeySystem, + "bear-640x360-v_frag-cbcs.mp4", media::kError); +} +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) + #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
diff --git a/chrome/browser/media/router/BUILD.gn b/chrome/browser/media/router/BUILD.gn index 49814a8..47b12f0c 100644 --- a/chrome/browser/media/router/BUILD.gn +++ b/chrome/browser/media/router/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. # -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//testing/test.gni") static_library("router") { @@ -93,6 +93,8 @@ "providers/cast/cast_app_discovery_service.h", "providers/cast/cast_media_route_provider.cc", "providers/cast/cast_media_route_provider.h", + "providers/cast/cast_media_route_provider_metrics.cc", + "providers/cast/cast_media_route_provider_metrics.h", "providers/cast/chrome_cast_message_handler.cc", "providers/cast/chrome_cast_message_handler.h", "providers/cast/dual_media_sink_service.cc",
diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc index f878f43..0e8fe7dc 100644 --- a/chrome/browser/media/router/media_router_feature.cc +++ b/chrome/browser/media/router/media_router_feature.cc
@@ -8,7 +8,7 @@ #include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "content/public/browser/browser_context.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/ui_features.h" #if defined(OS_ANDROID) || BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc b/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc index f4e3277..b9493f4 100644 --- a/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc +++ b/chrome/browser/media/router/providers/cast/cast_app_discovery_service.cc
@@ -4,6 +4,7 @@ #include "chrome/browser/media/router/providers/cast/cast_app_discovery_service.h" +#include "chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h" #include "components/cast_channel/cast_message_handler.h" #include "components/cast_channel/cast_socket.h" #include "components/cast_channel/cast_socket_service.h" @@ -109,14 +110,17 @@ message_handler_->RequestAppAvailability( socket, app_id, base::BindOnce(&CastAppDiscoveryService::UpdateAppAvailability, - weak_ptr_factory_.GetWeakPtr(), sink_id)); + weak_ptr_factory_.GetWeakPtr(), base::TimeTicks::Now(), + sink_id)); } void CastAppDiscoveryService::UpdateAppAvailability( + base::TimeTicks start_time, const MediaSink::Id& sink_id, const std::string& app_id, cast_channel::GetAppAvailabilityResult result) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + RecordAppAvailabilityResult(result, base::TimeTicks::Now() - start_time); if (!base::ContainsKey(sinks_, sink_id)) return;
diff --git a/chrome/browser/media/router/providers/cast/cast_app_discovery_service.h b/chrome/browser/media/router/providers/cast/cast_app_discovery_service.h index 3a4c3934..4348e8f 100644 --- a/chrome/browser/media/router/providers/cast/cast_app_discovery_service.h +++ b/chrome/browser/media/router/providers/cast/cast_app_discovery_service.h
@@ -15,6 +15,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/sequenced_task_runner.h" +#include "base/time/time.h" #include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h" #include "chrome/browser/media/router/providers/cast/cast_app_availability_tracker.h" #include "chrome/common/media_router/media_sink.h" @@ -68,7 +69,10 @@ // Updates the availability result for |sink_id| and |app_id| with |result|, // and notifies callbacks with updated sink query results. - void UpdateAppAvailability(const MediaSink::Id& sink_id, + // |start_time| is the time when the app availability request was made, and + // is used for metrics. + void UpdateAppAvailability(base::TimeTicks start_time, + const MediaSink::Id& sink_id, const std::string& app_id, cast_channel::GetAppAvailabilityResult result);
diff --git a/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.cc b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.cc new file mode 100644 index 0000000..8920e653 --- /dev/null +++ b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.cc
@@ -0,0 +1,20 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h" + +#include "base/metrics/histogram_macros.h" +#include "base/time/time.h" + +namespace media_router { + +void RecordAppAvailabilityResult(cast_channel::GetAppAvailabilityResult result, + base::TimeDelta duration) { + if (result == cast_channel::GetAppAvailabilityResult::kUnknown) + UMA_HISTOGRAM_TIMES(kHistogramAppAvailabilityFailure, duration); + else + UMA_HISTOGRAM_TIMES(kHistogramAppAvailabilitySuccess, duration); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h new file mode 100644 index 0000000..14c121f --- /dev/null +++ b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h
@@ -0,0 +1,27 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_CAST_CAST_MEDIA_ROUTE_PROVIDER_METRICS_H_ +#define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_CAST_CAST_MEDIA_ROUTE_PROVIDER_METRICS_H_ + +#include "base/time/time.h" +#include "components/cast_channel/cast_message_util.h" + +namespace media_router { + +// Histogram names for app availability. +static constexpr char kHistogramAppAvailabilitySuccess[] = + "MediaRouter.Cast.App.Availability.Success"; +static constexpr char kHistogramAppAvailabilityFailure[] = + "MediaRouter.Cast.App.Availability.Failure"; + +// Records the result of an app availability request and how long it took. +// If |result| is kUnknown, then a failure is recorded. Otherwise, a success +// is recorded. +void RecordAppAvailabilityResult(cast_channel::GetAppAvailabilityResult result, + base::TimeDelta duration); + +} // namespace media_router + +#endif // CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_CAST_CAST_MEDIA_ROUTE_PROVIDER_METRICS_H_
diff --git a/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics_unittest.cc b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics_unittest.cc new file mode 100644 index 0000000..cb7f58c --- /dev/null +++ b/chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics_unittest.cc
@@ -0,0 +1,35 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/media/router/providers/cast/cast_media_route_provider_metrics.h" +#include "base/test/histogram_tester.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using base::Bucket; +using testing::ElementsAre; + +namespace media_router { + +TEST(CastMediaRouteProviderMetricsTest, RecordAppAvailabilityResult) { + base::HistogramTester tester; + + RecordAppAvailabilityResult( + cast_channel::GetAppAvailabilityResult::kAvailable, + base::TimeDelta::FromMilliseconds(111)); + RecordAppAvailabilityResult( + cast_channel::GetAppAvailabilityResult::kUnavailable, + base::TimeDelta::FromMilliseconds(222)); + tester.ExpectTimeBucketCount(kHistogramAppAvailabilitySuccess, + base::TimeDelta::FromMilliseconds(111), 1); + tester.ExpectTimeBucketCount(kHistogramAppAvailabilitySuccess, + base::TimeDelta::FromMilliseconds(222), 1); + + RecordAppAvailabilityResult(cast_channel::GetAppAvailabilityResult::kUnknown, + base::TimeDelta::FromMilliseconds(333)); + tester.ExpectTimeBucketCount(kHistogramAppAvailabilityFailure, + base::TimeDelta::FromMilliseconds(333), 1); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/test/test_helper.cc b/chrome/browser/media/router/test/test_helper.cc index b6262dfb..bff368d2 100644 --- a/chrome/browser/media/router/test/test_helper.cc +++ b/chrome/browser/media/router/test/test_helper.cc
@@ -8,8 +8,11 @@ #include "base/json/string_escape.h" #include "base/strings/stringprintf.h" #include "chrome/common/media_router/media_source.h" + +#if !defined(OS_ANDROID) #include "services/network/public/cpp/simple_url_loader.h" #include "url/gurl.h" +#endif namespace media_router { @@ -72,7 +75,6 @@ base::BindOnce(&DialURLFetcher::ProcessResponse, base::Unretained(this)), 256 * 1024); } -#endif // !defined(OS_ANDROID) net::IPEndPoint CreateIPEndPoint(int num) { net::IPAddress ip_address; @@ -112,4 +114,6 @@ return MediaSinkInternal(sink, extra_data); } +#endif // !defined(OS_ANDROID) + } // namespace media_router
diff --git a/chrome/browser/media/router/test/test_helper.h b/chrome/browser/media/router/test/test_helper.h index 3eb45ae..9b0ed735 100644 --- a/chrome/browser/media/router/test/test_helper.h +++ b/chrome/browser/media/router/test/test_helper.h
@@ -13,10 +13,6 @@ #include "base/macros.h" #include "build/build_config.h" -#include "chrome/browser/media/router/discovery/dial/dial_media_sink_service.h" -#include "chrome/browser/media/router/discovery/dial/dial_url_fetcher.h" -#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" -#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h" #include "chrome/browser/media/router/issue_manager.h" #include "chrome/browser/media/router/issues_observer.h" #include "chrome/browser/media/router/media_routes_observer.h" @@ -24,9 +20,16 @@ #include "chrome/common/media_router/discovery/media_sink_internal.h" #include "content/public/browser/presentation_service_delegate.h" #include "content/public/common/presentation_connection_message.h" +#include "testing/gmock/include/gmock/gmock.h" + +#if !defined(OS_ANDROID) +#include "chrome/browser/media/router/discovery/dial/dial_media_sink_service.h" +#include "chrome/browser/media/router/discovery/dial/dial_url_fetcher.h" +#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service.h" +#include "chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl.h" #include "net/base/ip_endpoint.h" #include "services/network/test/test_url_loader_factory.h" -#include "testing/gmock/include/gmock/gmock.h" +#endif // !defined(OS_ANDROID) namespace media_router { @@ -149,7 +152,6 @@ private: network::TestURLLoaderFactory* const factory_; }; -#endif // !defined(OS_ANDROID) // Helper function to create an IP endpoint object. // If |num| is 1, returns 192.168.0.101:8009; @@ -172,6 +174,8 @@ // Helper function to create a Cast sink. MediaSinkInternal CreateCastSink(int num); +#endif // !defined(OS_ANDROID) + } // namespace media_router #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_TEST_HELPER_H_
diff --git a/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc b/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc index a1ffdf2..bd7b39b 100644 --- a/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc +++ b/chrome/browser/media/webrtc/media_capture_devices_dispatcher.cc
@@ -30,8 +30,8 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/media_stream_request.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "media/base/media_switches.h" #if defined(OS_CHROMEOS)
diff --git a/chrome/browser/media/webrtc/media_stream_capture_indicator.cc b/chrome/browser/media/webrtc/media_stream_capture_indicator.cc index d2bb760..23c9c37b 100644 --- a/chrome/browser/media/webrtc/media_stream_capture_indicator.cc +++ b/chrome/browser/media/webrtc/media_stream_capture_indicator.cc
@@ -24,7 +24,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/gfx/image/image_skia.h" #if !defined(OS_ANDROID)
diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index 5ef6e729..a2648df 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc
@@ -31,7 +31,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/bindings_policy.h" #include "content/public/common/content_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/l10n/l10n_util.h" #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc index a78dfe6c9..77927b77 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -110,8 +110,8 @@ #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/metrics/extensions_metrics_provider.h" #include "extensions/browser/extension_registry.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension.h" -#include "extensions/features/features.h" #endif #if BUILDFLAG(ENABLE_PLUGINS)
diff --git a/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc b/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc index afcdad13..04d4d6d6 100644 --- a/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc +++ b/chrome/browser/metrics/chrome_metrics_service_client_unittest.cc
@@ -12,7 +12,7 @@ #include "chrome/test/base/testing_profile_manager.h" #include "components/metrics/file_metrics_provider.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider.cc b/chrome/browser/metrics/chrome_stability_metrics_provider.cc index 8b662d7c..20a853b 100644 --- a/chrome/browser/metrics/chrome_stability_metrics_provider.cc +++ b/chrome/browser/metrics/chrome_stability_metrics_provider.cc
@@ -16,7 +16,7 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/render_process_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/features/features.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc b/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc index 09d8da5..3712151 100644 --- a/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc +++ b/chrome/browser/metrics/chrome_stability_metrics_provider_unittest.cc
@@ -23,7 +23,7 @@ #include "content/public/common/process_type.h" #include "content/public/test/mock_render_process_host.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/metrics_proto/system_profile.pb.h"
diff --git a/chrome/browser/metrics/field_trial_synchronizer.cc b/chrome/browser/metrics/field_trial_synchronizer.cc index 4961249d0..34fb2b2 100644 --- a/chrome/browser/metrics/field_trial_synchronizer.cc +++ b/chrome/browser/metrics/field_trial_synchronizer.cc
@@ -9,28 +9,15 @@ #include "base/threading/thread.h" #include "chrome/common/renderer_configuration.mojom.h" #include "components/metrics/persistent_system_profile.h" -#include "components/variations/variations_util.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_process_host.h" using content::BrowserThread; -namespace { - -// This singleton instance should be constructed during the single threaded -// portion of main(). It initializes globals to provide support for all future -// calls. This object is created on the UI thread, and it is destroyed after -// all the other threads have gone away. -FieldTrialSynchronizer* g_field_trial_synchronizer = NULL; - -} // namespace - FieldTrialSynchronizer::FieldTrialSynchronizer() { - DCHECK(g_field_trial_synchronizer == NULL); - g_field_trial_synchronizer = this; - base::FieldTrialList::AddObserver(this); - - variations::SetVariationListCrashKeys(); + bool success = base::FieldTrialList::AddObserver(this); + // Ensure the observer was actually registered. + DCHECK(success); } void FieldTrialSynchronizer::NotifyAllRenderers( @@ -65,10 +52,8 @@ BrowserThread::UI, FROM_HERE, base::BindOnce(&FieldTrialSynchronizer::NotifyAllRenderers, this, field_trial_name, group_name)); - variations::SetVariationListCrashKeys(); } FieldTrialSynchronizer::~FieldTrialSynchronizer() { base::FieldTrialList::RemoveObserver(this); - g_field_trial_synchronizer = NULL; }
diff --git a/chrome/browser/metrics/oom/out_of_memory_reporter_unittest.cc b/chrome/browser/metrics/oom/out_of_memory_reporter_unittest.cc index 474acb5..ee0c4d27 100644 --- a/chrome/browser/metrics/oom/out_of_memory_reporter_unittest.cc +++ b/chrome/browser/metrics/oom/out_of_memory_reporter_unittest.cc
@@ -27,6 +27,7 @@ #include "content/public/test/mock_render_process_host.h" #include "content/public/test/navigation_simulator.h" #include "content/public/test/test_renderer_host.h" +#include "content/public/test/test_utils.h" #include "net/base/net_errors.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "testing/gtest/include/gtest/gtest.h" @@ -42,28 +43,33 @@ #if defined(OS_ANDROID) // This class listens for notifications that crash dumps have been processed. // Notifications will come from all crashes, even if an associated crash dump -// was not created. On destruction, waits for a crash dump message. +// was not created. class CrashDumpWaiter : public breakpad::CrashDumpManager::Observer { public: CrashDumpWaiter() { breakpad::CrashDumpManager::GetInstance()->AddObserver(this); } ~CrashDumpWaiter() { - base::RunLoop run_loop; - wait_closure_ = run_loop.QuitClosure(); - run_loop.Run(); breakpad::CrashDumpManager::GetInstance()->RemoveObserver(this); } + // Waits for the crash dump notification and returns whether the crash was + // considered a foreground oom. + bool Wait() { + waiter_.Run(); + return last_crash_was_oom_.value(); + } + private: // CrashDumpManager::Observer: void OnCrashDumpProcessed( const breakpad::CrashDumpManager::CrashDumpDetails& details) override { - if (!wait_closure_.is_null()) - std::move(wait_closure_).Run(); + last_crash_was_oom_ = breakpad::CrashDumpManager::IsForegroundOom(details); + waiter_.Quit(); } - base::OnceClosure wait_closure_; + base::RunLoop waiter_; + base::Optional<bool> last_crash_was_oom_; DISALLOW_COPY_AND_ASSIGN(CrashDumpWaiter); }; #endif // defined(OS_ANDROID) @@ -111,8 +117,6 @@ void OnForegroundOOMDetected(const GURL& url, ukm::SourceId source_id) override { last_oom_url_ = url; - if (!oom_closure_.is_null()) - std::move(oom_closure_).Run(); } void SimulateOOM() { @@ -128,27 +132,31 @@ #endif } - void RunClosureAndWaitForNotification(base::OnceClosure closure) { + // Runs a closure which should simulate some sort of crash, and waits until + // the OutOfMemoryReporter *should* have received a notification for it. + void RunCrashClosureAndWait(base::OnceClosure crash_closure, + bool expect_oom) { #if defined(OS_ANDROID) - { - CrashDumpWaiter crash_waiter; - std::move(closure).Run(); - } + CrashDumpWaiter crash_waiter; + std::move(crash_closure).Run(); + bool was_oom = crash_waiter.Wait(); + EXPECT_EQ(expect_oom, was_oom); + // Since the observer list is not ordered, it isn't guaranteed that the - // OutOfMemoryReporter will be notified at this point. However, we do know - // the task to notify the reporter will be posted, so just pump the run loop - // here. - base::RunLoop().RunUntilIdle(); + // OutOfMemoryReporter will be notified at this point. Flush the current + // message loop and task scheduler of tasks. + content::RunAllTasksUntilIdle(); #else // No need to wait on non-android platforms. The message will be // synchronous. - std::move(closure).Run(); + std::move(crash_closure).Run(); #endif } void SimulateOOMAndWait() { - RunClosureAndWaitForNotification(base::BindOnce( - &OutOfMemoryReporterTest::SimulateOOM, base::Unretained(this))); + RunCrashClosureAndWait(base::BindOnce(&OutOfMemoryReporterTest::SimulateOOM, + base::Unretained(this)), + true /* expect_oom */); } void CheckUkmMetricRecorded(const GURL& url, int64_t time_delta) { @@ -167,7 +175,6 @@ base::ShadowingAtExitManager at_exit_; base::Optional<GURL> last_oom_url_; - base::OnceClosure oom_closure_; std::unique_ptr<ukm::TestAutoSetUkmRecorder> test_ukm_recorder_; private: @@ -176,17 +183,12 @@ DISALLOW_COPY_AND_ASSIGN(OutOfMemoryReporterTest); }; -// Flaky on Android: http://crbug.com/819592 -#if defined(OS_ANDROID) -#define MAYBE_SimpleOOM DISABLED_SimpleOOM -#else -#define MAYBE_SimpleOOM SimpleOOM -#endif -TEST_F(OutOfMemoryReporterTest, MAYBE_SimpleOOM) { +TEST_F(OutOfMemoryReporterTest, SimpleOOM) { const GURL url("https://example.test/"); NavigateAndCommit(url); SimulateOOMAndWait(); + EXPECT_TRUE(last_oom_url_.has_value()); EXPECT_EQ(url, last_oom_url_.value()); CheckUkmMetricRecorded(url, 3000); } @@ -194,24 +196,18 @@ TEST_F(OutOfMemoryReporterTest, NormalCrash_NoOOM) { const GURL url("https://example.test/"); NavigateAndCommit(url); - RunClosureAndWaitForNotification( + RunCrashClosureAndWait( base::BindOnce(&content::MockRenderProcessHost::SimulateRenderProcessExit, base::Unretained(process()), - base::TERMINATION_STATUS_ABNORMAL_TERMINATION, 0)); + base::TERMINATION_STATUS_ABNORMAL_TERMINATION, 0), + false /* expect_oom */); EXPECT_FALSE(last_oom_url_.has_value()); const auto& entries = test_ukm_recorder_->GetEntriesByName( ukm::builders::Tab_RendererOOM::kEntryName); EXPECT_EQ(0u, entries.size()); } -// Flaky on Android: http://crbug.com/819592 -#if defined(OS_ANDROID) -#define MAYBE_SubframeNavigation_IsNotLogged \ - DISABLED_SubframeNavigation_IsNotLogged -#else -#define MAYBE_SubframeNavigation_IsNotLogged SubframeNavigation_IsNotLogged -#endif -TEST_F(OutOfMemoryReporterTest, MAYBE_SubframeNavigation_IsNotLogged) { +TEST_F(OutOfMemoryReporterTest, SubframeNavigation_IsNotLogged) { const GURL url("https://example.test/"); NavigateAndCommit(url); @@ -224,17 +220,12 @@ EXPECT_TRUE(subframe); SimulateOOMAndWait(); + EXPECT_TRUE(last_oom_url_.has_value()); EXPECT_EQ(url, last_oom_url_.value()); CheckUkmMetricRecorded(url, 3000); } -// Flaky on Android: http://crbug.com/819592 -#if defined(OS_ANDROID) -#define MAYBE_OOMOnPreviousPage DISABLED_OOMOnPreviousPage -#else -#define MAYBE_OOMOnPreviousPage OOMOnPreviousPage -#endif -TEST_F(OutOfMemoryReporterTest, MAYBE_OOMOnPreviousPage) { +TEST_F(OutOfMemoryReporterTest, OOMOnPreviousPage) { const GURL url1("https://example.test1/"); const GURL url2("https://example.test2/"); const GURL url3("https://example.test2/"); @@ -245,6 +236,7 @@ content::NavigationSimulator::NavigateAndFailFromBrowser(web_contents(), url3, net::ERR_ABORTED); SimulateOOMAndWait(); + EXPECT_TRUE(last_oom_url_.has_value()); EXPECT_EQ(url2, last_oom_url_.value()); CheckUkmMetricRecorded(url2, 3000);
diff --git a/chrome/browser/metrics/process_memory_metrics_emitter.cc b/chrome/browser/metrics/process_memory_metrics_emitter.cc index eebed9c..8c0aa960 100644 --- a/chrome/browser/metrics/process_memory_metrics_emitter.cc +++ b/chrome/browser/metrics/process_memory_metrics_emitter.cc
@@ -13,7 +13,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "services/metrics/public/cpp/ukm_recorder.h" #include "services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h"
diff --git a/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc b/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc index b6203b417..03989bc 100644 --- a/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc +++ b/chrome/browser/metrics/process_memory_metrics_emitter_browsertest.cc
@@ -22,7 +22,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/render_process_host.h" #include "content/public/test/test_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/dns/mock_host_resolver.h" #include "services/metrics/public/cpp/ukm_builders.h" #include "services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h"
diff --git a/chrome/browser/metrics/renderer_uptime_tracker.cc b/chrome/browser/metrics/renderer_uptime_tracker.cc index 39d320e..e77aa48 100644 --- a/chrome/browser/metrics/renderer_uptime_tracker.cc +++ b/chrome/browser/metrics/renderer_uptime_tracker.cc
@@ -8,7 +8,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/render_process_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/process_map.h"
diff --git a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc index c0cb95f68..1de6640 100644 --- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc +++ b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc
@@ -24,7 +24,7 @@ #include "chrome/common/logging_chrome.h" #include "chrome/common/pepper_permission_util.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/nacl_host/nacl_browser_delegate_impl.h b/chrome/browser/nacl_host/nacl_browser_delegate_impl.h index b3d2727c..fdcc379 100644 --- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.h +++ b/chrome/browser/nacl_host/nacl_browser_delegate_impl.h
@@ -11,7 +11,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "components/nacl/browser/nacl_browser_delegate.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/memory/ref_counted.h"
diff --git a/chrome/browser/net/chrome_extensions_network_delegate.cc b/chrome/browser/net/chrome_extensions_network_delegate.cc index 4e315d6..f3bdcdb 100644 --- a/chrome/browser/net/chrome_extensions_network_delegate.cc +++ b/chrome/browser/net/chrome_extensions_network_delegate.cc
@@ -10,7 +10,7 @@ #include <memory> #include "base/macros.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/net_errors.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/net/chrome_extensions_network_delegate.h b/chrome/browser/net/chrome_extensions_network_delegate.h index 2b23f408..7c95239 100644 --- a/chrome/browser/net/chrome_extensions_network_delegate.h +++ b/chrome/browser/net/chrome_extensions_network_delegate.h
@@ -8,7 +8,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/network_delegate_impl.h" namespace extensions {
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc index 9915c369..511d85e 100644 --- a/chrome/browser/net/chrome_network_delegate.cc +++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -45,7 +45,7 @@ #include "content/public/common/content_switches.h" #include "content/public/common/process_type.h" #include "content/public/common/resource_type.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/host_port_pair.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h"
diff --git a/chrome/browser/net/chrome_network_delegate_unittest.cc b/chrome/browser/net/chrome_network_delegate_unittest.cc index 99728f4..3418ef2d 100644 --- a/chrome/browser/net/chrome_network_delegate_unittest.cc +++ b/chrome/browser/net/chrome_network_delegate_unittest.cc
@@ -39,7 +39,7 @@ #include "content/public/test/mock_permission_manager.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/request_priority.h" #include "net/http/http_request_headers.h" #include "net/socket/socket_test_util.h"
diff --git a/chrome/browser/net/net_export_helper.cc b/chrome/browser/net/net_export_helper.cc index a4e8dab..3abbd329 100644 --- a/chrome/browser/net/net_export_helper.cc +++ b/chrome/browser/net/net_export_helper.cc
@@ -14,7 +14,7 @@ #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_service.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_event_store.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/extension_service.h"
diff --git a/chrome/browser/notifications/notification_platform_bridge_win.cc b/chrome/browser/notifications/notification_platform_bridge_win.cc index 791196d..7f663001 100644 --- a/chrome/browser/notifications/notification_platform_bridge_win.cc +++ b/chrome/browser/notifications/notification_platform_bridge_win.cc
@@ -747,8 +747,7 @@ ForwardNotificationOperationOnUiThread( operation, launch_id.notification_type(), launch_id.origin_url(), launch_id.notification_id(), launch_id.profile_id(), - launch_id.incognito(), - /*action_index=*/base::nullopt, /*by_user=*/true); + launch_id.incognito(), launch_id.button_index(), /*by_user=*/true); return true; }
diff --git a/chrome/browser/notifications/notifier_state_tracker.cc b/chrome/browser/notifications/notifier_state_tracker.cc index 6979a69..53a10a5 100644 --- a/chrome/browser/notifications/notifier_state_tracker.cc +++ b/chrome/browser/notifications/notifier_state_tracker.cc
@@ -18,7 +18,7 @@ #include "components/content_settings/core/common/content_settings_types.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/scoped_user_pref_update.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/message_center/public/cpp/notifier_id.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/notifications/notifier_state_tracker.h b/chrome/browser/notifications/notifier_state_tracker.h index 5b1c507..0095073 100644 --- a/chrome/browser/notifications/notifier_state_tracker.h +++ b/chrome/browser/notifications/notifier_state_tracker.h
@@ -11,7 +11,7 @@ #include "base/macros.h" #include "components/keyed_service/core/keyed_service.h" #include "components/prefs/pref_member.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "base/scoped_observer.h"
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc index 4f56d31f..f1d2a84 100644 --- a/chrome/browser/notifications/platform_notification_service_impl.cc +++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -48,7 +48,7 @@ #include "content/public/browser/notification_event_dispatcher.h" #include "content/public/common/notification_resources.h" #include "content/public/common/platform_notification_data.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h"
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc index 8a044dfe..612104d 100644 --- a/chrome/browser/notifications/platform_notification_service_unittest.cc +++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -25,7 +25,7 @@ #include "content/public/common/notification_resources.h" #include "content/public/common/platform_notification_data.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/overlay/overlay_window.h b/chrome/browser/overlay/overlay_window.h index 42b517cb8..87bf3d7f 100644 --- a/chrome/browser/overlay/overlay_window.h +++ b/chrome/browser/overlay/overlay_window.h
@@ -29,16 +29,12 @@ // implementation for the class. static std::unique_ptr<OverlayWindow> Create(); - virtual void Init() = 0; virtual bool IsActive() const = 0; virtual void Show() = 0; - virtual void Hide() = 0; virtual void Close() = 0; - virtual void Activate() = 0; - virtual bool IsVisible() = 0; + virtual bool IsVisible() const = 0; virtual bool IsAlwaysOnTop() const = 0; virtual ui::Layer* GetLayer() = 0; - virtual gfx::NativeWindow GetNativeWindow() const = 0; // Retrieves the window's current bounds, including its window. virtual gfx::Rect GetBounds() const = 0;
diff --git a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.cc b/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.cc deleted file mode 100644 index 613356c..0000000 --- a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.cc +++ /dev/null
@@ -1,140 +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/page_load_metrics/experiments/delay_navigation_throttle.h" - -#include "base/metrics/field_trial_params.h" -#include "base/metrics/histogram_macros.h" -#include "base/rand_util.h" -#include "base/threading/thread_task_runner_handle.h" -#include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/search/search.h" -#include "content/public/browser/navigation_handle.h" -#include "content/public/browser/web_contents.h" - -namespace { - -const char kHistogramNavigationDelaySpecified[] = - "DelayNavigationThrottle.Delay.Specified"; -const char kHistogramNavigationDelayActual[] = - "DelayNavigationThrottle.Delay.Actual"; -const char kHistogramNavigationDelayDelta[] = - "DelayNavigationThrottle.Delay.Delta"; - -base::TimeDelta GetNavigationDelayFromParams() { - double delay_probability = base::GetFieldTrialParamByFeatureAsDouble( - kDelayNavigationFeature, - DelayNavigationThrottle::kParamDelayNavigationProbability, - 0 /* default value */); - - DCHECK_GE(delay_probability, 0.0); - DCHECK_LE(delay_probability, 1.0); - if (delay_probability == 0 || delay_probability < base::RandDouble()) - return base::TimeDelta(); - - int navigation_delay_millis = base::GetFieldTrialParamByFeatureAsInt( - kDelayNavigationFeature, - DelayNavigationThrottle::kParamDelayNavigationDurationMillis, - -1 /* default value */); - - if (navigation_delay_millis <= 0) - return base::TimeDelta(); - - bool randomize_delay = base::GetFieldTrialParamByFeatureAsBool( - kDelayNavigationFeature, - DelayNavigationThrottle::kParamDelayNavigationRandomize, - false /* default value */); - - if (randomize_delay) { - // RandGenerator produces a value in [0, navigation_delay_millis). We want - // a value in [1, navigation_delay_millis]. - navigation_delay_millis = base::RandGenerator(navigation_delay_millis) + 1; - } - - return base::TimeDelta::FromMilliseconds(navigation_delay_millis); -} - -} // namespace - -const base::Feature kDelayNavigationFeature{"DelayNavigation", - base::FEATURE_DISABLED_BY_DEFAULT}; - -const char DelayNavigationThrottle::kParamDelayNavigationDurationMillis[] = - "delay_millis"; - -const char DelayNavigationThrottle::kParamDelayNavigationRandomize[] = - "randomize_delay"; - -const char DelayNavigationThrottle::kParamDelayNavigationProbability[] = - "delay_probability"; - -// static -std::unique_ptr<DelayNavigationThrottle> -DelayNavigationThrottle::MaybeCreateThrottleFor( - content::NavigationHandle* handle) { - if (!handle->IsInMainFrame() || - !base::FeatureList::IsEnabled(kDelayNavigationFeature) || - !handle->GetURL().SchemeIsHTTPOrHTTPS()) { - return nullptr; - } - - // Do not delay the NTP, which in some cases has an HTTPS URL. - if (search::IsNTPURL(handle->GetURL(), - Profile::FromBrowserContext( - handle->GetWebContents()->GetBrowserContext()))) { - return nullptr; - } - - base::TimeDelta navigation_delay = GetNavigationDelayFromParams(); - if (navigation_delay.is_zero()) - return nullptr; - - return std::make_unique<DelayNavigationThrottle>( - handle, base::ThreadTaskRunnerHandle::Get(), navigation_delay); -} - -DelayNavigationThrottle::DelayNavigationThrottle( - content::NavigationHandle* handle, - scoped_refptr<base::TaskRunner> task_runner, - base::TimeDelta navigation_delay) - : content::NavigationThrottle(handle), - task_runner_(task_runner), - navigation_delay_(navigation_delay), - weak_ptr_factory_(this) {} - -DelayNavigationThrottle::~DelayNavigationThrottle() {} - -content::NavigationThrottle::ThrottleCheckResult -DelayNavigationThrottle::WillStartRequest() { - UMA_HISTOGRAM_TIMES(kHistogramNavigationDelaySpecified, navigation_delay_); - delay_start_time_ = base::TimeTicks::Now(); - task_runner_->PostDelayedTask( - FROM_HERE, - base::BindOnce(&DelayNavigationThrottle::OnDelayComplete, - weak_ptr_factory_.GetWeakPtr()), - navigation_delay_); - return content::NavigationThrottle::DEFER; -} - -const char* DelayNavigationThrottle::GetNameForLogging() { - return "DelayNavigationThrottle"; -} - -void DelayNavigationThrottle::OnDelayComplete() { - base::TimeDelta actual_delay = base::TimeTicks::Now() - delay_start_time_; - base::TimeDelta delay_delta = actual_delay - navigation_delay_; - UMA_HISTOGRAM_TIMES(kHistogramNavigationDelayActual, actual_delay); - UMA_HISTOGRAM_TIMES(kHistogramNavigationDelayDelta, delay_delta.magnitude()); - - page_load_metrics::MetricsWebContentsObserver* observer = - page_load_metrics::MetricsWebContentsObserver::FromWebContents( - navigation_handle()->GetWebContents()); - if (observer) { - observer->OnNavigationDelayComplete(navigation_handle(), navigation_delay_, - actual_delay); - } - - Resume(); -}
diff --git a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.h b/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.h deleted file mode 100644 index efb7b27..0000000 --- a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.h +++ /dev/null
@@ -1,73 +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_PAGE_LOAD_METRICS_EXPERIMENTS_DELAY_NAVIGATION_THROTTLE_H_ -#define CHROME_BROWSER_PAGE_LOAD_METRICS_EXPERIMENTS_DELAY_NAVIGATION_THROTTLE_H_ - -#include <memory> - -#include "base/feature_list.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/weak_ptr.h" -#include "base/task_runner.h" -#include "base/time/time.h" -#include "content/public/browser/navigation_throttle.h" - -// This feature controls whether the DelayNavigationThrottle should be -// instantiated. -extern const base::Feature kDelayNavigationFeature; - -// DelayNavigationThrottle introduces a delay to main frame navigations. -class DelayNavigationThrottle : public content::NavigationThrottle { - public: - // The duration of the delay to add to the start of each navigation, in - // milliseconds. - static const char kParamDelayNavigationDurationMillis[]; - - // Whether the delay should be randomized in the interval 0ms and - // kParamDelayNavigationDurationMillis. - static const char kParamDelayNavigationRandomize[]; - - // The probability that the navigation delay should be introduced. Should be a - // double in the interval [0, 1], where a value of 0 indicates the delay - // should never be introduced, and a value of 1 indicates the delay should - // always be introduced. - static const char kParamDelayNavigationProbability[]; - - // Creates a DelayNavigationThrottle if the DelayNavigation feature is - // enabled and configured. - static std::unique_ptr<DelayNavigationThrottle> MaybeCreateThrottleFor( - content::NavigationHandle* handle); - - // Creates a DelayNavigationThrottle directly. Only intended for use in - // tests. Production code should use MaybeCreateThrottleFor. - DelayNavigationThrottle(content::NavigationHandle* handle, - scoped_refptr<base::TaskRunner> task_runner, - base::TimeDelta navigation_delay); - ~DelayNavigationThrottle() override; - - // Return the navigation delay for this throttle. - base::TimeDelta navigation_delay() const { return navigation_delay_; } - - // content::NavigationThrottle: - content::NavigationThrottle::ThrottleCheckResult WillStartRequest() override; - const char* GetNameForLogging() override; - - private: - void OnDelayComplete(); - - const scoped_refptr<base::TaskRunner> task_runner_; - const base::TimeDelta navigation_delay_; - - // The time we added a delay to this navigation. - base::TimeTicks delay_start_time_; - - // This has to be the last member of the class. - base::WeakPtrFactory<DelayNavigationThrottle> weak_ptr_factory_; - - DISALLOW_COPY_AND_ASSIGN(DelayNavigationThrottle); -}; - -#endif // CHROME_BROWSER_PAGE_LOAD_METRICS_EXPERIMENTS_DELAY_NAVIGATION_THROTTLE_H_
diff --git a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc b/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc deleted file mode 100644 index 3b0fcf57..0000000 --- a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc +++ /dev/null
@@ -1,209 +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/page_load_metrics/experiments/delay_navigation_throttle.h" - -#include <map> -#include <memory> -#include <string> -#include <tuple> -#include <utility> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/run_loop.h" -#include "base/strings/string_number_conversions.h" -#include "base/test/scoped_feature_list.h" -#include "base/test/test_mock_time_task_runner.h" -#include "base/time/time.h" -#include "chrome/test/base/chrome_render_view_host_test_harness.h" -#include "components/variations/variations_associated_data.h" -#include "content/public/browser/navigation_handle.h" -#include "content/public/browser/navigation_throttle.h" -#include "net/http/http_util.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "url/gurl.h" - -class DelayNavigationThrottleTest : public ChromeRenderViewHostTestHarness {}; - -TEST_F(DelayNavigationThrottleTest, BasicDelay) { - const char kBasicResponseHeaders[] = "HTTP/1.1 200 OK"; - base::TimeDelta navigation_delay = base::TimeDelta::FromSeconds(1); - GURL url("http://www.example.com/"); - - scoped_refptr<base::TestMockTimeTaskRunner> mock_time_task_runner( - new base::TestMockTimeTaskRunner()); - std::unique_ptr<content::NavigationHandle> test_handle = - content::NavigationHandle::CreateNavigationHandleForTesting(url, - main_rfh()); - test_handle->RegisterThrottleForTesting( - std::make_unique<DelayNavigationThrottle>( - test_handle.get(), mock_time_task_runner, navigation_delay)); - - EXPECT_FALSE(mock_time_task_runner->HasPendingTask()); - EXPECT_EQ(content::NavigationThrottle::DEFER, - test_handle->CallWillStartRequestForTesting()); - - // There may be other throttles that DEFER and post async tasks to the UI - // thread. Allow them to run to completion, so our throttle is guaranteed to - // have a chance to run. - base::RunLoop().RunUntilIdle(); - - EXPECT_TRUE(mock_time_task_runner->HasPendingTask()); - EXPECT_FALSE(test_handle->HasCommitted()); - - mock_time_task_runner->FastForwardBy(navigation_delay); - EXPECT_FALSE(mock_time_task_runner->HasPendingTask()); - - // Run any remaining async tasks, to make sure all other deferred throttles - // can complete. - base::RunLoop().RunUntilIdle(); - - // Verify that the WillSendRequest portion of the navigation has completed, - // and NavigationHandle::WillProcessResponse and the commit portion of the - // navigation lifetime can now be invoked. - EXPECT_EQ(content::NavigationThrottle::PROCEED, - test_handle->CallWillProcessResponseForTesting( - main_rfh(), - net::HttpUtil::AssembleRawHeaders( - kBasicResponseHeaders, strlen(kBasicResponseHeaders)))); - test_handle->CallDidCommitNavigationForTesting(url); - EXPECT_TRUE(test_handle->HasCommitted()); -} - -enum ExpectInstantiationResult { - EXPECT_INSTANTIATION, - EXPECT_NO_INSTANTIATION -}; - -class DelayNavigationThrottleInstantiationTest - : public ChromeRenderViewHostTestHarness, - public testing::WithParamInterface< - std::tuple<ExpectInstantiationResult, - base::FeatureList::OverrideState, - base::TimeDelta, - bool, - double, - GURL>> { - public: - DelayNavigationThrottleInstantiationTest() - : field_trial_list_(nullptr /* entropy_provider */) {} - - void SetUp() override { - ChromeRenderViewHostTestHarness::SetUp(); - - std::tie(expected_instantiation_result_, feature_state_, param_delay_, - param_randomize_delay_, param_probability_, url_) = GetParam(); - - std::map<std::string, std::string> variation_params( - {{DelayNavigationThrottle::kParamDelayNavigationDurationMillis, - base::IntToString(param_delay_.InMilliseconds())}, - {DelayNavigationThrottle::kParamDelayNavigationRandomize, - param_randomize_delay_ ? "true" : "false"}, - {DelayNavigationThrottle::kParamDelayNavigationProbability, - base::NumberToString(param_probability_)}}); - InitializeScopedFeatureList(feature_state_, variation_params); - } - - void TearDown() override { - ChromeRenderViewHostTestHarness::TearDown(); - variations::testing::ClearAllVariationParams(); - } - - void InitializeScopedFeatureList( - base::FeatureList::OverrideState feature_state, - const std::map<std::string, std::string>& variation_params) { - static const char kTestFieldTrialName[] = "TestTrial"; - static const char kTestExperimentGroupName[] = "TestGroup"; - - EXPECT_TRUE(variations::AssociateVariationParams( - kTestFieldTrialName, kTestExperimentGroupName, variation_params)); - - base::FieldTrial* field_trial = base::FieldTrialList::CreateFieldTrial( - kTestFieldTrialName, kTestExperimentGroupName); - - std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList); - feature_list->RegisterFieldTrialOverride(kDelayNavigationFeature.name, - feature_state, field_trial); - - // Since we are adding a scoped feature list after browser start, copy over - // the existing feature list to prevent inconsistency. - base::FeatureList* existing_feature_list = base::FeatureList::GetInstance(); - if (existing_feature_list) { - std::string enabled_features; - std::string disabled_features; - base::FeatureList::GetInstance()->GetFeatureOverrides(&enabled_features, - &disabled_features); - feature_list->InitializeFromCommandLine(enabled_features, - disabled_features); - } - - scoped_feature_list_.InitWithFeatureList(std::move(feature_list)); - } - - base::FieldTrialList field_trial_list_; - base::test::ScopedFeatureList scoped_feature_list_; - - // Fields filled in via GetParam(): - base::FeatureList::OverrideState feature_state_; - base::TimeDelta param_delay_; - bool param_randomize_delay_ = false; - double param_probability_ = 0; - GURL url_; - ExpectInstantiationResult expected_instantiation_result_; - - private: - DISALLOW_COPY_AND_ASSIGN(DelayNavigationThrottleInstantiationTest); -}; - -TEST_P(DelayNavigationThrottleInstantiationTest, Instantiate) { - std::unique_ptr<content::NavigationHandle> test_handle = - content::NavigationHandle::CreateNavigationHandleForTesting(url_, - main_rfh()); - std::unique_ptr<DelayNavigationThrottle> throttle = - DelayNavigationThrottle::MaybeCreateThrottleFor(test_handle.get()); - const bool expect_instantiation = - expected_instantiation_result_ == EXPECT_INSTANTIATION; - EXPECT_EQ(expect_instantiation, throttle != nullptr); - if (throttle) { - base::TimeDelta delay = throttle->navigation_delay(); - EXPECT_FALSE(delay.is_zero()); - EXPECT_GE(param_delay_, delay); - } -} - -INSTANTIATE_TEST_CASE_P( - InstantiateThrottle, - DelayNavigationThrottleInstantiationTest, - ::testing::Values( - std::make_tuple(EXPECT_NO_INSTANTIATION, - base::FeatureList::OVERRIDE_DISABLE_FEATURE, - base::TimeDelta::FromMilliseconds(10), - false /* randomize delay */, - 1.0 /* delay probability */, - GURL("http://www.example.com/")), - std::make_tuple(EXPECT_NO_INSTANTIATION, - base::FeatureList::OVERRIDE_ENABLE_FEATURE, - base::TimeDelta::FromMilliseconds(10), - false /* randomize delay */, - 1.0 /* delay probability */, - GURL("chrome://version")), - std::make_tuple(EXPECT_NO_INSTANTIATION, - base::FeatureList::OVERRIDE_ENABLE_FEATURE, - base::TimeDelta::FromMilliseconds(10), - false /* randomize delay */, - 0.0 /* delay probability */, - GURL("http://www.example.com/")), - std::make_tuple(EXPECT_INSTANTIATION, - base::FeatureList::OVERRIDE_ENABLE_FEATURE, - base::TimeDelta::FromMilliseconds(10), - false /* randomize delay */, - 1.0 /* delay probability */, - GURL("http://www.example.com/")), - std::make_tuple(EXPECT_INSTANTIATION, - base::FeatureList::OVERRIDE_ENABLE_FEATURE, - base::TimeDelta::FromMilliseconds(10), - true /* randomize delay */, - 1.0 /* delay probability */, - GURL("http://www.example.com/"))));
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc index 533efe6a..138ca61 100644 --- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc +++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
@@ -306,16 +306,6 @@ } } -void MetricsWebContentsObserver::OnNavigationDelayComplete( - content::NavigationHandle* navigation_handle, - base::TimeDelta scheduled_delay, - base::TimeDelta actual_delay) { - auto it = provisional_loads_.find(navigation_handle); - if (it == provisional_loads_.end()) - return; - it->second->OnNavigationDelayComplete(scheduled_delay, actual_delay); -} - const PageLoadExtraInfo MetricsWebContentsObserver::GetPageLoadExtraInfoForCommittedLoad() { DCHECK(committed_load_);
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h index 546fc2b..cacee3c 100644 --- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h +++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
@@ -118,13 +118,6 @@ int net_error, std::unique_ptr<net::LoadTimingInfo> load_timing_info); - // Invoked on navigations where a navigation delay was added by the - // DelayNavigationThrottle. This is a temporary method that will be removed - // once the experiment is complete. - void OnNavigationDelayComplete(content::NavigationHandle* navigation_handle, - base::TimeDelta scheduled_delay, - base::TimeDelta actual_delay); - // Flush any buffered metrics, as part of the metrics subsystem persisting // metrics as the application goes into the background. The application may be // killed at any time after this method is invoked without further
diff --git a/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.cc deleted file mode 100644 index d779f27..0000000 --- a/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.cc +++ /dev/null
@@ -1,56 +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/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.h" - -#include "base/metrics/histogram_macros.h" - -namespace internal { - -const char kHistogramNavigationDelaySpecified[] = - "PageLoad.Clients.DelayNavigation.Delay.Specified"; -const char kHistogramNavigationDelayActual[] = - "PageLoad.Clients.DelayNavigation.Delay.Actual"; -const char kHistogramNavigationDelayDelta[] = - "PageLoad.Clients.DelayNavigation.Delay.Delta"; - -} // namespace internal - -page_load_metrics::PageLoadMetricsObserver::ObservePolicy -DelayNavigationPageLoadMetricsObserver::OnStart( - content::NavigationHandle* navigation_handle, - const GURL& currently_committed_url, - bool started_in_foreground) { - return started_in_foreground ? CONTINUE_OBSERVING : STOP_OBSERVING; -} - -page_load_metrics::PageLoadMetricsObserver::ObservePolicy -DelayNavigationPageLoadMetricsObserver::OnHidden( - const page_load_metrics::mojom::PageLoadTiming& timing, - const page_load_metrics::PageLoadExtraInfo& info) { - return STOP_OBSERVING; -} - -void DelayNavigationPageLoadMetricsObserver::OnNavigationDelayComplete( - base::TimeDelta scheduled_delay, - base::TimeDelta actual_delay) { - delay_navigation_ = true; - scheduled_delay_ = scheduled_delay; - actual_delay_ = actual_delay; -} - -void DelayNavigationPageLoadMetricsObserver::OnFirstPaintInPage( - const page_load_metrics::mojom::PageLoadTiming& timing, - const page_load_metrics::PageLoadExtraInfo& info) { - if (!delay_navigation_) - return; - - UMA_HISTOGRAM_TIMES(internal::kHistogramNavigationDelaySpecified, - scheduled_delay_); - UMA_HISTOGRAM_TIMES(internal::kHistogramNavigationDelayActual, actual_delay_); - - base::TimeDelta delay_delta = actual_delay_ - scheduled_delay_; - UMA_HISTOGRAM_TIMES(internal::kHistogramNavigationDelayDelta, - delay_delta.magnitude()); -}
diff --git a/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.h b/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.h deleted file mode 100644 index 8c3980e..0000000 --- a/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.h +++ /dev/null
@@ -1,58 +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_PAGE_LOAD_METRICS_OBSERVERS_DELAY_NAVIGATION_PAGE_LOAD_METRICS_OBSERVER_H_ -#define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DELAY_NAVIGATION_PAGE_LOAD_METRICS_OBSERVER_H_ - -#include "base/macros.h" -#include "base/time/time.h" -#include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" - -namespace internal { - -extern const char kHistogramNavigationDelaySpecified[]; -extern const char kHistogramNavigationDelayActual[]; -extern const char kHistogramNavigationDelayDelta[]; - -} // namespace internal - -// DelayNavigationPageLoadMetricsObserver tracks delays in navigations -// introduced by the DelayNavigation experiment. This class is temporary and -// will be removed once the experiment is complete. -// -// Metrics logged by this class complement the metrics logged in -// DelayNavigationThrottle. DelayNavigationThrottle metrics are logged for all -// main frame loads, including those that happen in the background and thus may -// be throttled, whereas this observer logs the same metrics for page loads -// tracked by the page load metrics infrastructure. We are most interested in -// impact on foregrounded page loads, so we use -// DelayNavigationPageLoadMetricsObserver to log metrics for just those -// pageloads that happen in the foreground. -class DelayNavigationPageLoadMetricsObserver - : public page_load_metrics::PageLoadMetricsObserver { - public: - DelayNavigationPageLoadMetricsObserver() = default; - - // page_load_metrics::PageLoadMetricsObserver: - ObservePolicy OnStart(content::NavigationHandle* navigation_handle, - const GURL& currently_committed_url, - bool started_in_foreground) override; - ObservePolicy OnHidden( - const page_load_metrics::mojom::PageLoadTiming& timing, - const page_load_metrics::PageLoadExtraInfo& info) override; - void OnNavigationDelayComplete(base::TimeDelta scheduled_delay, - base::TimeDelta actual_delay) override; - void OnFirstPaintInPage( - const page_load_metrics::mojom::PageLoadTiming& timing, - const page_load_metrics::PageLoadExtraInfo& info) override; - - private: - bool delay_navigation_ = false; - base::TimeDelta scheduled_delay_; - base::TimeDelta actual_delay_; - - DISALLOW_COPY_AND_ASSIGN(DelayNavigationPageLoadMetricsObserver); -}; - -#endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_DELAY_NAVIGATION_PAGE_LOAD_METRICS_OBSERVER_H_
diff --git a/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer_unittest.cc deleted file mode 100644 index 2a27662..0000000 --- a/chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer_unittest.cc +++ /dev/null
@@ -1,125 +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/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.h" - -#include <memory> - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/run_loop.h" -#include "base/test/test_mock_time_task_runner.h" -#include "base/time/time.h" -#include "chrome/browser/page_load_metrics/experiments/delay_navigation_throttle.h" -#include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h" -#include "chrome/browser/page_load_metrics/page_load_tracker.h" -#include "chrome/common/page_load_metrics/test/page_load_metrics_test_util.h" -#include "content/public/browser/navigation_handle.h" -#include "content/public/browser/web_contents.h" -#include "content/public/browser/web_contents_observer.h" -#include "content/public/browser/web_contents_user_data.h" -#include "content/public/test/navigation_simulator.h" -#include "content/public/test/test_navigation_throttle_inserter.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace { - -const char kDefaultTestUrl[] = "https://example.com/"; - -const int kDelayMillis = 100; - -} // namespace - -class DelayNavigationPageLoadMetricsObserverTest - : public page_load_metrics::PageLoadMetricsObserverTestHarness { - public: - DelayNavigationPageLoadMetricsObserverTest() = default; - ~DelayNavigationPageLoadMetricsObserverTest() override = default; - - void RegisterObservers(page_load_metrics::PageLoadTracker* tracker) override { - tracker->AddObserver( - std::make_unique<DelayNavigationPageLoadMetricsObserver>()); - } - - void SetUp() override { - PageLoadMetricsObserverTestHarness::SetUp(); - mock_time_task_runner_ = new base::TestMockTimeTaskRunner(); - - // Instantiates a DelayNavigationThrottle for each main frame navigation in - // the web_contents(). - throttle_inserter_ = - std::make_unique<content::TestNavigationThrottleInserter>( - web_contents(), - base::BindRepeating( - &DelayNavigationPageLoadMetricsObserverTest::CreateThrottle, - base::Unretained(this))); - } - - std::unique_ptr<content::NavigationThrottle> CreateThrottle( - content::NavigationHandle* handle) { - if (!handle->IsInMainFrame()) - return nullptr; - return std::make_unique<DelayNavigationThrottle>( - handle, mock_time_task_runner_, - base::TimeDelta::FromMilliseconds(kDelayMillis)); - } - - bool AnyMetricsRecorded() { - return !histogram_tester() - .GetTotalCountsForPrefix("PageLoad.Clients.DelayNavigation.") - .empty(); - } - - void OnNavigationDeferred() { - EXPECT_TRUE(mock_time_task_runner_->HasPendingTask()); - mock_time_task_runner_->FastForwardBy( - base::TimeDelta::FromMilliseconds(kDelayMillis)); - EXPECT_FALSE(mock_time_task_runner_->HasPendingTask()); - } - - void NavigateToDefaultUrlAndCommit() { - GURL url(kDefaultTestUrl); - std::unique_ptr<content::NavigationSimulator> navigation = - content::NavigationSimulator::CreateRendererInitiated(url, main_rfh()); - navigation->SetOnDeferCallback(base::Bind( - &DelayNavigationPageLoadMetricsObserverTest::OnNavigationDeferred, - base::Unretained(this))); - navigation->Commit(); - EXPECT_EQ(url, web_contents()->GetLastCommittedURL()); - } - - private: - std::unique_ptr<content::TestNavigationThrottleInserter> throttle_inserter_; - scoped_refptr<base::TestMockTimeTaskRunner> mock_time_task_runner_; - - DISALLOW_COPY_AND_ASSIGN(DelayNavigationPageLoadMetricsObserverTest); -}; - -TEST_F(DelayNavigationPageLoadMetricsObserverTest, NoMetricsWithoutNavigation) { - ASSERT_FALSE(AnyMetricsRecorded()); -} - -TEST_F(DelayNavigationPageLoadMetricsObserverTest, CommitWithPaint) { - NavigateToDefaultUrlAndCommit(); - - page_load_metrics::mojom::PageLoadTiming timing; - page_load_metrics::InitPageLoadTimingForTest(&timing); - timing.navigation_start = base::Time::FromDoubleT(1); - timing.paint_timing->first_paint = base::TimeDelta::FromMilliseconds(1); - PopulateRequiredTimingFields(&timing); - SimulateTimingUpdate(timing); - - ASSERT_TRUE(AnyMetricsRecorded()); - histogram_tester().ExpectTotalCount( - internal::kHistogramNavigationDelaySpecified, 1); - histogram_tester().ExpectBucketCount( - internal::kHistogramNavigationDelaySpecified, kDelayMillis, 1); - - histogram_tester().ExpectTotalCount(internal::kHistogramNavigationDelayActual, - 1); - histogram_tester().ExpectTotalCount(internal::kHistogramNavigationDelayDelta, - 1); -}
diff --git a/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc b/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc index 30c38cd..0ad00ff 100644 --- a/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc +++ b/chrome/browser/page_load_metrics/observers/use_counter/ukm_features.cc
@@ -24,7 +24,7 @@ WebFeature::kMixedContentAudio, WebFeature::kMixedContentImage, WebFeature::kMixedContentVideo, WebFeature::kMixedContentPlugin, WebFeature::kOpenerNavigationWithoutGesture, - WebFeature::kUsbRequestDevice, + WebFeature::kUsbRequestDevice, WebFeature::kXMLHttpRequestSynchronous, })); return opt_in_features.count(feature); }
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc index 530d337..21b2ed0 100644 --- a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc +++ b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc
@@ -17,7 +17,6 @@ #include "chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/css_scanning_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h" -#include "chrome/browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/document_write_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/observers/google_captcha_observer.h" @@ -161,8 +160,6 @@ tracker->AddObserver( std::make_unique<OmniboxSuggestionUsedMetricsObserver>(IsPrerendering())); tracker->AddObserver( - std::make_unique<DelayNavigationPageLoadMetricsObserver>()); - tracker->AddObserver( SecurityStatePageLoadMetricsObserver::MaybeCreateForProfile( web_contents_->GetBrowserContext())); }
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_observer.h b/chrome/browser/page_load_metrics/page_load_metrics_observer.h index 28241172..0b4ffcd 100644 --- a/chrome/browser/page_load_metrics/page_load_metrics_observer.h +++ b/chrome/browser/page_load_metrics/page_load_metrics_observer.h
@@ -419,12 +419,6 @@ const content::WebContentsObserver::MediaPlayerInfo& video_type, bool is_in_main_frame) {} - // Invoked on navigations where a navigation delay was added by the - // DelayNavigationThrottle. This is a temporary method that will be removed - // once the experiment is complete. - virtual void OnNavigationDelayComplete(base::TimeDelta scheduled_delay, - base::TimeDelta actual_delay) {} - // Invoked when the UMA metrics subsystem is persisting metrics as the // application goes into the background, on platforms where the browser // process may be killed after backgrounding (Android). Implementers should
diff --git a/chrome/browser/page_load_metrics/page_load_tracker.cc b/chrome/browser/page_load_metrics/page_load_tracker.cc index 99ec917..e7a685c 100644 --- a/chrome/browser/page_load_metrics/page_load_tracker.cc +++ b/chrome/browser/page_load_metrics/page_load_tracker.cc
@@ -593,12 +593,6 @@ observer->MediaStartedPlaying(video_type, is_in_main_frame); } -void PageLoadTracker::OnNavigationDelayComplete(base::TimeDelta scheduled_delay, - base::TimeDelta actual_delay) { - for (const auto& observer : observers_) - observer->OnNavigationDelayComplete(scheduled_delay, actual_delay); -} - void PageLoadTracker::OnTimingChanged() { DCHECK(!last_dispatched_merged_page_timing_->Equals( metrics_update_dispatcher_.timing()));
diff --git a/chrome/browser/page_load_metrics/page_load_tracker.h b/chrome/browser/page_load_metrics/page_load_tracker.h index 16a2e55..89949bc8 100644 --- a/chrome/browser/page_load_metrics/page_load_tracker.h +++ b/chrome/browser/page_load_metrics/page_load_tracker.h
@@ -271,12 +271,6 @@ const content::WebContentsObserver::MediaPlayerInfo& video_type, bool is_in_main_frame); - // Invoked on navigations where a navigation delay was added by the - // DelayNavigationThrottle. This is a temporary method that will be removed - // once the experiment is complete. - void OnNavigationDelayComplete(base::TimeDelta scheduled_delay, - base::TimeDelta actual_delay); - // Informs the observers that the event corresponding to |event_key| has // occurred. void BroadcastEventToObservers(const void* const event_key);
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc index df335694..abb830ea 100644 --- a/chrome/browser/password_manager/chrome_password_manager_client.cc +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -64,7 +64,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/content_switches.h" #include "content/public/common/origin_util.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "google_apis/gaia/gaia_urls.h" #include "net/base/url_util.h" #include "net/cert/cert_status_flags.h"
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc index 21b388e..0223a75 100644 --- a/chrome/browser/password_manager/password_manager_browsertest.cc +++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -1959,16 +1959,8 @@ EXPECT_FALSE(prompt_observer->IsSavePromptShownAutomatically()); } -// https://crbug.com/814845 Flaky on macOS ASan. -#if defined(ADDRESS_SANITIZER) && defined(OS_MACOSX) -#define MAYBE_InFrameNavigationDoesNotClearPopupState \ - DISABLED_InFrameNavigationDoesNotClearPopupState -#else -#define MAYBE_InFrameNavigationDoesNotClearPopupState \ - InFrameNavigationDoesNotClearPopupState -#endif IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, - MAYBE_InFrameNavigationDoesNotClearPopupState) { + InFrameNavigationDoesNotClearPopupState) { scoped_refptr<password_manager::TestPasswordStore> password_store = static_cast<password_manager::TestPasswordStore*>( PasswordStoreFactory::GetForProfile(
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index cb8bd43..b90b233 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -9,7 +9,6 @@ #include "base/command_line.h" #include "base/environment.h" -#include "base/memory/ref_counted.h" #include "base/metrics/histogram_macros.h" #include "base/rand_util.h" #include "build/build_config.h" @@ -24,8 +23,8 @@ #include "components/browser_sync/profile_sync_service.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/os_crypt/os_crypt_switches.h" -#include "components/password_manager/core/browser/http_data_cleaner.h" #include "components/password_manager/core/browser/login_database.h" +#include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/browser/password_reuse_defines.h" #include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/browser/password_store_default.h" @@ -260,9 +259,10 @@ return nullptr; } - password_manager::DelayCleanObsoleteHttpDataForPasswordStoreAndPrefs( - ps.get(), profile->GetPrefs(), - base::WrapRefCounted(profile->GetRequestContext())); + // TODO(https://crbug.com/817754): remove the code once majority of the users + // executed it. + password_manager_util::CleanUserDataInBlacklistedCredentials( + ps.get(), profile->GetPrefs(), 60); #if defined(OS_WIN) || defined(OS_MACOSX) || \ (defined(OS_LINUX) && !defined(OS_CHROMEOS))
diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc index d5fcc11..bef2eac7 100644 --- a/chrome/browser/pdf/pdf_extension_test.cc +++ b/chrome/browser/pdf/pdf_extension_test.cc
@@ -314,6 +314,25 @@ WebContents* GetActiveWebContents() { return browser()->tab_strip_model()->GetActiveWebContents(); } + + int CountPDFProcesses() { + int result = -1; + base::RunLoop run_loop; + content::BrowserThread::PostTaskAndReply( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(&PDFExtensionTest::CountPDFProcessesOnIOThread, + base::Unretained(this), base::Unretained(&result)), + run_loop.QuitClosure()); + run_loop.Run(); + return result; + } + + void CountPDFProcessesOnIOThread(int* result) { + auto* service = content::PluginService::GetInstance(); + *result = service->CountPpapiPluginProcessesForProfile( + base::FilePath::FromUTF8Unsafe(ChromeContentClient::kPDFPluginPath), + browser()->profile()->GetPath()); + } }; IN_PROC_BROWSER_TEST_P(PDFExtensionTest, Load) { @@ -372,6 +391,9 @@ ui_test_utils::NavigateToURL(browser(), url); ASSERT_EQ(url, helper.GetLastUrl()); + // Didn't launch a PPAPI process. + EXPECT_EQ(0, CountPDFProcesses()); + // Cancel the download to shutdown cleanly. download_manager->RemoveObserver(&helper); std::vector<download::DownloadItem*> downloads; @@ -387,6 +409,9 @@ IN_PROC_BROWSER_TEST_F(PDFExtensionTest, Basic) { RunTestsInFile("basic_test.js", "test.pdf"); + + // Ensure it loaded in a PPAPI process. + EXPECT_EQ(1, CountPDFProcesses()); } IN_PROC_BROWSER_TEST_F(PDFExtensionTest, BasicPlugin) { @@ -504,6 +529,9 @@ ui_test_utils::NavigateToURL(browser(), forbiddenUrl); console_delegate->Wait(); + + // Didn't launch a PPAPI process. + EXPECT_EQ(0, CountPDFProcesses()); } // This test ensures that PDF can be loaded from local file @@ -520,6 +548,9 @@ } WebContents* guest_contents = LoadPdfGetGuestContents(test_pdf_url); ASSERT_TRUE(guest_contents); + + // Did launch a PPAPI process. + EXPECT_EQ(1, CountPDFProcesses()); } // This test ensures that link permissions are enforced properly in PDFs.
diff --git a/chrome/browser/performance_monitor/performance_monitor.cc b/chrome/browser/performance_monitor/performance_monitor.cc index 2131222..df6c7096 100644 --- a/chrome/browser/performance_monitor/performance_monitor.cc +++ b/chrome/browser/performance_monitor/performance_monitor.cc
@@ -17,7 +17,7 @@ #include "content/public/browser/child_process_data.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/content_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_host.h"
diff --git a/chrome/browser/permissions/permission_manager.cc b/chrome/browser/permissions/permission_manager.cc index 8224892..06dbeca 100644 --- a/chrome/browser/permissions/permission_manager.cc +++ b/chrome/browser/permissions/permission_manager.cc
@@ -40,7 +40,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #include "extensions/common/constants.h" #include "ppapi/features/features.h"
diff --git a/chrome/browser/permissions/permission_manager_unittest.cc b/chrome/browser/permissions/permission_manager_unittest.cc index 3e5d2b7..09a3b78 100644 --- a/chrome/browser/permissions/permission_manager_unittest.cc +++ b/chrome/browser/permissions/permission_manager_unittest.cc
@@ -23,7 +23,7 @@ #include "components/content_settings/core/browser/host_content_settings_map.h" #include "content/public/browser/permission_type.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(OS_ANDROID)
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_controller.cc b/chrome/browser/picture_in_picture/picture_in_picture_window_controller.cc index 51fb3336..b16da06 100644 --- a/chrome/browser/picture_in_picture/picture_in_picture_window_controller.cc +++ b/chrome/browser/picture_in_picture/picture_in_picture_window_controller.cc
@@ -32,7 +32,6 @@ : initiator_(initiator) { DCHECK(initiator_); window_ = OverlayWindow::Create(); - window_->Init(); } void PictureInPictureWindowController::Show() {
diff --git a/chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc b/chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc index c80daec7..8790c5b 100644 --- a/chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc +++ b/chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc
@@ -13,7 +13,7 @@ #include "chrome/common/pepper_permission_util.h" #include "components/version_info/version_info.h" #include "content/public/browser/render_process_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/host/ppapi_host.h" #include "ppapi/shared_impl/ppapi_switches.h" #include "services/service_manager/public/cpp/binder_registry.h"
diff --git a/chrome/browser/plugins/plugin_info_host_impl.cc b/chrome/browser/plugins/plugin_info_host_impl.cc index ab3fd0de..e9ff30f 100644 --- a/chrome/browser/plugins/plugin_info_host_impl.cc +++ b/chrome/browser/plugins/plugin_info_host_impl.cc
@@ -47,7 +47,7 @@ #include "content/public/browser/plugin_service_filter.h" #include "content/public/browser/render_frame_host.h" #include "content/public/common/content_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "ppapi/features/features.h" #include "services/metrics/public/cpp/ukm_builders.h"
diff --git a/chrome/browser/plugins/plugin_info_host_impl.h b/chrome/browser/plugins/plugin_info_host_impl.h index fafa518..2909a3c2 100644 --- a/chrome/browser/plugins/plugin_info_host_impl.h +++ b/chrome/browser/plugins/plugin_info_host_impl.h
@@ -21,7 +21,7 @@ #include "components/keyed_service/core/keyed_service_shutdown_notifier.h" #include "components/prefs/pref_member.h" #include "content/public/browser/browser_message_filter.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "mojo/public/cpp/bindings/associated_binding.h"
diff --git a/chrome/browser/policy/configuration_policy_handler_list_factory.cc b/chrome/browser/policy/configuration_policy_handler_list_factory.cc index 6e83718..741503e 100644 --- a/chrome/browser/policy/configuration_policy_handler_list_factory.cc +++ b/chrome/browser/policy/configuration_policy_handler_list_factory.cc
@@ -59,7 +59,7 @@ #include "components/sync/driver/sync_policy_handler.h" #include "components/translate/core/browser/translate_pref_names.h" #include "components/variations/pref_names.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/features/features.h"
diff --git a/chrome/browser/policy/managed_bookmarks_policy_handler_unittest.cc b/chrome/browser/policy/managed_bookmarks_policy_handler_unittest.cc index 57f29be..d5b96da56 100644 --- a/chrome/browser/policy/managed_bookmarks_policy_handler_unittest.cc +++ b/chrome/browser/policy/managed_bookmarks_policy_handler_unittest.cc
@@ -16,7 +16,7 @@ #include "components/policy/core/common/policy_types.h" #include "components/policy/core/common/schema.h" #include "components/policy/policy_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/common/value_builder.h"
diff --git a/chrome/browser/policy/policy_conversions.cc b/chrome/browser/policy/policy_conversions.cc index 34c5c20..f9cb48fc 100644 --- a/chrome/browser/policy/policy_conversions.cc +++ b/chrome/browser/policy/policy_conversions.cc
@@ -17,7 +17,7 @@ #include "components/policy/core/common/policy_types.h" #include "components/policy/policy_constants.h" #include "components/strings/grit/components_strings.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_registry.h"
diff --git a/chrome/browser/policy/policy_helpers.cc b/chrome/browser/policy/policy_helpers.cc index 37349dd..af4039a 100644 --- a/chrome/browser/policy/policy_helpers.cc +++ b/chrome/browser/policy/policy_helpers.cc
@@ -7,7 +7,7 @@ #include "build/build_config.h" #include "chrome/common/pref_names.h" #include "components/prefs/pref_registry_simple.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/net_errors.h" #include "url/gurl.h"
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 05dfcd3..62d0c5f 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -109,7 +109,7 @@ #include "components/update_client/update_client.h" #include "components/variations/service/variations_service.h" #include "content/public/browser/render_process_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/http/http_server_properties_manager.h" #include "ppapi/features/features.h" #include "printing/features/features.h"
diff --git a/chrome/browser/prefs/chrome_pref_service_factory.cc b/chrome/browser/prefs/chrome_pref_service_factory.cc index 11e55d3..05f37014 100644 --- a/chrome/browser/prefs/chrome_pref_service_factory.cc +++ b/chrome/browser/prefs/chrome_pref_service_factory.cc
@@ -57,7 +57,7 @@ #include "components/sync_preferences/pref_service_syncable_factory.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "rlz/features/features.h" #include "services/preferences/public/cpp/tracked/configuration.h"
diff --git a/chrome/browser/prerender/prerender_link_manager.cc b/chrome/browser/prerender/prerender_link_manager.cc index b0b2bc6..07649e5 100644 --- a/chrome/browser/prerender/prerender_link_manager.cc +++ b/chrome/browser/prerender/prerender_link_manager.cc
@@ -23,7 +23,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/session_storage_namespace.h" #include "content/public/common/referrer.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "third_party/WebKit/public/common/associated_interfaces/associated_interface_provider.h" #include "ui/gfx/geometry/size.h" #include "url/gurl.h"
diff --git a/chrome/browser/prerender/prerender_manager_factory.cc b/chrome/browser/prerender/prerender_manager_factory.cc index 0605e3ac..a6f7fc4 100644 --- a/chrome/browser/prerender/prerender_manager_factory.cc +++ b/chrome/browser/prerender/prerender_manager_factory.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_system_provider.h"
diff --git a/chrome/browser/prerender/prerender_util.cc b/chrome/browser/prerender/prerender_util.cc index dec66b23..9ed46b8 100644 --- a/chrome/browser/prerender/prerender_util.cc +++ b/chrome/browser/prerender/prerender_util.cc
@@ -6,7 +6,7 @@ #include "base/metrics/histogram_macros.h" #include "components/google/core/browser/google_util.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/printing/print_view_manager_common.cc b/chrome/browser/printing/print_view_manager_common.cc index 1832389..11c064a 100644 --- a/chrome/browser/printing/print_view_manager_common.cc +++ b/chrome/browser/printing/print_view_manager_common.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/printing/print_view_manager_common.h" #include "content/public/browser/render_frame_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "printing/features/features.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc index 15ddbfd8..58f461b3 100644 --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -83,7 +83,7 @@ #include "components/feature_engagement/buildflags.h" #include "components/policy/content/policy_blacklist_navigation_throttle.h" #include "components/spellcheck/spellcheck_buildflags.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/features/features.h" #include "printing/features/features.h"
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index 8e555f29..1a0bd2200 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -58,7 +58,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/http/http_server_properties.h" #include "net/http/transport_security_state.h" #include "ppapi/features/features.h"
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc index 343e3937..4da0785 100644 --- a/chrome/browser/profiles/off_the_record_profile_io_data.cc +++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -29,8 +29,8 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/cookie_store_factory.h" #include "content/public/browser/resource_context.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "net/http/http_cache.h" #include "net/http/http_network_session.h" #include "net/http/http_server_properties_impl.h"
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index 0ef8339..0fcec88 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc
@@ -27,7 +27,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if defined(OS_CHROMEOS) #include "base/command_line.h"
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 5cc3ec16..4f665c8 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc
@@ -121,7 +121,7 @@ #include "content/public/browser/storage_partition.h" #include "content/public/browser/url_data_source.h" #include "content/public/common/content_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "mojo/public/cpp/bindings/strong_binding.h" #include "ppapi/features/features.h" #include "printing/features/features.h"
diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h index d2b59dc..dd5d3df 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h
@@ -21,7 +21,7 @@ #include "chrome/common/buildflags.h" #include "components/prefs/pref_change_registrar.h" #include "content/public/browser/content_browser_client.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if !defined(OS_ANDROID) #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc index dccc30dcb..a4af657a 100644 --- a/chrome/browser/profiles/profile_impl_io_data.cc +++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -60,8 +60,8 @@ #include "content/public/browser/resource_context.h" #include "content/public/browser/storage_partition.h" #include "extensions/browser/extension_protocols.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "net/base/cache_type.h" #include "net/cookies/cookie_store.h" #include "net/http/http_cache.h"
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc index f225465..f2a6c72 100644 --- a/chrome/browser/profiles/profile_io_data.cc +++ b/chrome/browser/profiles/profile_io_data.cc
@@ -79,7 +79,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/resource_context.h" #include "content/public/common/content_switches.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/cert/caching_cert_verifier.h" #include "net/cert/cert_verifier.h" #include "net/cert/cert_verify_proc.h"
diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h index 7b764de..67abf5b 100644 --- a/chrome/browser/profiles/profile_io_data.h +++ b/chrome/browser/profiles/profile_io_data.h
@@ -28,7 +28,7 @@ #include "components/prefs/pref_member.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/resource_context.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/cookies/cookie_store.h" #include "net/http/http_cache.h" #include "net/http/http_network_session.h"
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index 69f5518..e3d55da 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc
@@ -89,7 +89,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/common/content_switches.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/http/http_transaction_factory.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc index 8c226f6..d7a2660 100644 --- a/chrome/browser/profiles/profile_window.cc +++ b/chrome/browser/profiles/profile_window.cc
@@ -47,7 +47,7 @@ #include "components/signin/core/browser/signin_pref_names.h" #include "components/signin/core/browser/signin_switches.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/escape.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc b/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc index fa60974ec..1fd0e51 100644 --- a/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc +++ b/chrome/browser/renderer_context_menu/context_menu_content_type_factory.cc
@@ -9,7 +9,7 @@ #include "components/renderer_context_menu/context_menu_content_type.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/app_mode/app_mode_utils.h"
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc index 1fd42ea..9bbe0de 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -114,7 +114,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/menu_item.h" #include "content/public/common/url_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/base/media_switches.h" #include "net/base/escape.h" #include "net/traffic_annotation/network_traffic_annotation.h"
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.h b/chrome/browser/renderer_context_menu/render_view_context_menu.h index 979186a5..e19a002 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu.h +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -20,7 +20,7 @@ #include "components/renderer_context_menu/render_view_context_menu_observer.h" #include "components/renderer_context_menu/render_view_context_menu_proxy.h" #include "content/public/common/context_menu_params.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/features/features.h" #include "printing/features/features.h" #include "ui/base/models/simple_menu_model.h"
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h b/chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h index ea9f5b87..00ae576c 100644 --- a/chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h +++ b/chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h
@@ -12,7 +12,7 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/renderer_host/chrome_navigation_ui_data.cc b/chrome/browser/renderer_host/chrome_navigation_ui_data.cc index d239c2b..afea094 100644 --- a/chrome/browser/renderer_host/chrome_navigation_ui_data.cc +++ b/chrome/browser/renderer_host/chrome_navigation_ui_data.cc
@@ -7,7 +7,7 @@ #include "chrome/browser/prerender/prerender_contents.h" #include "chrome/browser/prerender/prerender_histograms.h" #include "content/public/browser/navigation_handle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/window_open_disposition.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/renderer_host/chrome_navigation_ui_data.h b/chrome/browser/renderer_host/chrome_navigation_ui_data.h index 839a443f..f40feb1e 100644 --- a/chrome/browser/renderer_host/chrome_navigation_ui_data.h +++ b/chrome/browser/renderer_host/chrome_navigation_ui_data.h
@@ -13,7 +13,7 @@ #include "components/offline_pages/core/request_header/offline_page_navigation_ui_data.h" #include "content/public/browser/navigation_ui_data.h" #include "extensions/browser/extension_navigation_ui_data.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" namespace content { class NavigationHandle;
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc index 3ba3a23..4f819e0 100644 --- a/chrome/browser/renderer_host/chrome_render_message_filter.cc +++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -30,7 +30,7 @@ #include "components/web_cache/browser/web_cache_manager.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/render_process_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/features/features.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.h b/chrome/browser/renderer_host/chrome_render_message_filter.h index 6b92d89..2cbec962 100644 --- a/chrome/browser/renderer_host/chrome_render_message_filter.h +++ b/chrome/browser/renderer_host/chrome_render_message_filter.h
@@ -12,7 +12,7 @@ #include "base/macros.h" #include "base/sequenced_task_runner_helpers.h" #include "content/public/browser/browser_message_filter.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/features/features.h" class GURL;
diff --git a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc index 40dde88b..5599a2d3 100644 --- a/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc +++ b/chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc
@@ -16,7 +16,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/render_view_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/c/pp_errors.h" #include "ppapi/host/dispatch_host_message.h" #include "ppapi/host/host_message_context.h"
diff --git a/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc b/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc index b93d2bb..a3aa787 100644 --- a/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc +++ b/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
@@ -29,7 +29,7 @@ LifecycleUnit* lifecycle_unit) { // If the browser is not shutting down and the tab is in a LOADED state after // being discarded, record TabManager.Discarding.ReloadToCloseTime. - if (g_browser_process && !g_browser_process->IsShuttingDown() && + if (!g_browser_process->IsShuttingDown() && lifecycle_unit->GetState() == LifecycleUnit::State::LOADED && !reload_time_.is_null()) { auto reload_to_close_time = NowTicks() - reload_time_;
diff --git a/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc b/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc index 40b3099..eceb1c9 100644 --- a/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc +++ b/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
@@ -46,12 +46,8 @@ } base::string16 GetTitle() const override { return base::string16(); } std::string GetIconURL() const override { return std::string(); } - base::ProcessHandle GetProcessHandle() const override { - return base::ProcessHandle(); - } SortKey GetSortKey() const override { return SortKey(last_focused_time_); } int GetEstimatedMemoryFreedOnDiscardKB() const override { return 0; } - bool CanPurge() const override { return false; } bool CanDiscard(DiscardReason reason) const override { return false; } bool Discard(DiscardReason discard_reason) override { return false; }
diff --git a/chrome/browser/resource_coordinator/discard_metrics_util.cc b/chrome/browser/resource_coordinator/discard_metrics_util.cc new file mode 100644 index 0000000..b8766dd4 --- /dev/null +++ b/chrome/browser/resource_coordinator/discard_metrics_util.cc
@@ -0,0 +1,35 @@ +// 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/resource_coordinator/discard_metrics_util.h" + +#include "base/metrics/histogram_macros.h" + +namespace resource_coordinator { + +void RecordTabDiscarded() { + static int discard_count = 0; + UMA_HISTOGRAM_CUSTOM_COUNTS("TabManager.Discarding.DiscardCount", + ++discard_count, 1, 1000, 50); +} + +void RecordTabReloaded(base::TimeTicks last_active_time, + base::TimeTicks discard_time, + base::TimeTicks reload_time) { + static int reload_count = 0; + UMA_HISTOGRAM_CUSTOM_COUNTS("TabManager.Discarding.ReloadCount", + ++reload_count, 1, 1000, 50); + auto discard_to_reload_time = reload_time - discard_time; + UMA_HISTOGRAM_CUSTOM_TIMES( + "TabManager.Discarding.DiscardToReloadTime", discard_to_reload_time, + base::TimeDelta::FromSeconds(1), base::TimeDelta::FromDays(1), 100); + if (!last_active_time.is_null()) { + auto inactive_to_reload_time = reload_time - last_active_time; + UMA_HISTOGRAM_CUSTOM_TIMES( + "TabManager.Discarding.InactiveToReloadTime", inactive_to_reload_time, + base::TimeDelta::FromSeconds(1), base::TimeDelta::FromDays(1), 100); + } +} + +} // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/discard_metrics_util.h b/chrome/browser/resource_coordinator/discard_metrics_util.h new file mode 100644 index 0000000..913cc21 --- /dev/null +++ b/chrome/browser/resource_coordinator/discard_metrics_util.h
@@ -0,0 +1,25 @@ +// 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_RESOURCE_COORDINATOR_DISCARD_METRICS_UTIL_H_ +#define CHROME_BROWSER_RESOURCE_COORDINATOR_DISCARD_METRICS_UTIL_H_ + +#include "base/time/time.h" + +namespace resource_coordinator { + +// Records histograms when a tab is discarded. +void RecordTabDiscarded(); + +// Records histograms when a discarded tab is reloaded. |last_active_time| is +// the last time at which the tab was active. |discard_time| is the time at +// which the tab was discarded. |reload_time| is the time at which the tab was +// reloaded. +void RecordTabReloaded(base::TimeTicks last_active_time, + base::TimeTicks discard_time, + base::TimeTicks reload_time); + +} // namespace resource_coordinator + +#endif // CHROME_BROWSER_RESOURCE_COORDINATOR_DISCARD_METRICS_UTIL_H_
diff --git a/chrome/browser/resource_coordinator/lifecycle_unit.h b/chrome/browser/resource_coordinator/lifecycle_unit.h index a70cae1e..da515b80 100644 --- a/chrome/browser/resource_coordinator/lifecycle_unit.h +++ b/chrome/browser/resource_coordinator/lifecycle_unit.h
@@ -7,10 +7,8 @@ #include <stdint.h> #include <string> -#include <vector> #include "base/containers/flat_set.h" -#include "base/process/process_handle.h" #include "base/strings/string16.h" #include "base/time/time.h" #include "chrome/browser/resource_coordinator/discard_reason.h" @@ -64,13 +62,6 @@ // icon is available. virtual std::string GetIconURL() const = 0; - // Returns the process hosting this LifecycleUnit. Used to distribute OOM - // scores. - // - // TODO(fdoray): Change this to take into account the fact that a - // LifecycleUnit can be hosted in multiple processes. https://crbug.com/775644 - virtual base::ProcessHandle GetProcessHandle() const = 0; - // Returns a key that can be used to evaluate the relative importance of this // LifecycleUnit. // @@ -93,12 +84,6 @@ // than for individual LifecycleUnits. https://crbug.com/775644 virtual int GetEstimatedMemoryFreedOnDiscardKB() const = 0; - // Whether memory can be purged in the process hosting this LifecycleUnit. - // - // TODO(fdoray): This method should be on a class that represents a process, - // not on a LifecycleUnit. https://crbug.com/775644 - virtual bool CanPurge() const = 0; - // Returns true if this LifecycleUnit can be discared. virtual bool CanDiscard(DiscardReason reason) const = 0; @@ -117,7 +102,6 @@ }; using LifecycleUnitSet = base::flat_set<LifecycleUnit*>; -using LifecycleUnitVector = std::vector<LifecycleUnit*>; } // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc b/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc index e1deb5b7..7bec0a2c 100644 --- a/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc +++ b/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
@@ -37,13 +37,9 @@ } base::string16 GetTitle() const override { return base::string16(); } std::string GetIconURL() const override { return std::string(); } - base::ProcessHandle GetProcessHandle() const override { - return base::ProcessHandle(); - } SortKey GetSortKey() const override { return SortKey(); } State GetState() const override { return State::LOADED; } int GetEstimatedMemoryFreedOnDiscardKB() const override { return 0; } - bool CanPurge() const override { return false; } bool CanDiscard(DiscardReason reason) const override { return false; } bool Discard(DiscardReason discard_reason) override { return false; }
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc b/chrome/browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc new file mode 100644 index 0000000..f22849b --- /dev/null +++ b/chrome/browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc
@@ -0,0 +1,196 @@ +// Copyright (c) 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/macros.h" +#include "build/build_config.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/resource_coordinator/tab_lifecycle_observer.h" +#include "chrome/browser/resource_coordinator/tab_manager.h" +#include "chrome/browser/resource_coordinator/tab_manager_web_contents_data.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/tabs/tab_strip_model.h" +#include "chrome/common/url_constants.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "content/public/test/test_utils.h" +#include "url/gurl.h" + +using content::OpenURLParams; +using content::WebContents; + +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || \ + defined(OS_CHROMEOS) + +namespace resource_coordinator { + +class TabLifecycleObserverTest : public InProcessBrowserTest { + public: + TabLifecycleObserverTest() {} + + // Helper functions. + void set_tab_strip_model(TabStripModel* tsm) { tab_strip_model_ = tsm; } + + int GetIndex(WebContents* contents) { + return tab_strip_model_->GetIndexOfWebContents(contents); + } + + WebContents* GetContents(int index) { + return tab_strip_model_->GetWebContentsAt(index); + } + + int64_t ContentsId(WebContents* contents) { + return TabManager::IdFromWebContents(contents); + } + + private: + TabStripModel* tab_strip_model_; +}; + +class MockTabLifecycleObserver : public TabLifecycleObserver { + public: + MockTabLifecycleObserver() + : nb_events_(0), + contents_(nullptr), + is_discarded_(false), + is_auto_discardable_(true) {} + + // TabLifecycleObserver implementation: + void OnDiscardedStateChange(content::WebContents* contents, + bool is_discarded) override { + nb_events_++; + contents_ = contents; + is_discarded_ = is_discarded; + } + + void OnAutoDiscardableStateChange(content::WebContents* contents, + bool is_auto_discardable) override { + nb_events_++; + contents_ = contents; + is_auto_discardable_ = is_auto_discardable; + } + + int nb_events() const { return nb_events_; } + WebContents* content() const { return contents_; } + bool is_discarded() const { return is_discarded_; } + bool is_auto_discardable() const { return is_auto_discardable_; } + + private: + int nb_events_; + WebContents* contents_; + bool is_discarded_; + bool is_auto_discardable_; + + DISALLOW_COPY_AND_ASSIGN(MockTabLifecycleObserver); +}; + +IN_PROC_BROWSER_TEST_F(TabLifecycleObserverTest, OnDiscardStateChange) { + TabManager* tab_manager = g_browser_process->GetTabManager(); + auto* tsm = browser()->tab_strip_model(); + set_tab_strip_model(tsm); + + // Open two tabs. + OpenURLParams open1(GURL(chrome::kChromeUIAboutURL), content::Referrer(), + WindowOpenDisposition::NEW_BACKGROUND_TAB, + ui::PAGE_TRANSITION_TYPED, false); + int index_1 = GetIndex(browser()->OpenURL(open1)); + + OpenURLParams open2(GURL(chrome::kChromeUICreditsURL), content::Referrer(), + WindowOpenDisposition::NEW_BACKGROUND_TAB, + ui::PAGE_TRANSITION_TYPED, false); + int index_2 = GetIndex(browser()->OpenURL(open2)); + + // Subscribe observer to TabManager's observer list. + MockTabLifecycleObserver tabmanager_observer; + tab_manager->AddObserver(&tabmanager_observer); + + // Discards both tabs and make sure the events were observed properly. + EXPECT_TRUE(tab_manager->DiscardTabById(ContentsId(GetContents(index_1)), + DiscardReason::kProactive)); + EXPECT_EQ(1, tabmanager_observer.nb_events()); + EXPECT_EQ(ContentsId(GetContents(index_1)), + ContentsId(tabmanager_observer.content())); + EXPECT_TRUE(tabmanager_observer.is_discarded()); + + EXPECT_TRUE(tab_manager->DiscardTabById(ContentsId(GetContents(index_2)), + DiscardReason::kProactive)); + EXPECT_EQ(2, tabmanager_observer.nb_events()); + EXPECT_EQ(ContentsId(GetContents(index_2)), + ContentsId(tabmanager_observer.content())); + EXPECT_TRUE(tabmanager_observer.is_discarded()); + + // Discarding an already discarded tab shouldn't fire the observers. + EXPECT_FALSE(tab_manager->DiscardTabById(ContentsId(GetContents(index_1)), + DiscardReason::kProactive)); + EXPECT_EQ(2, tabmanager_observer.nb_events()); + + // Reload tab 1. + tsm->ActivateTabAt(index_1, false); + EXPECT_EQ(index_1, tsm->active_index()); + EXPECT_EQ(3, tabmanager_observer.nb_events()); + EXPECT_EQ(ContentsId(GetContents(index_1)), + ContentsId(tabmanager_observer.content())); + EXPECT_FALSE(tabmanager_observer.is_discarded()); + + // Reloading a tab that's not discarded shouldn't fire the observers. + tsm->ActivateTabAt(index_1, false); + EXPECT_EQ(3, tabmanager_observer.nb_events()); + + // Reload tab 2. + tsm->ActivateTabAt(index_2, false); + EXPECT_EQ(index_2, tsm->active_index()); + EXPECT_EQ(4, tabmanager_observer.nb_events()); + EXPECT_EQ(ContentsId(GetContents(index_2)), + ContentsId(tabmanager_observer.content())); + EXPECT_FALSE(tabmanager_observer.is_discarded()); + + // After removing the observer from the TabManager's list, it shouldn't + // receive events anymore. + tab_manager->RemoveObserver(&tabmanager_observer); + EXPECT_TRUE(tab_manager->DiscardTabById(ContentsId(GetContents(index_1)), + DiscardReason::kProactive)); + EXPECT_EQ(4, tabmanager_observer.nb_events()); +} + +IN_PROC_BROWSER_TEST_F(TabLifecycleObserverTest, OnAutoDiscardableStateChange) { + TabManager* tab_manager = g_browser_process->GetTabManager(); + auto* tsm = browser()->tab_strip_model(); + set_tab_strip_model(tsm); + + // Open two tabs. + OpenURLParams open(GURL(chrome::kChromeUIAboutURL), content::Referrer(), + WindowOpenDisposition::NEW_BACKGROUND_TAB, + ui::PAGE_TRANSITION_TYPED, false); + WebContents* contents = browser()->OpenURL(open); + + // Subscribe observer to TabManager's observer list. + MockTabLifecycleObserver observer; + tab_manager->AddObserver(&observer); + + // No events initially. + EXPECT_EQ(0, observer.nb_events()); + + // Should maintain at zero since the default value of the state is true. + tab_manager->SetTabAutoDiscardableState(contents, true); + EXPECT_EQ(0, observer.nb_events()); + + // Now it has to change. + tab_manager->SetTabAutoDiscardableState(contents, false); + EXPECT_EQ(1, observer.nb_events()); + EXPECT_FALSE(observer.is_auto_discardable()); + EXPECT_EQ(ContentsId(contents), ContentsId(observer.content())); + + // No changes since it's not a new state. + tab_manager->SetTabAutoDiscardableState(contents, false); + EXPECT_EQ(1, observer.nb_events()); + + // Change it back and we should have another event. + tab_manager->SetTabAutoDiscardableState(contents, true); + EXPECT_EQ(2, observer.nb_events()); + EXPECT_TRUE(observer.is_auto_discardable()); + EXPECT_EQ(ContentsId(contents), ContentsId(observer.content())); +} + +} // namespace resource_coordinator + +#endif // defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) || + // defined(OS_CHROMEOS)
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc index 102cd21..fe8e17e 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
@@ -95,17 +95,6 @@ return favicon.valid ? favicon.url.spec() : std::string(); } -base::ProcessHandle TabLifecycleUnitSource::TabLifecycleUnit::GetProcessHandle() - const { - content::RenderFrameHost* main_frame = GetWebContents()->GetMainFrame(); - if (!main_frame) - return base::ProcessHandle(); - content::RenderProcessHost* process = main_frame->GetProcess(); - if (!process) - return base::ProcessHandle(); - return process->GetHandle(); -} - LifecycleUnit::SortKey TabLifecycleUnitSource::TabLifecycleUnit::GetSortKey() const { return SortKey(last_focused_time_); @@ -117,11 +106,6 @@ return 0; } -bool TabLifecycleUnitSource::TabLifecycleUnit::CanPurge() const { - // A renderer can be purged if it's not playing media. - return !IsMediaTab(); -} - bool TabLifecycleUnitSource::TabLifecycleUnit::CanDiscard( DiscardReason reason) const { // Can't discard a tab that is already discarded.
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit.h b/chrome/browser/resource_coordinator/tab_lifecycle_unit.h index 2573efc..3cfaa4f 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit.h +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
@@ -73,10 +73,8 @@ TabLifecycleUnitExternal* AsTabLifecycleUnitExternal() override; base::string16 GetTitle() const override; std::string GetIconURL() const override; - base::ProcessHandle GetProcessHandle() const override; SortKey GetSortKey() const override; int GetEstimatedMemoryFreedOnDiscardKB() const override; - bool CanPurge() const override; bool CanDiscard(DiscardReason reason) const override; bool Discard(DiscardReason discard_reason) override;
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc index fa777285..7992ea3 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc
@@ -4,7 +4,6 @@ #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" -#include "base/logging.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" namespace resource_coordinator { @@ -13,24 +12,9 @@ TabLifecycleUnitExternal* TabLifecycleUnitExternal::FromWebContents( content::WebContents* web_contents) { TabLifecycleUnitSource* source = TabLifecycleUnitSource::GetInstance(); - DCHECK(source); + if (!source) + return nullptr; return source->GetTabLifecycleUnitExternal(web_contents); } -// static -void TabLifecycleUnitExternal::AddTabLifecycleObserver( - TabLifecycleObserver* observer) { - TabLifecycleUnitSource* source = TabLifecycleUnitSource::GetInstance(); - DCHECK(source); - source->AddTabLifecycleObserver(observer); -} - -// static -void TabLifecycleUnitExternal::RemoveTabLifecycleObserver( - TabLifecycleObserver* observer) { - TabLifecycleUnitSource* source = TabLifecycleUnitSource::GetInstance(); - DCHECK(source); - source->RemoveTabLifecycleObserver(observer); -} - } // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h b/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h index 81bd970..8b11fb7f 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
@@ -11,8 +11,6 @@ namespace resource_coordinator { -class TabLifecycleObserver; - // Interface to control the lifecycle of a tab exposed outside of // chrome/browser/resource_coordinator/. class TabLifecycleUnitExternal { @@ -22,11 +20,6 @@ static TabLifecycleUnitExternal* FromWebContents( content::WebContents* web_contents); - // Adds / removes an observer that is notified when the discarded or auto- - // discardable state of a tab changes. - static void AddTabLifecycleObserver(TabLifecycleObserver* observer); - static void RemoveTabLifecycleObserver(TabLifecycleObserver* observer); - virtual ~TabLifecycleUnitExternal() = default; // Returns the WebContents associated with this tab.
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc index e3093d3c..d5aecc9b 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
@@ -66,9 +66,7 @@ TabStripModel* TabLifecycleUnitSource::GetFocusedTabStripModel() const { if (focused_tab_strip_model_for_testing_) return focused_tab_strip_model_for_testing_; - // Use FindLastActive() rather than FindBrowserWithActiveWindow() to avoid - // flakiness when focus changes during browser tests. - Browser* const focused_browser = chrome::FindLastActive(); + Browser* const focused_browser = chrome::FindBrowserWithActiveWindow(); if (!focused_browser) return nullptr; return focused_browser->tab_strip_model(); @@ -161,11 +159,7 @@ if (change_type != TabChangeType::kAll) return; auto it = tabs_.find(contents); - // The WebContents destructor might cause this function to be called, at this - // point TabClosingAt has already been called and so this WebContents has - // been removed from |tabs_|. - if (it == tabs_.end()) - return; + DCHECK(it != tabs_.end()); TabLifecycleUnit* lifecycle_unit = it->second.get(); lifecycle_unit->SetRecentlyAudible(contents->WasRecentlyAudible()); }
diff --git a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc index c05c8c6..4273915 100644 --- a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
@@ -74,18 +74,15 @@ protected: TabLifecycleUnitSourceTest() : scoped_set_tick_clock_for_testing_(&test_clock_) { + source_.AddObserver(&source_observer_); + source_.AddTabLifecycleObserver(&tab_observer_); } void SetUp() override { ChromeRenderViewHostTestHarness::SetUp(); - - source_ = TabLifecycleUnitSource::GetInstance(); - source_->AddObserver(&source_observer_); - source_->AddTabLifecycleObserver(&tab_observer_); - tab_strip_model_ = std::make_unique<TabStripModel>(&tab_strip_model_delegate_, profile()); - tab_strip_model_->AddObserver(source_); + tab_strip_model_->AddObserver(&source_); } void TearDown() override { @@ -106,7 +103,7 @@ LifecycleUnit** first_lifecycle_unit, LifecycleUnit** second_lifecycle_unit) { if (focus_tab_strip) - source_->SetFocusedTabStripModelForTesting(tab_strip_model_.get()); + source_.SetFocusedTabStripModelForTesting(tab_strip_model_.get()); // Add a foreground tab to the tab strip. test_clock_.Advance(kShortDelay); @@ -125,7 +122,7 @@ content::WebContents* first_web_contents = CreateAndNavigateWebContents(); tab_strip_model_->AppendWebContents(first_web_contents, true); testing::Mock::VerifyAndClear(&source_observer_); - EXPECT_TRUE(source_->GetTabLifecycleUnitExternal(first_web_contents)); + EXPECT_TRUE(source_.GetTabLifecycleUnitExternal(first_web_contents)); // Add another foreground tab to the focused tab strip. test_clock_.Advance(kShortDelay); @@ -148,7 +145,7 @@ content::WebContents* second_web_contents = CreateAndNavigateWebContents(); tab_strip_model_->AppendWebContents(second_web_contents, true); testing::Mock::VerifyAndClear(&source_observer_); - EXPECT_TRUE(source_->GetTabLifecycleUnitExternal(second_web_contents)); + EXPECT_TRUE(source_.GetTabLifecycleUnitExternal(second_web_contents)); // TabStripModel doesn't update the visibility of its WebContents by itself. first_web_contents->WasHidden(); @@ -188,7 +185,7 @@ content::WebContents* third_web_contents = CreateAndNavigateWebContents(); tab_strip_model_->AppendWebContents(third_web_contents, false); testing::Mock::VerifyAndClear(&source_observer_); - EXPECT_TRUE(source_->GetTabLifecycleUnitExternal(third_web_contents)); + EXPECT_TRUE(source_.GetTabLifecycleUnitExternal(third_web_contents)); // Expect notifications when tabs are closed. EXPECT_CALL(source_observer_, @@ -200,7 +197,7 @@ tab_strip_model_->CloseAllTabs(); } - TabLifecycleUnitSource* source_ = nullptr; + TabLifecycleUnitSource source_; testing::StrictMock<MockLifecycleUnitSourceObserver> source_observer_; testing::StrictMock<MockTabLifecycleObserver> tab_observer_; std::unique_ptr<TabStripModel> tab_strip_model_; @@ -283,13 +280,13 @@ content::WebContents* original_web_contents = tab_strip_model_->GetWebContentsAt(1); TabLifecycleUnitExternal* tab_lifecycle_unit_external = - source_->GetTabLifecycleUnitExternal(original_web_contents); + source_.GetTabLifecycleUnitExternal(original_web_contents); content::WebContents* new_web_contents = CreateTestWebContents(); EXPECT_EQ(original_web_contents, tab_strip_model_->ReplaceWebContentsAt(1, new_web_contents)); - EXPECT_FALSE(source_->GetTabLifecycleUnitExternal(original_web_contents)); + EXPECT_FALSE(source_.GetTabLifecycleUnitExternal(original_web_contents)); EXPECT_EQ(tab_lifecycle_unit_external, - source_->GetTabLifecycleUnitExternal(new_web_contents)); + source_.GetTabLifecycleUnitExternal(new_web_contents)); delete original_web_contents; @@ -331,7 +328,7 @@ EXPECT_EQ(kDummyLastActiveTime, tab_strip_model_->GetWebContentsAt(0)->GetLastActiveTime()); - source_->SetFocusedTabStripModelForTesting(nullptr); + source_.SetFocusedTabStripModelForTesting(nullptr); } TEST_F(TabLifecycleUnitSourceTest, DiscardAndActivate) {
diff --git a/chrome/browser/resource_coordinator/tab_manager.cc b/chrome/browser/resource_coordinator/tab_manager.cc index 143a574e..a11970a 100644 --- a/chrome/browser/resource_coordinator/tab_manager.cc +++ b/chrome/browser/resource_coordinator/tab_manager.cc
@@ -11,10 +11,12 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/containers/flat_set.h" #include "base/feature_list.h" #include "base/memory/memory_pressure_monitor.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" +#include "base/observer_list.h" #include "base/process/process.h" #include "base/rand_util.h" #include "base/strings/string16.h" @@ -31,7 +33,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/resource_coordinator/background_tab_navigation_throttle.h" #include "chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.h" -#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" +#include "chrome/browser/resource_coordinator/tab_lifecycle_observer.h" #include "chrome/browser/resource_coordinator/tab_manager_features.h" #include "chrome/browser/resource_coordinator/tab_manager_resource_coordinator_signal_observer.h" #include "chrome/browser/resource_coordinator/tab_manager_stats_collector.h" @@ -61,6 +63,7 @@ #include "content/public/common/content_features.h" #include "content/public/common/page_importance_signals.h" #include "third_party/WebKit/public/platform/WebSuddenTerminationDisablerType.h" +#include "ui/gfx/geometry/rect.h" #if defined(OS_CHROMEOS) #include "chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h" @@ -87,21 +90,85 @@ // value. const int kAdjustmentIntervalSeconds = 10; -struct LifecycleUnitAndSortKey { - explicit LifecycleUnitAndSortKey(LifecycleUnit* lifecycle_unit) - : lifecycle_unit(lifecycle_unit), - sort_key(lifecycle_unit->GetSortKey()) {} +// The time during which a tab is protected from discarding after it stops being +// audible. +const int kAudioProtectionTimeSeconds = 60; - bool operator<(const LifecycleUnitAndSortKey& other) const { - return sort_key < other.sort_key; - } - bool operator>(const LifecycleUnitAndSortKey& other) const { - return sort_key > other.sort_key; +int FindWebContentsById(const TabStripModel* model, int32_t tab_id) { + for (int idx = 0; idx < model->count(); idx++) { + WebContents* web_contents = model->GetWebContentsAt(idx); + auto* data = TabManager::WebContentsData::FromWebContents(web_contents); + if (data && tab_id == data->id()) + return idx; } - LifecycleUnit* lifecycle_unit; - LifecycleUnit::SortKey sort_key; -}; + return -1; +} + +void ReloadWebContentsIfDiscarded(WebContents* contents, + TabManager::WebContentsData* contents_data) { + if (contents_data->IsDiscarded()) { + contents->GetController().SetNeedsReload(); + contents->GetController().LoadIfNecessary(); + contents_data->SetDiscardState(false); + } +} + +// Returns a set with browsers in |browser_info_list| that are completely +// covered by another browser in |browser_info_list| (some browsers that match +// this description might not be included in the set if insufficient z-order +// information is provided). Non-browser windows are not taken into +// consideration when computing window occlusion, because there is no simple way +// to know whether they opaquely fill their bounds. +// +// TODO(fdoray): Handle the case where a browser window is completely covered by +// the union of other browser windows but not by a single browser window. +base::flat_set<const BrowserInfo*> GetOccludedBrowsers( + const std::vector<BrowserInfo>& browser_info_list, + const std::vector<gfx::NativeWindow>& windows_sorted_by_z_index) { + base::flat_set<const BrowserInfo*> occluded_browsers; + std::vector<gfx::Rect> bounds_of_previous_browsers; + + // Traverse windows from topmost to bottommost. + for (gfx::NativeWindow native_window : windows_sorted_by_z_index) { + // Find the BrowserInfo corresponding to the current NativeWindow. + auto browser_info_it = std::find_if( + browser_info_list.begin(), browser_info_list.end(), + [&native_window](const BrowserInfo& browser_info) { + return browser_info.browser->window()->GetNativeWindow() == + native_window; + }); + + // Skip the current NativeWindow if no browser is associated with it or if + // the associated browser is minimized. + if (browser_info_it == browser_info_list.end() || + browser_info_it->browser->window()->IsMinimized()) { + continue; + } + + // Determine if the browser window is occluded by looking for a previously + // traversed browser window that completely covers it.] + bool browser_is_occluded = false; + const gfx::Rect bounds = browser_info_it->browser->window()->GetBounds(); + for (const gfx::Rect other_bounds : bounds_of_previous_browsers) { + if (other_bounds.Contains(bounds)) { + browser_is_occluded = true; + break; + } + } + + // Add the current browser to the list of occluded browsers if + // |browser_is_occluded| is true. Otherwise, add the current window bounds + // to |bounds_of_previous_browsers| for use in future window occlusion + // computations. + if (browser_is_occluded) + occluded_browsers.insert(&*browser_info_it); + else + bounds_of_previous_browsers.push_back(bounds); + } + + return occluded_browsers; +} std::unique_ptr<base::trace_event::ConvertableToTraceFormat> DataAsTraceValue( TabManager::BackgroundTabLoadingMode mode, @@ -152,10 +219,12 @@ constexpr base::TimeDelta TabManager::kDefaultMinTimeToPurge; TabManager::TabManager() - : browser_tab_strip_tracker_(this, nullptr, nullptr), + : discard_count_(0), + browser_tab_strip_tracker_(this, nullptr, this), is_session_restore_loading_tabs_(false), restored_tab_count_(0u), background_tab_loading_mode_(BackgroundTabLoadingMode::kStaggered), + force_load_timer_(std::make_unique<base::OneShotTimer>(GetTickClock())), loading_slots_(kNumOfLoadingSlots), weak_ptr_factory_(this) { #if defined(OS_CHROMEOS) @@ -238,31 +307,106 @@ void TabManager::Stop() { update_timer_.Stop(); - force_load_timer_.reset(); + force_load_timer_->Stop(); memory_pressure_listener_.reset(); } -LifecycleUnitVector TabManager::GetSortedLifecycleUnits() { - std::vector<LifecycleUnitAndSortKey> lifecycle_units_and_sort_keys; - lifecycle_units_and_sort_keys.reserve(lifecycle_units_.size()); - for (auto* lifecycle_unit : lifecycle_units_) - lifecycle_units_and_sort_keys.emplace_back(lifecycle_unit); - std::sort(lifecycle_units_and_sort_keys.begin(), - lifecycle_units_and_sort_keys.end()); +int TabManager::FindTabStripModelById(int32_t tab_id, + TabStripModel** model) const { + DCHECK(model); - LifecycleUnitVector sorted_lifecycle_units; - sorted_lifecycle_units.reserve(lifecycle_units_.size()); - for (auto& lifecycle_unit_and_sort_key : lifecycle_units_and_sort_keys) { - sorted_lifecycle_units.push_back( - lifecycle_unit_and_sort_key.lifecycle_unit); + for (const auto& browser_info : GetBrowserInfoList()) { + TabStripModel* local_model = browser_info.tab_strip_model; + int idx = FindWebContentsById(local_model, tab_id); + if (idx != -1) { + *model = local_model; + return idx; + } } - return sorted_lifecycle_units; + return -1; +} + +TabStatsList TabManager::GetTabStats() const { + TabStatsList stats_list(GetUnsortedTabStats()); + + // Sort the collected data so that least desirable to be killed is first, most + // desirable is last. + std::sort(stats_list.begin(), stats_list.end(), CompareTabStats); + + return stats_list; } bool TabManager::IsTabDiscarded(content::WebContents* contents) const { - auto* lifecycle_unit = TabLifecycleUnitExternal::FromWebContents(contents); - return lifecycle_unit && lifecycle_unit->IsDiscarded(); + return GetWebContentsData(contents)->IsDiscarded(); +} + +bool TabManager::CanDiscardTab(const TabStats& tab_stats, + DiscardReason reason) const { +#if defined(OS_CHROMEOS) + if (tab_stats.is_active && tab_stats.is_in_visible_window) + return false; +#else + if (tab_stats.is_active) + return false; +#endif // defined(OS_CHROMEOS) + + TabStripModel* model; + const int idx = FindTabStripModelById(tab_stats.id, &model); + + if (idx == -1) + return false; + + WebContents* web_contents = model->GetWebContentsAt(idx); + + // Do not discard tabs that don't have a valid URL (most probably they have + // just been opened and dicarding them would lose the URL). + // TODO(georgesak): Look into a workaround to be able to kill the tab without + // losing the pending navigation. + if (!web_contents->GetLastCommittedURL().is_valid() || + web_contents->GetLastCommittedURL().is_empty()) { + return false; + } + + // Do not discard tabs in which the user has entered text in a form, lest that + // state gets lost. + if (web_contents->GetPageImportanceSignals().had_form_interaction) + return false; + + // Do not discard tabs that are playing either playing audio or accessing the + // microphone or camera as it's too distruptive to the user experience. Note + // that tabs that have recently stopped playing audio by at least + // |kAudioProtectionTimeSeconds| seconds are protected as well. + if (IsMediaTab(web_contents)) + return false; + + // Do not discard PDFs as they might contain entry that is not saved and they + // don't remember their scrolling positions. See https://crbug.com/547286 and + // https://crbug.com/65244. + // TODO(georgesak): Remove this workaround when the bugs are fixed. + if (web_contents->GetContentsMimeType() == "application/pdf") + return false; + + // Do not discard a tab that was explicitly disallowed to. + if (!IsTabAutoDiscardable(web_contents)) + return false; + +#if defined(OS_CHROMEOS) + // The following protections are ignored on ChromeOS during urgent discard, + // because running out of memory would lead to a kernel panic. + if (reason == DiscardReason::kUrgent) + return true; +#endif // defined(OS_CHROMEOS) + + if (GetWebContentsData(web_contents)->DiscardCount() > 0) + return false; + + auto delta = + NowTicks() - GetWebContentsData(web_contents)->LastInactiveTime(); + if (delta < kDiscardProtectionTime) + return false; + + return true; } void TabManager::DiscardTab(DiscardReason reason) { @@ -279,23 +423,22 @@ DiscardTabImpl(reason); } -void TabManager::DiscardTabById(int32_t tab_id, DiscardReason reason) { - for (LifecycleUnit* lifecycle_unit : lifecycle_units_) { - if (lifecycle_unit->GetID() == tab_id) { - lifecycle_unit->Discard(reason); - return; - } - } +WebContents* TabManager::DiscardTabById(int32_t tab_id, DiscardReason reason) { + TabStripModel* model; + int index = FindTabStripModelById(tab_id, &model); + + if (index == -1) + return nullptr; + + VLOG(1) << "Discarding tab " << index << " id " << tab_id; + + return DiscardWebContentsAt(index, model, reason); } WebContents* TabManager::DiscardTabByExtension(content::WebContents* contents) { if (contents) { - TabLifecycleUnitExternal* tab_lifecycle_unit_external = - TabLifecycleUnitExternal::FromWebContents(contents); - DCHECK(tab_lifecycle_unit_external); - if (tab_lifecycle_unit_external->DiscardTab()) - return tab_lifecycle_unit_external->GetWebContents(); - return nullptr; + return DiscardTabById(IdFromWebContents(contents), + DiscardReason::kExternal); } return DiscardTabImpl(DiscardReason::kExternal); @@ -312,56 +455,118 @@ memory::OomMemoryDetails::Log(title, callback); } +TabStatsList TabManager::GetUnsortedTabStats( + const std::vector<gfx::NativeWindow>& windows_sorted_by_z_index) const { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + const auto browser_info_list = GetBrowserInfoList(); + const base::flat_set<const BrowserInfo*> occluded_browsers = + GetOccludedBrowsers(browser_info_list, windows_sorted_by_z_index); + + TabStatsList stats_list; + stats_list.reserve(32); // 99% of users have < 30 tabs open. + for (const BrowserInfo& browser_info : browser_info_list) { + const bool window_is_active = stats_list.empty(); + const bool window_is_visible = + !browser_info.window_is_minimized && + !base::ContainsKey(occluded_browsers, &browser_info); + AddTabStats(browser_info, window_is_active, window_is_visible, &stats_list); + } + + return stats_list; +} + void TabManager::AddObserver(TabLifecycleObserver* observer) { - TabLifecycleUnitExternal::AddTabLifecycleObserver(observer); + observers_.AddObserver(observer); } void TabManager::RemoveObserver(TabLifecycleObserver* observer) { - TabLifecycleUnitExternal::RemoveTabLifecycleObserver(observer); + observers_.RemoveObserver(observer); } bool TabManager::IsTabAutoDiscardable(content::WebContents* contents) const { - auto* lifecycle_unit = TabLifecycleUnitExternal::FromWebContents(contents); - return !lifecycle_unit || lifecycle_unit->IsAutoDiscardable(); + return GetWebContentsData(contents)->IsAutoDiscardable(); } void TabManager::SetTabAutoDiscardableState(int32_t tab_id, bool state) { - for (LifecycleUnit* lifecycle_unit : lifecycle_units_) { - if (lifecycle_unit->GetID() == tab_id) { - TabLifecycleUnitExternal* tab_lifecycle_unit_external = - lifecycle_unit->AsTabLifecycleUnitExternal(); - // For now, all LifecycleUnits are TabLifecycleUnitExternals. - DCHECK(tab_lifecycle_unit_external); - tab_lifecycle_unit_external->SetAutoDiscardable(state); - return; - } - } + auto* web_contents = GetWebContentsById(tab_id); + if (web_contents) + SetTabAutoDiscardableState(web_contents, state); } void TabManager::SetTabAutoDiscardableState(content::WebContents* contents, bool state) { - TabLifecycleUnitExternal::FromWebContents(contents)->SetAutoDiscardable( - state); + GetWebContentsData(contents)->SetAutoDiscardableState(state); +} + +content::WebContents* TabManager::GetWebContentsById(int32_t tab_id) const { + TabStripModel* model = nullptr; + int index = FindTabStripModelById(tab_id, &model); + if (index == -1) + return nullptr; + return model->GetWebContentsAt(index); } bool TabManager::CanPurgeBackgroundedRenderer(int render_process_id) const { - for (LifecycleUnit* lifecycle_unit : lifecycle_units_) { - TabLifecycleUnitExternal* tab_lifecycle_unit_external = - lifecycle_unit->AsTabLifecycleUnitExternal(); - // For now, all LifecycleUnits are TabLifecycleUnitExternals. - DCHECK(tab_lifecycle_unit_external); - content::WebContents* content = - tab_lifecycle_unit_external->GetWebContents(); - DCHECK(content); - - if (content->GetMainFrame()->GetProcess()->GetID() != render_process_id) + // A renderer can be purged if it's not playing media. + auto tab_stats = GetUnsortedTabStats(); + for (auto& tab : tab_stats) { + if (tab.child_process_host_id != render_process_id) continue; - if (!lifecycle_unit->CanPurge()) + WebContents* web_contents = GetWebContentsById(tab.id); + if (!web_contents) + return false; + if (IsMediaTab(web_contents)) return false; } return true; } +// static +bool TabManager::CompareTabStats(const TabStats& first, + const TabStats& second) { + // Protect non auto-discardable tabs. + if (first.is_auto_discardable != second.is_auto_discardable) + return !first.is_auto_discardable; + + // Protect tabs with pending form entries. + if (first.has_form_entry != second.has_form_entry) + return first.has_form_entry; + + // Protect streaming audio and video conferencing tabs as these are similar to + // active tabs. + if (first.is_media != second.is_media) + return first.is_media; + + // Tab with internal web UI like NTP or Settings are good choices to discard, + // so protect non-Web UI and let the other conditionals finish the sort. + if (first.is_internal_page != second.is_internal_page) + return !first.is_internal_page; + + // Being pinned is important to protect. + if (first.is_pinned != second.is_pinned) + return first.is_pinned; + + // Being an app is important too, as it's the only visible surface in the + // window and should not be discarded. + if (first.is_app != second.is_app) + return first.is_app; + + // A tab with a beforeunload handler usually indicates that the tab has + // unsaved user state. + if (first.has_beforeunload_handler != second.has_beforeunload_handler) + return first.has_beforeunload_handler; + + // Being more recently active is more important. + return first.last_active > second.last_active; +} + +// static +int32_t TabManager::IdFromWebContents(WebContents* web_contents) { + auto* data = GetWebContentsData(web_contents); + return data->id(); +} + bool TabManager::IsTabInSessionRestore(WebContents* web_contents) const { return GetWebContentsData(web_contents)->is_in_session_restore(); } @@ -398,6 +603,18 @@ /////////////////////////////////////////////////////////////////////////////// // TabManager, private: +void TabManager::OnDiscardedStateChange(content::WebContents* contents, + bool is_discarded) { + for (TabLifecycleObserver& observer : observers_) + observer.OnDiscardedStateChange(contents, is_discarded); +} + +void TabManager::OnAutoDiscardableStateChange(content::WebContents* contents, + bool is_auto_discardable) { + for (TabLifecycleObserver& observer : observers_) + observer.OnAutoDiscardableStateChange(contents, is_auto_discardable); +} + // static void TabManager::PurgeMemoryAndDiscardTab(DiscardReason reason) { TabManager* manager = g_browser_process->GetTabManager(); @@ -436,6 +653,56 @@ } } +void TabManager::AddTabStats(const BrowserInfo& browser_info, + bool window_is_active, + bool window_is_visible, + TabStatsList* stats_list) const { + TabStripModel* tab_strip_model = browser_info.tab_strip_model; + for (int i = 0; i < tab_strip_model->count(); i++) { + WebContents* contents = tab_strip_model->GetWebContentsAt(i); + if (!contents->IsCrashed()) { + TabStats stats; + stats.is_app = browser_info.browser_is_app; + stats.is_internal_page = IsInternalPage(contents->GetLastCommittedURL()); + stats.is_media = IsMediaTab(contents); + stats.is_pinned = tab_strip_model->IsTabPinned(i); + stats.is_active = tab_strip_model->active_index() == i; + stats.is_in_active_window = window_is_active; + stats.is_in_visible_window = window_is_visible; + stats.is_discarded = GetWebContentsData(contents)->IsDiscarded(); + stats.has_form_entry = + contents->GetPageImportanceSignals().had_form_interaction; + stats.discard_count = GetWebContentsData(contents)->DiscardCount(); + stats.last_active = contents->GetLastActiveTime(); + stats.render_process_host = contents->GetMainFrame()->GetProcess(); + stats.renderer_handle = + contents->GetMainFrame()->GetProcess()->GetHandle(); + stats.child_process_host_id = + contents->GetMainFrame()->GetProcess()->GetID(); +#if defined(OS_CHROMEOS) + stats.oom_score = delegate_->GetCachedOomScore(stats.renderer_handle); +#endif + stats.tab_url = contents->GetLastCommittedURL().spec(); + auto* commit = contents->GetController().GetLastCommittedEntry(); + if (commit) { + const auto& favicon = commit->GetFavicon(); + if (favicon.valid) + stats.favicon_url = favicon.url.spec(); + } + stats.title = contents->GetTitle(); + stats.id = IdFromWebContents(contents); + content::RenderFrameHost* render_frame = contents->GetMainFrame(); + DCHECK(render_frame); + stats.has_beforeunload_handler = + render_frame->GetSuddenTerminationDisablerState( + blink::kBeforeUnloadHandler); + stats.is_auto_discardable = + GetWebContentsData(contents)->IsAutoDiscardable(); + stats_list->push_back(stats); + } + } +} + // This function is called when |update_timer_| fires. It will adjust the clock // if needed (if it detects that the machine was asleep) and will fire the stats // updating on ChromeOS via the delegate. This function also tries to purge @@ -449,8 +716,9 @@ return; #if defined(OS_CHROMEOS) + TabStatsList stats_list = GetTabStats(); // This starts the CrOS specific OOM adjustments in /proc/<pid>/oom_score_adj. - delegate_->AdjustOomPriorities(); + delegate_->AdjustOomPriorities(stats_list); #endif PurgeBackgroundedTabsIfNeeded(); @@ -466,8 +734,6 @@ bool TabManager::ShouldPurgeNow(content::WebContents* content) const { if (GetWebContentsData(content)->is_purged()) return false; - if (IsTabDiscarded(content)) - return false; base::TimeDelta time_passed = NowTicks() - GetWebContentsData(content)->LastInactiveTime(); @@ -475,28 +741,15 @@ } void TabManager::PurgeBackgroundedTabsIfNeeded() { - for (LifecycleUnit* lifecycle_unit : lifecycle_units_) { - TabLifecycleUnitExternal* tab_lifecycle_unit_external = - lifecycle_unit->AsTabLifecycleUnitExternal(); - // For now, all LifecycleUnits are TabLifecycleUnitExternals. - DCHECK(tab_lifecycle_unit_external); - content::WebContents* content = - tab_lifecycle_unit_external->GetWebContents(); - // TODO(fdoray): Check if TabLifecycleUnitSource should override - // WebContentsObserver::WebContentsDestroyed() as in some situations a - // WebContents might get destroyed without a call to - // TabStripModelObserver::TabClosingAt, in this case we'll have a - // TabLifecycleUnitExternal that points to a null WebContents. - if (content == nullptr) - return; - - content::RenderProcessHost* render_process_host = - content->GetMainFrame()->GetProcess(); - int render_process_id = render_process_host->GetID(); - - if (!render_process_host->IsProcessBackgrounded()) + auto tab_stats = GetUnsortedTabStats(); + for (auto& tab : tab_stats) { + if (!tab.render_process_host->IsProcessBackgrounded()) continue; - if (!CanPurgeBackgroundedRenderer(render_process_id)) + if (!CanPurgeBackgroundedRenderer(tab.child_process_host_id)) + continue; + + WebContents* content = GetWebContentsById(tab.id); + if (!content) continue; bool purge_now = ShouldPurgeNow(content); @@ -508,10 +761,94 @@ GetWebContentsData(content)->set_is_purged(true); // TODO(tasak): rename PurgeAndSuspend with a better name, e.g. // RequestPurgeCache, because we don't suspend any renderers. - render_process_host->PurgeAndSuspend(); + tab.render_process_host->PurgeAndSuspend(); } } +WebContents* TabManager::DiscardWebContentsAt(int index, + TabStripModel* model, + DiscardReason reason) { + WebContents* old_contents = model->GetWebContentsAt(index); + + // Can't discard tabs that are already discarded. + if (GetWebContentsData(old_contents)->IsDiscarded()) + return nullptr; + + ++discard_count_; + + UMA_HISTOGRAM_BOOLEAN( + "TabManager.Discarding.DiscardedTabHasBeforeUnloadHandler", + old_contents->NeedToFireBeforeUnload()); + + WebContents* null_contents = + WebContents::Create(WebContents::CreateParams(model->profile())); + // Copy over the state from the navigation controller to preserve the + // back/forward history and to continue to display the correct title/favicon. + // + // Set |needs_reload| to false so that the tab is not automatically reloaded + // when activated (otherwise, there would be an immediate reload when the + // active tab in a non-visible window is discarded). TabManager will + // explicitly reload the tab when it becomes the active tab in an active + // window (ReloadWebContentsIfDiscarded). + // + // Note: It is important that |needs_reload| is false even when the discarded + // tab is not active. Otherwise, it would get reloaded by + // WebContentsImpl::WasShown() and by ReloadWebContentsIfDiscarded() when + // activated. + null_contents->GetController().CopyStateFrom(old_contents->GetController(), + /* needs_reload */ false); + + // Make sure to persist the last active time property. + null_contents->SetLastActiveTime(old_contents->GetLastActiveTime()); + // Copy over the discard count. + WebContentsData::CopyState(old_contents, null_contents); + + // First try to fast-kill the process, if it's just running a single tab. + bool fast_shutdown_success = + old_contents->GetMainFrame()->GetProcess()->FastShutdownIfPossible(1u, + false); + +#ifdef OS_CHROMEOS + if (!fast_shutdown_success && reason == DiscardReason::kUrgent) { + content::RenderFrameHost* main_frame = old_contents->GetMainFrame(); + // We avoid fast shutdown on tabs with beforeunload handlers on the main + // frame, as that is often an indication of unsaved user state. + DCHECK(main_frame); + if (!main_frame->GetSuddenTerminationDisablerState( + blink::kBeforeUnloadHandler)) { + fast_shutdown_success = + old_contents->GetMainFrame()->GetProcess()->FastShutdownIfPossible( + 1u, /* skip_unload_handlers */ true); + } + UMA_HISTOGRAM_BOOLEAN( + "TabManager.Discarding.DiscardedTabCouldUnsafeFastShutdown", + fast_shutdown_success); + } +#endif + UMA_HISTOGRAM_BOOLEAN("TabManager.Discarding.DiscardedTabCouldFastShutdown", + fast_shutdown_success); + + // Replace the discarded tab with the null version. + model->ReplaceWebContentsAt(index, null_contents); + // Mark the tab so it will reload when clicked on. + GetWebContentsData(null_contents)->SetDiscardState(true); + GetWebContentsData(null_contents)->IncrementDiscardCount(); + + // Make the tab PURGED to avoid purging null_contents. + GetWebContentsData(null_contents)->set_is_purged(true); + + // Discard the old tab's renderer. + // TODO(jamescook): This breaks script connections with other tabs. + // Find a different approach that doesn't do that, perhaps based on + // RenderFrameProxyHosts. + delete old_contents; + + // This ensures that on reload after discard, the document has + // "wasDiscarded" set to true. + null_contents->SetWasDiscarded(true); + return null_contents; +} + void TabManager::PauseBackgroundTabOpeningIfNeeded() { TRACE_EVENT_INSTANT0("navigation", "TabManager::PauseBackgroundTabOpeningIfNeeded", @@ -558,6 +895,20 @@ // calling PurgeBrowserMemory() before CRITICAL is reached. } +void TabManager::TabChangedAt(content::WebContents* contents, + int index, + TabChangeType change_type) { + if (change_type != TabChangeType::kAll) + return; + auto* data = GetWebContentsData(contents); + bool old_state = data->IsRecentlyAudible(); + bool current_state = contents->WasRecentlyAudible(); + if (old_state != current_state) { + data->SetRecentlyAudible(current_state); + data->SetLastAudioChangeTime(NowTicks()); + } +} + void TabManager::ActiveTabChanged(content::WebContents* old_contents, content::WebContents* new_contents, int index, @@ -580,6 +931,12 @@ stats_collector_->RecordSwitchToTab(old_contents, new_contents); } + // Reload |web_contents| if it is in an active browser and discarded. + if (IsActiveWebContentsInActiveBrowser(new_contents)) { + ReloadWebContentsIfDiscarded(new_contents, + GetWebContentsData(new_contents)); + } + ResumeTabNavigationIfNeeded(new_contents); } @@ -600,11 +957,36 @@ GetTimeToPurge(min_time_to_purge_, max_time_to_purge_)); } -void TabManager::TabReplacedAt(TabStripModel* tab_strip_model, - content::WebContents* old_contents, - content::WebContents* new_contents, - int index) { - WebContentsData::CopyState(old_contents, new_contents); +void TabManager::OnBrowserSetLastActive(Browser* browser) { + // Reload the active tab in |browser| if it is discarded. + content::WebContents* contents = + browser->tab_strip_model()->GetActiveWebContents(); + if (contents) + ReloadWebContentsIfDiscarded(contents, GetWebContentsData(contents)); +} + +bool TabManager::IsMediaTab(WebContents* contents) const { + if (contents->WasRecentlyAudible()) + return true; + + scoped_refptr<MediaStreamCaptureIndicator> media_indicator = + MediaCaptureDevicesDispatcher::GetInstance() + ->GetMediaStreamCaptureIndicator(); + if (media_indicator->IsCapturingUserMedia(contents) || + media_indicator->IsBeingMirrored(contents)) { + return true; + } + + auto last_audio_change_time = + GetWebContentsData(contents)->LastAudioChangeTime(); + + if (last_audio_change_time.is_null()) { + // The tab was never audible. + return false; + } + + auto delta = NowTicks() - last_audio_change_time; + return delta < TimeDelta::FromSeconds(kAudioProtectionTimeSeconds); } // static @@ -619,21 +1001,54 @@ // discarding the entire set together, or use that in the priority computation. content::WebContents* TabManager::DiscardTabImpl(DiscardReason reason) { DCHECK_CURRENTLY_ON(BrowserThread::UI); + TabStatsList stats = GetTabStats(); - for (LifecycleUnit* lifecycle_unit : GetSortedLifecycleUnits()) { - if (lifecycle_unit->CanDiscard(reason) && lifecycle_unit->Discard(reason)) { - TabLifecycleUnitExternal* tab_lifecycle_unit_external = - lifecycle_unit->AsTabLifecycleUnitExternal(); - // For now, all LifecycleUnits are TabLifecycleUnitExternals. - DCHECK(tab_lifecycle_unit_external); - - return tab_lifecycle_unit_external->GetWebContents(); + if (stats.empty()) + return nullptr; + // Loop until a non-discarded tab to kill is found. + for (TabStatsList::const_reverse_iterator stats_rit = stats.rbegin(); + stats_rit != stats.rend(); ++stats_rit) { + if (CanDiscardTab(*stats_rit, reason)) { + WebContents* new_contents = DiscardTabById(stats_rit->id, reason); + if (new_contents) + return new_contents; } } - return nullptr; } +bool TabManager::IsActiveWebContentsInActiveBrowser( + content::WebContents* contents) const { + auto browser_info_list = GetBrowserInfoList(); + if (browser_info_list.empty()) + return false; + return browser_info_list.front().tab_strip_model->GetActiveWebContents() == + contents; +} + +std::vector<BrowserInfo> TabManager::GetBrowserInfoList() const { + if (!test_browser_info_list_.empty()) + return test_browser_info_list_; + + std::vector<BrowserInfo> browser_info_list; + + BrowserList* browser_list = BrowserList::GetInstance(); + for (auto browser_iterator = browser_list->begin_last_active(); + browser_iterator != browser_list->end_last_active(); + ++browser_iterator) { + Browser* browser = *browser_iterator; + + BrowserInfo browser_info; + browser_info.browser = browser; + browser_info.tab_strip_model = browser->tab_strip_model(); + browser_info.window_is_minimized = browser->window()->IsMinimized(); + browser_info.browser_is_app = browser->is_app(); + browser_info_list.push_back(browser_info); + } + + return browser_info_list; +} + void TabManager::OnSessionRestoreStartedLoadingTabs() { DCHECK(!is_session_restore_loading_tabs_); is_session_restore_loading_tabs_ = true; @@ -779,11 +1194,7 @@ DataAsTraceValue(background_tab_loading_mode_, pending_navigations_.size(), loading_contents_.size())); - if (force_load_timer_) - force_load_timer_->Stop(); - else - force_load_timer_ = std::make_unique<base::OneShotTimer>(GetTickClock()); - + force_load_timer_->Stop(); force_load_timer_->Start(FROM_HERE, GetTabLoadTimeout(kDefaultBackgroundTabLoadTimeout), this, &TabManager::LoadNextBackgroundTabIfNeeded); @@ -793,7 +1204,7 @@ TRACE_EVENT_INSTANT2( "navigation", "TabManager::LoadNextBackgroundTabIfNeeded", TRACE_EVENT_SCOPE_THREAD, "is_force_load_timer_running", - IsForceLoadTimerRunning(), "data", + force_load_timer_->IsRunning(), "data", DataAsTraceValue(background_tab_loading_mode_, pending_navigations_.size(), loading_contents_.size())); @@ -803,13 +1214,14 @@ // Do not load more background tabs until TabManager can load the next tab. // Ignore this constraint if the timer fires to force loading the next // background tab. - if (IsForceLoadTimerRunning() && !CanLoadNextTab()) + if (force_load_timer_->IsRunning() && !CanLoadNextTab()) return; if (pending_navigations_.empty()) return; - stats_collector_->OnWillLoadNextBackgroundTab(!IsForceLoadTimerRunning()); + stats_collector_->OnWillLoadNextBackgroundTab( + !force_load_timer_->IsRunning()); BackgroundTabNavigationThrottle* throttle = pending_navigations_.front(); pending_navigations_.erase(pending_navigations_.begin()); ResumeNavigation(throttle); @@ -903,16 +1315,4 @@ return false; } -bool TabManager::IsForceLoadTimerRunning() const { - return force_load_timer_ && force_load_timer_->IsRunning(); -} - -void TabManager::OnLifecycleUnitCreated(LifecycleUnit* lifecycle_unit) { - lifecycle_units_.insert(lifecycle_unit); -} - -void TabManager::OnLifecycleUnitDestroyed(LifecycleUnit* lifecycle_unit) { - lifecycle_units_.erase(lifecycle_unit); -} - } // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_manager.h b/chrome/browser/resource_coordinator/tab_manager.h index 00391061..5783651 100644 --- a/chrome/browser/resource_coordinator/tab_manager.h +++ b/chrome/browser/resource_coordinator/tab_manager.h
@@ -17,19 +17,21 @@ #include "base/macros.h" #include "base/memory/memory_pressure_listener.h" #include "base/memory/weak_ptr.h" +#include "base/observer_list.h" #include "base/strings/string16.h" #include "base/timer/timer.h" #include "build/build_config.h" #include "chrome/browser/resource_coordinator/discard_reason.h" -#include "chrome/browser/resource_coordinator/lifecycle_unit.h" -#include "chrome/browser/resource_coordinator/lifecycle_unit_source_observer.h" #include "chrome/browser/resource_coordinator/tab_lifecycle_observer.h" +#include "chrome/browser/resource_coordinator/tab_stats.h" #include "chrome/browser/sessions/session_restore_observer.h" +#include "chrome/browser/ui/browser_list_observer.h" #include "chrome/browser/ui/browser_tab_strip_tracker.h" #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" #include "content/public/browser/navigation_throttle.h" #include "ui/gfx/native_widget_types.h" +class BrowserList; class GURL; class TabStripModel; @@ -47,6 +49,14 @@ #endif class TabManagerStatsCollector; +// Information about a Browser. +struct BrowserInfo { + Browser* browser = nullptr; // Can be nullptr in tests. + TabStripModel* tab_strip_model = nullptr; + bool window_is_minimized = false; + bool browser_is_app = false; +}; + // The TabManager periodically updates (see // |kAdjustmentIntervalSeconds| in the source) the status of renderers // which are then used by the algorithm embedded here for priority in being @@ -72,10 +82,7 @@ // Tabs are identified by a unique ID vended by this component. These IDs are // not reused in a session. They are stable for a given conceptual tab, and will // follow it through discards, reloads, tab strip operations, etc. -// -// TODO(fdoray): Rename to LifecycleManager. https://crbug.com/775644 -class TabManager : public LifecycleUnitSourceObserver, - public TabStripModelObserver { +class TabManager : public TabStripModelObserver, public BrowserListObserver { public: // Forward declaration of resource coordinator signal observer. class ResourceCoordinatorSignalObserver; @@ -86,18 +93,25 @@ TabManager(); ~TabManager() override; + // Number of discard events since Chrome started. + int discard_count() const { return discard_count_; } + // Start/Stop the Tab Manager. void Start(); void Stop(); - // Returns the LifecycleUnits managed by this, sorted from less to most - // important to the user. It is unsafe to access a pointer in the returned - // vector after a LifecycleUnit has been destroyed. - LifecycleUnitVector GetSortedLifecycleUnits(); + // Returns the list of the stats for all renderers. Must be called on the UI + // thread. The returned list is sorted by reversed importance. + TabStatsList GetTabStats() const; // Returns true if |contents| is currently discarded. bool IsTabDiscarded(content::WebContents* contents) const; + // Goes through a list of checks to see if a tab is allowed to be discarded + // for |reason|. Note that this is not used when discarding a particular tab + // from about:discards or from an extension. + bool CanDiscardTab(const TabStats& tab_stats, DiscardReason reason) const; + // Discards a tab to free the memory occupied by its renderer. The tab still // exists in the tab-strip; clicking on it will reload it. If the |reason| is // urgent, an aggressive fast-kill will be attempted if the sudden termination @@ -109,7 +123,7 @@ // tab-strip; clicking on it will reload it. Returns null if the tab cannot // be found or cannot be discarded. Otherwise returns the new web_contents // of the discarded tab. - void DiscardTabById(int32_t tab_id, DiscardReason reason); + content::WebContents* DiscardTabById(int32_t tab_id, DiscardReason reason); // Method used by the extensions API to discard tabs. If |contents| is null, // discards the least important tab using DiscardTab(). Otherwise discards @@ -125,8 +139,16 @@ // Log memory statistics for the running processes, then call the callback. void LogMemory(const std::string& title, const base::Closure& callback); - // TODO(fdoray): Remove these methods. TabManager shouldn't know about tabs. - // https://crbug.com/775644 + // Returns TabStats for all tabs in the current Chrome instance. The tabs are + // sorted first by most recently used to least recently used Browser and + // second by index in the Browser. |windows_sorted_by_z_index| is a list of + // Browser windows sorted by z-index, from topmost to bottommost. If left + // empty, no window occlusion checks will be performed. Must be called on the + // UI thread. + TabStatsList GetUnsortedTabStats( + const std::vector<gfx::NativeWindow>& windows_sorted_by_z_index = + std::vector<gfx::NativeWindow>()) const; + void AddObserver(TabLifecycleObserver* observer); void RemoveObserver(TabLifecycleObserver* observer); @@ -170,6 +192,14 @@ // needs to clean up data related to that tab. void OnWebContentsDestroyed(content::WebContents* contents); + // Returns true if |first| is considered less desirable to be killed than + // |second|. + static bool CompareTabStats(const TabStats& first, const TabStats& second); + + // Returns the unique ID associated with a tab given the |web_contents| + // currently backing that tab. + static int32_t IdFromWebContents(content::WebContents* web_contents); + // Return whether tabs are being loaded during session restore. bool IsSessionRestoreLoadingTabs() const { return is_session_restore_loading_tabs_; @@ -213,14 +243,21 @@ FRIEND_TEST_ALL_PREFIXES(TabManagerTest, AutoDiscardable); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, Comparator); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardedTabKeepsLastActiveTime); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardWebContentsAt); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, InvalidOrEmptyURL); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, IsInternalPage); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, OomPressureListener); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectPDFPages); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectRecentlyUsedTabs); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ProtectVideoTabs); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ReloadDiscardedTabContextMenu); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, TabManagerBasics); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, TabManagerWasDiscarded); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, + GetUnsortedTabStatsIsInVisibleWindow); + FRIEND_TEST_ALL_PREFIXES(TabManagerTest, DiscardTabWithNonVisibleTabs); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, MaybeThrottleNavigation); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, OnDidFinishNavigation); FRIEND_TEST_ALL_PREFIXES(TabManagerTest, OnTabIsLoaded); @@ -264,6 +301,20 @@ // min time to purge times this value. const int kDefaultMinMaxTimeToPurgeRatio = 4; + // Finds TabStripModel which has a WebContents whose id is the given + // |tab_id|, and returns the WebContents index and the TabStripModel. + int FindTabStripModelById(int32_t tab_id, TabStripModel** model) const; + + // Called by WebContentsData whenever the discard state of a WebContents + // changes, so that observers can be informed. + void OnDiscardedStateChange(content::WebContents* contents, + bool is_discarded); + + // Called by WebContentsData whenever the auto-discardable state of a + // WebContents changes, so that observers can be informed. + void OnAutoDiscardableStateChange(content::WebContents* contents, + bool is_auto_discardable); + static void PurgeMemoryAndDiscardTab(DiscardReason reason); // Returns true if the |url| represents an internal Chrome web UI page that @@ -273,10 +324,22 @@ // Purges data structures in the browser that can be easily recomputed. void PurgeBrowserMemory(); + // Adds all the stats of the tabs in |browser_info| into |stats_list|. + // |window_is_active| indicates whether |browser_info|'s window is active. + // |window_is_visible| indicates whether |browser_info|'s window might be + // visible (true when window visibility is unknown). + void AddTabStats(const BrowserInfo& browser_info, + bool window_is_active, + bool window_is_visible, + TabStatsList* stats_list) const; + // Callback for when |update_timer_| fires. Takes care of executing the tasks // that need to be run periodically (see comment in implementation). void UpdateTimerCallback(); + // Returns WebContents whose contents id matches the given |tab_id|. + content::WebContents* GetWebContentsById(int32_t tab_id) const; + // Returns a random time-to-purge whose min value is min_time_to_purge and max // value is max_time_to_purge. base::TimeDelta GetTimeToPurge(base::TimeDelta min_time_to_purge, @@ -297,6 +360,13 @@ // (=ActiveTabChanged is invoked). void PurgeBackgroundedTabsIfNeeded(); + // Does the actual discard by destroying the WebContents in |model| at |index| + // and replacing it by an empty one. Returns the new WebContents or NULL if + // the operation fails (return value used only in testing). + content::WebContents* DiscardWebContentsAt(int index, + TabStripModel* model, + DiscardReason reason); + // Pause or resume background tab opening according to memory pressure change // if there are pending background tabs. void PauseBackgroundTabOpeningIfNeeded(); @@ -307,6 +377,9 @@ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); // TabStripModelObserver overrides. + void TabChangedAt(content::WebContents* contents, + int index, + TabChangeType change_type) override; void ActiveTabChanged(content::WebContents* old_contents, content::WebContents* new_contents, int index, @@ -315,19 +388,32 @@ content::WebContents* contents, int index, bool foreground) override; - void TabReplacedAt(TabStripModel* tab_strip_model, - content::WebContents* old_contents, - content::WebContents* new_contents, - int index) override; + + // BrowserListObserver overrides. + void OnBrowserSetLastActive(Browser* browser) override; + + // Returns true if the tab is currently playing audio or has played audio + // recently, or if the tab is currently accessing the camera, microphone or + // mirroring the display. + bool IsMediaTab(content::WebContents* contents) const; // Returns the WebContentsData associated with |contents|. Also takes care of // creating one if needed. static WebContentsData* GetWebContentsData(content::WebContents* contents); - // Discards the less important LifecycleUnit that supports discarding under - // |reason|. + // Implementation of DiscardTab. Returns null if no tab was discarded. + // Otherwise returns the new web_contents of the discarded tab. content::WebContents* DiscardTabImpl(DiscardReason reason); + // Returns true if |web_contents| is the active WebContents in the last active + // Browser. + bool IsActiveWebContentsInActiveBrowser(content::WebContents* contents) const; + + // Returns a list of BrowserInfo constructed from either + // |test_browser_info_list_| or BrowserList. The first BrowserInfo in the list + // corresponds to the last active Browser. + std::vector<BrowserInfo> GetBrowserInfoList() const; + void OnSessionRestoreStartedLoadingTabs(); void OnSessionRestoreFinishedLoadingTabs(); void OnWillRestoreTab(content::WebContents* contents); @@ -394,22 +480,15 @@ TabManagerStatsCollector* stats_collector() { return stats_collector_.get(); } - // Returns true if the background tab force load timer is running. - bool IsForceLoadTimerRunning() const; - - // LifecycleUnitSourceObserver: - void OnLifecycleUnitCreated(LifecycleUnit* lifecycle_unit) override; - void OnLifecycleUnitDestroyed(LifecycleUnit* lifecycle_unit) override; - - // LifecycleUnits managed by this. - LifecycleUnitSet lifecycle_units_; - // Timer to periodically update the stats of the renderers. base::RepeatingTimer update_timer_; // A listener to global memory pressure events. std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; + // Number of times a tab has been discarded, for statistics. + int discard_count_; + // A backgrounded renderer will be purged between min_time_to_purge_ and // max_time_to_purge_. base::TimeDelta min_time_to_purge_; @@ -423,6 +502,18 @@ // TabStripModels. Automatically tracks browsers as they come and go. BrowserTabStripTracker browser_tab_strip_tracker_; + // Injected BrowserInfo list. Allows this to be tested end-to-end without + // requiring a full browser environment. If specified these BrowserInfo will + // be crawled as the authoritative source of tabs, otherwise the BrowserList + // and associated Browser objects are crawled. The first BrowserInfo in the + // list corresponds to the last active Browser. + // TODO(chrisha): Factor out tab-strip model enumeration to a helper class, + // and make a delegate that centralizes all testing seams. + std::vector<BrowserInfo> test_browser_info_list_; + + // List of observers that will receive notifications on state changes. + base::ObserverList<TabLifecycleObserver> observers_; + bool is_session_restore_loading_tabs_; size_t restored_tab_count_;
diff --git a/chrome/browser/resource_coordinator/tab_manager_browsertest.cc b/chrome/browser/resource_coordinator/tab_manager_browsertest.cc index 34aa0ee..d09b8b5 100644 --- a/chrome/browser/resource_coordinator/tab_manager_browsertest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
@@ -47,16 +47,11 @@ namespace { -constexpr base::TimeDelta kShortDelay = base::TimeDelta::FromSeconds(1); static constexpr char kBlinkPageLifecycleFeature[] = "PageLifecycle"; class TabManagerTest : public InProcessBrowserTest { public: - TabManagerTest() : scoped_set_tick_clock_for_testing_(&test_clock_) { - // Start with a non-null TimeTicks, as there is no discard protection for - // a tab with a null focused timestamp. - test_clock_.Advance(kShortDelay); - } + TabManagerTest() : scoped_set_tick_clock_for_testing_(&test_clock_) {} void SetUpCommandLine(base::CommandLine* command_line) override { command_line->AppendSwitchASCII(switches::kEnableBlinkFeatures, @@ -110,8 +105,6 @@ TabManager* tab_manager = g_browser_process->GetTabManager(); // Get three tabs open. - - test_clock_.Advance(kShortDelay); WindowedNotificationObserver load1( content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); @@ -121,7 +114,6 @@ browser()->OpenURL(open1); load1.Wait(); - test_clock_.Advance(kShortDelay); WindowedNotificationObserver load2( content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); @@ -131,7 +123,6 @@ browser()->OpenURL(open2); load2.Wait(); - test_clock_.Advance(kShortDelay); WindowedNotificationObserver load3( content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); @@ -193,11 +184,9 @@ // Kill the third tab after making second tab active. tsm->ActivateTabAt(1, true); - EXPECT_EQ(1, tsm->active_index()); EXPECT_FALSE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(1))); - FastForwardAfterDiscardProtectionTime(); - tab_manager->DiscardTabImpl(DiscardReason::kProactive); + tab_manager->DiscardWebContentsAt(2, tsm, DiscardReason::kProactive); EXPECT_TRUE(tab_manager->IsTabDiscarded(tsm->GetWebContentsAt(2))); // Force creation of the FindBarController. @@ -819,10 +808,8 @@ EXPECT_FALSE(not_discarded_result); // Discard the tab. This simulates a tab discard. - content::WebContents* content = - browser()->tab_strip_model()->GetWebContentsAt(0); - auto* lifecycle_unit = TabLifecycleUnitExternal::FromWebContents(content); - lifecycle_unit->DiscardTab(); + g_browser_process->GetTabManager()->DiscardWebContentsAt( + 0, browser()->tab_strip_model(), DiscardReason::kProactive); // Here we simulate re-focussing the tab causing reload with navigation, // the navigation will reload the tab.
diff --git a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc index e6167c8..21fa186 100644 --- a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc +++ b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
@@ -12,6 +12,7 @@ #include <vector> #include "ash/shell.h" +#include "base/barrier_closure.h" #include "base/bind.h" #include "base/command_line.h" #include "base/files/file_path.h" @@ -28,10 +29,11 @@ #include "chrome/browser/chromeos/arc/process/arc_process.h" #include "chrome/browser/chromeos/arc/process/arc_process_service.h" #include "chrome/browser/memory/memory_kills_monitor.h" -#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" +#include "chrome/browser/resource_coordinator/tab_stats.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" +#include "chrome/browser/ui/sort_windows_by_z_index.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_features.h" @@ -47,6 +49,7 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/zygote_host_linux.h" +#include "ui/gfx/native_widget_types.h" #include "ui/wm/public/activation_client.h" using base::ProcessHandle; @@ -81,6 +84,81 @@ LOG(WARNING) << "Set OOM score: " << output; } +using LoadTabListAndArcProcessesCallback = + base::OnceCallback<void(const TabStatsList&, + const std::vector<arc::ArcProcess>&)>; + +// Loads TabStatsList and a list of ARC processes. Invokes |callback| with the +// result. +void LoadTabListAndArcProcesses(base::WeakPtr<TabManager> tab_manager, + LoadTabListAndArcProcessesCallback callback) { + std::unique_ptr<TabStatsList> tab_stats_list = + std::make_unique<TabStatsList>(); + TabStatsList* const tab_stats_list_raw = tab_stats_list.get(); + + std::unique_ptr<std::vector<arc::ArcProcess>> arc_processes = + std::make_unique<std::vector<arc::ArcProcess>>(); + std::vector<arc::ArcProcess>* const arc_processes_raw = arc_processes.get(); + + // Invoked when the TabStatsList is loaded and when the list of ARC processes + // is loaded. Invokes |callback| the second time it's called (i.e. when both + // the lists have been loaded). + auto barrier = base::BarrierClosure( + 2, base::BindOnce( + [](std::unique_ptr<TabStatsList> tab_stats_list, + std::unique_ptr<std::vector<arc::ArcProcess>> arc_processes, + LoadTabListAndArcProcessesCallback callback) { + std::move(callback).Run(*tab_stats_list.get(), + *arc_processes.get()); + }, + std::move(tab_stats_list), std::move(arc_processes), + std::move(callback))); + + // Invoked when the list of browser windows sorted by z-index is loaded. + auto sort_windows_by_z_index_callback = base::BindOnce( + [](TabStatsList* tab_stats_list, base::WeakPtr<TabManager> tab_manager, + base::RepeatingClosure barrier, + std::vector<gfx::NativeWindow> windows_sorted_by_z_index) { + if (tab_manager) { + *tab_stats_list = + tab_manager->GetUnsortedTabStats(windows_sorted_by_z_index); + } + barrier.Run(); + }, + base::Unretained(tab_stats_list_raw), tab_manager, barrier); + + // Start loading the list of browser windows sorted by z-index. + std::vector<gfx::NativeWindow> browser_windows; + for (Browser* browser : *BrowserList::GetInstance()) + browser_windows.push_back(browser->window()->GetNativeWindow()); + // In unit tests, windows can't be sorted because the Shell is not available. + if (ash::Shell::HasInstance()) { + ui::SortWindowsByZIndex(browser_windows, + std::move(sort_windows_by_z_index_callback)); + } else { + std::move(sort_windows_by_z_index_callback) + .Run(std::vector<gfx::NativeWindow>()); + } + + // Invoked when the list of ARC processes is loaded. + auto request_app_process_list_callback = base::BindRepeating( + [](std::vector<arc::ArcProcess>* arc_processes_dest, + base::RepeatingClosure barrier, + std::vector<arc::ArcProcess> arc_processes_src) { + *arc_processes_dest = std::move(arc_processes_src); + barrier.Run(); + }, + base::Unretained(arc_processes_raw), barrier); + + // Start loading the list of ARC processes. + arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get(); + + if (!arc_process_service || !arc_process_service->RequestAppProcessList( + request_app_process_list_callback)) { + request_app_process_list_callback.Run(std::vector<arc::ArcProcess>()); + } +} + } // namespace // static @@ -94,12 +172,10 @@ return os << "FOCUSED_APP"; case ProcessType::IMPORTANT_APP: return os << "IMPORTANT_APP"; - case ProcessType::BACKGROUND_APP: - return os << "BACKGROUND_APP"; case ProcessType::BACKGROUND_TAB: return os << "BACKGROUND_TAB"; - case ProcessType::PROTECTED_BACKGROUND_TAB: - return os << "PROTECTED_BACKGROUND_TAB"; + case ProcessType::BACKGROUND_APP: + return os << "BACKGROUND_APP"; case ProcessType::UNKNOWN_TYPE: return os << "UNKNOWN_TYPE"; default: @@ -111,16 +187,27 @@ // TabManagerDelegate::Candidate implementation. std::ostream& operator<<(std::ostream& out, const TabManagerDelegate::Candidate& candidate) { - if (candidate.app()) + if (candidate.app()) { out << "app " << *candidate.app(); - else if (candidate.lifecycle_unit()) - out << "tab " << candidate.lifecycle_unit()->GetTitle(); + } else if (candidate.tab()) { + const TabStats* const& tab = candidate.tab(); + out << "tab " << tab->title << ", renderer_handle: " << tab->renderer_handle + << ", oom_score: " << tab->oom_score + << ", is_discarded: " << tab->is_discarded + << ", discard_count: " << tab->discard_count + << ", last_active: " << tab->last_active; + } out << ", process_type " << candidate.process_type(); return out; } TabManagerDelegate::Candidate& TabManagerDelegate::Candidate::operator=( - TabManagerDelegate::Candidate&& other) = default; + TabManagerDelegate::Candidate&& other) { + tab_ = other.tab_; + app_ = other.app_; + process_type_ = other.process_type_; + return *this; +} bool TabManagerDelegate::Candidate::operator<( const TabManagerDelegate::Candidate& rhs) const { @@ -128,8 +215,8 @@ return process_type() < rhs.process_type(); if (app() && rhs.app()) return *app() < *rhs.app(); - if (lifecycle_unit() && rhs.lifecycle_unit()) - return lifecycle_unit_sort_key_ > rhs.lifecycle_unit_sort_key_; + if (tab() && rhs.tab()) + return TabManager::CompareTabStats(*tab(), *rhs.tab()); // Impossible case. If app and tab are mixed in one process type, favor // apps. NOTREACHED() << "Undefined comparison between apps and tabs: process_type=" @@ -145,11 +232,9 @@ return ProcessType::IMPORTANT_APP; return ProcessType::BACKGROUND_APP; } - if (lifecycle_unit()) { - if (lifecycle_unit_sort_key_.last_focused_time == base::TimeTicks::Max()) + if (tab()) { + if (tab()->is_active && tab()->is_in_active_window) return ProcessType::FOCUSED_TAB; - if (!lifecycle_unit()->CanDiscard(DiscardReason::kProactive)) - return ProcessType::PROTECTED_BACKGROUND_TAB; return ProcessType::BACKGROUND_TAB; } NOTREACHED() << "Unexpected process type"; @@ -331,21 +416,17 @@ void TabManagerDelegate::ScheduleEarlyOomPrioritiesAdjustment() { DCHECK_CURRENTLY_ON(BrowserThread::UI); - AdjustOomPriorities(); + if (tab_manager_) { + AdjustOomPriorities(tab_manager_->GetUnsortedTabStats()); + } } // If able to get the list of ARC procsses, prioritize tabs and apps as a whole. // Otherwise try to kill tabs only. void TabManagerDelegate::LowMemoryKill(DiscardReason reason) { - arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get(); - if (arc_process_service && - arc_process_service->RequestAppProcessList( - base::BindRepeating(&TabManagerDelegate::LowMemoryKillImpl, - weak_ptr_factory_.GetWeakPtr(), reason))) { - return; - } - - LowMemoryKillImpl(reason, std::vector<arc::ArcProcess>()); + LoadTabListAndArcProcesses( + tab_manager_, base::BindOnce(&TabManagerDelegate::LowMemoryKillImpl, + weak_ptr_factory_.GetWeakPtr(), reason)); } int TabManagerDelegate::GetCachedOomScore(ProcessHandle process_handle) { @@ -358,12 +439,6 @@ return -1001; } -LifecycleUnitVector TabManagerDelegate::GetLifecycleUnits() { - if (tab_manager_) - return tab_manager_->GetSortedLifecycleUnits(); - return LifecycleUnitVector(); -} - void TabManagerDelegate::OnFocusTabScoreAdjustmentTimeout() { DCHECK_CURRENTLY_ON(BrowserThread::UI); base::ProcessHandle pid = focused_process_->GetTabPid(); @@ -470,18 +545,18 @@ // 1) whether or not a tab is pinned // 2) last time a tab was selected // 3) is the tab currently selected -void TabManagerDelegate::AdjustOomPriorities() { +void TabManagerDelegate::AdjustOomPriorities(const TabStatsList& tab_list) { if (IsArcMemoryManagementEnabled()) { arc::ArcProcessService* arc_process_service = arc::ArcProcessService::Get(); if (arc_process_service && arc_process_service->RequestAppProcessList( base::Bind(&TabManagerDelegate::AdjustOomPrioritiesImpl, - weak_ptr_factory_.GetWeakPtr()))) { + weak_ptr_factory_.GetWeakPtr(), tab_list))) { return; } } // Pass in a dummy list if unable to get ARC processes. - AdjustOomPrioritiesImpl(std::vector<arc::ArcProcess>()); + AdjustOomPrioritiesImpl(tab_list, std::vector<arc::ArcProcess>()); } // Excludes persistent ARC apps, but still preserves active chrome tabs and @@ -490,13 +565,13 @@ // static std::vector<TabManagerDelegate::Candidate> TabManagerDelegate::GetSortedCandidates( - const LifecycleUnitVector& lifecycle_units, + const TabStatsList& tab_list, const std::vector<arc::ArcProcess>& arc_processes) { std::vector<Candidate> candidates; - candidates.reserve(lifecycle_units.size() + arc_processes.size()); + candidates.reserve(tab_list.size() + arc_processes.size()); - for (LifecycleUnit* lifecycle_unit : lifecycle_units) { - candidates.emplace_back(lifecycle_unit); + for (const auto& tab : tab_list) { + candidates.emplace_back(&tab); } for (const auto& app : arc_processes) { @@ -532,9 +607,11 @@ return true; } -bool TabManagerDelegate::KillTab(LifecycleUnit* lifecycle_unit, +bool TabManagerDelegate::KillTab(const TabStats& tab_stats, DiscardReason reason) { - return lifecycle_unit->CanDiscard(reason) && lifecycle_unit->Discard(reason); + // Check |tab_manager_| is alive before taking tabs into consideration. + return tab_manager_ && tab_manager_->CanDiscardTab(tab_stats, reason) && + tab_manager_->DiscardTabById(tab_stats.id, reason); } chromeos::DebugDaemonClient* TabManagerDelegate::GetDebugDaemonClient() { @@ -543,12 +620,13 @@ void TabManagerDelegate::LowMemoryKillImpl( DiscardReason reason, - std::vector<arc::ArcProcess> arc_processes) { + const TabStatsList& tab_list, + const std::vector<arc::ArcProcess>& arc_processes) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); VLOG(2) << "LowMemoryKillImpl"; - std::vector<TabManagerDelegate::Candidate> candidates = - GetSortedCandidates(GetLifecycleUnits(), arc_processes); + const std::vector<TabManagerDelegate::Candidate> candidates = + GetSortedCandidates(tab_list, arc_processes); // TODO(semenzato): decide if TargetMemoryToFreeKB is doing real // I/O and if it is, move to I/O thread (crbug.com/778703). @@ -581,9 +659,9 @@ if (process_type <= ProcessType::IMPORTANT_APP) { if (it->app()) { MEMORY_LOG(ERROR) << "Skipped killing " << it->app()->process_name(); - } else if (it->lifecycle_unit()) { - MEMORY_LOG(ERROR) << "Skipped killing " - << it->lifecycle_unit()->GetTitle(); + } else if (it->tab()) { + MEMORY_LOG(ERROR) << "Skipped killing " << it->tab()->title << " (" + << it->tab()->renderer_handle << ")"; } continue; } @@ -607,19 +685,19 @@ } else { MEMORY_LOG(ERROR) << "Failed to kill " << it->app()->process_name(); } - } else if (it->lifecycle_unit()) { + } else if (it->tab()) { // The estimation is problematic since multiple tabs may share the same // process, while the calculation counts memory used by the whole process. // So |estimated_memory_freed_kb| is an over-estimation. int estimated_memory_freed_kb = - it->lifecycle_unit()->GetEstimatedMemoryFreedOnDiscardKB(); - if (KillTab(it->lifecycle_unit(), reason)) { + mem_stat_->EstimatedMemoryFreedKB(it->tab()->renderer_handle); + if (KillTab(*it->tab(), reason)) { target_memory_to_free_kb -= estimated_memory_freed_kb; memory::MemoryKillsMonitor::LogLowMemoryKill("TAB", estimated_memory_freed_kb); - MEMORY_LOG(ERROR) << "Killed tab " << it->lifecycle_unit()->GetTitle() - << ", estimated " << estimated_memory_freed_kb - << " KB freed"; + MEMORY_LOG(ERROR) << "Killed tab " << it->tab()->title << " (" + << it->tab()->renderer_handle << "), estimated " + << estimated_memory_freed_kb << " KB freed"; } } } @@ -630,14 +708,13 @@ } void TabManagerDelegate::AdjustOomPrioritiesImpl( + const TabStatsList& tab_list, std::vector<arc::ArcProcess> arc_processes) { std::vector<TabManagerDelegate::Candidate> candidates; std::vector<TabManagerDelegate::Candidate> apps_non_killable; // Least important first. - LifecycleUnitVector lifecycle_units = GetLifecycleUnits(); - auto all_candidates = - GetSortedCandidates(std::move(lifecycle_units), arc_processes); + auto all_candidates = GetSortedCandidates(tab_list, arc_processes); for (auto& candidate : all_candidates) { // TODO(cylee|yusukes): Consider using IsImportant() instead of // IsKernelKillable() for simplicity. @@ -680,8 +757,8 @@ ProcessScoreMap new_map; // Make the apps non-killable. - DistributeOomScoreInRange(apps_non_killable.begin(), apps_non_killable.end(), - kLowestOomScore, kLowestOomScore, &new_map); + if (!apps_non_killable.empty()) + SetOomScore(apps_non_killable, kLowestOomScore, &new_map); // Higher priority part. DistributeOomScoreInRange(candidates.begin(), lower_priority_part, @@ -694,9 +771,17 @@ oom_score_map_.swap(new_map); } +void TabManagerDelegate::SetOomScore( + const std::vector<TabManagerDelegate::Candidate>& candidates, + int score, + ProcessScoreMap* new_map) { + DistributeOomScoreInRange(candidates.begin(), candidates.end(), score, score, + new_map); +} + void TabManagerDelegate::DistributeOomScoreInRange( - std::vector<TabManagerDelegate::Candidate>::iterator begin, - std::vector<TabManagerDelegate::Candidate>::iterator end, + std::vector<TabManagerDelegate::Candidate>::const_iterator begin, + std::vector<TabManagerDelegate::Candidate>::const_iterator end, int range_begin, int range_end, ProcessScoreMap* new_map) { @@ -719,7 +804,7 @@ if (cur->app()) { pid = cur->app()->pid(); } else { - pid = cur->lifecycle_unit()->GetProcessHandle(); + pid = cur->tab()->renderer_handle; // 1. tab_list contains entries for already-discarded tabs. If the PID // (renderer_handle) is zero, we don't need to adjust the oom_score. // 2. Only add unseen process handle so if there's multiple tab maps to
diff --git a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h index be0836f..b2bd5c16 100644 --- a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h +++ b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h
@@ -18,8 +18,8 @@ #include "base/process/process.h" #include "base/timer/timer.h" #include "chrome/browser/chromeos/arc/process/arc_process.h" -#include "chrome/browser/resource_coordinator/lifecycle_unit.h" #include "chrome/browser/resource_coordinator/tab_manager.h" +#include "chrome/browser/resource_coordinator/tab_stats.h" #include "chrome/browser/ui/browser_list_observer.h" #include "chromeos/dbus/debug_daemon_client.h" #include "components/arc/common/process.mojom.h" @@ -46,9 +46,8 @@ IMPORTANT_APP = 3, BACKGROUND_APP = 4, - PROTECTED_BACKGROUND_TAB = 5, - BACKGROUND_TAB = 6, - UNKNOWN_TYPE = 7, + BACKGROUND_TAB = 5, + UNKNOWN_TYPE = 6, }; // The Chrome OS TabManagerDelegate is responsible for keeping the @@ -82,7 +81,7 @@ int GetCachedOomScore(base::ProcessHandle process_handle); // Called when the timer fires, sets oom_adjust_score for all renderers. - void AdjustOomPriorities(); + void AdjustOomPriorities(const TabStatsList& tab_list); // Returns true if the process has recently been killed. // Virtual for unit testing. @@ -96,7 +95,7 @@ // Kills a tab. Returns true if the tab is killed successfully. // Virtual for unit testing. - virtual bool KillTab(LifecycleUnit* lifecycle_unit, DiscardReason reason); + virtual bool KillTab(const TabStats& tab_stats, DiscardReason reason); // Get debugd client instance. Virtual for unit testing. virtual chromeos::DebugDaemonClient* GetDebugDaemonClient(); @@ -133,35 +132,44 @@ // Get the list of candidates to kill, sorted by descending importance. static std::vector<Candidate> GetSortedCandidates( - const LifecycleUnitVector& lifecycle_units, + const TabStatsList& tab_list, const std::vector<arc::ArcProcess>& arc_processes); - // Returns the LifecycleUnits in TabManager. Virtual for unit tests. - virtual LifecycleUnitVector GetLifecycleUnits(); - // Sets OOM score for the focused tab. void OnFocusTabScoreAdjustmentTimeout(); // Kills a process after getting all info of tabs and apps. void LowMemoryKillImpl(DiscardReason reason, - std::vector<arc::ArcProcess> arc_processes); + const TabStatsList& tab_list, + const std::vector<arc::ArcProcess>& arc_processes); + + // Public interface to adjust OOM scores. + void AdjustOomPriorities(const TabStatsList& tab_list, + const std::vector<arc::ArcProcess>& arc_processes); // Sets a newly focused tab the highest priority process if it wasn't. void AdjustFocusedTabScore(base::ProcessHandle pid); // Called by AdjustOomPriorities. Runs on the main thread. - void AdjustOomPrioritiesImpl(std::vector<arc::ArcProcess> arc_processes); + void AdjustOomPrioritiesImpl(const TabStatsList& tab_list, + std::vector<arc::ArcProcess> arc_processes); // Sets OOM score for processes in the range [|rbegin|, |rend|) to integers // distributed evenly in [|range_begin|, |range_end|). // The new score is set in |new_map|. void DistributeOomScoreInRange( - std::vector<TabManagerDelegate::Candidate>::iterator begin, - std::vector<TabManagerDelegate::Candidate>::iterator end, + std::vector<TabManagerDelegate::Candidate>::const_iterator begin, + std::vector<TabManagerDelegate::Candidate>::const_iterator end, int range_begin, int range_end, ProcessScoreMap* new_map); + // Changes |candidates|' OOM scores to |score|. The new scores are set in + // |new_map|. + void SetOomScore(const std::vector<TabManagerDelegate::Candidate>& candidates, + int score, + ProcessScoreMap* new_map); + // Initiates an oom priority adjustment. void ScheduleEarlyOomPrioritiesAdjustment(); @@ -210,12 +218,14 @@ // victims. class TabManagerDelegate::Candidate { public: - explicit Candidate(LifecycleUnit* lifecycle_unit) - : lifecycle_unit_(lifecycle_unit), - lifecycle_unit_sort_key_(lifecycle_unit_->GetSortKey()) { - DCHECK(lifecycle_unit_); + explicit Candidate(const TabStats* tab) + : tab_(tab), app_(nullptr), process_type_(GetProcessTypeInternal()) { + DCHECK(tab_); } - explicit Candidate(const arc::ArcProcess* app) : app_(app) { DCHECK(app_); } + explicit Candidate(const arc::ArcProcess* app) + : tab_(nullptr), app_(app), process_type_(GetProcessTypeInternal()) { + DCHECK(app_); + } // Move-only class. Candidate(Candidate&&) = default; @@ -224,8 +234,7 @@ // Higher priority first. bool operator<(const Candidate& rhs) const; - LifecycleUnit* lifecycle_unit() { return lifecycle_unit_; } - const LifecycleUnit* lifecycle_unit() const { return lifecycle_unit_; } + const TabStats* tab() const { return tab_; } const arc::ArcProcess* app() const { return app_; } ProcessType process_type() const { return process_type_; } @@ -233,10 +242,9 @@ // Derive process type for this candidate. Used to initialize |process_type_|. ProcessType GetProcessTypeInternal() const; - LifecycleUnit* lifecycle_unit_ = nullptr; - LifecycleUnit::SortKey lifecycle_unit_sort_key_; - const arc::ArcProcess* app_ = nullptr; - ProcessType process_type_ = GetProcessTypeInternal(); + const TabStats* tab_; + const arc::ArcProcess* app_; + ProcessType process_type_; DISALLOW_COPY_AND_ASSIGN(Candidate); };
diff --git a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc index 15733dc..d764a3b5 100644 --- a/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
@@ -9,16 +9,13 @@ #include <utility> #include <vector> -#include "base/macros.h" #include "base/process/process_handle.h" -#include "chrome/browser/resource_coordinator/lifecycle_unit_base.h" #include "chrome/browser/resource_coordinator/time.h" #include "chromeos/dbus/fake_debug_daemon_client.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gtest/include/gtest/gtest.h" namespace resource_coordinator { -namespace { class TabManagerDelegateTest : public testing::Test { public: @@ -29,43 +26,9 @@ content::TestBrowserThreadBundle thread_bundle_; }; -class DummyLifecycleUnit : public LifecycleUnitBase { - public: - explicit DummyLifecycleUnit( - base::TimeTicks last_focused_time, - base::ProcessHandle process_handle = base::ProcessHandle(), - bool can_discard = true) - : last_focused_time_(last_focused_time), - process_handle_(process_handle), - can_discard_(can_discard) {} - - // LifecycleUnit: - base::string16 GetTitle() const override { return base::string16(); } - std::string GetIconURL() const override { return std::string(); } - base::ProcessHandle GetProcessHandle() const override { - return process_handle_; - } - TabLifecycleUnitExternal* AsTabLifecycleUnitExternal() override { - return nullptr; - } - SortKey GetSortKey() const override { return SortKey(last_focused_time_); } - State GetState() const override { return State::LOADED; } - int GetEstimatedMemoryFreedOnDiscardKB() const override { return 0; } - bool CanPurge() const override { return false; } - bool CanDiscard(DiscardReason reason) const override { return can_discard_; } - bool Discard(DiscardReason discard_reason) override { return false; } - - private: - base::TimeTicks last_focused_time_; - base::ProcessHandle process_handle_; - bool can_discard_; - - DISALLOW_COPY_AND_ASSIGN(DummyLifecycleUnit); -}; - +namespace { constexpr bool kIsFocused = true; constexpr bool kNotFocused = false; - } // namespace TEST_F(TabManagerDelegateTest, CandidatesSorted) { @@ -79,42 +42,56 @@ arc_processes.emplace_back(4, 40, "visible2", arc::mojom::ProcessState::TOP, kNotFocused, 150); - DummyLifecycleUnit focused_lifecycle_unit(base::TimeTicks::Max()); - DummyLifecycleUnit protected_lifecycle_unit( - base::TimeTicks() + base::TimeDelta::FromSeconds(5), 0, false); - DummyLifecycleUnit non_focused_lifecycle_unit( - base::TimeTicks() + base::TimeDelta::FromSeconds(1)); - DummyLifecycleUnit other_non_focused_lifecycle_unit( - base::TimeTicks() + base::TimeDelta::FromSeconds(2)); - LifecycleUnitVector lifecycle_units{ - &focused_lifecycle_unit, &protected_lifecycle_unit, - &non_focused_lifecycle_unit, &other_non_focused_lifecycle_unit}; + TabStats tab1, tab2, tab3, tab4, tab5; + tab1.id = 100; + tab1.is_pinned = true; + + tab2.id = 200; + tab2.is_internal_page = true; + + tab3.id = 300; + tab3.is_pinned = true; + tab3.is_media = true; + + tab4.id = 400; + tab4.is_media = true; + + tab5.id = 500; + tab5.is_app = true; + TabStatsList tab_list = {tab1, tab2, tab3, tab4, tab5}; std::vector<TabManagerDelegate::Candidate> candidates; - candidates = - TabManagerDelegate::GetSortedCandidates(lifecycle_units, arc_processes); - ASSERT_EQ(8U, candidates.size()); + candidates = TabManagerDelegate::GetSortedCandidates(tab_list, arc_processes); + ASSERT_EQ(9U, candidates.size()); - // focused LifecycleUnit - EXPECT_EQ(candidates[0].lifecycle_unit(), &focused_lifecycle_unit); // focused app. - ASSERT_TRUE(candidates[1].app()); - EXPECT_EQ("focused", candidates[1].app()->process_name()); + ASSERT_TRUE(candidates[0].app()); + EXPECT_EQ("focused", candidates[0].app()->process_name()); // visible app 1, last_activity_time larger than visible app 2. - ASSERT_TRUE(candidates[2].app()); - EXPECT_EQ("visible1", candidates[2].app()->process_name()); + ASSERT_TRUE(candidates[1].app()); + EXPECT_EQ("visible1", candidates[1].app()->process_name()); // visible app 2, last_activity_time less than visible app 1. - ASSERT_TRUE(candidates[3].app()); - EXPECT_EQ("visible2", candidates[3].app()->process_name()); + ASSERT_TRUE(candidates[2].app()); + EXPECT_EQ("visible2", candidates[2].app()->process_name()); // background service. - ASSERT_TRUE(candidates[4].app()); - EXPECT_EQ("service", candidates[4].app()->process_name()); - // protected LifecycleUnit - EXPECT_EQ(candidates[5].lifecycle_unit(), &protected_lifecycle_unit); - // non-focused LifecycleUnits, sorted by last focused time. - EXPECT_EQ(candidates[6].lifecycle_unit(), &other_non_focused_lifecycle_unit); - EXPECT_EQ(candidates[7].lifecycle_unit(), &non_focused_lifecycle_unit); + ASSERT_TRUE(candidates[3].app()); + EXPECT_EQ("service", candidates[3].app()->process_name()); + // pinned and media. + ASSERT_TRUE(candidates[4].tab()); + EXPECT_EQ(300, candidates[4].tab()->id); + // media. + ASSERT_TRUE(candidates[5].tab()); + EXPECT_EQ(400, candidates[5].tab()->id); + // pinned. + ASSERT_TRUE(candidates[6].tab()); + EXPECT_EQ(100, candidates[6].tab()->id); + // chrome app. + ASSERT_TRUE(candidates[7].tab()); + EXPECT_EQ(500, candidates[7].tab()->id); + // internal page. + ASSERT_TRUE(candidates[8].tab()); + EXPECT_EQ(200, candidates[8].tab()->id); } // Occasionally, Chrome sees both FOCUSED_TAB and FOCUSED_APP at the same time. @@ -123,15 +100,19 @@ std::vector<arc::ArcProcess> arc_processes; arc_processes.emplace_back(1, 10, "focused", arc::mojom::ProcessState::TOP, kIsFocused, 100); - - DummyLifecycleUnit focused_lifecycle_unit(base::TimeTicks::Max()); - LifecycleUnitVector lifecycle_units{&focused_lifecycle_unit}; + TabStats tab1; + tab1.id = 100; + tab1.is_pinned = true; + tab1.is_in_active_window = true; + tab1.is_active = true; + const TabStatsList tab_list = {tab1}; const std::vector<TabManagerDelegate::Candidate> candidates = - TabManagerDelegate::GetSortedCandidates(lifecycle_units, arc_processes); + TabManagerDelegate::GetSortedCandidates(tab_list, arc_processes); ASSERT_EQ(2U, candidates.size()); // FOCUSED_TAB should be the first one. - EXPECT_EQ(&focused_lifecycle_unit, candidates[0].lifecycle_unit()); + ASSERT_TRUE(candidates[0].tab()); + EXPECT_EQ(100, candidates[0].tab()->id); ASSERT_TRUE(candidates[1].app()); EXPECT_EQ("focused", candidates[1].app()->process_name()); } @@ -150,7 +131,7 @@ std::vector<int> GetKilledArcProcesses() { return killed_arc_processes_; } // unit test. - LifecycleUnitVector GetKilledTabs() { return killed_tabs_; } + std::vector<int64_t> GetKilledTabs() { return killed_tabs_; } // unit test. void Clear() { @@ -165,10 +146,6 @@ always_return_true_from_is_recently_killed; } - void AddLifecycleUnit(LifecycleUnit* lifecycle_unit) { - lifecycle_units_.push_back(lifecycle_unit); - } - bool IsRecentlyKilledArcProcess(const std::string& process_name, const base::TimeTicks& now) override { if (always_return_true_from_is_recently_killed_) @@ -182,22 +159,19 @@ return true; } - bool KillTab(LifecycleUnit* lifecycle_unit, DiscardReason reason) override { - killed_tabs_.push_back(lifecycle_unit); + bool KillTab(const TabStats& tab_stats, DiscardReason reason) override { + killed_tabs_.push_back(tab_stats.id); return true; } - LifecycleUnitVector GetLifecycleUnits() override { return lifecycle_units_; } - chromeos::DebugDaemonClient* GetDebugDaemonClient() override { return &debugd_client_; } private: - LifecycleUnitVector lifecycle_units_; chromeos::FakeDebugDaemonClient debugd_client_; std::vector<int> killed_arc_processes_; - LifecycleUnitVector killed_tabs_; + std::vector<int64_t> killed_tabs_; bool always_return_true_from_is_recently_killed_; }; @@ -246,21 +220,23 @@ arc::mojom::ProcessState::PERSISTENT_UI, kNotFocused, 700); - DummyLifecycleUnit tab1(base::TimeTicks() + base::TimeDelta::FromSeconds(3), - 11); - tab_manager_delegate.AddLifecycleUnit(&tab1); - DummyLifecycleUnit tab2(base::TimeTicks() + base::TimeDelta::FromSeconds(1), - 11); - tab_manager_delegate.AddLifecycleUnit(&tab2); - DummyLifecycleUnit tab3(base::TimeTicks() + base::TimeDelta::FromSeconds(5), - 12); - tab_manager_delegate.AddLifecycleUnit(&tab3); - DummyLifecycleUnit tab4(base::TimeTicks() + base::TimeDelta::FromSeconds(4), - 12); - tab_manager_delegate.AddLifecycleUnit(&tab4); - DummyLifecycleUnit tab5(base::TimeTicks() + base::TimeDelta::FromSeconds(2), - 12); - tab_manager_delegate.AddLifecycleUnit(&tab5); + TabStats tab1, tab2, tab3, tab4, tab5; + tab1.is_pinned = true; + tab1.renderer_handle = 11; + + tab2.is_internal_page = true; + tab2.renderer_handle = 11; + + tab3.is_pinned = true; + tab3.is_media = true; + tab3.renderer_handle = 12; + + tab4.is_media = true; + tab4.renderer_handle = 12; + + tab5.is_app = true; + tab5.renderer_handle = 12; + TabStatsList tab_list = {tab1, tab2, tab3, tab4, tab5}; // Sorted order (by GetSortedCandidates): // app "focused" pid: 10 @@ -274,7 +250,8 @@ // tab1 pid: 11 // tab5 pid: 12 // tab2 pid: 11 - tab_manager_delegate.AdjustOomPrioritiesImpl(std::move(arc_processes)); + tab_manager_delegate.AdjustOomPrioritiesImpl(tab_list, + std::move(arc_processes)); auto& oom_score_map = tab_manager_delegate.oom_score_map_; // 6 PIDs for apps + 2 PIDs for tabs. @@ -360,8 +337,9 @@ memory_stat->SetTargetMemoryToFreeKB(250000); memory_stat->SetProcessPss(30, 10000); - tab_manager_delegate.LowMemoryKillImpl(DiscardReason::kUrgent, - std::move(arc_processes)); + TabStatsList tab_list; + tab_manager_delegate.LowMemoryKillImpl(DiscardReason::kUrgent, tab_list, + arc_processes); auto killed_arc_processes = tab_manager_delegate.GetKilledArcProcesses(); EXPECT_EQ(0U, killed_arc_processes.size()); @@ -391,21 +369,28 @@ arc::mojom::ProcessState::PERSISTENT, kNotFocused, 400); - DummyLifecycleUnit tab1(base::TimeTicks() + base::TimeDelta::FromSeconds(3), - 11); - tab_manager_delegate.AddLifecycleUnit(&tab1); - DummyLifecycleUnit tab2(base::TimeTicks() + base::TimeDelta::FromSeconds(1), - 11); - tab_manager_delegate.AddLifecycleUnit(&tab2); - DummyLifecycleUnit tab3(base::TimeTicks() + base::TimeDelta::FromSeconds(5), - 12); - tab_manager_delegate.AddLifecycleUnit(&tab3); - DummyLifecycleUnit tab4(base::TimeTicks() + base::TimeDelta::FromSeconds(4), - 12); - tab_manager_delegate.AddLifecycleUnit(&tab4); - DummyLifecycleUnit tab5(base::TimeTicks() + base::TimeDelta::FromSeconds(2), - 12); - tab_manager_delegate.AddLifecycleUnit(&tab5); + TabStats tab1, tab2, tab3, tab4, tab5; + tab1.is_pinned = true; + tab1.renderer_handle = 11; + tab1.id = 1; + + tab2.is_internal_page = true; + tab2.renderer_handle = 11; + tab2.id = 2; + + tab3.is_pinned = true; + tab3.is_media = true; + tab3.renderer_handle = 12; + tab3.id = 3; + + tab4.is_media = true; + tab4.renderer_handle = 12; + tab4.id = 4; + + tab5.is_app = true; + tab5.renderer_handle = 12; + tab5.id = 5; + TabStatsList tab_list = {tab1, tab2, tab3, tab4, tab5}; // Sorted order (by GetSortedCandidates): // app "focused" pid: 10 nspid 1 @@ -431,8 +416,8 @@ memory_stat->SetProcessPss(20, 30000); memory_stat->SetProcessPss(10, 100000); - tab_manager_delegate.LowMemoryKillImpl(DiscardReason::kProactive, - std::move(arc_processes)); + tab_manager_delegate.LowMemoryKillImpl(DiscardReason::kProactive, tab_list, + arc_processes); auto killed_arc_processes = tab_manager_delegate.GetKilledArcProcesses(); auto killed_tabs = tab_manager_delegate.GetKilledTabs(); @@ -446,11 +431,11 @@ // times. But so far I don't have a good way to estimate the memory freed // if multiple tabs share one process. ASSERT_EQ(5U, killed_tabs.size()); - EXPECT_EQ(&tab2, killed_tabs[0]); - EXPECT_EQ(&tab5, killed_tabs[1]); - EXPECT_EQ(&tab1, killed_tabs[2]); - EXPECT_EQ(&tab4, killed_tabs[3]); - EXPECT_EQ(&tab3, killed_tabs[4]); + EXPECT_EQ(2, killed_tabs[0]); + EXPECT_EQ(5, killed_tabs[1]); + EXPECT_EQ(1, killed_tabs[2]); + EXPECT_EQ(4, killed_tabs[3]); + EXPECT_EQ(3, killed_tabs[4]); // Check that killed apps are in the map. const TabManagerDelegate::KilledArcProcessesMap& processes_map =
diff --git a/chrome/browser/resource_coordinator/tab_manager_unittest.cc b/chrome/browser/resource_coordinator/tab_manager_unittest.cc index 4120139..d201205 100644 --- a/chrome/browser/resource_coordinator/tab_manager_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_unittest.cc
@@ -29,15 +29,14 @@ #include "chrome/browser/resource_coordinator/tab_manager_resource_coordinator_signal_observer.h" #include "chrome/browser/resource_coordinator/tab_manager_stats_collector.h" #include "chrome/browser/resource_coordinator/tab_manager_web_contents_data.h" +#include "chrome/browser/resource_coordinator/tab_stats.h" #include "chrome/browser/resource_coordinator/time.h" #include "chrome/browser/sessions/tab_loader.h" -#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tab_ui_helper.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/tabs/test_tab_strip_model_delegate.h" #include "chrome/common/url_constants.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" -#include "chrome/test/base/test_browser_window.h" #include "chrome/test/base/testing_profile.h" #include "components/variations/variations_associated_data.h" #include "content/public/browser/render_frame_host.h" @@ -289,6 +288,107 @@ // TODO(georgesak): Add tests for protection to tabs with form input and // playing audio; +// Tests the sorting comparator to make sure it's producing the desired order. +TEST_F(TabManagerTest, Comparator) { + TabStatsList test_list; + const base::TimeTicks now = NowTicks(); + + // Add kAutoDiscardable last to verify that the array is being sorted. + + { + TabStats stats; + stats.last_active = now; + stats.is_pinned = true; + stats.child_process_host_id = kPinned; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.last_active = now; + stats.is_app = true; + stats.child_process_host_id = kApp; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.last_active = now; + stats.is_media = true; + stats.child_process_host_id = kPlayingAudio; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.last_active = now; + stats.has_form_entry = true; + stats.child_process_host_id = kFormEntry; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.last_active = now - base::TimeDelta::FromSeconds(10); + stats.child_process_host_id = kRecent; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.last_active = now - base::TimeDelta::FromMinutes(15); + stats.child_process_host_id = kOld; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.last_active = now - base::TimeDelta::FromDays(365); + stats.child_process_host_id = kReallyOld; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.is_pinned = true; + stats.last_active = now - base::TimeDelta::FromDays(365); + stats.child_process_host_id = kOldButPinned; + test_list.push_back(stats); + } + + { + TabStats stats; + stats.last_active = now; + stats.is_internal_page = true; + stats.child_process_host_id = kInternalPage; + test_list.push_back(stats); + } + + // This entry sorts to the front, so by adding it last, it verifies that the + // array is being sorted. + { + TabStats stats; + stats.last_active = now; + stats.is_auto_discardable = false; + stats.child_process_host_id = kAutoDiscardable; + test_list.push_back(stats); + } + + std::sort(test_list.begin(), test_list.end(), TabManager::CompareTabStats); + + int index = 0; + EXPECT_EQ(kAutoDiscardable, test_list[index++].child_process_host_id); + EXPECT_EQ(kFormEntry, test_list[index++].child_process_host_id); + EXPECT_EQ(kPlayingAudio, test_list[index++].child_process_host_id); + EXPECT_EQ(kPinned, test_list[index++].child_process_host_id); + EXPECT_EQ(kOldButPinned, test_list[index++].child_process_host_id); + EXPECT_EQ(kApp, test_list[index++].child_process_host_id); + EXPECT_EQ(kRecent, test_list[index++].child_process_host_id); + EXPECT_EQ(kOld, test_list[index++].child_process_host_id); + EXPECT_EQ(kReallyOld, test_list[index++].child_process_host_id); + EXPECT_EQ(kInternalPage, test_list[index++].child_process_host_id); +} + TEST_F(TabManagerTest, IsInternalPage) { EXPECT_TRUE(TabManager::IsInternalPage(GURL(chrome::kChromeUIDownloadsURL))); EXPECT_TRUE(TabManager::IsInternalPage(GURL(chrome::kChromeUIHistoryURL))); @@ -307,6 +407,124 @@ TabManager::IsInternalPage(GURL("chrome://settings/fakeSetting"))); } +// Ensures discarding tabs leaves TabStripModel in a good state. +TEST_F(TabManagerTest, DiscardWebContentsAt) { + // Create a tab strip in a visible and active window. + TabStripDummyDelegate delegate; + TabStripModel tabstrip(&delegate, profile()); + tabstrip.AddObserver(tab_manager_); + + BrowserInfo browser_info; + browser_info.tab_strip_model = &tabstrip; + browser_info.window_is_minimized = false; + browser_info.browser_is_app = false; + tab_manager_->test_browser_info_list_.push_back(browser_info); + + // Fill it with some tabs. + WebContents* contents1 = CreateWebContents(); + tabstrip.AppendWebContents(contents1, true); + WebContents* contents2 = CreateWebContents(); + tabstrip.AppendWebContents(contents2, true); + + // Start watching for events after the appends to avoid observing state + // transitions that aren't relevant to this test. + MockTabStripModelObserver tabstrip_observer; + tabstrip.AddObserver(&tabstrip_observer); + + // Discard one of the tabs. + WebContents* null_contents1 = tab_manager_->DiscardWebContentsAt( + 0, &tabstrip, DiscardReason::kProactive); + ASSERT_EQ(2, tabstrip.count()); + EXPECT_TRUE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(0))); + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(1))); + ASSERT_EQ(null_contents1, tabstrip.GetWebContentsAt(0)); + ASSERT_EQ(contents2, tabstrip.GetWebContentsAt(1)); + ASSERT_EQ(1, tabstrip_observer.NbEvents()); + EXPECT_EQ(contents1, tabstrip_observer.OldContents()); + EXPECT_EQ(null_contents1, tabstrip_observer.NewContents()); + tabstrip_observer.Reset(); + + // Discard the same tab again, after resetting its discard state. + tab_manager_->GetWebContentsData(tabstrip.GetWebContentsAt(0)) + ->SetDiscardState(false); + WebContents* null_contents2 = tab_manager_->DiscardWebContentsAt( + 0, &tabstrip, DiscardReason::kProactive); + ASSERT_EQ(2, tabstrip.count()); + EXPECT_TRUE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(0))); + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(1))); + ASSERT_EQ(null_contents2, tabstrip.GetWebContentsAt(0)); + ASSERT_EQ(contents2, tabstrip.GetWebContentsAt(1)); + ASSERT_EQ(1, tabstrip_observer.NbEvents()); + EXPECT_EQ(null_contents1, tabstrip_observer.OldContents()); + EXPECT_EQ(null_contents2, tabstrip_observer.NewContents()); + + // Activating the tab should clear its discard state. + tabstrip.ActivateTabAt(0, true /* user_gesture */); + ASSERT_EQ(2, tabstrip.count()); + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(0))); + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(1))); + + tabstrip.CloseAllTabs(); + EXPECT_TRUE(tabstrip.empty()); +} + +// Makes sure that reloading a discarded tab without activating it unmarks the +// tab as discarded so it won't reload on activation. +TEST_F(TabManagerTest, ReloadDiscardedTabContextMenu) { + // Note that we do not add |tab_manager| as an observer to |tabstrip| here as + // the event we are trying to test for is not related to the tab strip, but + // the web content instead and therefore should be handled by WebContentsData + // (which observes the web content). + TabStripDummyDelegate delegate; + TabStripModel tabstrip(&delegate, profile()); + + // Create 2 tabs because the active tab cannot be discarded. + tabstrip.AppendWebContents(CreateWebContents(), true); + content::WebContents* test_contents = + WebContentsTester::CreateTestWebContents(browser_context(), nullptr); + tabstrip.AppendWebContents(test_contents, false); // Opened in background. + + // Navigate to a web page. This is necessary to set a current entry in memory + // so the reload can happen. + WebContentsTester::For(test_contents) + ->NavigateAndCommit(GURL("chrome://newtab")); + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(1))); + + tab_manager_->DiscardWebContentsAt(1, &tabstrip, DiscardReason::kProactive); + EXPECT_TRUE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(1))); + + tabstrip.GetWebContentsAt(1)->GetController().Reload( + content::ReloadType::NORMAL, false); + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tabstrip.GetWebContentsAt(1))); + tabstrip.CloseAllTabs(); + EXPECT_TRUE(tabstrip.empty()); +} + +// Makes sure that the last active time property is saved even though the tab is +// discarded. +TEST_F(TabManagerTest, DiscardedTabKeepsLastActiveTime) { + TabStripDummyDelegate delegate; + TabStripModel tabstrip(&delegate, profile()); + tabstrip.AddObserver(tab_manager_); + + tabstrip.AppendWebContents(CreateWebContents(), true); + WebContents* test_contents = CreateWebContents(); + tabstrip.AppendWebContents(test_contents, false); + + // Simulate an old inactive tab about to get discarded. + base::TimeTicks new_last_active_time = + NowTicks() - base::TimeDelta::FromMinutes(35); + test_contents->SetLastActiveTime(new_last_active_time); + EXPECT_EQ(new_last_active_time, test_contents->GetLastActiveTime()); + + WebContents* null_contents = tab_manager_->DiscardWebContentsAt( + 1, &tabstrip, DiscardReason::kProactive); + EXPECT_EQ(new_last_active_time, null_contents->GetLastActiveTime()); + + tabstrip.CloseAllTabs(); + EXPECT_TRUE(tabstrip.empty()); +} + TEST_F(TabManagerTest, DefaultTimeToPurgeInCorrectRange) { base::TimeDelta time_to_purge = tab_manager_->GetTimeToPurge(TabManager::kDefaultMinTimeToPurge, @@ -316,15 +534,12 @@ } TEST_F(TabManagerTest, ShouldPurgeAtDefaultTime) { - auto window = std::make_unique<TestBrowserWindow>(); - Browser::CreateParams params(profile(), true); - params.type = Browser::TYPE_TABBED; - params.window = window.get(); - auto browser = std::make_unique<Browser>(params); - TabStripModel* tab_strip = browser->tab_strip_model(); + TabStripDummyDelegate delegate; + TabStripModel tabstrip(&delegate, profile()); + tabstrip.AddObserver(tab_manager_); WebContents* test_contents = CreateWebContents(); - tab_strip->AppendWebContents(test_contents, false); + tabstrip.AppendWebContents(test_contents, false); tab_manager_->GetWebContentsData(test_contents)->set_is_purged(false); tab_manager_->GetWebContentsData(test_contents) @@ -349,21 +564,24 @@ EXPECT_FALSE(tab_manager_->ShouldPurgeNow(test_contents)); // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. - tab_strip->CloseAllTabs(); + tabstrip.CloseAllTabs(); } TEST_F(TabManagerTest, ActivateTabResetPurgeState) { - auto window = std::make_unique<TestBrowserWindow>(); - Browser::CreateParams params(profile(), true); - params.type = Browser::TYPE_TABBED; - params.window = window.get(); - auto browser = std::make_unique<Browser>(params); - TabStripModel* tabstrip = browser->tab_strip_model(); + TabStripDummyDelegate delegate; + TabStripModel tabstrip(&delegate, profile()); + tabstrip.AddObserver(tab_manager_); + + BrowserInfo browser_info; + browser_info.tab_strip_model = &tabstrip; + browser_info.window_is_minimized = false; + browser_info.browser_is_app = false; + tab_manager_->test_browser_info_list_.push_back(browser_info); WebContents* tab1 = CreateWebContents(); WebContents* tab2 = CreateWebContents(); - tabstrip->AppendWebContents(tab1, true); - tabstrip->AppendWebContents(tab2, false); + tabstrip.AppendWebContents(tab1, true); + tabstrip.AppendWebContents(tab2, false); tab_manager_->GetWebContentsData(tab2)->SetLastInactiveTime(NowTicks()); static_cast<content::MockRenderProcessHost*>( @@ -382,11 +600,66 @@ EXPECT_TRUE(tab_manager_->GetWebContentsData(tab2)->is_purged()); // Activate tab2. Tab2's PurgeAndSuspend state should be NOT_PURGED. - tabstrip->ActivateTabAt(1, true /* user_gesture */); + tabstrip.ActivateTabAt(1, true /* user_gesture */); EXPECT_FALSE(tab_manager_->GetWebContentsData(tab2)->is_purged()); // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. - tabstrip->CloseAllTabs(); + tabstrip.CloseAllTabs(); +} + +// Verify that the |is_in_visible_window| field of TabStats returned by +// GetUnsortedTabStats() is set correctly. +TEST_F(TabManagerTest, GetUnsortedTabStatsIsInVisibleWindow) { + TabStripDummyDelegate delegate; + + WebContents* web_contents1a = CreateWebContents(); + WebContents* web_contents1b = CreateWebContents(); + WebContents* web_contents2a = CreateWebContents(); + WebContents* web_contents2b = CreateWebContents(); + + // Create 2 TabStripModels. + TabStripModel tab_strip1(&delegate, profile()); + tab_strip1.AppendWebContents(web_contents1a, true); + tab_strip1.AppendWebContents(web_contents1b, false); + + TabStripModel tab_strip2(&delegate, profile()); + tab_strip2.AppendWebContents(web_contents2a, true); + tab_strip2.AppendWebContents(web_contents2b, false); + + // Add the 2 TabStripModels to the TabManager. + // The window for |tab_strip1| is visible while the window for |tab_strip2| is + // minimized. + BrowserInfo browser_info1; + browser_info1.tab_strip_model = &tab_strip1; + browser_info1.window_is_minimized = false; + browser_info1.browser_is_app = false; + tab_manager_->test_browser_info_list_.push_back(browser_info1); + + BrowserInfo browser_info2; + browser_info2.tab_strip_model = &tab_strip2; + browser_info2.window_is_minimized = true; + browser_info2.browser_is_app = false; + tab_manager_->test_browser_info_list_.push_back(browser_info2); + + // Get TabStats and verify the the |is_in_visible_window| field of each + // TabStats is set correctly. + auto tab_stats = tab_manager_->GetUnsortedTabStats(); + + ASSERT_EQ(4U, tab_stats.size()); + + EXPECT_EQ(tab_stats[0].id, tab_manager_->IdFromWebContents(web_contents1a)); + EXPECT_EQ(tab_stats[1].id, tab_manager_->IdFromWebContents(web_contents1b)); + EXPECT_EQ(tab_stats[2].id, tab_manager_->IdFromWebContents(web_contents2a)); + EXPECT_EQ(tab_stats[3].id, tab_manager_->IdFromWebContents(web_contents2b)); + + EXPECT_TRUE(tab_stats[0].is_in_visible_window); + EXPECT_TRUE(tab_stats[1].is_in_visible_window); + EXPECT_FALSE(tab_stats[2].is_in_visible_window); + EXPECT_FALSE(tab_stats[3].is_in_visible_window); + + // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. + tab_strip1.CloseAllTabs(); + tab_strip2.CloseAllTabs(); } // Data race on Linux. http://crbug.com/787842 @@ -397,34 +670,35 @@ #endif // Verify that: -// - On ChromeOS, DiscardTab can discard every non-visible tab, but cannot -// discard a visible tab. -// - On other platforms, DiscardTab can discard every tab that is not active in -// its tab strip. +// - On ChromeOS, DiscardTab can discard every tab in a non-visible window, but +// cannot discard the active tab in a visible window. +// - On other platforms, DiscardTab can discard every non-active tab. TEST_F(TabManagerTest, MAYBE_DiscardTabWithNonVisibleTabs) { - // Create 2 tab strips. Simulate the second tab strip being hidden by hiding - // its active tab. - auto window1 = std::make_unique<TestBrowserWindow>(); - Browser::CreateParams params1(profile(), true); - params1.type = Browser::TYPE_TABBED; - params1.window = window1.get(); - auto browser1 = std::make_unique<Browser>(params1); - TabStripModel* tab_strip1 = browser1->tab_strip_model(); - tab_strip1->AppendWebContents(CreateWebContents(), true); - tab_strip1->AppendWebContents(CreateWebContents(), false); - tab_strip1->GetWebContentsAt(0)->WasShown(); - tab_strip1->GetWebContentsAt(1)->WasHidden(); + TabStripDummyDelegate delegate; - auto window2 = std::make_unique<TestBrowserWindow>(); - Browser::CreateParams params2(profile(), true); - params2.type = Browser::TYPE_TABBED; - params2.window = window2.get(); - auto browser2 = std::make_unique<Browser>(params1); - TabStripModel* tab_strip2 = browser2->tab_strip_model(); - tab_strip2->AppendWebContents(CreateWebContents(), true); - tab_strip2->AppendWebContents(CreateWebContents(), false); - tab_strip2->GetWebContentsAt(0)->WasHidden(); - tab_strip2->GetWebContentsAt(1)->WasHidden(); + // Create 2 TabStripModels. + TabStripModel tab_strip1(&delegate, profile()); + tab_strip1.AppendWebContents(CreateWebContents(), true); + tab_strip1.AppendWebContents(CreateWebContents(), false); + + TabStripModel tab_strip2(&delegate, profile()); + tab_strip2.AppendWebContents(CreateWebContents(), true); + tab_strip2.AppendWebContents(CreateWebContents(), false); + + // Add the 2 TabStripModels to the TabManager. + // The window for |tab_strip1| is visible while the window for |tab_strip2| + // is minimized. + BrowserInfo browser_info1; + browser_info1.tab_strip_model = &tab_strip1; + browser_info1.window_is_minimized = false; + browser_info1.browser_is_app = false; + tab_manager_->test_browser_info_list_.push_back(browser_info1); + + BrowserInfo browser_info2; + browser_info2.tab_strip_model = &tab_strip2; + browser_info2.window_is_minimized = true; + browser_info2.browser_is_app = false; + tab_manager_->test_browser_info_list_.push_back(browser_info2); // Fast-forward time until no tab is protected from being discarded for having // recently been used. @@ -434,25 +708,24 @@ tab_manager_->DiscardTab(DiscardReason::kProactive); // Active tab in a visible window should not be discarded. - EXPECT_FALSE(tab_manager_->IsTabDiscarded(tab_strip1->GetWebContentsAt(0))); + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tab_strip1.GetWebContentsAt(0))); // Non-active tabs should be discarded. - EXPECT_TRUE(tab_manager_->IsTabDiscarded(tab_strip1->GetWebContentsAt(1))); - EXPECT_TRUE(tab_manager_->IsTabDiscarded(tab_strip2->GetWebContentsAt(1))); + EXPECT_TRUE(tab_manager_->IsTabDiscarded(tab_strip1.GetWebContentsAt(1))); + EXPECT_TRUE(tab_manager_->IsTabDiscarded(tab_strip2.GetWebContentsAt(1))); #if defined(OS_CHROMEOS) - // On ChromeOS, a non-visible tab should be discarded even if it's active in - // its tab strip. - EXPECT_TRUE(tab_manager_->IsTabDiscarded(tab_strip2->GetWebContentsAt(0))); + // On ChromeOS, active tab in a minimized window should be discarded. + EXPECT_TRUE(tab_manager_->IsTabDiscarded(tab_strip2.GetWebContentsAt(0))); #else - // On other platforms, an active tab is never discarded, even if it's not - // visible. - EXPECT_FALSE(tab_manager_->IsTabDiscarded(tab_strip2->GetWebContentsAt(0))); + // On other platforms, an active tab is never discarded, even if its window is + // minimized. + EXPECT_FALSE(tab_manager_->IsTabDiscarded(tab_strip2.GetWebContentsAt(0))); #endif // defined(OS_CHROMEOS) // Tabs with a committed URL must be closed explicitly to avoid DCHECK errors. - tab_strip1->CloseAllTabs(); - tab_strip2->CloseAllTabs(); + tab_strip1.CloseAllTabs(); + tab_strip2.CloseAllTabs(); } TEST_F(TabManagerTest, MaybeThrottleNavigation) {
diff --git a/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc b/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc index 64deba0..059cfc86 100644 --- a/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc +++ b/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc
@@ -5,7 +5,9 @@ #include "chrome/browser/resource_coordinator/tab_manager_web_contents_data.h" #include "base/metrics/histogram_macros.h" +#include "base/time/tick_clock.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/resource_coordinator/discard_metrics_util.h" #include "chrome/browser/resource_coordinator/tab_manager.h" #include "chrome/browser/resource_coordinator/tab_manager_stats_collector.h" #include "chrome/browser/resource_coordinator/time.h" @@ -25,10 +27,19 @@ TabManager::WebContentsData::WebContentsData(content::WebContents* web_contents) : WebContentsObserver(web_contents), time_to_purge_(base::TimeDelta::FromMinutes(30)), - is_purged_(false) {} + is_purged_(false) { + tab_data_.is_hidden = + web_contents->GetVisibility() == content::Visibility::HIDDEN; +} TabManager::WebContentsData::~WebContentsData() {} +void TabManager::WebContentsData::DidStartLoading() { + // Marks the tab as no longer discarded if it has been reloaded from another + // source (ie: context menu). + SetDiscardState(false); +} + void TabManager::WebContentsData::DidStopLoading() { if (IsPageAlmostIdleSignalEnabled()) return; @@ -62,6 +73,17 @@ if (g_browser_process->IsShuttingDown()) return; + // If the tab has been previously discarded but is not currently discarded + // (ie. it has been reloaded), we want to record the time it took between the + // reload event and the closing of the tab. + if (tab_data_.discard_count > 0 && !tab_data_.is_discarded) { + auto delta = NowTicks() - tab_data_.last_reload_time; + // Capped to one day for now, will adjust if necessary. + UMA_HISTOGRAM_CUSTOM_TIMES("TabManager.Discarding.ReloadToCloseTime", delta, + base::TimeDelta::FromSeconds(1), + base::TimeDelta::FromDays(1), 100); + } + SetTabLoadingState(TAB_IS_NOT_LOADING); SetIsInSessionRestore(false); g_browser_process->GetTabManager()->OnWebContentsDestroyed(web_contents()); @@ -76,6 +98,52 @@ } } +bool TabManager::WebContentsData::IsDiscarded() { + return tab_data_.is_discarded; +} + +void TabManager::WebContentsData::SetDiscardState(bool is_discarded) { + if (tab_data_.is_discarded == is_discarded) + return; + + if (is_discarded) { + tab_data_.last_discard_time = NowTicks(); + RecordTabDiscarded(); + } else { + tab_data_.last_reload_time = NowTicks(); + RecordTabReloaded(tab_data_.last_inactive_time, tab_data_.last_discard_time, + tab_data_.last_reload_time); + } + + tab_data_.is_discarded = is_discarded; + g_browser_process->GetTabManager()->OnDiscardedStateChange(web_contents(), + is_discarded); +} + +int TabManager::WebContentsData::DiscardCount() { + return tab_data_.discard_count; +} + +void TabManager::WebContentsData::IncrementDiscardCount() { + tab_data_.discard_count++; +} + +bool TabManager::WebContentsData::IsRecentlyAudible() { + return tab_data_.is_recently_audible; +} + +void TabManager::WebContentsData::SetRecentlyAudible(bool state) { + tab_data_.is_recently_audible = state; +} + +TimeTicks TabManager::WebContentsData::LastAudioChangeTime() { + return tab_data_.last_audio_change_time; +} + +void TabManager::WebContentsData::SetLastAudioChangeTime(TimeTicks timestamp) { + tab_data_.last_audio_change_time = timestamp; +} + TimeTicks TabManager::WebContentsData::LastInactiveTime() { return tab_data_.last_inactive_time; } @@ -97,12 +165,27 @@ } TabManager::WebContentsData::Data::Data() - : tab_loading_state(TAB_IS_NOT_LOADING), + : id(0), + is_discarded(false), + discard_count(0), + is_hidden(true), + is_recently_audible(false), + is_auto_discardable(true), + tab_loading_state(TAB_IS_NOT_LOADING), is_in_session_restore(false), - is_restored_in_foreground(false) {} + is_restored_in_foreground(false) { + static int32_t next_id = 0; + id = ++next_id; +} bool TabManager::WebContentsData::Data::operator==(const Data& right) const { - return last_inactive_time == right.last_inactive_time && + return id == right.id && is_discarded == right.is_discarded && + is_hidden == right.is_hidden && + is_recently_audible == right.is_recently_audible && + last_audio_change_time == right.last_audio_change_time && + last_discard_time == right.last_discard_time && + last_reload_time == right.last_reload_time && + last_inactive_time == right.last_inactive_time && tab_loading_state == right.tab_loading_state && is_in_session_restore == right.is_in_session_restore && is_restored_in_foreground == right.is_restored_in_foreground; @@ -112,4 +195,17 @@ return !(*this == right); } +void TabManager::WebContentsData::SetAutoDiscardableState(bool state) { + if (tab_data_.is_auto_discardable == state) + return; + + tab_data_.is_auto_discardable = state; + g_browser_process->GetTabManager()->OnAutoDiscardableStateChange( + web_contents(), state); +} + +bool TabManager::WebContentsData::IsAutoDiscardable() { + return tab_data_.is_auto_discardable; +} + } // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h b/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h index e7012cc..d200715 100644 --- a/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h +++ b/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h
@@ -51,6 +51,7 @@ ~WebContentsData() override; // WebContentsObserver implementation: + void DidStartLoading() override; void DidStopLoading() override; void DidStartNavigation( content::NavigationHandle* navigation_handle) override; @@ -62,6 +63,30 @@ // tab is considered loaded. void NotifyTabIsLoaded(); + // Returns true if the tab has been discarded to save memory. + bool IsDiscarded(); + + // Sets/clears the discard state of the tab. + void SetDiscardState(bool is_discarded); + + // Returns the number of times the tab has been discarded. + int DiscardCount(); + + // Increments the number of times the tab has been discarded. + void IncrementDiscardCount(); + + // Returns true if audio has recently been audible. + bool IsRecentlyAudible(); + + // Set/clears the state of whether audio has recently been audible. + void SetRecentlyAudible(bool state); + + // Returns the timestamp of the last time the tab changed its audio state. + base::TimeTicks LastAudioChangeTime(); + + // Sets the timestamp of the last time the tab changed its audio state. + void SetLastAudioChangeTime(base::TimeTicks timestamp); + // Returns the timestamp of the last time the tab changed became inactive. base::TimeTicks LastInactiveTime(); @@ -72,6 +97,13 @@ static void CopyState(content::WebContents* old_contents, content::WebContents* new_contents); + // Returns the auto-discardable state of the tab. + // See tab_manager.h for more information. + bool IsAutoDiscardable(); + + // Sets/clears the auto-discardable state of the tab. + void SetAutoDiscardableState(bool state); + // Sets the current purge state. // TODO(tasak): remove this after the logic is moved into // MemoryCoordinator. @@ -114,6 +146,8 @@ return tab_data_.is_restored_in_foreground; } + int32_t id() const { return tab_data_.id; } + private: // Needed to access tab_data_. FRIEND_TEST_ALL_PREFIXES(TabManagerWebContentsDataTest, CopyState); @@ -124,8 +158,29 @@ bool operator==(const Data& right) const; bool operator!=(const Data& right) const; + // Unique ID associated with this tab. This stays constant through discards + // and reloads, and is independent of the underlying WebContents and + // TabStripModel index, both of which may change. + int32_t id; + // Is the tab currently discarded? + bool is_discarded; + // Number of times the tab has been discarded. + int discard_count; + // Is the tab hidden? + bool is_hidden; + // Is the tab playing audio? + bool is_recently_audible; + // Last time the tab started or stopped playing audio (we record the + // transition time). + base::TimeTicks last_audio_change_time; + // The last time the tab was discarded. + base::TimeTicks last_discard_time; + // The last time the tab was reloaded after being discarded. + base::TimeTicks last_reload_time; // The last time the tab switched from being active to inactive. base::TimeTicks last_inactive_time; + // Is tab eligible for auto discarding? Defaults to true. + bool is_auto_discardable; // Current loading state of this tab. TabLoadingState tab_loading_state; // True if the tab was created by session restore. Remains true until the
diff --git a/chrome/browser/resource_coordinator/tab_manager_web_contents_data_unittest.cc b/chrome/browser/resource_coordinator/tab_manager_web_contents_data_unittest.cc index a48f671..05a60fee 100644 --- a/chrome/browser/resource_coordinator/tab_manager_web_contents_data_unittest.cc +++ b/chrome/browser/resource_coordinator/tab_manager_web_contents_data_unittest.cc
@@ -62,6 +62,37 @@ } // namespace +TEST_F(TabManagerWebContentsDataTest, DiscardState) { + EXPECT_FALSE(tab_data()->IsDiscarded()); + tab_data()->SetDiscardState(true); + EXPECT_TRUE(tab_data()->IsDiscarded()); + tab_data()->SetDiscardState(false); + EXPECT_FALSE(tab_data()->IsDiscarded()); +} + +TEST_F(TabManagerWebContentsDataTest, DiscardCount) { + EXPECT_EQ(0, tab_data()->DiscardCount()); + tab_data()->IncrementDiscardCount(); + EXPECT_EQ(1, tab_data()->DiscardCount()); + tab_data()->IncrementDiscardCount(); + EXPECT_EQ(2, tab_data()->DiscardCount()); +} + +TEST_F(TabManagerWebContentsDataTest, RecentlyAudible) { + EXPECT_FALSE(tab_data()->IsRecentlyAudible()); + tab_data()->SetRecentlyAudible(true); + EXPECT_TRUE(tab_data()->IsRecentlyAudible()); + tab_data()->SetRecentlyAudible(false); + EXPECT_FALSE(tab_data()->IsRecentlyAudible()); +} + +TEST_F(TabManagerWebContentsDataTest, LastAudioChangeTime) { + EXPECT_TRUE(tab_data()->LastAudioChangeTime().is_null()); + auto now = NowTicks(); + tab_data()->SetLastAudioChangeTime(now); + EXPECT_EQ(now, tab_data()->LastAudioChangeTime()); +} + TEST_F(TabManagerWebContentsDataTest, LastInactiveTime) { EXPECT_TRUE(tab_data()->LastInactiveTime().is_null()); auto now = NowTicks(); @@ -78,21 +109,116 @@ } TEST_F(TabManagerWebContentsDataTest, CopyState) { - tab_data()->SetLastInactiveTime(base::TimeTicks() + - base::TimeDelta::FromSeconds(42)); - tab_data()->SetTabLoadingState(TAB_IS_LOADED); - tab_data()->SetIsInSessionRestore(true); - tab_data()->SetIsRestoredInForeground(true); - std::unique_ptr<WebContents> web_contents2; auto* tab_data2 = CreateWebContentsAndTabData(&web_contents2); - + // TabManagerWebContentsData are initially distinct as they each have unique + // IDs assigned to them at construction time. EXPECT_NE(tab_data()->tab_data_, tab_data2->tab_data_); + + // Copying the state should bring the ID along with it, so they should have + // identical content afterwards. TabManager::WebContentsData::CopyState(tab_data()->web_contents(), tab_data2->web_contents()); EXPECT_EQ(tab_data()->tab_data_, tab_data2->tab_data_); } +TEST_F(TabManagerWebContentsDataTest, HistogramDiscardCount) { + const char kHistogramName[] = "TabManager.Discarding.DiscardCount"; + + base::HistogramTester histograms; + + EXPECT_TRUE(histograms.GetTotalCountsForPrefix(kHistogramName).empty()); + tab_data()->SetDiscardState(true); + EXPECT_EQ(1, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + tab_data()->SetDiscardState(false); + EXPECT_EQ(1, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + tab_data()->SetDiscardState(true); + EXPECT_EQ(2, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + tab_data()->SetDiscardState(false); + EXPECT_EQ(2, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); +} + +TEST_F(TabManagerWebContentsDataTest, HistogramReloadCount) { + const char kHistogramName[] = "TabManager.Discarding.ReloadCount"; + + base::HistogramTester histograms; + + EXPECT_TRUE(histograms.GetTotalCountsForPrefix(kHistogramName).empty()); + tab_data()->SetDiscardState(true); + EXPECT_TRUE(histograms.GetTotalCountsForPrefix(kHistogramName).empty()); + tab_data()->SetDiscardState(false); + EXPECT_EQ(1, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + tab_data()->SetDiscardState(true); + EXPECT_EQ(1, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + tab_data()->SetDiscardState(false); + EXPECT_EQ(2, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); +} + +TEST_F(TabManagerWebContentsDataTest, HistogramsDiscardToReloadTime) { + const char kHistogramName[] = "TabManager.Discarding.DiscardToReloadTime"; + + base::HistogramTester histograms; + + EXPECT_TRUE(histograms.GetTotalCountsForPrefix(kHistogramName).empty()); + + tab_data()->SetDiscardState(true); + test_clock().Advance(base::TimeDelta::FromSeconds(24)); + tab_data()->SetDiscardState(false); + + EXPECT_EQ(1, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + + histograms.ExpectBucketCount(kHistogramName, 24000, 1); +} + +TEST_F(TabManagerWebContentsDataTest, HistogramsReloadToCloseTime) { + const char kHistogramName[] = "TabManager.Discarding.ReloadToCloseTime"; + + base::HistogramTester histograms; + + EXPECT_TRUE(histograms.GetTotalCountsForPrefix(kHistogramName).empty()); + + tab_data()->SetDiscardState(true); + tab_data()->IncrementDiscardCount(); + test_clock().Advance(base::TimeDelta::FromSeconds(5)); + tab_data()->SetDiscardState(false); + test_clock().Advance(base::TimeDelta::FromSeconds(13)); + + tab_data()->WebContentsDestroyed(); + + EXPECT_EQ(1, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + + histograms.ExpectBucketCount(kHistogramName, 13000, 1); +} + +TEST_F(TabManagerWebContentsDataTest, HistogramsInactiveToReloadTime) { + const char kHistogramName[] = "TabManager.Discarding.InactiveToReloadTime"; + + base::HistogramTester histograms; + + EXPECT_TRUE(histograms.GetTotalCountsForPrefix(kHistogramName).empty()); + + tab_data()->SetLastInactiveTime(NowTicks()); + test_clock().Advance(base::TimeDelta::FromSeconds(5)); + tab_data()->SetDiscardState(true); + tab_data()->IncrementDiscardCount(); + test_clock().Advance(base::TimeDelta::FromSeconds(7)); + tab_data()->SetDiscardState(false); + + EXPECT_EQ(1, + histograms.GetTotalCountsForPrefix(kHistogramName).begin()->second); + + histograms.ExpectBucketCount(kHistogramName, 12000, 1); +} + TEST_F(TabManagerWebContentsDataTest, IsInSessionRestoreWithTabLoading) { EXPECT_FALSE(tab_data()->is_in_session_restore()); tab_data()->SetIsInSessionRestore(true);
diff --git a/chrome/browser/resource_coordinator/tab_stats.cc b/chrome/browser/resource_coordinator/tab_stats.cc new file mode 100644 index 0000000..9a9f5376 --- /dev/null +++ b/chrome/browser/resource_coordinator/tab_stats.cc
@@ -0,0 +1,20 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/resource_coordinator/tab_stats.h" +#include "build/build_config.h" + +namespace resource_coordinator { + +TabStats::TabStats() = default; + +TabStats::TabStats(const TabStats& other) = default; + +TabStats::TabStats(TabStats&& other) noexcept = default; + +TabStats::~TabStats() {} + +TabStats& TabStats::operator=(const TabStats& other) = default; + +} // namespace resource_coordinator
diff --git a/chrome/browser/resource_coordinator/tab_stats.h b/chrome/browser/resource_coordinator/tab_stats.h new file mode 100644 index 0000000..7dd270d --- /dev/null +++ b/chrome/browser/resource_coordinator/tab_stats.h
@@ -0,0 +1,65 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_STATS_H_ +#define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_STATS_H_ + +#include <stdint.h> + +#include <vector> + +#include "base/process/process.h" +#include "base/strings/string16.h" +#include "base/time/time.h" +#include "build/build_config.h" + +namespace content { +class RenderProcessHost; +} // namespace content + +namespace resource_coordinator { + +struct TabStats { + TabStats(); + TabStats(const TabStats& other); + TabStats(TabStats&& other) noexcept; + ~TabStats(); + + TabStats& operator=(const TabStats& other); + + bool is_app = false; // Browser window is an app. + bool is_internal_page = false; // Internal page, such as NTP or Settings. + // Playing audio, accessing cam/mic or mirroring display. + bool is_media = false; + bool is_pinned = false; + bool is_in_visible_window = false; + bool is_in_active_window = false; + // Whether this is the active tab in a browser window. + bool is_active = false; + bool is_discarded = false; + // User has entered text in a form. + bool has_form_entry = false; + int discard_count = 0; + bool has_beforeunload_handler = false; + base::TimeTicks last_active; + content::RenderProcessHost* render_process_host = nullptr; + base::ProcessHandle renderer_handle = 0; + int child_process_host_id = 0; + std::string tab_url; + std::string favicon_url; + base::string16 title; +#if defined(OS_CHROMEOS) + int oom_score = 0; +#endif + // Unique ID for the tab. This is constant across discards/reloads and + // tab strip model manipulations. + int32_t id = 0; + bool is_auto_discardable = true; +}; + +typedef std::vector<TabStats> TabStatsList; + +} // namespace resource_coordinator + +#endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_STATS_H_
diff --git a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.html b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.html index 6878e2d..61c7b8f 100644 --- a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.html +++ b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.html
@@ -19,6 +19,8 @@ <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_network_icon.html"> <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html"> +<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html"> +<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/load_time_data.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> @@ -34,6 +36,10 @@ <dom-module id="internet-detail-dialog"> <template> <style include="network-shared iron-flex"> + cr-policy-network-indicator { + -webkit-margin-end: 10px; + } + .section { @apply(--cr-section); margin-bottom: 10px; @@ -122,6 +128,15 @@ <!-- Proxy --> <div class="section single-column"> + <template is="dom-if" + if="[[shouldShowProxyPolicyIndicator_(networkProperties)]]"> + <div class="property-box"> + <cr-policy-network-indicator + property="[[networkProperties.ProxySettings.Type]]"> + </cr-policy-network-indicator> + <div>$i18n{networkProxyEnforcedPolicy}</div> + </div> + </template> <network-proxy editable use-shared-proxies on-proxy-change="onProxyChange_" network-properties="[[networkProperties]]">
diff --git a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js index 5ffeb85..5a0c574 100644 --- a/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js +++ b/chrome/browser/resources/chromeos/internet_detail_dialog/internet_detail_dialog.js
@@ -10,7 +10,7 @@ Polymer({ is: 'internet-detail-dialog', - behaviors: [I18nBehavior], + behaviors: [CrPolicyNetworkBehavior, I18nBehavior], properties: { /** The network GUID to display details for. */ @@ -279,6 +279,18 @@ /** * @param {!CrOnc.NetworkProperties} networkProperties + * @return {boolean} + * @private + */ + shouldShowProxyPolicyIndicator_: function(networkProperties) { + var property = this.get('ProxySettings.Type', networkProperties); + return !!property && + this.isNetworkPolicyEnforced( + /** @type {!CrOnc.ManagedProperty} */ (property)); + }, + + /** + * @param {!CrOnc.NetworkProperties} networkProperties * @return {boolean} Whether or not to enable the network connect button. * @private */
diff --git a/chrome/browser/resources/chromeos/login/arc_terms_of_service.html b/chrome/browser/resources/chromeos/login/arc_terms_of_service.html index 6a0c1d7..979c2273 100644 --- a/chrome/browser/resources/chromeos/login/arc_terms_of_service.html +++ b/chrome/browser/resources/chromeos/login/arc_terms_of_service.html
@@ -24,8 +24,9 @@ <div id="arc-tos-view-container-md" class="arc-tos-content"> <webview id="arc-tos-view-md"></webview> </div> - <a id="arc-policy-link-md" class="arc-tos-content" href="#" - i18n-content="arcPolicyLink"></a> + <div id="arc-policy-link-md" class="arc-tos-content"> + <a href="#" i18n-content="arcPolicyLink"></a> + </div> <div class="parameter-section arc-tos-content"> <p id="arc-text-metrics-md"></p> </div>
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_login.html b/chrome/browser/resources/chromeos/login/custom_elements_login.html index 41470955..a5e37e5 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_login.html +++ b/chrome/browser/resources/chromeos/login/custom_elements_login.html
@@ -27,5 +27,6 @@ <include src="encryption_migration.html"> <include src="enrollment_license_card.html"> <include src="sync_consent.html"> +<include src="demo_setup.html"> <script src="chrome://oobe/custom_elements.js"></script>
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_login.js b/chrome/browser/resources/chromeos/login/custom_elements_login.js index a62022c..aaf1c591 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_login.js +++ b/chrome/browser/resources/chromeos/login/custom_elements_login.js
@@ -31,3 +31,4 @@ // <include src="oobe_wait_for_container_ready.js"> // <include src="enrollment_license_card.js"> // <include src="sync_consent.js"> +// <include src="demo_setup.js">
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_oobe.html b/chrome/browser/resources/chromeos/login/custom_elements_oobe.html index 987f988..7d45a83 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_oobe.html +++ b/chrome/browser/resources/chromeos/login/custom_elements_oobe.html
@@ -34,5 +34,6 @@ <include src="arc_terms_of_service.html"> <include src="enrollment_license_card.html"> <include src="sync_consent.html"> +<include src="demo_setup.html"> <script src="chrome://oobe/custom_elements.js"></script>
diff --git a/chrome/browser/resources/chromeos/login/custom_elements_oobe.js b/chrome/browser/resources/chromeos/login/custom_elements_oobe.js index 29d1a1c..b0496ae1 100644 --- a/chrome/browser/resources/chromeos/login/custom_elements_oobe.js +++ b/chrome/browser/resources/chromeos/login/custom_elements_oobe.js
@@ -44,3 +44,4 @@ // <include src="oobe_wait_for_container_ready.js"> // <include src="enrollment_license_card.js"> // <include src="sync_consent.js"> +// <include src="demo_setup.js">
diff --git a/chrome/browser/resources/chromeos/login/demo_setup.css b/chrome/browser/resources/chromeos/login/demo_setup.css new file mode 100644 index 0000000..85441ebe --- /dev/null +++ b/chrome/browser/resources/chromeos/login/demo_setup.css
@@ -0,0 +1,7 @@ +/* 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. */ + +.bottom-buttons { + -webkit-padding-end: 24px; +}
diff --git a/chrome/browser/resources/chromeos/login/demo_setup.html b/chrome/browser/resources/chromeos/login/demo_setup.html new file mode 100644 index 0000000..b15e405 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/demo_setup.html
@@ -0,0 +1,27 @@ +<!-- 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. --> + +<dom-module id="demo-setup-md"> + <template> + <link rel="stylesheet" href="demo_setup.css"> + <link rel="stylesheet" href="oobe_dialog_parameters.css"> + <link rel="stylesheet" href="oobe_flex_layout.css"> + <oobe-dialog id="demo-setup-dialog" role="dialog" has-buttons> + <div class="header"> + <h1 class="title">Demo mode setup dev</h1> + </div> + </div> + <div class="bottom-buttons flex layout horizontal"> + <oobe-back-button inverse on-tap="onBackButtonClicked_"> + </oobe-back-button> + <div class="flex"></div> + <oobe-text-button inverse on-tap="onOfflineSetupClicked_"> + Offline setup + </oobe-text-button> + <oobe-text-button inverse on-tap="onOnlineSetupClicked_"> + Online setup + </oobe-text-button> + </oobe-dialog> + </template> +</dom-module>
diff --git a/chrome/browser/resources/chromeos/login/demo_setup.js b/chrome/browser/resources/chromeos/login/demo_setup.js new file mode 100644 index 0000000..860a3ca5 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/demo_setup.js
@@ -0,0 +1,39 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * @fileoverview Polymer element for displaying material design Demo Setup + * screen. + */ + +Polymer({ + is: 'demo-setup-md', + + /** + * Online setup button click handler. + * @private + */ + onOnlineSetupClicked_: function(e) { + chrome.send('login.DemoSetupScreen.userActed', ['online-setup']); + e.stopPropagation(); + }, + + /** + * Offline setup button click handler. + * @private + */ + onOfflineSetupClicked_: function(e) { + chrome.send('login.DemoSetupScreen.userActed', ['offline-setup']); + e.stopPropagation(); + }, + + /** + * Close button click handler. + * @private + */ + onBackButtonClicked_: function(e) { + chrome.send('login.DemoSetupScreen.userActed', ['close-setup']); + e.stopPropagation(); + }, +});
diff --git a/chrome/browser/resources/chromeos/login/login.js b/chrome/browser/resources/chromeos/login/login.js index e118ac8..65da3a9e 100644 --- a/chrome/browser/resources/chromeos/login/login.js +++ b/chrome/browser/resources/chromeos/login/login.js
@@ -56,6 +56,7 @@ login.VoiceInteractionValuePropScreen.register(); login.WaitForContainerReadyScreen.register(); login.UpdateRequiredScreen.register(); + login.DemoSetupScreen.register(); cr.ui.Bubble.decorate($('bubble')); login.HeaderBar.decorate($('login-header-bar'));
diff --git a/chrome/browser/resources/chromeos/login/login_non_lock_shared.js b/chrome/browser/resources/chromeos/login/login_non_lock_shared.js index 8f24f4d..694c5fd 100644 --- a/chrome/browser/resources/chromeos/login/login_non_lock_shared.js +++ b/chrome/browser/resources/chromeos/login/login_non_lock_shared.js
@@ -19,6 +19,7 @@ // <include src="oobe_screen_voice_interaction_value_prop.js"> // <include src="oobe_screen_wait_for_container_ready.js"> // <include src="oobe_select.js"> +// <include src="oobe_screen_demo_setup.js"> // <include src="screen_app_launch_splash.js"> // <include src="screen_arc_kiosk_splash.js">
diff --git a/chrome/browser/resources/chromeos/login/login_screens.html b/chrome/browser/resources/chromeos/login/login_screens.html index d58b5f0..1ebe753 100644 --- a/chrome/browser/resources/chromeos/login/login_screens.html +++ b/chrome/browser/resources/chromeos/login/login_screens.html
@@ -5,6 +5,7 @@ <include src="oobe_screen_user_image.html"> <include src="oobe_screen_voice_interaction_value_prop.html"> <include src="oobe_screen_wait_for_container_ready.html"> +<include src="oobe_screen_demo_setup.html"> <include src="../../../../../ui/login/account_picker/screen_account_picker.html"> <include src="screen_arc_terms_of_service.html"> <include src="screen_error_message.html">
diff --git a/chrome/browser/resources/chromeos/login/md_login.js b/chrome/browser/resources/chromeos/login/md_login.js index 6015bc28..c949e96a 100644 --- a/chrome/browser/resources/chromeos/login/md_login.js +++ b/chrome/browser/resources/chromeos/login/md_login.js
@@ -56,6 +56,7 @@ login.VoiceInteractionValuePropScreen.register(); login.WaitForContainerReadyScreen.register(); login.UpdateRequiredScreen.register(); + login.DemoSetupScreen.register(); cr.ui.Bubble.decorate($('bubble')); login.HeaderBar.decorate($('login-header-bar'));
diff --git a/chrome/browser/resources/chromeos/login/md_login_screens.html b/chrome/browser/resources/chromeos/login/md_login_screens.html index 1891e6d..44e7c48 100644 --- a/chrome/browser/resources/chromeos/login/md_login_screens.html +++ b/chrome/browser/resources/chromeos/login/md_login_screens.html
@@ -5,6 +5,7 @@ <include src="oobe_screen_user_image.html"> <include src="oobe_screen_voice_interaction_value_prop.html"> <include src="oobe_screen_wait_for_container_ready.html"> +<include src="oobe_screen_demo_setup.html"> <include src="../../../../../ui/login/account_picker/md_screen_account_picker.html"> <include src="screen_arc_terms_of_service.html"> <include src="screen_error_message.html">
diff --git a/chrome/browser/resources/chromeos/login/oobe.js b/chrome/browser/resources/chromeos/login/oobe.js index 17ec648..915545d6 100644 --- a/chrome/browser/resources/chromeos/login/oobe.js +++ b/chrome/browser/resources/chromeos/login/oobe.js
@@ -57,6 +57,7 @@ login.ActiveDirectoryPasswordChangeScreen.register(/* lazyInit= */ true); login.VoiceInteractionValuePropScreen.register(); login.WaitForContainerReadyScreen.register(); + login.DemoSetupScreen.register(); cr.ui.Bubble.decorate($('bubble')); login.HeaderBar.decorate($('login-header-bar'));
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_demo_setup.html b/chrome/browser/resources/chromeos/login/oobe_screen_demo_setup.html new file mode 100644 index 0000000..d621361 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/oobe_screen_demo_setup.html
@@ -0,0 +1,7 @@ +<!-- 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. --> + +<div class="step hidden right" id="demo-setup" role="group" hidden> + <demo-setup-md id="demo-setup-content"></demo-setup-md> +</div> \ No newline at end of file
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_demo_setup.js b/chrome/browser/resources/chromeos/login/oobe_screen_demo_setup.js new file mode 100644 index 0000000..44f1fd3 --- /dev/null +++ b/chrome/browser/resources/chromeos/login/oobe_screen_demo_setup.js
@@ -0,0 +1,31 @@ +// 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. + +/** + * @fileoverview Demo mode setup screen implementation. + */ + +login.createScreen('DemoSetupScreen', 'demo-setup', function() { + return { + UI_STATE: {ERROR: -1, DEFAULT: 0, PROCESSING: 1}, + EXTERNAL_API: ['setState'], + + get defaultControl() { + return $('demo-setup-content'); + }, + + /** @override */ + onBeforeShow: function(data) { + this.setState(this.UI_STATE.DEFAULT); + }, + + /** + * Sets state of the UI. + * @param {number} state. + */ + setState: function(state) { + this.state_ = state; + }, + }; +});
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js index 605b909a..e3737b7 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js +++ b/chrome/browser/resources/chromeos/login/oobe_screen_oauth_enrollment.js
@@ -24,8 +24,6 @@ /** @const */ var STEP_ACTIVE_DIRECTORY_JOIN_ERROR = 'active-directory-join-error'; - /** @const */ var HELP_TOPIC_ENROLLMENT = 4631259; - return { EXTERNAL_API: [ 'showStep',
diff --git a/chrome/browser/resources/chromeos/login/oobe_screens.html b/chrome/browser/resources/chromeos/login/oobe_screens.html index 59c7e91..c1d16d5 100644 --- a/chrome/browser/resources/chromeos/login/oobe_screens.html +++ b/chrome/browser/resources/chromeos/login/oobe_screens.html
@@ -13,6 +13,7 @@ <include src="oobe_screen_hid_detection.html"> <include src="oobe_screen_voice_interaction_value_prop.html"> <include src="oobe_screen_wait_for_container_ready.html"> +<include src="oobe_screen_demo_setup.html"> <include src="../../../../../ui/login/account_picker/md_screen_account_picker.html"> <include src="screen_error_message.html"> <include src="screen_arc_terms_of_service.html">
diff --git a/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js b/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js index ddc3105d..37346798 100644 --- a/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js +++ b/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js
@@ -202,7 +202,7 @@ this.trackingMouse_ = true; this.didTrackMouse_ = true; this.mouseStart_ = {x: evt.screenX, y: evt.screenY}; - chrome.tts.stop(); + this.cancelIfSpeaking_(); // Fire a hit test event on click to warm up the cache. this.desktop_.hitTest(evt.screenX, evt.screenY, EventType.MOUSE_PRESSED); @@ -345,7 +345,7 @@ if (this.isSelectionKeyDown_ && this.keysPressedTogether_.size == 2 && this.keysPressedTogether_.has(evt.keyCode) && this.keysPressedTogether_.has(SelectToSpeak.SEARCH_KEY_CODE)) { - chrome.tts.isSpeaking(this.cancelIfSpeaking_.bind(this)); + this.cancelIfSpeaking_(); chrome.automation.getFocus(this.requestSpeakSelectedText_.bind(this)); } this.isSelectionKeyDown_ = false; @@ -367,7 +367,7 @@ this.keysPressedTogether_.has(evt.keyCode) && this.keysPressedTogether_.size == 1) { this.trackingMouse_ = false; - chrome.tts.isSpeaking(this.cancelIfSpeaking_.bind(this)); + this.cancelIfSpeaking_(); } this.keysCurrentlyDown_.delete(evt.keyCode); @@ -750,7 +750,7 @@ * Prepares for speech. Call once before chrome.tts.speak is called. */ prepareForSpeech_: function() { - chrome.tts.stop(); + this.cancelIfSpeaking_(); if (this.intervalRef_ !== undefined) { clearInterval(this.intervalRef_); } @@ -794,11 +794,22 @@ }, /** - * Cancels the current speech queue if speech is in progress. + * Cancels the current speech queue after doing a callback to + * record a cancel event if speech was in progress. We must cancel + * before the callback (rather than in it) to avoid race conditions + * where cancel is called twice. */ - cancelIfSpeaking_: function(speaking) { + cancelIfSpeaking_: function() { + chrome.tts.isSpeaking(this.recordCancelIfSpeaking_.bind(this)); + this.stopAll_(); + }, + + /** + * Records a cancel event if speech was in progress. + * @param {boolean} speaking Whether speech was in progress + */ + recordCancelIfSpeaking_: function(speaking) { if (speaking) { - this.stopAll_(); this.recordCancelEvent_(); } },
diff --git a/chrome/browser/resources/local_ntp/local_ntp.html b/chrome/browser/resources/local_ntp/local_ntp.html index e6d3467..d8ed2e62 100644 --- a/chrome/browser/resources/local_ntp/local_ntp.html +++ b/chrome/browser/resources/local_ntp/local_ntp.html
@@ -69,34 +69,36 @@ <div id="attribution"><div id="attribution-text"></div></div> </div> - <div id="voice-overlay" class="overlay-hidden" hidden> - <div id="voice-outer" class="outer"> - <div class="inner-container"> - <div id="voice-button-container" class="button-container"> - <!-- The audio level animation. --> - <span id="voice-level" class="level"></span> - <!-- The microphone button. --> - <span id="voice-button" class="button"> - <!-- The microphone icon (in CSS). --> - <div class="microphone"> - <span class="receiver"></span> - <div class="wrapper"> - <span class="stem"></span> - <span class="shell"></span> + <dialog id="voice-overlay-dialog" class="overlay-dialog"> + <div id="voice-overlay" class="overlay-hidden"> + <button id="voice-close-button" class="close-button">×</button> + <div id="voice-outer" class="outer"> + <div class="inner-container"> + <div id="voice-button-container" class="button-container"> + <!-- The audio level animation. --> + <span id="voice-level" class="level"></span> + <!-- The microphone button. --> + <span id="voice-button" class="button"> + <!-- The microphone icon (in CSS). --> + <div class="microphone"> + <span class="receiver"></span> + <div class="wrapper"> + <span class="stem"></span> + <span class="shell"></span> + </div> </div> - </div> - </span> - </div> - <div class="text-container"> - <!-- Low confidence text underneath high confidence text. --> - <span id="voice-text-i" class="voice-text"></span> - <!-- High confidence text on top of low confidence text. --> - <span id="voice-text-f" class="voice-text"></span> + </span> + </div> + <div class="text-container"> + <!-- Low confidence text underneath high confidence text. --> + <span id="voice-text-i" class="voice-text"></span> + <!-- High confidence text on top of low confidence text. --> + <span id="voice-text-f" class="voice-text"></span> + </div> </div> </div> </div> - <div id="voice-close-button" class="close-button">×</div> - </div> + </dialog> <div id="one-google-end-of-body"></div> </body>
diff --git a/chrome/browser/resources/local_ntp/voice.css b/chrome/browser/resources/local_ntp/voice.css index 891d91f..8a33a16 100644 --- a/chrome/browser/resources/local_ntp/voice.css +++ b/chrome/browser/resources/local_ntp/voice.css
@@ -37,6 +37,12 @@ --text_link_color: rgb(17, 85, 204); } +/* The dialog container for the background element. */ +.overlay-dialog { + background: transparent; + border: none; +} + /* The background element. */ .overlay, .overlay-hidden { @@ -48,8 +54,7 @@ position: fixed; text-align: left; top: 0; - transition: visibility 0s linear 218ms, opacity 218ms, - background-color 218ms; + transition: visibility 0s linear 218ms, background-color 218ms; visibility: hidden; width: 100%; z-index: 10000;
diff --git a/chrome/browser/resources/local_ntp/voice.js b/chrome/browser/resources/local_ntp/voice.js index 1ba0323..7d34f80a 100644 --- a/chrome/browser/resources/local_ntp/voice.js +++ b/chrome/browser/resources/local_ntp/voice.js
@@ -82,7 +82,8 @@ ESC: 'Escape', NUMPAD_ENTER: 'NumpadEnter', PERIOD: 'Period', - SPACE: 'Space' + SPACE: 'Space', + TAB: 'Tab' }; @@ -298,6 +299,13 @@ /** + * Indicates if the user is using keyboard navigation (i.e. tab). + * @private {boolean} + */ +speech.usingKeyboardNavigation_ = false; + + +/** * Log an event from Voice Search. * @param {!number} eventType Event from |LOG_TYPE|. */ @@ -445,6 +453,7 @@ speech.interimResult_ = ''; speech.finalResult_ = ''; speech.currentState_ = speech.State_.READY; + speech.usingKeyboardNavigation_ = false; }; @@ -674,10 +683,29 @@ /** + * Determines if the given event's target id is for a button or navigation link. + * @param {!string} An event's target id. + * @return True, iff the id is for a button or link. + * @private + */ +speech.isButtonOrLink_ = function(id) { + switch (id) { + case text.RETRY_LINK_ID: + case text.SUPPORT_LINK_ID: + case view.CLOSE_BUTTON_ID: + return true; + default: + return false; + } +}; + + +/** * Handles the following keyboard actions. * - <CTRL> + <SHIFT> + <.> starts voice input(<CMD> + <SHIFT> + <.> on mac). * - <ESC> aborts voice input when the recognition interface is active. - * - <ENTER> submits the speech query if there is one. + * - <ENTER> or <SPACE> interprets as a click if the target is a button or + * navigation link, otherwise it submits the speech query if there is one * @param {KeyboardEvent} event The keydown event. */ speech.onKeyDown = function(event) { @@ -692,10 +720,19 @@ } else { // Ensures that keyboard events are not propagated during voice input. event.stopPropagation(); - if (speech.isSpaceOrEnter_(event.code) && speech.finalResult_) { - speech.submitFinalResult_(); - } else if ( - speech.isSpaceOrEnter_(event.code) || event.code == KEYCODE.ESC) { + + if (event.code == KEYCODE.TAB) { + speech.usingKeyboardNavigation_ = true; + } else if (speech.isSpaceOrEnter_(event.code)) { + if (event.target != null && speech.isButtonOrLink_(event.target.id)) { + view.onWindowClick_(event); + } else if (speech.finalResult_) { + speech.submitFinalResult_(); + } else { + speech.logEvent(LOG_TYPE.ACTION_CLOSE_OVERLAY); + speech.stop(); + } + } else if (event.code == KEYCODE.ESC) { speech.logEvent(LOG_TYPE.ACTION_CLOSE_OVERLAY); speech.stop(); } @@ -746,10 +783,11 @@ /** - * Aborts the speech session if the UI is showing and omnibox gets focused. + * Aborts the speech session if the UI is showing and omnibox gets focused. Does + * not abort if the user is using keyboard navigation (i.e. tab). */ speech.onOmniboxFocused = function() { - if (!speech.isUiDefinitelyHidden_()) { + if (!speech.isUiDefinitelyHidden_() && !speech.usingKeyboardNavigation_) { speech.logEvent(LOG_TYPE.ACTION_CLOSE_OVERLAY); speech.stop(); } @@ -1174,6 +1212,7 @@ switch (error) { case RecognitionError.NO_MATCH: linkElement.id = text.RETRY_LINK_ID; + linkElement.tabIndex = '0'; linkElement.textContent = speech.messages.tryAgain; // When clicked, |view.onWindowClick_| gets called. return linkElement; @@ -1410,6 +1449,13 @@ /** + * ID for the close button in the speech output container. + * @const @private + */ +view.CLOSE_BUTTON_ID = 'voice-close-button'; + + +/** * Class name of the speech recognition interface on the homepage. * @const @private */ @@ -1425,6 +1471,13 @@ /** + * ID for the dialog that contains the speech recognition interface. + * @const @private + */ +view.DIALOG_ID_ = 'voice-overlay-dialog'; + + +/** * ID for the speech output background. * @const @private */ @@ -1578,6 +1631,7 @@ view.init = function(onClick) { view.onClick_ = onClick; + view.dialog_ = $(view.DIALOG_ID_); view.background_ = $(view.BACKGROUND_ID_); view.container_ = $(view.CONTAINER_ID_); @@ -1604,33 +1658,23 @@ */ view.showView_ = function() { if (!view.isVisible_) { - view.background_.hidden = false; - view.showFullPage_(); + view.dialog_.showModal(); + view.background_.className = view.OVERLAY_HIDDEN_CLASS_; + view.background_.className = view.OVERLAY_CLASS_; view.isVisible_ = true; } }; /** - * Displays the full page view, animating from the hidden state to the visible - * state. - * @private - */ -view.showFullPage_ = function() { - view.background_.className = view.OVERLAY_HIDDEN_CLASS_; - view.background_.className = view.OVERLAY_CLASS_; -}; - - -/** * Hides the view. * @private */ view.hideView_ = function() { + view.dialog_.close(); view.background_.className = view.OVERLAY_HIDDEN_CLASS_; view.container_.className = view.INACTIVE_CLASS_; view.background_.removeAttribute('style'); - view.background_.hidden = true; view.isVisible_ = false; }; @@ -1662,6 +1706,8 @@ retryLinkClicked || (micIconClicked && view.isNoMatchShown_); const navigatingAway = supportLinkClicked; + speech.usingKeyboardNavigation_ = false; + if (shouldRetry) { if (micIconClicked) { speech.logEvent(LOG_TYPE.ACTION_TRY_AGAIN_MIC_BUTTON);
diff --git a/chrome/browser/resources/md_extensions/toolbar.js b/chrome/browser/resources/md_extensions/toolbar.js index b5d3a5cf..a264b18 100644 --- a/chrome/browser/resources/md_extensions/toolbar.js +++ b/chrome/browser/resources/md_extensions/toolbar.js
@@ -59,6 +59,12 @@ * @private */ toastLabel_: String, + + /** + * Prevents initiating update while update is in progress. + * @private + */ + isUpdating_: {type: Boolean, value: false} }, behaviors: [I18nBehavior], @@ -136,9 +142,11 @@ /** @private */ onUpdateNowTap_: function() { - const updateButton = this.$.updateNow; - assert(!updateButton.disabled); - updateButton.disabled = true; + // If already updating, do not initiate another update. + if (this.isUpdating_) + return; + + this.isUpdating_ = true; const toastElement = this.$$('cr-toast'); this.toastLabel_ = this.i18n('toolbarUpdatingToast'); toastElement.show(); @@ -149,10 +157,10 @@ this.fire('iron-announce', {text: doneText}); this.toastLabel_ = doneText; toastElement.show(); - updateButton.disabled = false; + this.isUpdating_ = false; }) .catch(function() { - updateButton.disabled = false; + this.isUpdating_ = false; }); }, });
diff --git a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html index d5bde697..b2860c78 100644 --- a/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html +++ b/chrome/browser/resources/settings/internet_page/internet_known_networks_page.html
@@ -28,7 +28,7 @@ <template is="dom-repeat" items="[[networkStateList_]]" filter="networkIsPreferred_"> <div class="list-item"> - <div actionable class="flex layout horizontal" + <div actionable class="flex layout horizontal center" on-click="fireShowDetails_"> <div class="flex">[[item.Name]]</div> <template is="dom-if" if="[[isPolicySource(item.Source))]]"> @@ -58,7 +58,7 @@ <template is="dom-repeat" items="[[networkStateList_]]" filter="networkIsNotPreferred_"> <div class="list-item"> - <div actionable class="flex layout horizontal" + <div actionable class="flex layout horizontal center" on-click="fireShowDetails_"> <div class="flex">[[item.Name]]</div> <template is="dom-if" if="[[isPolicySource(item.Source))]]">
diff --git a/chrome/browser/resources/settings/people_page/compiled_resources2.gyp b/chrome/browser/resources/settings/people_page/compiled_resources2.gyp index 5c15ade..35f3f05 100644 --- a/chrome/browser/resources/settings/people_page/compiled_resources2.gyp +++ b/chrome/browser/resources/settings/people_page/compiled_resources2.gyp
@@ -151,6 +151,7 @@ 'dependencies': [ '../compiled_resources2.gyp:route', '../settings_page/compiled_resources2.gyp:settings_animated_pages', + '<(DEPTH)/ui/webui/resources/cr_elements/cr_toast/compiled_resources2.gyp:cr_toast', '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/cr_picture/compiled_resources2.gyp:cr_png_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
diff --git a/chrome/browser/resources/settings/people_page/manage_profile.js b/chrome/browser/resources/settings/people_page/manage_profile.js index ea0791b..7f38ab1 100644 --- a/chrome/browser/resources/settings/people_page/manage_profile.js +++ b/chrome/browser/resources/settings/people_page/manage_profile.js
@@ -36,7 +36,7 @@ /** * The available icons for selection. - * @type {!Array<string>} + * @type {!Array<!AvatarIcon>} */ availableIcons: { type: Array,
diff --git a/chrome/browser/resources/settings/people_page/people_page.html b/chrome/browser/resources/settings/people_page/people_page.html index d7b6822e..663d702 100644 --- a/chrome/browser/resources/settings/people_page/people_page.html +++ b/chrome/browser/resources/settings/people_page/people_page.html
@@ -33,6 +33,7 @@ <link rel="import" href="users_page.html"> </if> <if expr="not chromeos"> +<link rel="import" href="chrome://resources/cr_elements/cr_toast/cr_toast.html"> <link rel="import" href="sync_account_control.html"> <link rel="import" href="import_data_dialog.html"> <link rel="import" href="manage_profile.html"> @@ -97,6 +98,19 @@ /* Override the cr-dialog footer padding. */ padding: 16px 0; } + +<if expr="not chromeos"> + #toast { + color: white; + left: 0; + z-index: 1; + } + + :host-context([dir='rtl']) #toast { + left: auto; + right: 0; + } +</if> </style> <settings-animated-pages id="pages" section="people" focus-config="[[focusConfig_]]"> @@ -366,6 +380,11 @@ </settings-import-data-dialog> </template> +<if expr="not chromeos"> + <cr-toast duration="3000" id="toast"> + $i18n{syncSettingsSavedToast} + </cr-toast> +</if> </template> <script src="people_page.js"></script> </dom-module>
diff --git a/chrome/browser/resources/settings/people_page/people_page.js b/chrome/browser/resources/settings/people_page/people_page.js index d1be1d2c..88cf9b2 100644 --- a/chrome/browser/resources/settings/people_page/people_page.js +++ b/chrome/browser/resources/settings/people_page/people_page.js
@@ -158,6 +158,11 @@ this.handleSyncStatus_.bind(this)); this.addWebUIListener( 'sync-status-changed', this.handleSyncStatus_.bind(this)); + // <if expr="not chromeos"> + this.addWebUIListener('sync-settings-saved', () => { + /** @type {!CrToastElement} */ (this.$.toast).show(); + }); + // </if> }, /** @protected */
diff --git a/chrome/browser/resources/settings/settings_shared_css.html b/chrome/browser/resources/settings/settings_shared_css.html index 8baf075..2c89c7a 100644 --- a/chrome/browser/resources/settings/settings_shared_css.html +++ b/chrome/browser/resources/settings/settings_shared_css.html
@@ -90,8 +90,9 @@ -webkit-margin-start: 16px; } - /* Adjust the margin between the separator and the first button. */ - .separator + paper-button { + /* Adjust the margin between the separator and the first button. Exclude + * .action-button since it has a background thus is visually different. */ + .separator + paper-button:not(.action-button) { -webkit-margin-start: calc(var(--cr-button-edge-spacing) * -1); }
diff --git a/chrome/browser/resources/vr/assets/PRESUBMIT.py b/chrome/browser/resources/vr/assets/PRESUBMIT.py index c290f6d..055131e 100644 --- a/chrome/browser/resources/vr/assets/PRESUBMIT.py +++ b/chrome/browser/resources/vr/assets/PRESUBMIT.py
@@ -25,6 +25,7 @@ new_version = None changed_assets = False changed_version = False + changed_component_list = False changed_asset_files = {'google_chrome': [], 'chromium': []} for file in input_api.AffectedFiles(): basename = input_api.os_path.basename(file.LocalPath()) @@ -37,12 +38,14 @@ dirname = input_api.os_path.basename( input_api.os_path.dirname(file.LocalPath())) action = file.Action() - if (dirname in changed_asset_files and extension in {'sha1', 'png'} and - action in {'A', 'D'}): + if (dirname in changed_asset_files and + extension in {'sha1', 'png', 'wav'} and action in {'A', 'D'}): changed_asset_files[dirname].append((action, basename_without_extension)) if (extension == 'sha1' or basename == 'vr_assets_component_files.json'): changed_assets = True - if (basename == 'VERSION'): + if basename == 'vr_assets_component_files.json': + changed_component_list = True + if basename == 'VERSION': changed_version = True old_version = parse_version.ParseVersion(file.OldContents()) new_version = parse_version.ParseVersion(file.NewContents()) @@ -50,6 +53,9 @@ local_version_filename = input_api.os_path.join( input_api.os_path.dirname(input_api.AffectedFiles()[0].LocalPath()), 'VERSION') + local_component_list_filename = input_api.os_path.join( + input_api.os_path.dirname(input_api.AffectedFiles()[0].LocalPath()), + 'vr_assets_component_files.json') if changed_asset_files['google_chrome'] != changed_asset_files['chromium']: return [ @@ -60,6 +66,13 @@ input_api.AffectedFiles()[0].LocalPath()))) ] + if changed_asset_files['google_chrome'] and not changed_component_list: + return [ + output_api.PresubmitError( + 'Must update \'%s\' if adding/removing assets.' % + local_component_list_filename) + ] + if changed_version and (not old_version or not new_version): return [ output_api.PresubmitError(
diff --git a/chrome/browser/resources/vr/assets/VERSION b/chrome/browser/resources/vr/assets/VERSION index 75fb8d3..2631a86c 100644 --- a/chrome/browser/resources/vr/assets/VERSION +++ b/chrome/browser/resources/vr/assets/VERSION
@@ -1,2 +1,2 @@ -MAJOR=1 -MINOR=3 \ No newline at end of file +MAJOR=2 +MINOR=0 \ No newline at end of file
diff --git a/chrome/browser/resources/vr/assets/chromium/back_button_click.wav b/chrome/browser/resources/vr/assets/chromium/back_button_click.wav new file mode 100644 index 0000000..e0f4f20 --- /dev/null +++ b/chrome/browser/resources/vr/assets/chromium/back_button_click.wav Binary files differ
diff --git a/chrome/browser/resources/vr/assets/chromium/button_click.wav b/chrome/browser/resources/vr/assets/chromium/button_click.wav new file mode 100644 index 0000000..12661f5 --- /dev/null +++ b/chrome/browser/resources/vr/assets/chromium/button_click.wav Binary files differ
diff --git a/chrome/browser/resources/vr/assets/chromium/button_hover.wav b/chrome/browser/resources/vr/assets/chromium/button_hover.wav new file mode 100644 index 0000000..3176f4cb --- /dev/null +++ b/chrome/browser/resources/vr/assets/chromium/button_hover.wav Binary files differ
diff --git a/chrome/browser/resources/vr/assets/google_chrome/back_button_click.wav.sha1 b/chrome/browser/resources/vr/assets/google_chrome/back_button_click.wav.sha1 new file mode 100644 index 0000000..36c8543d --- /dev/null +++ b/chrome/browser/resources/vr/assets/google_chrome/back_button_click.wav.sha1
@@ -0,0 +1 @@ +386f2aa1ef2d9f7464f15e9d0ce3d9bacf2138fe \ No newline at end of file
diff --git a/chrome/browser/resources/vr/assets/google_chrome/button_click.wav.sha1 b/chrome/browser/resources/vr/assets/google_chrome/button_click.wav.sha1 new file mode 100644 index 0000000..2c4620d --- /dev/null +++ b/chrome/browser/resources/vr/assets/google_chrome/button_click.wav.sha1
@@ -0,0 +1 @@ +45bb0252f7d82e6297a149f33314e01a7f329f40 \ No newline at end of file
diff --git a/chrome/browser/resources/vr/assets/google_chrome/button_hover.wav.sha1 b/chrome/browser/resources/vr/assets/google_chrome/button_hover.wav.sha1 new file mode 100644 index 0000000..4e68360be --- /dev/null +++ b/chrome/browser/resources/vr/assets/google_chrome/button_hover.wav.sha1
@@ -0,0 +1 @@ +bba1d3c97ffc3962676af1c494f7776e63964cb7 \ No newline at end of file
diff --git a/chrome/browser/resources/vr/assets/vr_assets_component_files.json b/chrome/browser/resources/vr/assets/vr_assets_component_files.json index f58922a3..5daecb2 100644 --- a/chrome/browser/resources/vr/assets/vr_assets_component_files.json +++ b/chrome/browser/resources/vr/assets/vr_assets_component_files.json
@@ -2,5 +2,8 @@ "google_chrome/background.png", "google_chrome/fullscreen_gradient.png", "google_chrome/incognito_gradient.png", - "google_chrome/normal_gradient.png" + "google_chrome/normal_gradient.png", + "google_chrome/button_click.wav", + "google_chrome/button_hover.wav", + "google_chrome/back_button_click.wav" ] \ No newline at end of file
diff --git a/chrome/browser/resources/webapks/about_webapks.js b/chrome/browser/resources/webapks/about_webapks.js index 72f4b9b..bf235d7c 100644 --- a/chrome/browser/resources/webapks/about_webapks.js +++ b/chrome/browser/resources/webapks/about_webapks.js
@@ -17,6 +17,8 @@ * orientation: string, * themeColor: string, * backgroundColor: string, + * lastUpdateCheckTimeMs: number, + * relaxUpdates: boolean, * }} */ var WebApkInfo; @@ -92,6 +94,12 @@ addWebApkField(webApkList, 'Orientation: ', webApkInfo.orientation); addWebApkField(webApkList, 'Theme color: ', webApkInfo.themeColor); addWebApkField(webApkList, 'Background color: ', webApkInfo.backgroundColor); + addWebApkField( + webApkList, 'Last Update Check Time: ', + new Date(webApkInfo.lastUpdateCheckTimeMs).toString()); + addWebApkField( + webApkList, 'Check for Updates Less Frequently: ', + webApkInfo.relaxUpdates.toString()); } document.addEventListener('DOMContentLoaded', function() {
diff --git a/chrome/browser/safe_browsing/BUILD.gn b/chrome/browser/safe_browsing/BUILD.gn index f6384717..4ded375 100644 --- a/chrome/browser/safe_browsing/BUILD.gn +++ b/chrome/browser/safe_browsing/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//third_party/protobuf/proto_library.gni") proto_library("chunk_proto") {
diff --git a/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc b/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc index 33733c1..d27c140 100644 --- a/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc +++ b/chrome/browser/safe_browsing/incident_reporting/extension_data_collection.cc
@@ -17,9 +17,9 @@ #include "extensions/browser/extension_prefs_factory.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry_factory.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension_set.h" #include "extensions/common/manifest_constants.h" -#include "extensions/features/features.h" namespace safe_browsing {
diff --git a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc index 2f5af2d..66d0c89 100644 --- a/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc +++ b/chrome/browser/safe_browsing/incident_reporting/last_download_finder.cc
@@ -34,7 +34,7 @@ #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" #include "crypto/sha2.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" namespace safe_browsing {
diff --git a/chrome/browser/safe_browsing/safe_browsing_controller_client.cc b/chrome/browser/safe_browsing/safe_browsing_controller_client.cc index d8c79e9..33d978c 100644 --- a/chrome/browser/safe_browsing/safe_browsing_controller_client.cc +++ b/chrome/browser/safe_browsing/safe_browsing_controller_client.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/safe_browsing/safe_browsing_controller_client.h" #include "components/security_interstitials/core/metrics_helper.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/ui/browser.h"
diff --git a/chrome/browser/sessions/chrome_tab_restore_service_client.cc b/chrome/browser/sessions/chrome_tab_restore_service_client.cc index 1fa9c8c4..3a16e9f 100644 --- a/chrome/browser/sessions/chrome_tab_restore_service_client.cc +++ b/chrome/browser/sessions/chrome_tab_restore_service_client.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/sessions/session_service_factory.h" #include "chrome/common/url_constants.h" #include "components/sessions/content/content_live_tab.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/tab_helper.h"
diff --git a/chrome/browser/sessions/session_tab_helper.h b/chrome/browser/sessions/session_tab_helper.h index 3a9c55e..0345f97 100644 --- a/chrome/browser/sessions/session_tab_helper.h +++ b/chrome/browser/sessions/session_tab_helper.h
@@ -10,7 +10,7 @@ #include "components/sessions/core/session_id.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" // This class keeps the extension API's windowID up to date with the current // window of the tab and observes navigation events.
diff --git a/chrome/browser/site_details.cc b/chrome/browser/site_details.cc index 8ad341db..e4dafde 100644 --- a/chrome/browser/site_details.cc +++ b/chrome/browser/site_details.cc
@@ -8,7 +8,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/origin.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/spellchecker/spell_check_host_chrome_impl_mac.cc b/chrome/browser/spellchecker/spell_check_host_chrome_impl_mac.cc index b0e1c89e..3dbe697 100644 --- a/chrome/browser/spellchecker/spell_check_host_chrome_impl_mac.cc +++ b/chrome/browser/spellchecker/spell_check_host_chrome_impl_mac.cc
@@ -68,10 +68,11 @@ private: // Request server-side checking for |text_|. - void RequestRemoteCheck(SpellingServiceClient* client); + void RequestRemoteCheck(SpellingServiceClient* client, + const service_manager::Identity& renderer_identity); // Request a check for |text_| from local spell checker. - void RequestLocalCheck(); + void RequestLocalCheck(int document_tag); // Check if all pending requests are done, send reply to render process if so. void OnCheckCompleted(); @@ -96,11 +97,13 @@ base::RepeatingClosure completion_barrier_; bool remote_success_; + // The string to be spell-checked. base::string16 text_; - const service_manager::Identity renderer_identity_; - int document_tag_; + + // Callback to send the results to renderer. RequestTextCheckCallback callback_; + // Callback to delete |this|. Called on |this| after everything is done. DestructionCallback destruction_callback_; base::WeakPtrFactory<SpellingRequest> weak_factory_; @@ -115,8 +118,6 @@ DestructionCallback destruction_callback) : remote_success_(false), text_(text), - renderer_identity_(renderer_identity), - document_tag_(document_tag), callback_(std::move(callback)), destruction_callback_(std::move(destruction_callback)), weak_factory_(this) { @@ -126,14 +127,16 @@ completion_barrier_ = BarrierClosure(2, base::BindOnce(&SpellingRequest::OnCheckCompleted, weak_factory_.GetWeakPtr())); - RequestRemoteCheck(client); - RequestLocalCheck(); + RequestRemoteCheck(client, renderer_identity); + RequestLocalCheck(document_tag); } -void SpellingRequest::RequestRemoteCheck(SpellingServiceClient* client) { +void SpellingRequest::RequestRemoteCheck( + SpellingServiceClient* client, + const service_manager::Identity& renderer_identity) { BrowserContext* context = NULL; content::RenderProcessHost* host = - content::RenderProcessHost::FromRendererIdentity(renderer_identity_); + content::RenderProcessHost::FromRendererIdentity(renderer_identity); if (host) context = host->GetBrowserContext(); @@ -144,10 +147,10 @@ weak_factory_.GetWeakPtr())); } -void SpellingRequest::RequestLocalCheck() { +void SpellingRequest::RequestLocalCheck(int document_tag) { // |this| may be gone at callback invocation if the owner has been removed. spellcheck_platform::RequestTextCheck( - document_tag_, text_, + document_tag, text_, base::BindOnce(&SpellingRequest::OnLocalCheckCompletedOnAnyThread, weak_factory_.GetWeakPtr())); }
diff --git a/chrome/browser/ssl/ssl_blocking_page.h b/chrome/browser/ssl/ssl_blocking_page.h index 0426514..40ec9360 100644 --- a/chrome/browser/ssl/ssl_blocking_page.h +++ b/chrome/browser/ssl/ssl_blocking_page.h
@@ -18,7 +18,7 @@ #include "chrome/browser/ssl/ssl_cert_reporter.h" #include "components/security_interstitials/content/security_interstitial_page.h" #include "content/public/browser/certificate_request_result_type.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/ssl/ssl_info.h" #include "url/gurl.h"
diff --git a/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc b/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc index 73858cf..03b6ac84 100644 --- a/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc +++ b/chrome/browser/subresource_filter/subresource_filter_browser_test_harness.cc
@@ -15,6 +15,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/safe_browsing/test_safe_browsing_database_helper.h" #include "chrome/browser/subresource_filter/subresource_filter_profile_context.h" #include "chrome/browser/subresource_filter/subresource_filter_profile_context_factory.h" @@ -25,6 +26,7 @@ #include "components/safe_browsing/db/v4_protocol_manager_util.h" #include "components/safe_browsing/db/v4_test_util.h" #include "components/safe_browsing/features.h" +#include "components/subresource_filter/content/browser/content_ruleset_service.h" #include "components/subresource_filter/core/browser/subresource_filter_features.h" #include "content/public/browser/web_contents.h" #include "content/public/common/content_paths.h" @@ -58,6 +60,13 @@ } void SubresourceFilterBrowserTest::SetUpOnMainThread() { + // Note: even after startup, tasks posted to be run after startup are + // artificially delayed up to 10s. To avoid that delay in tests, just fake + // being after startup internally so there is no delay when writing and + // publishing rulesets. + g_browser_process->subresource_filter_ruleset_service() + ->SetIsAfterStartupForTesting(); + base::FilePath test_data_dir; ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir)); embedded_test_server()->ServeFilesFromDirectory(test_data_dir);
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc index 3b75e6a1..6ffcd1ba 100644 --- a/chrome/browser/supervised_user/supervised_user_service.cc +++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -54,7 +54,7 @@ #include "components/signin/core/browser/signin_manager_base.h" #include "components/signin/core/browser/signin_switches.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/supervised_user/supervised_user_service.h b/chrome/browser/supervised_user/supervised_user_service.h index 5af40f80..5ef54e5 100644 --- a/chrome/browser/supervised_user/supervised_user_service.h +++ b/chrome/browser/supervised_user/supervised_user_service.h
@@ -29,7 +29,7 @@ #include "components/prefs/pref_change_registrar.h" #include "components/sync/driver/sync_service_observer.h" #include "components/sync/driver/sync_type_preference_provider.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/url_request/url_request_context_getter.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/supervised_user/supervised_user_service_factory.cc b/chrome/browser/supervised_user/supervised_user_service_factory.cc index 09ceffd..f094bde 100644 --- a/chrome/browser/supervised_user/supervised_user_service_factory.cc +++ b/chrome/browser/supervised_user/supervised_user_service_factory.cc
@@ -10,7 +10,7 @@ #include "chrome/browser/supervised_user/supervised_user_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_system_provider.h"
diff --git a/chrome/browser/supervised_user/supervised_user_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_service_unittest.cc index 8128484..a2eaa5b 100644 --- a/chrome/browser/supervised_user/supervised_user_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_service_unittest.cc
@@ -40,7 +40,7 @@ #include "components/version_info/version_info.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/supervised_user/supervised_user_url_filter.cc b/chrome/browser/supervised_user/supervised_user_url_filter.cc index a3a81d7..79234437 100644 --- a/chrome/browser/supervised_user/supervised_user_url_filter.cc +++ b/chrome/browser/supervised_user/supervised_user_url_filter.cc
@@ -29,7 +29,7 @@ #include "components/url_formatter/url_fixer.h" #include "components/url_matcher/url_matcher.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/escape.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/base/url_util.h"
diff --git a/chrome/browser/supervised_user/supervised_user_url_filter_unittest.cc b/chrome/browser/supervised_user/supervised_user_url_filter_unittest.cc index 9da08e7..b7c14a2 100644 --- a/chrome/browser/supervised_user/supervised_user_url_filter_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_url_filter_unittest.cc
@@ -13,7 +13,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_task_environment.h" #include "chrome/browser/supervised_user/supervised_user_site_list.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/chrome/browser/sync/chrome_sync_client.cc b/chrome/browser/sync/chrome_sync_client.cc index 40bdebf..2055826cd 100644 --- a/chrome/browser/sync/chrome_sync_client.cc +++ b/chrome/browser/sync/chrome_sync_client.cc
@@ -72,7 +72,7 @@ #include "components/sync_sessions/sync_sessions_client.h" #include "content/public/browser/browser_thread.h" #include "extensions/browser/api/storage/backend_task_runner.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/device_form_factor.h" #if BUILDFLAG(ENABLE_APP_LIST)
diff --git a/chrome/browser/sync/glue/extensions_activity_monitor.h b/chrome/browser/sync/glue/extensions_activity_monitor.h index d7f8370..e72128ea8 100644 --- a/chrome/browser/sync/glue/extensions_activity_monitor.h +++ b/chrome/browser/sync/glue/extensions_activity_monitor.h
@@ -9,7 +9,7 @@ #include "base/memory/ref_counted.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" namespace syncer { class ExtensionsActivity;
diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc index 39e866d..e128f3bf 100644 --- a/chrome/browser/sync/profile_sync_service_factory.cc +++ b/chrome/browser/sync/profile_sync_service_factory.cc
@@ -46,7 +46,7 @@ #include "components/sync/driver/startup_controller.h" #include "components/sync/driver/sync_util.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc b/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc index b6c22d7a..2c486475 100644 --- a/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_user_events_sync_test.cc
@@ -254,7 +254,13 @@ event_service->RecordUserEvent(testEvent1); event_service->RecordUserEvent(consent1); + + // Wait until the first two events are committed before disabling sync, + // because disabled TYPED_URLS also disables user event sync, dropping all + // uncommitted consents. + EXPECT_TRUE(ExpectUserEvents({testEvent1, consent1})); ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::TYPED_URLS)); + event_service->RecordUserEvent(testEvent2); event_service->RecordUserEvent(consent2); ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::TYPED_URLS));
diff --git a/chrome/browser/tab_contents/tab_util.cc b/chrome/browser/tab_contents/tab_util.cc index 34156ff..598f657 100644 --- a/chrome/browser/tab_contents/tab_util.cc +++ b/chrome/browser/tab_contents/tab_util.cc
@@ -11,7 +11,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/site_instance.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/task_manager/providers/render_process_host_task_provider.cc b/chrome/browser/task_manager/providers/render_process_host_task_provider.cc index 42e89490..9d181c2 100644 --- a/chrome/browser/task_manager/providers/render_process_host_task_provider.cc +++ b/chrome/browser/task_manager/providers/render_process_host_task_provider.cc
@@ -13,7 +13,7 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/render_process_host.h" #include "content/public/common/process_type.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" using content::RenderProcessHost; using content::BrowserThread;
diff --git a/chrome/browser/task_manager/providers/web_contents/extension_tag.cc b/chrome/browser/task_manager/providers/web_contents/extension_tag.cc index b4ce5ed..ce1db081 100644 --- a/chrome/browser/task_manager/providers/web_contents/extension_tag.cc +++ b/chrome/browser/task_manager/providers/web_contents/extension_tag.cc
@@ -5,7 +5,7 @@ #include "chrome/browser/task_manager/providers/web_contents/extension_tag.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/process_manager.h"
diff --git a/chrome/browser/task_manager/sampling/task_group_sampler.cc b/chrome/browser/task_manager/sampling/task_group_sampler.cc index e19cad3..d1769be 100644 --- a/chrome/browser/task_manager/sampling/task_group_sampler.cc +++ b/chrome/browser/task_manager/sampling/task_group_sampler.cc
@@ -14,6 +14,12 @@ #include "content/public/browser/browser_child_process_host.h" #include "content/public/browser/browser_thread.h" +#if defined(OS_WIN) +#include <windows.h> + +#include <psapi.h> +#endif + namespace task_manager { namespace { @@ -145,13 +151,18 @@ // On Linux private memory is also resident. Just use it. memory_usage.physical_bytes = memory_usage.private_bytes; #else + PROCESS_MEMORY_COUNTERS pmc; + if (::GetProcessMemoryInfo(process_.Handle(), &pmc, sizeof(pmc))) { + memory_usage.physical_bytes = static_cast<int64_t>(pmc.WorkingSetSize); + } else { + memory_usage.physical_bytes = 0; + } + // Memory = working_set.private which is working set minus shareable. This // avoids the unpredictable counting that occurs when calculating memory as // working set minus shared (renderer code counted when one tab is open and // not counted when two or more are open) and it is much more efficient to // calculate on Windows. - memory_usage.physical_bytes = - static_cast<int64_t>(process_metrics_->GetWorkingSetSize()); memory_usage.physical_bytes -= static_cast<int64_t>(ws_usage.shareable * 1024); #endif // defined(OS_LINUX)
diff --git a/chrome/browser/task_manager/web_contents_tags.cc b/chrome/browser/task_manager/web_contents_tags.cc index c0f0cff5..d5f3215 100644 --- a/chrome/browser/task_manager/web_contents_tags.cc +++ b/chrome/browser/task_manager/web_contents_tags.cc
@@ -9,7 +9,7 @@ #include "build/build_config.h" #include "content/public/browser/web_contents.h" #include "extensions/browser/view_type_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "printing/features/features.h" #if !defined(OS_ANDROID)
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc index 190ef71..56b1659 100644 --- a/chrome/browser/themes/theme_service.cc +++ b/chrome/browser/themes/theme_service.cc
@@ -43,9 +43,9 @@ #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/uninstall_reason.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension.h" #include "extensions/common/extension_set.h" -#include "extensions/features/features.h" #include "ui/base/layout.h" #include "ui/base/material_design/material_design_controller.h" #include "ui/base/resource/resource_bundle.h"
diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h index 116675e..86ceda0 100644 --- a/chrome/browser/themes/theme_service.h +++ b/chrome/browser/themes/theme_service.h
@@ -22,8 +22,8 @@ #include "components/keyed_service/core/keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension_id.h" -#include "extensions/features/features.h" #include "ui/base/theme_provider.h" class BrowserThemePack;
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index a04d171..55bb0ab 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -11,7 +11,7 @@ import("//components/nacl/features.gni") import("//components/offline_pages/buildflags/features.gni") import("//components/signin/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//ppapi/features/features.gni") import("//printing/features/features.gni") @@ -1051,7 +1051,7 @@ "//crypto", "//device/base", "//device/usb", - "//extensions/features", + "//extensions/buildflags", "//media", "//net:net", "//ppapi/features", @@ -1256,7 +1256,7 @@ "//device/usb/mojo", "//device/usb/public/cpp", "//device/usb/public/mojom", - "//device/vr/features", + "//device/vr/buildflags", "//ui/android", ] } else { @@ -1989,6 +1989,8 @@ "webui/chromeos/login/controller_pairing_screen_handler.h", "webui/chromeos/login/core_oobe_handler.cc", "webui/chromeos/login/core_oobe_handler.h", + "webui/chromeos/login/demo_setup_screen_handler.cc", + "webui/chromeos/login/demo_setup_screen_handler.h", "webui/chromeos/login/device_disabled_screen_handler.cc", "webui/chromeos/login/device_disabled_screen_handler.h", "webui/chromeos/login/enable_debugging_screen_handler.cc", @@ -2995,8 +2997,8 @@ sources += [ "views/sync/dice_bubble_sync_promo_view.cc", "views/sync/dice_bubble_sync_promo_view.h", - "views/sync/dice_signin_button.cc", - "views/sync/dice_signin_button.h", + "views/sync/dice_signin_button_view.cc", + "views/sync/dice_signin_button_view.h", ] } @@ -3271,7 +3273,6 @@ "views/profiles/forced_reauthentication_dialog_view.h", "views/profiles/signin_view_controller_delegate_views.cc", "views/profiles/signin_view_controller_delegate_views.h", - "views/screen_capture_notification_ui_views.cc", "views/sync/one_click_signin_dialog_view.cc", "views/sync/one_click_signin_dialog_view.h", "views/touch_uma/touch_uma.cc", @@ -3344,6 +3345,7 @@ "views/relaunch_notification/relaunch_recommended_bubble_view.h", "views/relaunch_notification/relaunch_required_dialog_view.cc", "views/relaunch_notification/relaunch_required_dialog_view.h", + "views/screen_capture_notification_ui_views.cc", ] if (is_mac) { sources += [ @@ -3496,10 +3498,20 @@ "app_list/search/common/webservice_cache_factory.h", "app_list/search/common/webservice_search_provider.cc", "app_list/search/common/webservice_search_provider.h", + "app_list/search/dictionary_data_store.cc", + "app_list/search/dictionary_data_store.h", "app_list/search/extension_app_result.cc", "app_list/search/extension_app_result.h", + "app_list/search/history.cc", + "app_list/search/history.h", + "app_list/search/history_data.cc", + "app_list/search/history_data.h", + "app_list/search/history_data_observer.h", + "app_list/search/history_data_store.cc", + "app_list/search/history_data_store.h", "app_list/search/history_factory.cc", "app_list/search/history_factory.h", + "app_list/search/history_types.h", "app_list/search/mixer.cc", "app_list/search/mixer.h", "app_list/search/omnibox_provider.cc", @@ -3510,6 +3522,8 @@ "app_list/search/search_controller.h", "app_list/search/search_controller_factory.cc", "app_list/search/search_controller_factory.h", + "app_list/search/search_provider.cc", + "app_list/search/search_provider.h", "app_list/search/search_resource_manager.cc", "app_list/search/search_resource_manager.h", "app_list/search/search_util.cc", @@ -3885,21 +3899,26 @@ "extensions/browser_action_test_util.h", "views/payments/test_chrome_payment_request_delegate.cc", "views/payments/test_chrome_payment_request_delegate.h", + "views/toolbar/browser_action_test_util_views_mac.mm", ] if (!is_mac || mac_views_browser) { sources += [ "views/find_bar_host_unittest_util_views.cc", "views/toolbar/browser_action_test_util_views.cc", ] - if (!is_mac) { - deps += [ "//ui/aura" ] - } } else { sources += [ "cocoa/extensions/browser_action_test_util_views_cocoa.mm", "cocoa/find_bar/find_bar_host_unittest_util_cocoa.mm", ] } + if (use_aura) { + sources += [ "views/toolbar/browser_action_test_util_views_aura.cc" ] + deps += [ + "//ui/aura", + "//ui/wm", + ] + } } if (!is_android) {
diff --git a/chrome/browser/ui/android/usb_chooser_dialog_android.cc b/chrome/browser/ui/android/usb_chooser_dialog_android.cc index 31d2242..8c4f37f 100644 --- a/chrome/browser/ui/android/usb_chooser_dialog_android.cc +++ b/chrome/browser/ui/android/usb_chooser_dialog_android.cc
@@ -31,7 +31,7 @@ #include "device/usb/public/cpp/filter_utils.h" #include "device/usb/usb_device.h" #include "device/usb/webusb_descriptors.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #include "jni/UsbChooserDialog_jni.h" #include "ui/android/window_android.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h index efd325c..247f525 100644 --- a/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h +++ b/chrome/browser/ui/app_list/search/answer_card/answer_card_search_provider.h
@@ -10,7 +10,7 @@ #include "base/time/time.h" #include "chrome/browser/ui/app_list/search/answer_card/answer_card_contents.h" -#include "ui/app_list/search_provider.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" #include "url/gurl.h" class AppListControllerDelegate;
diff --git a/chrome/browser/ui/app_list/search/app_search_provider.h b/chrome/browser/ui/app_list/search/app_search_provider.h index 367e6e0..852be58 100644 --- a/chrome/browser/ui/app_list/search/app_search_provider.h +++ b/chrome/browser/ui/app_list/search/app_search_provider.h
@@ -13,7 +13,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/scoped_observer.h" -#include "ui/app_list/search_provider.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" class AppListControllerDelegate; class AppListModelUpdater;
diff --git a/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.h b/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.h index 1eade87..0b48e33 100644 --- a/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.h +++ b/chrome/browser/ui/app_list/search/arc/arc_playstore_search_provider.h
@@ -8,8 +8,8 @@ #include <memory> #include <vector> +#include "chrome/browser/ui/app_list/search/search_provider.h" #include "components/arc/common/app.mojom.h" -#include "ui/app_list/search_provider.h" class Profile; class AppListControllerDelegate;
diff --git a/chrome/browser/ui/app_list/search/common/webservice_cache.h b/chrome/browser/ui/app_list/search/common/webservice_cache.h index 425c38a4..c5b1903c 100644 --- a/chrome/browser/ui/app_list/search/common/webservice_cache.h +++ b/chrome/browser/ui/app_list/search/common/webservice_cache.h
@@ -6,14 +6,15 @@ #define CHROME_BROWSER_UI_APP_LIST_SEARCH_COMMON_WEBSERVICE_CACHE_H_ #include <memory> +#include <string> #include <utility> #include "base/containers/mru_cache.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" +#include "chrome/browser/ui/app_list/search/dictionary_data_store.h" #include "components/keyed_service/core/keyed_service.h" -#include "ui/app_list/search/dictionary_data_store.h" namespace base { class DictionaryValue;
diff --git a/chrome/browser/ui/app_list/search/common/webservice_search_provider.h b/chrome/browser/ui/app_list/search/common/webservice_search_provider.h index 093e8c2..b489953 100644 --- a/chrome/browser/ui/app_list/search/common/webservice_search_provider.h +++ b/chrome/browser/ui/app_list/search/common/webservice_search_provider.h
@@ -11,7 +11,7 @@ #include "base/time/time.h" #include "base/timer/timer.h" #include "chrome/browser/ui/app_list/search/common/webservice_cache.h" -#include "ui/app_list/search_provider.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" class Profile;
diff --git a/ui/app_list/search/dictionary_data_store.cc b/chrome/browser/ui/app_list/search/dictionary_data_store.cc similarity index 97% rename from ui/app_list/search/dictionary_data_store.cc rename to chrome/browser/ui/app_list/search/dictionary_data_store.cc index 423181a03..2f50345 100644 --- a/ui/app_list/search/dictionary_data_store.cc +++ b/chrome/browser/ui/app_list/search/dictionary_data_store.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/app_list/search/dictionary_data_store.h" +#include "chrome/browser/ui/app_list/search/dictionary_data_store.h" #include <set> #include <utility>
diff --git a/ui/app_list/search/dictionary_data_store.h b/chrome/browser/ui/app_list/search/dictionary_data_store.h similarity index 89% rename from ui/app_list/search/dictionary_data_store.h rename to chrome/browser/ui/app_list/search/dictionary_data_store.h index fdce0068..b2ef8dc 100644 --- a/ui/app_list/search/dictionary_data_store.h +++ b/chrome/browser/ui/app_list/search/dictionary_data_store.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ -#define UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ #include <memory> #include <string> @@ -14,19 +14,18 @@ #include "base/files/important_file_writer.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "ui/app_list/app_list_export.h" namespace base { class DictionaryValue; class SequencedTaskRunner; -} +} // namespace base namespace app_list { // A simple JSON store to persist a dictionary. There must only be one // DictionaryDataStore instance per data file at a time (writes issued by // DictionaryDataStore instances bound to the same file would be racy). -class APP_LIST_EXPORT DictionaryDataStore +class DictionaryDataStore : public base::RefCountedThreadSafe<DictionaryDataStore>, public base::ImportantFileWriter::DataSerializer { public: @@ -74,4 +73,4 @@ } // namespace app_list -#endif // UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_ +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_DICTIONARY_DATA_STORE_H_
diff --git a/ui/app_list/search/history.cc b/chrome/browser/ui/app_list/search/history.cc similarity index 89% rename from ui/app_list/search/history.cc rename to chrome/browser/ui/app_list/search/history.cc index aea1837..21e9fcc 100644 --- a/ui/app_list/search/history.cc +++ b/chrome/browser/ui/app_list/search/history.cc
@@ -2,15 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/app_list/search/history.h" +#include "chrome/browser/ui/app_list/search/history.h" #include <stddef.h> #include "ash/public/cpp/app_list/tokenized_string.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "ui/app_list/search/history_data.h" -#include "ui/app_list/search/history_data_store.h" +#include "chrome/browser/ui/app_list/search/history_data.h" +#include "chrome/browser/ui/app_list/search/history_data_store.h" namespace app_list {
diff --git a/ui/app_list/search/history.h b/chrome/browser/ui/app_list/search/history.h similarity index 81% rename from ui/app_list/search/history.h rename to chrome/browser/ui/app_list/search/history.h index 5eb9751..d37ba25 100644 --- a/ui/app_list/search/history.h +++ b/chrome/browser/ui/app_list/search/history.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_APP_LIST_SEARCH_HISTORY_H_ -#define UI_APP_LIST_SEARCH_HISTORY_H_ +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_H_ +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_H_ #include <map> #include <memory> @@ -11,10 +11,9 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "chrome/browser/ui/app_list/search/history_data_observer.h" +#include "chrome/browser/ui/app_list/search/history_types.h" #include "components/keyed_service/core/keyed_service.h" -#include "ui/app_list/app_list_export.h" -#include "ui/app_list/search/history_data_observer.h" -#include "ui/app_list/search/history_types.h" namespace app_list { @@ -31,8 +30,7 @@ // primary and secondary associations. See HistoryData comments to see how // they are built. The learning data is sent to the mixer to boost results that // have been launched before. -class APP_LIST_EXPORT History : public KeyedService, - public HistoryDataObserver { +class History : public KeyedService, public HistoryDataObserver { public: explicit History(scoped_refptr<HistoryDataStore> store); ~History() override; @@ -62,4 +60,4 @@ } // namespace app_list -#endif // UI_APP_LIST_SEARCH_HISTORY_H_ +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_H_
diff --git a/ui/app_list/search/history_data.cc b/chrome/browser/ui/app_list/search/history_data.cc similarity index 88% rename from ui/app_list/search/history_data.cc rename to chrome/browser/ui/app_list/search/history_data.cc index 777990b..310acf2 100644 --- a/ui/app_list/search/history_data.cc +++ b/chrome/browser/ui/app_list/search/history_data.cc
@@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/app_list/search/history_data.h" +#include "chrome/browser/ui/app_list/search/history_data.h" #include <algorithm> #include <vector> #include "base/bind.h" -#include "ui/app_list/search/history_data_observer.h" -#include "ui/app_list/search/history_data_store.h" +#include "chrome/browser/ui/app_list/search/history_data_observer.h" +#include "chrome/browser/ui/app_list/search/history_data_store.h" namespace app_list { @@ -32,11 +32,9 @@ } // namespace -HistoryData::Data::Data() { -} +HistoryData::Data::Data() {} HistoryData::Data::Data(const Data& other) = default; -HistoryData::Data::~Data() { -} +HistoryData::Data::~Data() {} HistoryData::HistoryData(HistoryDataStore* store, size_t max_primary, @@ -45,8 +43,7 @@ store_->Load(base::Bind(&HistoryData::OnStoreLoaded, AsWeakPtr())); } -HistoryData::~HistoryData() { -} +HistoryData::~HistoryData() {} void HistoryData::Add(const std::string& query, const std::string& result_id) { Associations::iterator assoc_it = associations_.find(query); @@ -101,8 +98,7 @@ const std::string& query) const { std::unique_ptr<KnownResults> results(new KnownResults); for (Associations::const_iterator assoc_it = associations_.lower_bound(query); - assoc_it != associations_.end(); - ++assoc_it) { + assoc_it != associations_.end(); ++assoc_it) { // Break out of the loop if |query| is no longer a prefix. if (assoc_it->first.size() < query.size() || strncmp(assoc_it->first.c_str(), query.c_str(), query.length()) != 0) { @@ -119,8 +115,7 @@ const HistoryData::SecondaryDeque& secondary = assoc_it->second.secondary; for (HistoryData::SecondaryDeque::const_iterator secondary_it = secondary.begin(); - secondary_it != secondary.end(); - ++secondary_it) { + secondary_it != secondary.end(); ++secondary_it) { const std::string& secondary_result_id = (*secondary_it); // Secondary match only gets added if there there is no primary match. @@ -155,16 +150,13 @@ std::vector<EntrySortData> entries; for (Associations::const_iterator it = associations_.begin(); - it != associations_.end(); - ++it) { + it != associations_.end(); ++it) { entries.push_back(EntrySortData(&it->first, &it->second.update_time)); } const size_t entries_to_remove = associations_.size() - max_primary_; - std::partial_sort(entries.begin(), - entries.begin() + entries_to_remove, - entries.end(), - &EntrySortByTimeAscending); + std::partial_sort(entries.begin(), entries.begin() + entries_to_remove, + entries.end(), &EntrySortByTimeAscending); for (size_t i = 0; i < entries_to_remove; ++i) { const std::string& query = *entries[i].query;
diff --git a/ui/app_list/search/history_data.h b/chrome/browser/ui/app_list/search/history_data.h similarity index 89% rename from ui/app_list/search/history_data.h rename to chrome/browser/ui/app_list/search/history_data.h index 6957d4e..11fef77 100644 --- a/ui/app_list/search/history_data.h +++ b/chrome/browser/ui/app_list/search/history_data.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_H_ -#define UI_APP_LIST_SEARCH_HISTORY_DATA_H_ +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_H_ +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_H_ #include <stddef.h> @@ -16,8 +16,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/time/time.h" -#include "ui/app_list/app_list_export.h" -#include "ui/app_list/search/history_types.h" +#include "chrome/browser/ui/app_list/search/history_types.h" namespace app_list { @@ -33,12 +32,12 @@ // secondary. However, if a secondary association is added twice in a row, it // is promoted to primary and the current primary mapping is demoted into // secondary. -class APP_LIST_EXPORT HistoryData : public base::SupportsWeakPtr<HistoryData> { +class HistoryData : public base::SupportsWeakPtr<HistoryData> { public: using SecondaryDeque = base::circular_deque<std::string>; // Defines data to be associated with a query. - struct APP_LIST_EXPORT Data { + struct Data { Data(); Data(const Data& other); ~Data(); @@ -94,4 +93,4 @@ } // namespace app_list -#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_H_ +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_H_
diff --git a/ui/app_list/search/history_data_observer.h b/chrome/browser/ui/app_list/search/history_data_observer.h similarity index 61% rename from ui/app_list/search/history_data_observer.h rename to chrome/browser/ui/app_list/search/history_data_observer.h index cf77cd6fd..32f871d2 100644 --- a/ui/app_list/search/history_data_observer.h +++ b/chrome/browser/ui/app_list/search/history_data_observer.h
@@ -2,14 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ -#define UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ - -#include "ui/app_list/app_list_export.h" +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ namespace app_list { -class APP_LIST_EXPORT HistoryDataObserver { +class HistoryDataObserver { public: // Invoked when the data is loaded from underlying store. virtual void OnHistoryDataLoadedFromStore() = 0; @@ -20,4 +18,4 @@ } // namespace app_list -#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_ +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_OBSERVER_H_
diff --git a/ui/app_list/search/history_data_store.cc b/chrome/browser/ui/app_list/search/history_data_store.cc similarity index 96% rename from ui/app_list/search/history_data_store.cc rename to chrome/browser/ui/app_list/search/history_data_store.cc index 81e40de..d8ce58433 100644 --- a/ui/app_list/search/history_data_store.cc +++ b/chrome/browser/ui/app_list/search/history_data_store.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/app_list/search/history_data_store.h" +#include "chrome/browser/ui/app_list/search/history_data_store.h" #include <stddef.h> #include <stdint.h> @@ -123,8 +123,7 @@ Init(data_store_->cached_dict()); } -HistoryDataStore::~HistoryDataStore() { -} +HistoryDataStore::~HistoryDataStore() {} void HistoryDataStore::Init(base::DictionaryValue* cached_dict) { DCHECK(cached_dict); @@ -143,8 +142,8 @@ void HistoryDataStore::Load( const HistoryDataStore::OnLoadedCallback& on_loaded) { if (data_store_.get()) { - data_store_->Load(base::Bind( - &HistoryDataStore::OnDictionaryLoadedCallback, this, on_loaded)); + data_store_->Load(base::Bind(&HistoryDataStore::OnDictionaryLoadedCallback, + this, on_loaded)); } else { OnDictionaryLoadedCallback(on_loaded, cached_dict_->CreateDeepCopy()); }
diff --git a/ui/app_list/search/history_data_store.h b/chrome/browser/ui/app_list/search/history_data_store.h similarity index 85% rename from ui/app_list/search/history_data_store.h rename to chrome/browser/ui/app_list/search/history_data_store.h index 05c5175..dd98bb1f 100644 --- a/ui/app_list/search/history_data_store.h +++ b/chrome/browser/ui/app_list/search/history_data_store.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ -#define UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ #include <memory> #include <string> @@ -12,9 +12,8 @@ #include "base/callback_forward.h" #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "ui/app_list/app_list_export.h" -#include "ui/app_list/search/dictionary_data_store.h" -#include "ui/app_list/search/history_data.h" +#include "chrome/browser/ui/app_list/search/dictionary_data_store.h" +#include "chrome/browser/ui/app_list/search/history_data.h" namespace base { class Value; @@ -27,8 +26,7 @@ } // A simple json store to persist HistoryData. -class APP_LIST_EXPORT HistoryDataStore - : public base::RefCountedThreadSafe<HistoryDataStore> { +class HistoryDataStore : public base::RefCountedThreadSafe<HistoryDataStore> { public: typedef base::Callback<void(std::unique_ptr<HistoryData::Associations>)> OnLoadedCallback; @@ -83,4 +81,4 @@ } // namespace app_list -#endif // UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_ +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_DATA_STORE_H_
diff --git a/chrome/browser/ui/app_list/search/history_factory.cc b/chrome/browser/ui/app_list/search/history_factory.cc index 1dc32ab..d4a1abc 100644 --- a/chrome/browser/ui/app_list/search/history_factory.cc +++ b/chrome/browser/ui/app_list/search/history_factory.cc
@@ -6,11 +6,11 @@ #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" +#include "chrome/browser/ui/app_list/search/dictionary_data_store.h" +#include "chrome/browser/ui/app_list/search/history.h" +#include "chrome/browser/ui/app_list/search/history_data_store.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "content/public/browser/browser_context.h" -#include "ui/app_list/search/dictionary_data_store.h" -#include "ui/app_list/search/history.h" -#include "ui/app_list/search/history_data_store.h" namespace app_list {
diff --git a/ui/app_list/search/history_types.h b/chrome/browser/ui/app_list/search/history_types.h similarity index 81% rename from ui/app_list/search/history_types.h rename to chrome/browser/ui/app_list/search/history_types.h index dae8e19..aff81a2 100644 --- a/ui/app_list/search/history_types.h +++ b/chrome/browser/ui/app_list/search/history_types.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ -#define UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ #include <map> #include <string> @@ -24,4 +24,4 @@ } // namespace app_list -#endif // UI_APP_LIST_SEARCH_HISTORY_TYPES_H_ +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_HISTORY_TYPES_H_
diff --git a/chrome/browser/ui/app_list/search/launcher_search/launcher_search_provider.h b/chrome/browser/ui/app_list/search/launcher_search/launcher_search_provider.h index 098ccd6..3508407 100644 --- a/chrome/browser/ui/app_list/search/launcher_search/launcher_search_provider.h +++ b/chrome/browser/ui/app_list/search/launcher_search/launcher_search_provider.h
@@ -15,8 +15,8 @@ #include "base/timer/timer.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/search/launcher_search/launcher_search_result.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" #include "extensions/common/extension_id.h" -#include "ui/app_list/search_provider.h" namespace app_list {
diff --git a/chrome/browser/ui/app_list/search/mixer.cc b/chrome/browser/ui/app_list/search/mixer.cc index 29f7ff6..dbe84ca 100644 --- a/chrome/browser/ui/app_list/search/mixer.cc +++ b/chrome/browser/ui/app_list/search/mixer.cc
@@ -15,8 +15,8 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "chrome/browser/ui/app_list/app_list_model_updater.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" #include "ui/app_list/app_list_features.h" -#include "ui/app_list/search_provider.h" namespace app_list {
diff --git a/chrome/browser/ui/app_list/search/mixer.h b/chrome/browser/ui/app_list/search/mixer.h index 0ba2aa5..c3cc3ea 100644 --- a/chrome/browser/ui/app_list/search/mixer.h +++ b/chrome/browser/ui/app_list/search/mixer.h
@@ -12,7 +12,7 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" -#include "ui/app_list/search/history_types.h" +#include "chrome/browser/ui/app_list/search/history_types.h" class AppListModelUpdater;
diff --git a/chrome/browser/ui/app_list/search/omnibox_provider.h b/chrome/browser/ui/app_list/search/omnibox_provider.h index 1ef6f34..4930f59 100644 --- a/chrome/browser/ui/app_list/search/omnibox_provider.h +++ b/chrome/browser/ui/app_list/search/omnibox_provider.h
@@ -8,8 +8,8 @@ #include <memory> #include "base/macros.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" #include "components/omnibox/browser/autocomplete_controller_delegate.h" -#include "ui/app_list/search_provider.h" class AppListControllerDelegate; class AutocompleteController;
diff --git a/chrome/browser/ui/app_list/search/search_controller.cc b/chrome/browser/ui/app_list/search/search_controller.cc index 329bdb6..dd377fd 100644 --- a/chrome/browser/ui/app_list/search/search_controller.cc +++ b/chrome/browser/ui/app_list/search/search_controller.cc
@@ -16,9 +16,9 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/app_list/app_list_model_updater.h" +#include "chrome/browser/ui/app_list/search/history.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" #include "ui/app_list/app_list_constants.h" -#include "ui/app_list/search/history.h" -#include "ui/app_list/search_provider.h" namespace app_list {
diff --git a/ui/app_list/search_provider.cc b/chrome/browser/ui/app_list/search/search_provider.cc similarity index 84% rename from ui/app_list/search_provider.cc rename to chrome/browser/ui/app_list/search/search_provider.cc index 42bf6f81..1180e82 100644 --- a/ui/app_list/search_provider.cc +++ b/chrome/browser/ui/app_list/search/search_provider.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/app_list/search_provider.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" #include <utility> @@ -10,10 +10,8 @@ namespace app_list { -SearchProvider::SearchProvider() { -} -SearchProvider::~SearchProvider() { -} +SearchProvider::SearchProvider() {} +SearchProvider::~SearchProvider() {} void SearchProvider::Add(std::unique_ptr<SearchResult> result) { results_.emplace_back(std::move(result));
diff --git a/ui/app_list/search_provider.h b/chrome/browser/ui/app_list/search/search_provider.h similarity index 86% rename from ui/app_list/search_provider.h rename to chrome/browser/ui/app_list/search/search_provider.h index 3da16b7..0a6d520 100644 --- a/ui/app_list/search_provider.h +++ b/chrome/browser/ui/app_list/search/search_provider.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef UI_APP_LIST_SEARCH_PROVIDER_H_ -#define UI_APP_LIST_SEARCH_PROVIDER_H_ +#ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_PROVIDER_H_ +#define CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_PROVIDER_H_ #include <memory> #include <vector> @@ -11,13 +11,12 @@ #include "base/callback.h" #include "base/macros.h" #include "base/strings/string16.h" -#include "ui/app_list/app_list_export.h" namespace app_list { class SearchResult; -class APP_LIST_EXPORT SearchProvider { +class SearchProvider { public: using Results = std::vector<std::unique_ptr<SearchResult>>; using ResultChangedCallback = base::Closure; @@ -56,4 +55,4 @@ } // namespace app_list -#endif // UI_APP_LIST_SEARCH_PROVIDER_H_ +#endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_SEARCH_PROVIDER_H_
diff --git a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/tests/app_search_provider_unittest.cc similarity index 99% rename from chrome/browser/ui/app_list/search/app_search_provider_unittest.cc rename to chrome/browser/ui/app_list/search/tests/app_search_provider_unittest.cc index 4b0ce59..e82ba5e 100644 --- a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/app_search_provider_unittest.cc
@@ -200,8 +200,7 @@ EXPECT_EQ("Packaged App 1", RunQuery("pa1")); EXPECT_FALSE(results().empty()); service_->UninstallExtension(kPackagedApp1Id, - extensions::UNINSTALL_REASON_FOR_TESTING, - NULL); + extensions::UNINSTALL_REASON_FOR_TESTING, NULL); // Allow async AppSearchProvider::UpdateResults to run. base::RunLoop().RunUntilIdle();
diff --git a/ui/app_list/search/history_data_store_unittest.cc b/chrome/browser/ui/app_list/search/tests/history_data_store_unittest.cc similarity index 93% rename from ui/app_list/search/history_data_store_unittest.cc rename to chrome/browser/ui/app_list/search/tests/history_data_store_unittest.cc index 2b15d4d..275a0ebb7 100644 --- a/ui/app_list/search/history_data_store_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/history_data_store_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ui/app_list/search/history_data_store.h" +#include "chrome/browser/ui/app_list/search/history_data_store.h" #include "base/bind.h" #include "base/files/file_util.h" @@ -11,9 +11,9 @@ #include "base/memory/ref_counted.h" #include "base/run_loop.h" #include "base/test/scoped_task_environment.h" +#include "chrome/browser/ui/app_list/search/dictionary_data_store.h" +#include "chrome/browser/ui/app_list/search/history_data.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/app_list/search/dictionary_data_store.h" -#include "ui/app_list/search/history_data.h" namespace app_list { namespace test { @@ -24,8 +24,7 @@ std::string str = std::string("p:") + data.primary + ";s:"; bool first = true; for (HistoryData::SecondaryDeque::const_iterator it = data.secondary.begin(); - it != data.secondary.end(); - ++it) { + it != data.secondary.end(); ++it) { if (first) first = false; else @@ -46,9 +45,7 @@ base::test::ScopedTaskEnvironment::MainThreadType::UI) {} // testing::Test overrides: - void SetUp() override { - ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - } + void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); } void TearDown() override { // Release |store_| while ui loop is still running. store_ = NULL;
diff --git a/chrome/browser/ui/app_list/search/history_unittest.cc b/chrome/browser/ui/app_list/search/tests/history_unittest.cc similarity index 94% rename from chrome/browser/ui/app_list/search/history_unittest.cc rename to chrome/browser/ui/app_list/search/tests/history_unittest.cc index f6c2022..2605a95 100644 --- a/chrome/browser/ui/app_list/search/history_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/history_unittest.cc
@@ -13,13 +13,13 @@ #include "base/strings/string_number_conversions.h" #include "base/test/scoped_task_environment.h" #include "base/threading/platform_thread.h" +#include "chrome/browser/ui/app_list/search/dictionary_data_store.h" +#include "chrome/browser/ui/app_list/search/history.h" +#include "chrome/browser/ui/app_list/search/history_data.h" +#include "chrome/browser/ui/app_list/search/history_data_observer.h" +#include "chrome/browser/ui/app_list/search/history_data_store.h" #include "chrome/browser/ui/app_list/search/history_factory.h" #include "testing/gtest/include/gtest/gtest.h" -#include "ui/app_list/search/dictionary_data_store.h" -#include "ui/app_list/search/history.h" -#include "ui/app_list/search/history_data.h" -#include "ui/app_list/search/history_data_observer.h" -#include "ui/app_list/search/history_data_store.h" namespace app_list { namespace test { @@ -35,7 +35,7 @@ // has passed. class HistoryDataLoadWaiter : public HistoryDataObserver { public: - explicit HistoryDataLoadWaiter(HistoryData* data) : data_(data) {} + explicit HistoryDataLoadWaiter(HistoryData* data) : data_(data) {} ~HistoryDataLoadWaiter() override {} void Wait() { @@ -75,9 +75,7 @@ } private: - void OnFlushed() { - run_loop_->Quit(); - } + void OnFlushed() { run_loop_->Quit(); } HistoryDataStore* store_; // Not owned. std::unique_ptr<base::RunLoop> run_loop_; @@ -99,9 +97,7 @@ ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); CreateHistory(); } - void TearDown() override { - Flush(); - } + void TearDown() override { Flush(); } void CreateHistory() { const char kStoreDataFileName[] = "app-launcher-test"; @@ -121,9 +117,7 @@ ASSERT_TRUE(history_->IsReady()); } - void Flush() { - StoreFlushWaiter(history_->store_.get()).Wait(); - } + void Flush() { StoreFlushWaiter(history_->store_.get()).Wait(); } size_t GetKnownResults(const std::string& query) { known_results_ = history()->GetKnownResults(query);
diff --git a/chrome/browser/ui/app_list/search/mixer_unittest.cc b/chrome/browser/ui/app_list/search/tests/mixer_unittest.cc similarity index 98% rename from chrome/browser/ui/app_list/search/mixer_unittest.cc rename to chrome/browser/ui/app_list/search/tests/mixer_unittest.cc index faa4dddd..0224a5a 100644 --- a/chrome/browser/ui/app_list/search/mixer_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/mixer_unittest.cc
@@ -16,12 +16,12 @@ #include "base/strings/string16.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "chrome/browser/ui/app_list/search/history_types.h" +#include "chrome/browser/ui/app_list/search/search_provider.h" #include "chrome/browser/ui/app_list/test/fake_app_list_model_updater.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/app_list/app_list_constants.h" #include "ui/app_list/app_list_features.h" -#include "ui/app_list/search/history_types.h" -#include "ui/app_list/search_provider.h" class FakeAppListModelUpdater;
diff --git a/chrome/browser/ui/app_list/search/omnibox_result_unittest.cc b/chrome/browser/ui/app_list/search/tests/omnibox_result_unittest.cc similarity index 100% rename from chrome/browser/ui/app_list/search/omnibox_result_unittest.cc rename to chrome/browser/ui/app_list/search/tests/omnibox_result_unittest.cc
diff --git a/ui/app_list/search/term_break_iterator_unittest.cc b/chrome/browser/ui/app_list/search/tests/term_break_iterator_unittest.cc similarity index 100% rename from ui/app_list/search/term_break_iterator_unittest.cc rename to chrome/browser/ui/app_list/search/tests/term_break_iterator_unittest.cc
diff --git a/ui/app_list/search/tokenized_string_char_iterator_unittest.cc b/chrome/browser/ui/app_list/search/tests/tokenized_string_char_iterator_unittest.cc similarity index 93% rename from ui/app_list/search/tokenized_string_char_iterator_unittest.cc rename to chrome/browser/ui/app_list/search/tests/tokenized_string_char_iterator_unittest.cc index e0073ad..9dd9c3e3 100644 --- a/ui/app_list/search/tokenized_string_char_iterator_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/tokenized_string_char_iterator_unittest.cc
@@ -22,11 +22,9 @@ // the current char in terms of the original text of the TokenizedString. The // last one is optional and only shows up when IsFirstCharOfToken returns true. std::string GetIterateState(const TokenizedStringCharIterator& iter) { - return base::StringPrintf("%s%d%s", - base::UTF16ToUTF8( - base::string16(1, iter.Get())).c_str(), - iter.GetArrayPos(), - iter.IsFirstCharOfToken() ? "!" : ""); + return base::StringPrintf( + "%s%d%s", base::UTF16ToUTF8(base::string16(1, iter.Get())).c_str(), + iter.GetArrayPos(), iter.IsFirstCharOfToken() ? "!" : ""); } void TestBeyondTheEnd(TokenizedStringCharIterator* iter) {
diff --git a/ui/app_list/search/tokenized_string_match_unittest.cc b/chrome/browser/ui/app_list/search/tests/tokenized_string_match_unittest.cc similarity index 73% rename from ui/app_list/search/tokenized_string_match_unittest.cc rename to chrome/browser/ui/app_list/search/tests/tokenized_string_match_unittest.cc index 5315099d..1b129d23 100644 --- a/ui/app_list/search/tokenized_string_match_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/tokenized_string_match_unittest.cc
@@ -37,20 +37,16 @@ const char* text; const char* query; } kTestCases[] = { - { "", "" }, - { "", "query" }, - { "text", "" }, - { "!", "!@#$%^&*()<<<**>>>" }, - { "abd", "abcd"}, - { "cd", "abcd"}, + {"", ""}, {"", "query"}, + {"text", ""}, {"!", "!@#$%^&*()<<<**>>>"}, + {"abd", "abcd"}, {"cd", "abcd"}, }; TokenizedStringMatch match; for (size_t i = 0; i < arraysize(kTestCases); ++i) { const base::string16 text(base::UTF8ToUTF16(kTestCases[i].text)); EXPECT_FALSE(match.Calculate(base::UTF8ToUTF16(kTestCases[i].query), text)) - << "Test case " << i - << " : text=" << kTestCases[i].text + << "Test case " << i << " : text=" << kTestCases[i].text << ", query=" << kTestCases[i].query; } } @@ -61,17 +57,17 @@ const char* query; const char* expect; } kTestCases[] = { - { "ScratchPad", "pad", "Scratch[Pad]" }, - { "ScratchPad", "sp", "[S]cratch[P]ad" }, - { "Chess2", "che", "[Che]ss2" }, - { "Chess2", "c2", "[C]hess[2]" }, - { "Cut the rope", "cut ro", "[Cut] the [ro]pe" }, - { "Cut the rope", "cr", "[C]ut the [r]ope" }, - { "John Doe", "jdoe", "[J]ohn [Doe]" }, - { "John Doe", "johnd", "[John D]oe" }, - { "Secure Shell", "she", "Secure [She]ll" }, - { "Simple Secure Shell", "sish", "[Si]mple Secure [Sh]ell" }, - { "Netflix", "flix", "Net[flix]" }, + {"ScratchPad", "pad", "Scratch[Pad]"}, + {"ScratchPad", "sp", "[S]cratch[P]ad"}, + {"Chess2", "che", "[Che]ss2"}, + {"Chess2", "c2", "[C]hess[2]"}, + {"Cut the rope", "cut ro", "[Cut] the [ro]pe"}, + {"Cut the rope", "cr", "[C]ut the [r]ope"}, + {"John Doe", "jdoe", "[J]ohn [Doe]"}, + {"John Doe", "johnd", "[John D]oe"}, + {"Secure Shell", "she", "Secure [She]ll"}, + {"Simple Secure Shell", "sish", "[Si]mple Secure [Sh]ell"}, + {"Netflix", "flix", "Net[flix]"}, }; TokenizedStringMatch match; @@ -88,21 +84,21 @@ const char* query_low; const char* query_high; } kTestCases[] = { - // More matched chars are better. - { "Google Chrome", "g", "go" }, - { "Google Chrome", "go", "goo" }, - { "Google Chrome", "goo", "goog" }, - { "Google Chrome", "c", "ch" }, - { "Google Chrome", "ch", "chr" }, - // Acronym match is better than something in the middle. - { "Google Chrome", "ch", "gc" }, - // Prefix match is better than middle match and acronym match. - { "Google Chrome", "ch", "go" }, - { "Google Chrome", "gc", "go" }, - // Substring match has the lowest score. - { "Google Chrome", "oo", "gc" }, - { "Google Chrome", "oo", "go" }, - { "Google Chrome", "oo", "ch" }, + // More matched chars are better. + {"Google Chrome", "g", "go"}, + {"Google Chrome", "go", "goo"}, + {"Google Chrome", "goo", "goog"}, + {"Google Chrome", "c", "ch"}, + {"Google Chrome", "ch", "chr"}, + // Acronym match is better than something in the middle. + {"Google Chrome", "ch", "gc"}, + // Prefix match is better than middle match and acronym match. + {"Google Chrome", "ch", "go"}, + {"Google Chrome", "gc", "go"}, + // Substring match has the lowest score. + {"Google Chrome", "oo", "gc"}, + {"Google Chrome", "oo", "go"}, + {"Google Chrome", "oo", "ch"}, }; TokenizedStringMatch match_low; @@ -114,8 +110,7 @@ EXPECT_TRUE(match_high.Calculate( base::UTF8ToUTF16(kTestCases[i].query_high), text)); EXPECT_LT(match_low.relevance(), match_high.relevance()) - << "Test case " << i - << " : text=" << kTestCases[i].text + << "Test case " << i << " : text=" << kTestCases[i].text << ", query_low=" << kTestCases[i].query_low << ", query_high=" << kTestCases[i].query_high; }
diff --git a/ui/app_list/search/tokenized_string_unittest.cc b/chrome/browser/ui/app_list/search/tests/tokenized_string_unittest.cc similarity index 86% rename from ui/app_list/search/tokenized_string_unittest.cc rename to chrome/browser/ui/app_list/search/tests/tokenized_string_unittest.cc index ae845f7..50b9f48a 100644 --- a/ui/app_list/search/tokenized_string_unittest.cc +++ b/chrome/browser/ui/app_list/search/tests/tokenized_string_unittest.cc
@@ -40,14 +40,12 @@ { base::string16 text(base::UTF8ToUTF16("ScratchPad")); TokenizedString tokens(text); - EXPECT_EQ(base::UTF8ToUTF16("scratch{0,7} pad{7,10}"), - GetContent(tokens)); + EXPECT_EQ(base::UTF8ToUTF16("scratch{0,7} pad{7,10}"), GetContent(tokens)); } { base::string16 text(base::UTF8ToUTF16("Chess2.0")); TokenizedString tokens(text); - EXPECT_EQ(base::UTF8ToUTF16("chess{0,5} 2.0{5,8}"), - GetContent(tokens)); + EXPECT_EQ(base::UTF8ToUTF16("chess{0,5} 2.0{5,8}"), GetContent(tokens)); } { base::string16 text(base::UTF8ToUTF16("Cut the rope")); @@ -70,8 +68,7 @@ { base::string16 text(base::UTF8ToUTF16("Draw-It!")); TokenizedString tokens(text); - EXPECT_EQ(base::UTF8ToUTF16("draw{0,4} it{5,7}"), - GetContent(tokens)); + EXPECT_EQ(base::UTF8ToUTF16("draw{0,4} it{5,7}"), GetContent(tokens)); } { base::string16 text(base::UTF8ToUTF16("Faxing & Signing")); @@ -82,8 +79,7 @@ { base::string16 text(base::UTF8ToUTF16("!@#$%^&*()<<<**>>>")); TokenizedString tokens(text); - EXPECT_EQ(base::UTF8ToUTF16(""), - GetContent(tokens)); + EXPECT_EQ(base::UTF8ToUTF16(""), GetContent(tokens)); } }
diff --git a/chrome/browser/ui/blocked_content/popunder_preventer.cc b/chrome/browser/ui/blocked_content/popunder_preventer.cc index 8c74504..24fb87fe 100644 --- a/chrome/browser/ui/blocked_content/popunder_preventer.cc +++ b/chrome/browser/ui/blocked_content/popunder_preventer.cc
@@ -13,7 +13,7 @@ #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "components/guest_view/browser/guest_view_base.h"
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc index d5f33ae..60e6c020 100644 --- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc +++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -57,7 +57,7 @@ #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ui/bookmarks/bookmark_utils.cc b/chrome/browser/ui/bookmarks/bookmark_utils.cc index 5411527..801f660 100644 --- a/chrome/browser/ui/bookmarks/bookmark_utils.cc +++ b/chrome/browser/ui/bookmarks/bookmark_utils.cc
@@ -22,7 +22,7 @@ #include "components/user_prefs/user_prefs.h" #include "components/vector_icons/vector_icons.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/drop_target_event.h" #include "ui/base/material_design/material_design_controller.h"
diff --git a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc index da3241ce..40c8feea 100644 --- a/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc +++ b/chrome/browser/ui/bookmarks/bookmark_utils_desktop.cc
@@ -31,7 +31,7 @@ #include "components/url_formatter/url_formatter.h" #include "components/user_prefs/user_prefs.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/drop_target_event.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 49d5264..c21f4ba8 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc
@@ -202,10 +202,10 @@ #include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "extensions/common/manifest_handlers/background_info.h" -#include "extensions/features/features.h" #include "net/base/filename_util.h" #include "net/base/registry_controlled_domains/registry_controlled_domain.h" #include "net/cookies/cookie_monster.h" @@ -293,24 +293,12 @@ // Browser, CreateParams: Browser::CreateParams::CreateParams(Profile* profile, bool user_gesture) - : type(TYPE_TABBED), - profile(profile), - trusted_source(false), - initial_show_state(ui::SHOW_STATE_DEFAULT), - is_session_restore(false), - user_gesture(user_gesture), - window(NULL) {} + : CreateParams(TYPE_TABBED, profile, user_gesture) {} Browser::CreateParams::CreateParams(Type type, Profile* profile, bool user_gesture) - : type(type), - profile(profile), - trusted_source(false), - initial_show_state(ui::SHOW_STATE_DEFAULT), - is_session_restore(false), - user_gesture(user_gesture), - window(NULL) {} + : type(type), profile(profile), user_gesture(user_gesture) {} Browser::CreateParams::CreateParams(const CreateParams& other) = default; @@ -449,6 +437,9 @@ ProfileMetrics::LogProfileLaunch(profile_); + if (params.skip_window_init_for_testing) + return; + window_ = params.window ? params.window : CreateBrowserWindow(this, params.user_gesture);
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index 7532d85e..792784e 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h
@@ -42,7 +42,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/common/page_zoom.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "printing/features/features.h" #include "ui/base/page_transition_types.h" #include "ui/base/ui_base_types.h" @@ -182,7 +182,7 @@ Profile* profile; // Specifies the browser is_trusted_source_ value. - bool trusted_source; + bool trusted_source = false; // The bounds of the window to open. gfx::Rect initial_bounds; @@ -190,9 +190,9 @@ // The workspace the window should open in, if the platform supports it. std::string initial_workspace; - ui::WindowShowState initial_show_state; + ui::WindowShowState initial_show_state = ui::SHOW_STATE_DEFAULT; - bool is_session_restore; + bool is_session_restore = false; // Whether this browser was created by a user gesture. We track this // specifically for the multi-user case in chromeos where we can place @@ -202,10 +202,11 @@ // Supply a custom BrowserWindow implementation, to be used instead of the // default. Intended for testing. - BrowserWindow* window; + BrowserWindow* window = nullptr; private: friend class Browser; + friend class WindowSizerAshTest; // The application name that is also the name of the window to the shell. // Do not set this value directly, use CreateForApp. @@ -214,6 +215,10 @@ // 2) undocked devtool windows. // 3) popup windows spawned from v1 applications. std::string app_name; + + // When set to true, skip initializing |window_| and everything that depends + // on it. + bool skip_window_init_for_testing = false; }; // Constructors, Creation, Showing //////////////////////////////////////////
diff --git a/chrome/browser/ui/browser_close_unittest.cc b/chrome/browser/ui/browser_close_unittest.cc index d6a123f..15fda79 100644 --- a/chrome/browser/ui/browser_close_unittest.cc +++ b/chrome/browser/ui/browser_close_unittest.cc
@@ -18,7 +18,7 @@ #include "components/keyed_service/core/keyed_service.h" #include "content/public/browser/browser_context.h" #include "content/public/test/test_browser_thread_bundle.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" class TestingDownloadCoreService : public DownloadCoreService {
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc index 1a2a94bf..ea76ede 100644 --- a/chrome/browser/ui/browser_commands.cc +++ b/chrome/browser/ui/browser_commands.cc
@@ -84,7 +84,7 @@ #include "content/public/common/url_constants.h" #include "content/public/common/url_utils.h" #include "content/public/common/user_agent.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/escape.h" #include "printing/features/features.h" #include "rlz/features/features.h"
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc index 94c55412..911bfcc 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc
@@ -40,7 +40,7 @@ #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/url_constants.h" #if defined(OS_CHROMEOS)
diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_test_util_views_cocoa.mm b/chrome/browser/ui/cocoa/extensions/browser_action_test_util_views_cocoa.mm index 65c16472..d86f903 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_action_test_util_views_cocoa.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_action_test_util_views_cocoa.mm
@@ -28,7 +28,6 @@ #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" #include "chrome/common/chrome_constants.h" -#import "ui/base/test/windowed_nsnotification_observer.h" #include "ui/base/theme_provider.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" @@ -248,23 +247,6 @@ return popup_owner ? popup_owner->GetPopupNativeView() : nil; } -bool BrowserActionTestUtil::WaitForPopup() { - NSWindow* window = [GetPopupNativeView() window]; - if (!window) - return false; - - if ([window isKeyWindow]) - return true; - - base::scoped_nsobject<WindowedNSNotificationObserver> waiter( - [[WindowedNSNotificationObserver alloc] - initForNotification:NSWindowDidBecomeKeyNotification - object:window]); - - BOOL notification_observed = [waiter wait]; - return notification_observed && [window isKeyWindow]; -} - bool BrowserActionTestUtil::HasPopup() { return GetPopupNativeView() != nil; }
diff --git a/chrome/browser/ui/cocoa/extensions/extension_view_mac.h b/chrome/browser/ui/cocoa/extensions/extension_view_mac.h index 67889503..690a5ff 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_view_mac.h +++ b/chrome/browser/ui/cocoa/extensions/extension_view_mac.h
@@ -62,7 +62,7 @@ void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; - void DidStopLoading() override; + void OnLoaded() override; private: content::RenderViewHost* render_view_host() const;
diff --git a/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm b/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm index 2aa0f53..e232ff9 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_view_mac.mm
@@ -82,7 +82,7 @@ [event_window redispatchKeyEvent:event.os_event]; } -void ExtensionViewMac::DidStopLoading() { +void ExtensionViewMac::OnLoaded() { ShowIfCompletelyLoaded(); }
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm index c7a12b4..afbfa9f0 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm
@@ -487,7 +487,9 @@ // more. Calling -stringValue ensures that |field_| reflects the changes to // |storage|. [field_ stringValue]; - } else { + } else if (!in_coalesced_update_block_) { + // Skip this if we're in a coalesced update block. Otherwise, the user text + // entered can get set in a new tab because we haven't yet set the URL text. SetText(GetText()); } }
diff --git a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm index 4d520ea..ec8275c 100644 --- a/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm +++ b/chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm
@@ -11,6 +11,7 @@ #include "base/mac/scoped_nsobject.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" +#include "chrome/browser/ui/cocoa/browser_dialogs_views_mac.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/theme_resources.h" #include "skia/ext/skia_utils_mac.h" @@ -69,17 +70,13 @@ std::unique_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::CreateCocoa(const base::string16& text) { + if (chrome::ShowAllDialogsWithViewsToolkit()) + return nullptr; + return std::unique_ptr<ScreenCaptureNotificationUI>( new ScreenCaptureNotificationUICocoa(text)); } -#if !BUILDFLAG(MAC_VIEWS_BROWSER) -std::unique_ptr<ScreenCaptureNotificationUI> -ScreenCaptureNotificationUI::Create(const base::string16& text) { - return CreateCocoa(text); -} -#endif - @implementation ScreenCaptureNotificationController - (id)initWithCallback:(const base::Closure&)stop_callback text:(const base::string16&)text {
diff --git a/chrome/browser/ui/fast_unload_controller.cc b/chrome/browser/ui/fast_unload_controller.cc index d7ea5196..58495eb 100644 --- a/chrome/browser/ui/fast_unload_controller.cc +++ b/chrome/browser/ui/fast_unload_controller.cc
@@ -22,7 +22,7 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_registry.h"
diff --git a/chrome/browser/ui/libgtkui/OWNERS b/chrome/browser/ui/libgtkui/OWNERS index 57ab12c54..f4ab9a47 100644 --- a/chrome/browser/ui/libgtkui/OWNERS +++ b/chrome/browser/ui/libgtkui/OWNERS
@@ -1,4 +1,3 @@ -erg@chromium.org estade@chromium.org thomasanderson@chromium.org
diff --git a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc index d499833..31a8087 100644 --- a/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc +++ b/chrome/browser/ui/libgtkui/nav_button_provider_gtk3.cc
@@ -213,8 +213,10 @@ // is not scaled for the (unexpected) smaller button size, and the button's // edges appear cut off. To fix this, manually set the background to scale // to the button size when it would have clipped. - ApplyCssToContext(button_context, - ".titlebutton { background-size: contain; }"); + if (GtkVersionCheck(3, 20)) { + ApplyCssToContext(button_context, + ".titlebutton { background-size: contain; }"); + } // Gtk doesn't support fractional scale factors, but chrome does. // Rendering the button background and border at a fractional
diff --git a/chrome/browser/ui/login/login_handler.cc b/chrome/browser/ui/login/login_handler.cc index be0614b..73151db 100644 --- a/chrome/browser/ui/login/login_handler.cc +++ b/chrome/browser/ui/login/login_handler.cc
@@ -33,7 +33,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/common/origin_util.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/auth.h" #include "net/base/host_port_pair.h" #include "net/base/load_flags.h"
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.cc b/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.cc index ed0a024..e1b66216 100644 --- a/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.cc +++ b/chrome/browser/ui/omnibox/chrome_omnibox_edit_controller.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "components/toolbar/toolbar_model.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h"
diff --git a/chrome/browser/ui/omnibox/omnibox_theme.cc b/chrome/browser/ui/omnibox/omnibox_theme.cc index ef66e32..58ba5fd 100644 --- a/chrome/browser/ui/omnibox/omnibox_theme.cc +++ b/chrome/browser/ui/omnibox/omnibox_theme.cc
@@ -24,7 +24,7 @@ ui::NativeTheme::kColorId_NumColors; template <class T> -constexpr T NormalHoveredSelectedOrBoth(OmniboxState state, +constexpr T NormalHoveredSelectedOrBoth(OmniboxPartState state, T normal, T hovered, T selected, @@ -34,7 +34,7 @@ } template <class T> -constexpr T NormalHoveredSelected(OmniboxState state, +constexpr T NormalHoveredSelected(OmniboxPartState state, T normal, T hovered, T selected) { @@ -44,7 +44,7 @@ } ui::NativeTheme::ColorId GetLegacyColorId(OmniboxPart part, - OmniboxState state) { + OmniboxPartState state) { using NativeId = ui::NativeTheme::ColorId; switch (part) { case OmniboxPart::RESULTS_BACKGROUND: @@ -52,11 +52,16 @@ state, NativeId::kColorId_ResultsTableNormalBackground, NativeId::kColorId_ResultsTableHoveredBackground, NativeId::kColorId_ResultsTableSelectedBackground); + case OmniboxPart::RESULTS_SEPARATOR: + NOTREACHED(); + break; } return kInvalidColorId; } -SkColor GetLegacyColor(OmniboxPart part, OmniboxTint tint, OmniboxState state) { +SkColor GetLegacyColor(OmniboxPart part, + OmniboxTint tint, + OmniboxPartState state) { ui::NativeTheme* native_theme = nullptr; #if defined(USE_AURA) if (tint == OmniboxTint::DARK) @@ -79,7 +84,7 @@ SkColor GetOmniboxColor(OmniboxPart part, OmniboxTint tint, - OmniboxState state) { + OmniboxPartState state) { if (!ui::MaterialDesignController::IsTouchOptimizedUiEnabled()) return GetLegacyColor(part, tint, state); @@ -95,6 +100,10 @@ return color_utils::BlendTowardOppositeLuma( dark ? gfx::kGoogleGrey800 : SK_ColorWHITE, NormalHoveredSelectedOrBoth<SkAlpha>(state, 0x00, 0x0f, 0x14, 0x24)); + case OmniboxPart::RESULTS_SEPARATOR: + // The dark base color doesn't appear in the MD2 spec, just Chrome's. + return dark ? SkColorSetARGB(0x6e, 0x16, 0x17, 0x1a) // 43% alpha. + : SkColorSetA(gfx::kGoogleGrey900, 0x24); // 14% alpha. } return gfx::kPlaceholderColor; }
diff --git a/chrome/browser/ui/omnibox/omnibox_theme.h b/chrome/browser/ui/omnibox/omnibox_theme.h index 8a10cbf..f13046b 100644 --- a/chrome/browser/ui/omnibox/omnibox_theme.h +++ b/chrome/browser/ui/omnibox/omnibox_theme.h
@@ -10,6 +10,7 @@ // A part of the omnibox (location bar, location bar decoration, or dropdown). enum class OmniboxPart { RESULTS_BACKGROUND, // Background of the results dropdown. + RESULTS_SEPARATOR, // Separator between the input row and the results rows. }; // The tint of the omnibox theme. E.g. Incognito may use a DARK tint. NATIVE is @@ -17,12 +18,12 @@ enum class OmniboxTint { DARK, LIGHT, NATIVE }; // An optional state for a given |OmniboxPart|. -enum class OmniboxState { NORMAL, HOVERED, SELECTED, HOVERED_AND_SELECTED }; +enum class OmniboxPartState { NORMAL, HOVERED, SELECTED, HOVERED_AND_SELECTED }; // Returns the color for the given |part| and |tint|. An optional |state| can be // provided for OmniboxParts that support stateful colors. SkColor GetOmniboxColor(OmniboxPart part, OmniboxTint tint, - OmniboxState state = OmniboxState::NORMAL); + OmniboxPartState state = OmniboxPartState::NORMAL); #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_THEME_H_
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc index 23dfe24..1c6b1427 100644 --- a/chrome/browser/ui/prefs/prefs_tab_helper.cc +++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -44,7 +44,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/common/renderer_preferences.h" #include "content/public/common/web_preferences.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "third_party/icu/source/common/unicode/uchar.h" #include "third_party/icu/source/common/unicode/uscript.h"
diff --git a/chrome/browser/ui/screen_capture_notification_ui.h b/chrome/browser/ui/screen_capture_notification_ui.h index 3d24972..0483e120 100644 --- a/chrome/browser/ui/screen_capture_notification_ui.h +++ b/chrome/browser/ui/screen_capture_notification_ui.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_UI_SCREEN_CAPTURE_NOTIFICATION_UI_H_ #include "base/callback.h" +#include "base/macros.h" #include "base/strings/string16.h" #include "build/build_config.h" #include "content/public/common/media_stream_request.h" @@ -14,18 +15,23 @@ // is being captured. class ScreenCaptureNotificationUI : public content::MediaStreamUI { public: - ~ScreenCaptureNotificationUI() override {} + ScreenCaptureNotificationUI() = default; + ~ScreenCaptureNotificationUI() override = default; // Creates platform-specific screen capture notification UI. |text| specifies // the text that should be shown in the notification. static std::unique_ptr<ScreenCaptureNotificationUI> Create( const base::string16& text); + + private: #if defined(OS_MACOSX) - // Temporary shim for Polychrome. See bottom of first comment in - // https://crbug.com/80495 for details. + // Returns a ScreenCaptureNotificationUI or nullptr if the Views version + // should be used instead. static std::unique_ptr<ScreenCaptureNotificationUI> CreateCocoa( const base::string16& text); #endif + + DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUI); }; #endif // CHROME_BROWSER_UI_SCREEN_CAPTURE_NOTIFICATION_UI_H_
diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc index 4856239..d2ba4145 100644 --- a/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc +++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper.cc
@@ -14,7 +14,7 @@ #include "components/browser_sync/signin_confirmation_helper.h" #include "components/history/core/browser/history_service.h" #include "content/public/browser/browser_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/gfx/color_utils.h" #include "ui/native_theme/native_theme.h"
diff --git a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc index f15bc42..294f8cc 100644 --- a/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc +++ b/chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc
@@ -33,7 +33,7 @@ #include "components/sync_preferences/testing_pref_service_syncable.h" #include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/test_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc index 42fac60..3a7ec5e 100644 --- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc +++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
@@ -18,7 +18,7 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "chrome/browser/extensions/tab_helper.h"
diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc index d058e27c..4d91df5f 100644 --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc
@@ -86,7 +86,7 @@ #include "components/tracing/common/tracing_switches.h" #include "components/ukm/content/source_url_recorder.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "printing/features/features.h" #if defined(OS_ANDROID)
diff --git a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc index 8e66597..e7571f6 100644 --- a/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc +++ b/chrome/browser/ui/toolbar/chrome_toolbar_model_delegate.cc
@@ -47,7 +47,8 @@ const GURL& url, const base::string16& formatted_url) const { return AutocompleteInput::FormattedStringWithEquivalentMeaning( - url, formatted_url, ChromeAutocompleteSchemeClassifier(GetProfile())); + url, formatted_url, ChromeAutocompleteSchemeClassifier(GetProfile()), + nullptr); } bool ChromeToolbarModelDelegate::GetURL(GURL* url) const {
diff --git a/chrome/browser/ui/unload_controller.cc b/chrome/browser/ui/unload_controller.cc index f4be8723b..1854772c 100644 --- a/chrome/browser/ui/unload_controller.cc +++ b/chrome/browser/ui/unload_controller.cc
@@ -17,7 +17,7 @@ #include "content/public/browser/notification_types.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_EXTENSIONS) #include "extensions/browser/extension_registry.h"
diff --git a/chrome/browser/ui/views/autofill/save_card_icon_view.cc b/chrome/browser/ui/views/autofill/save_card_icon_view.cc index 9a94402..6476088 100644 --- a/chrome/browser/ui/views/autofill/save_card_icon_view.cc +++ b/chrome/browser/ui/views/autofill/save_card_icon_view.cc
@@ -8,27 +8,28 @@ #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_command_controller.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h" +#include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" #include "chrome/grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" namespace autofill { SaveCardIconView::SaveCardIconView(CommandUpdater* command_updater, - Browser* browser) - : BubbleIconView(command_updater, IDC_SAVE_CREDIT_CARD_FOR_PAGE), + Browser* browser, + BubbleIconView::Delegate* delegate) + : BubbleIconView(command_updater, IDC_SAVE_CREDIT_CARD_FOR_PAGE, delegate), browser_(browser) { + DCHECK(delegate); set_id(VIEW_ID_SAVE_CREDIT_CARD_BUTTON); SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_SAVE_CREDIT_CARD)); } SaveCardIconView::~SaveCardIconView() {} -void SaveCardIconView::OnExecuting( - BubbleIconView::ExecuteSource execute_source) {} - views::BubbleDialogDelegateView* SaveCardIconView::GetBubble() const { SaveCardBubbleControllerImpl* controller = GetController(); if (!controller) @@ -38,6 +39,24 @@ controller->save_card_bubble_view()); } +bool SaveCardIconView::Refresh() { + if (!GetWebContents()) + return false; + + const bool was_visible = visible(); + + // |controller| may be nullptr due to lazy initialization. + SaveCardBubbleControllerImpl* controller = GetController(); + bool enabled = controller && controller->IsIconVisible(); + + enabled &= SetCommandEnabled(enabled); + SetVisible(enabled); + return was_visible != visible(); +} + +void SaveCardIconView::OnExecuting( + BubbleIconView::ExecuteSource execute_source) {} + const gfx::VectorIcon& SaveCardIconView::GetVectorIcon() const { return kCreditCardIcon; } @@ -45,8 +64,8 @@ SaveCardBubbleControllerImpl* SaveCardIconView::GetController() const { if (!browser_) return nullptr; - content::WebContents* web_contents = - browser_->tab_strip_model()->GetActiveWebContents(); + content::WebContents* web_contents = GetWebContents(); + if (!web_contents) return nullptr; return autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents);
diff --git a/chrome/browser/ui/views/autofill/save_card_icon_view.h b/chrome/browser/ui/views/autofill/save_card_icon_view.h index 52001230..bcbef63 100644 --- a/chrome/browser/ui/views/autofill/save_card_icon_view.h +++ b/chrome/browser/ui/views/autofill/save_card_icon_view.h
@@ -20,13 +20,18 @@ // it. class SaveCardIconView : public BubbleIconView { public: - SaveCardIconView(CommandUpdater* command_updater, Browser* browser); + SaveCardIconView(CommandUpdater* command_updater, + Browser* browser, + BubbleIconView::Delegate* delegate); ~SaveCardIconView() override; + // BubbleIconView: + views::BubbleDialogDelegateView* GetBubble() const override; + bool Refresh() override; + protected: // BubbleIconView: void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; - views::BubbleDialogDelegateView* GetBubble() const override; const gfx::VectorIcon& GetVectorIcon() const override; private:
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc index 3ad3d7a..5373409a 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -197,12 +197,10 @@ #if BUILDFLAG(ENABLE_DICE_SUPPORT) if (AccountConsistencyModeManager::IsDiceEnabledForProfile(profile_)) { - DiceBubbleSyncPromoView* dice_bubble_sync_promo_view = - new DiceBubbleSyncPromoView(profile_, delegate_.get(), - IDS_BOOKMARK_DICE_PROMO_SIGNIN_MESSAGE, - IDS_BOOKMARK_DICE_PROMO_SYNC_MESSAGE); - dice_bubble_sync_promo_view->SetSigninButtonNonProminent(); - footnote_view_ = dice_bubble_sync_promo_view; + footnote_view_ = new DiceBubbleSyncPromoView( + profile_, delegate_.get(), IDS_BOOKMARK_DICE_PROMO_SIGNIN_MESSAGE, + IDS_BOOKMARK_DICE_PROMO_SYNC_MESSAGE, + false /* signin_button_prominent */); } else { footnote_view_ = new BubbleSyncPromoView(delegate_.get(), IDS_BOOKMARK_SYNC_PROMO_LINK,
diff --git a/chrome/browser/ui/views/extensions/extension_view_views.cc b/chrome/browser/ui/views/extensions/extension_view_views.cc index d79c889..9b2e0348 100644 --- a/chrome/browser/ui/views/extensions/extension_view_views.cc +++ b/chrome/browser/ui/views/extensions/extension_view_views.cc
@@ -107,14 +107,16 @@ GetFocusManager()); } -void ExtensionViewViews::DidStopLoading() { - // We wait to show the ExtensionViewViews until it has loaded, and the view - // has actually been created. These can happen in different orders. - // TODO(devlin): Can they? Isn't the view created during construction? - if (!visible() && host_->has_loaded_once()) { - SetVisible(true); - ResizeDueToAutoResize(web_contents(), pending_preferred_size_); - } +void ExtensionViewViews::OnLoaded() { + DCHECK(host_->has_loaded_once()); + + // ExtensionPopup delegates showing the view to OnLoaded(). ExtensionDialog + // handles visibility directly. + if (visible()) + return; + + SetVisible(true); + ResizeDueToAutoResize(web_contents(), pending_preferred_size_); } gfx::NativeCursor ExtensionViewViews::GetCursor(const ui::MouseEvent& event) {
diff --git a/chrome/browser/ui/views/extensions/extension_view_views.h b/chrome/browser/ui/views/extensions/extension_view_views.h index be3280b2..880fd8d 100644 --- a/chrome/browser/ui/views/extensions/extension_view_views.h +++ b/chrome/browser/ui/views/extensions/extension_view_views.h
@@ -60,7 +60,7 @@ void HandleKeyboardEvent( content::WebContents* source, const content::NativeWebKeyboardEvent& event) override; - void DidStopLoading() override; + void OnLoaded() override; // views::WebView: gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override;
diff --git a/chrome/browser/ui/views/frame/OWNERS b/chrome/browser/ui/views/frame/OWNERS index a8f8759..a03d7983 100644 --- a/chrome/browser/ui/views/frame/OWNERS +++ b/chrome/browser/ui/views/frame/OWNERS
@@ -3,7 +3,7 @@ sky@chromium.org per-file immersive_mode_controller*=pkotwicz@chromium.org -per-file *x11*=erg@chromium.org +per-file *x11*=thomasanderson@chromium.org per-file desktop_linux_browser_frame_view*=thomasanderson@chromium.org # COMPONENT: UI>Browser
diff --git a/chrome/browser/ui/views/hover_button.cc b/chrome/browser/ui/views/hover_button.cc index 8a006b99..444a4b6 100644 --- a/chrome/browser/ui/views/hover_button.cc +++ b/chrome/browser/ui/views/hover_button.cc
@@ -251,6 +251,10 @@ return LabelButton::GetKeyClickActionForEvent(event); } +void HoverButton::SetHighlightingView(views::View* highlighting_view) { + highlighting_view_ = highlighting_view; +} + void HoverButton::StateChanged(ButtonState old_state) { LabelButton::StateChanged(old_state); @@ -278,8 +282,9 @@ // remove the rounded corners. std::unique_ptr<views::InkDropHighlight> highlight( new views::InkDropHighlight( - size(), 0, - gfx::RectF(GetMirroredRect(GetContentsBounds())).CenterPoint(), + highlighting_view_->size(), 0, + gfx::RectF(GetMirroredRect(highlighting_view_->GetContentsBounds())) + .CenterPoint(), GetInkDropBaseColor())); highlight->set_explode_size(gfx::SizeF(CalculateLargeInkDropSize(size()))); return highlight;
diff --git a/chrome/browser/ui/views/hover_button.h b/chrome/browser/ui/views/hover_button.h index 2f5c331..db1c9d0 100644 --- a/chrome/browser/ui/views/hover_button.h +++ b/chrome/browser/ui/views/hover_button.h
@@ -76,6 +76,11 @@ auto_compute_tooltip_ = auto_compute_tooltip; } + // Sets the view to be highlighted when the button is hovered. If this + // function is not called, |this| will be used. This function can be used e.g. + // when siblings in the parent view have to be highlighted as well. + void SetHighlightingView(views::View* highlighting_view); + protected: // views::LabelButton: KeyClickAction GetKeyClickActionForEvent(const ui::KeyEvent& event) override; @@ -104,6 +109,9 @@ // from the |title_| and |subtitle_| text. bool auto_compute_tooltip_ = true; + // View that gets highlighted when this button is hovered. + views::View* highlighting_view_ = this; + DISALLOW_COPY_AND_ASSIGN(HoverButton); };
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc index 71c011e..ef1f4b2 100644 --- a/chrome/browser/ui/views/location_bar/bubble_icon_view.cc +++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.cc
@@ -28,10 +28,13 @@ SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); } -BubbleIconView::BubbleIconView(CommandUpdater* command_updater, int command_id) +BubbleIconView::BubbleIconView(CommandUpdater* command_updater, + int command_id, + BubbleIconView::Delegate* delegate) : widget_observer_(this), image_(new views::ImageView()), command_updater_(command_updater), + delegate_(delegate), command_id_(command_id), active_(false), suppress_mouse_released_action_(false) {} @@ -44,6 +47,12 @@ return GetBubble() != nullptr; } +bool BubbleIconView::SetCommandEnabled(bool enabled) const { + DCHECK(command_updater_); + command_updater_->UpdateCommandEnabled(command_id_, enabled); + return command_updater_->IsCommandEnabled(command_id_); +} + void BubbleIconView::SetImage(const gfx::ImageSkia* image_skia) { image_->SetImage(image_skia); } @@ -69,6 +78,10 @@ SetHighlighted(true); } +bool BubbleIconView::Refresh() { + return false; +} + void BubbleIconView::GetAccessibleNodeData(ui::AXNodeData* node_data) { image_->GetAccessibleNodeData(node_data); node_data->role = ax::mojom::Role::kButton; @@ -240,6 +253,10 @@ UpdateIcon(); } +content::WebContents* BubbleIconView::GetWebContents() const { + return delegate_->GetWebContentsForBubbleIconView(); +} + BubbleIconView::WidgetObserver::WidgetObserver(BubbleIconView* parent) : parent_(parent), scoped_observer_(this) {}
diff --git a/chrome/browser/ui/views/location_bar/bubble_icon_view.h b/chrome/browser/ui/views/location_bar/bubble_icon_view.h index 74a412c..d7840c5 100644 --- a/chrome/browser/ui/views/location_bar/bubble_icon_view.h +++ b/chrome/browser/ui/views/location_bar/bubble_icon_view.h
@@ -16,6 +16,10 @@ class CommandUpdater; +namespace content { +class WebContents; +} + namespace gfx { struct VectorIcon; } @@ -28,6 +32,11 @@ // TODO(spqchan): Convert this to subclass Button. class BubbleIconView : public views::InkDropHostView { public: + class Delegate { + public: + virtual content::WebContents* GetWebContentsForBubbleIconView() = 0; + }; + void Init(); // Invoked when a bubble for this icon is created. The BubbleIconView changes @@ -37,6 +46,10 @@ // Returns the bubble instance for the icon. virtual views::BubbleDialogDelegateView* GetBubble() const = 0; + // Updates the icon state and associated bubble when the WebContents changes. + // Returns true if there was a change. + virtual bool Refresh(); + protected: enum ExecuteSource { EXECUTE_SOURCE_MOUSE, @@ -44,12 +57,18 @@ EXECUTE_SOURCE_GESTURE, }; - BubbleIconView(CommandUpdater* command_updater, int command_id); + BubbleIconView(CommandUpdater* command_updater, + int command_id, + Delegate* delegate = nullptr); ~BubbleIconView() override; // Returns true if a related bubble is showing. bool IsBubbleShowing() const; + // Enables or disables the associated command. + // Returns true if the command is enabled. + bool SetCommandEnabled(bool enabled) const; + // Sets the image that should be displayed in |image_|. void SetImage(const gfx::ImageSkia* image_skia); @@ -108,6 +127,9 @@ // "call to action" color. void SetActiveInternal(bool active); + // Returns the associated web contents from the delegate. + content::WebContents* GetWebContents() const; + bool active() const { return active_; } private: @@ -141,6 +163,9 @@ // The CommandUpdater for the Browser object that owns the location bar. CommandUpdater* command_updater_; + // Delegate for access to associated state. + Delegate* delegate_; + // The command ID executed when the user clicks this icon. const int command_id_;
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index 2eff665..06921e8 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -258,15 +258,20 @@ AddChildView(image_view); } - bubble_icons_.push_back(zoom_view_ = new ZoomView(delegate_)); - bubble_icons_.push_back(manage_passwords_icon_view_ = - new ManagePasswordsIconViews(command_updater())); - if (browser_) - bubble_icons_.push_back( - save_credit_card_icon_view_ = - new autofill::SaveCardIconView(command_updater(), browser_)); - bubble_icons_.push_back(translate_icon_view_ = - new TranslateIconView(command_updater())); + zoom_view_ = new ZoomView(delegate_); + bubble_icons_.push_back(zoom_view_); + manage_passwords_icon_view_ = + new ManagePasswordsIconViews(command_updater(), this); + bubble_icons_.push_back(manage_passwords_icon_view_); + + if (browser_) { + save_credit_card_icon_view_ = + new autofill::SaveCardIconView(command_updater(), browser_, this); + bubble_icons_.push_back(save_credit_card_icon_view_); + } + translate_icon_view_ = new TranslateIconView(command_updater(), this); + bubble_icons_.push_back(translate_icon_view_); + #if defined(OS_CHROMEOS) if (browser_) bubble_icons_.push_back(intent_picker_view_ = @@ -377,6 +382,15 @@ return origin; } +int LocationBarView::GetTextInsetForNormalInputStart() const { + // Note that this does not need to account for the internal Textfield border, + // since that's subtracted during layout. + return GetHorizontalEdgeThickness() + + GetLayoutConstant(LOCATION_BAR_ICON_SIZE) + + 2 * GetLayoutConstant(LOCATION_BAR_ICON_INTERIOR_PADDING) + + GetLayoutConstant(LOCATION_BAR_ELEMENT_PADDING); +} + void LocationBarView::SetImeInlineAutocompletion(const base::string16& text) { ime_inline_autocomplete_view_->SetText(text); ime_inline_autocomplete_view_->SetVisible(!text.empty()); @@ -641,14 +655,19 @@ void LocationBarView::Update(const WebContents* contents) { RefreshContentSettingViews(); + + // TODO(calamity): Refactor Update to use BubbleIconView::Refresh. RefreshZoomView(); - RefreshTranslateIcon(); - RefreshSaveCreditCardIconView(); - RefreshManagePasswordsIconView(); + + RefreshBubbleIconViews(); + + // TODO(calamity): Refactor Update to use BubbleIconView::Refresh. RefreshFindBarIcon(); - if (star_view_) + if (star_view_) { + // TODO(calamity): Refactor Update to use BubbleIconView::Refresh. UpdateBookmarkStarVisibility(); + } if (contents) omnibox_view_->OnTabChanged(contents); @@ -710,6 +729,12 @@ } //////////////////////////////////////////////////////////////////////////////// +// LocationBarView, public BubbleIconView::Delegate implementation: +WebContents* LocationBarView::GetWebContentsForBubbleIconView() { + return GetWebContents(); +} + +//////////////////////////////////////////////////////////////////////////////// // LocationBarView, private: int LocationBarView::IncrementalMinimumWidth(views::View* view) const { @@ -770,6 +795,21 @@ return visibility_changed; } +bool LocationBarView::RefreshBubbleIconViews() { + if (extensions::HostedAppBrowserController::IsForExperimentalHostedAppBrowser( + browser_)) { + // For hosted apps, the location bar is normally hidden and icons appear in + // the window frame instead. + GetWidget()->non_client_view()->ResetWindowControls(); + } + + bool visibility_changed = false; + for (auto* v : bubble_icons_) { + visibility_changed |= v->Refresh(); + } + return visibility_changed; +} + bool LocationBarView::RefreshZoomView() { DCHECK(zoom_view_); WebContents* web_contents = GetWebContents(); @@ -807,26 +847,6 @@ #endif } -bool LocationBarView::RefreshSaveCreditCardIconView() { - WebContents* web_contents = GetWebContents(); - if (!save_credit_card_icon_view_ || !web_contents) - return false; - - const bool was_visible = save_credit_card_icon_view_->visible(); - // |controller| may be nullptr due to lazy initialization. - autofill::SaveCardBubbleControllerImpl* controller = - autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents); - bool enabled = controller && controller->IsIconVisible(); - if (!command_updater()->UpdateCommandEnabled( - IDC_SAVE_CREDIT_CARD_FOR_PAGE, enabled)) { - enabled = enabled && command_updater()->IsCommandEnabled( - IDC_SAVE_CREDIT_CARD_FOR_PAGE); - } - save_credit_card_icon_view_->SetVisible(enabled); - - return was_visible != save_credit_card_icon_view_->visible(); -} - bool LocationBarView::RefreshFindBarIcon() { // |browser_| may be nullptr since some unit tests pass it in for the // Browser*. |browser_->window()| may return nullptr because Update() is @@ -841,33 +861,6 @@ return was_visible != find_bar_icon_->visible(); } -void LocationBarView::RefreshTranslateIcon() { - WebContents* web_contents = GetWebContents(); - if (!web_contents) - return; - translate::LanguageState& language_state = - ChromeTranslateClient::FromWebContents(web_contents)->GetLanguageState(); - bool enabled = language_state.translate_enabled(); - if (!command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled)) { - enabled = enabled && command_updater()->IsCommandEnabled( - IDC_TRANSLATE_PAGE); - } - translate_icon_view_->SetVisible(enabled); - if (!enabled) - TranslateBubbleView::CloseCurrentBubble(); -} - -bool LocationBarView::RefreshManagePasswordsIconView() { - DCHECK(manage_passwords_icon_view_); - WebContents* web_contents = GetWebContents(); - if (!web_contents) - return false; - const bool was_visible = manage_passwords_icon_view_->visible(); - ManagePasswordsUIController::FromWebContents( - web_contents)->UpdateIconAndBubbleState(manage_passwords_icon_view_); - return was_visible != manage_passwords_icon_view_->visible(); -} - void LocationBarView::RefreshClearAllButtonIcon() { if (!clear_all_button_) return; @@ -959,14 +952,14 @@ } void LocationBarView::UpdateManagePasswordsIconAndBubble() { - if (RefreshManagePasswordsIconView()) { + if (manage_passwords_icon_view_->Refresh()) { Layout(); SchedulePaint(); } } void LocationBarView::UpdateSaveCreditCardIcon() { - if (RefreshSaveCreditCardIconView()) { + if (save_credit_card_icon_view_->Refresh()) { Layout(); SchedulePaint(); }
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index b11b7c55..aff087b 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h
@@ -19,6 +19,7 @@ #include "chrome/browser/ui/views/dropdown_bar_host.h" #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" #include "chrome/browser/ui/views/extensions/extension_popup.h" +#include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" #include "components/prefs/pref_member.h" @@ -31,7 +32,6 @@ #include "ui/views/controls/button/button.h" #include "ui/views/drag_controller.h" -class BubbleIconView; class CommandUpdater; class ContentSettingBubbleModelDelegate; class FindBarIcon; @@ -73,7 +73,8 @@ public DropdownBarHostDelegate, public zoom::ZoomEventManagerObserver, public views::ButtonListener, - public ContentSettingImageView::Delegate { + public ContentSettingImageView::Delegate, + public BubbleIconView::Delegate { public: class Delegate { public: @@ -172,6 +173,10 @@ // not where the icons are shown). gfx::Point GetOmniboxViewOrigin() const; + // Returns the inset from the edge of the location bar where text begins when + // only a location icon is showing (no security chip or keyword bubble). + int GetTextInsetForNormalInputStart() const; + // Shows |text| as an inline autocompletion. This is useful for IMEs, where // we can't show the autocompletion inside the actual OmniboxView. See // comments on |ime_inline_autocomplete_view_|. @@ -236,6 +241,9 @@ ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate() override; + // BubbleIconView::Delegate: + content::WebContents* GetWebContentsForBubbleIconView() override; + // ZoomEventManagerObserver: // Updates the view for the zoom icon when default zoom levels change. void OnDefaultZoomLevelChanged() override; @@ -271,22 +279,19 @@ // of at least one of the views in |content_setting_views_| changed. bool RefreshContentSettingViews(); + // Updates the visibility state of the BubbleIconView (page action) icons + // to reflect what actions are available on the current page. + // Returns true if the visibility of at least one of the views in + // |bubble_icons_| changed. + bool RefreshBubbleIconViews(); + // Updates the view for the zoom icon based on the current tab's zoom. Returns // true if the visibility of the view changed. bool RefreshZoomView(); - // Updates |save_credit_card_icon_view_|. Returns true if visibility changed. - bool RefreshSaveCreditCardIconView(); - // Updates |find_bar_icon_|. Returns true if visibility changed. bool RefreshFindBarIcon(); - // Updates the Translate icon based on the current tab's Translate status. - void RefreshTranslateIcon(); - - // Updates |manage_passwords_icon_view_|. Returns true if visibility changed. - bool RefreshManagePasswordsIconView(); - // Updates the color of the icon for the "clear all" button. void RefreshClearAllButtonIcon();
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc index a1a6fdd6..be2b23f 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -138,33 +138,26 @@ font_height_(std::max( font_list.GetHeight(), font_list.DeriveWithWeight(gfx::Font::Weight::BOLD).GetHeight())), - keyword_icon_(new views::ImageView()), - animation_(new gfx::SlideAnimation(this)) { + animation_(new gfx::SlideAnimation(this)), + icon_view_(AddImageView()), + image_view_(AddImageView()), + keyword_icon_view_(AddImageView()), + content_view_(AddOmniboxTextView(font_list)), + description_view_(AddOmniboxTextView(font_list)), + keyword_content_view_(AddOmniboxTextView(font_list)), + keyword_description_view_(AddOmniboxTextView(font_list)), + separator_view_(AddOmniboxTextView(font_list)) { CHECK_GE(model_index, 0); - keyword_icon_->set_owned_by_client(); - keyword_icon_->EnableCanvasFlippingForRTLUI(true); - keyword_icon_->SetImage(gfx::CreateVectorIcon( + keyword_icon_view_->EnableCanvasFlippingForRTLUI(true); + keyword_icon_view_->SetImage(gfx::CreateVectorIcon( omnibox::kKeywordSearchIcon, GetLayoutConstant(LOCATION_BAR_ICON_SIZE), GetVectorIconColor())); - keyword_icon_->SizeToPreferredSize(); + keyword_icon_view_->SizeToPreferredSize(); - if (OmniboxFieldTrial::InTabSwitchSuggestionWithButtonTrial()) { - tab_switch_button_.reset(new OmniboxTabSwitchButton(this)); - tab_switch_button_->set_owned_by_client(); - } - - content_view_ = new OmniboxTextView(this, font_list); - description_view_ = new OmniboxTextView(this, font_list); - keyword_content_view_ = new OmniboxTextView(this, font_list); - keyword_description_view_ = new OmniboxTextView(this, font_list); - separator_view_ = new OmniboxTextView(this, font_list); - - AddChildView(content_view_); - AddChildView(description_view_); - AddChildView(keyword_content_view_); - AddChildView(keyword_description_view_); - AddChildView(separator_view_); + tab_switch_button_ = new OmniboxTabSwitchButton(this); + AddChildView(tab_switch_button_); + tab_switch_button_->SetVisible(false); } OmniboxResultView::~OmniboxResultView() {} @@ -188,27 +181,15 @@ void OmniboxResultView::SetMatch(const AutocompleteMatch& match) { match_ = match.GetMatchWithContentsAndDescriptionPossiblySwapped(); animation_->Reset(); - answer_image_ = gfx::ImageSkia(); is_hovered_ = false; + icon_view_->SetImage(GetIcon().ToImageSkia()); + image_view_->SetVisible(false); // Until SetAnswerImage is called. - AutocompleteMatch* associated_keyword_match = match_.associated_keyword.get(); - if (associated_keyword_match) { - if (!keyword_icon_->parent()) - AddChildView(keyword_icon_.get()); - } else if (keyword_icon_->parent()) { - RemoveChildView(keyword_icon_.get()); + keyword_icon_view_->SetVisible(match_.associated_keyword.get()); + if (OmniboxFieldTrial::InTabSwitchSuggestionWithButtonTrial()) { + tab_switch_button_->SetVisible(match.type == + AutocompleteMatchType::TAB_SEARCH); } - if (tab_switch_button_) { - if (match.type == AutocompleteMatchType::TAB_SEARCH && - !keyword_icon_->parent()) { - if (!tab_switch_button_->parent()) { - AddChildView(tab_switch_button_.get()); - } - } else if (tab_switch_button_->parent()) { - RemoveChildView(tab_switch_button_.get()); - } - } - Invalidate(); if (GetWidget()) Layout(); @@ -275,12 +256,12 @@ return is_hovered_ ? HOVERED : NORMAL; } -OmniboxState OmniboxResultView::GetThemeState() const { +OmniboxPartState OmniboxResultView::GetThemeState() const { if (model_->IsSelectedIndex(model_index_)) { - return is_hovered_ ? OmniboxState::HOVERED_AND_SELECTED - : OmniboxState::SELECTED; + return is_hovered_ ? OmniboxPartState::HOVERED_AND_SELECTED + : OmniboxPartState::SELECTED; } - return is_hovered_ ? OmniboxState::HOVERED : OmniboxState::NORMAL; + return is_hovered_ ? OmniboxPartState::HOVERED : OmniboxPartState::NORMAL; } OmniboxTint OmniboxResultView::GetTint() const { @@ -293,7 +274,8 @@ } void OmniboxResultView::SetAnswerImage(const gfx::ImageSkia& image) { - answer_image_ = image; + image_view_->SetImage(image); + image_view_->SetVisible(true); Layout(); SchedulePaint(); } @@ -318,12 +300,12 @@ if (event.IsOnlyLeftMouseButton()) { if (GetState() != SELECTED) model_->SetSelectedLine(model_index_); - if (tab_switch_button_ && tab_switch_button_->parent()) { + if (tab_switch_button_->visible()) { gfx::Point point_in_child_coords(event.location()); - View::ConvertPointToTarget(this, tab_switch_button_.get(), + View::ConvertPointToTarget(this, tab_switch_button_, &point_in_child_coords); if (tab_switch_button_->HitTestPoint(point_in_child_coords)) { - SetMouseHandler(tab_switch_button_.get()); + SetMouseHandler(tab_switch_button_); return false; } } @@ -400,6 +382,19 @@ //////////////////////////////////////////////////////////////////////////////// // OmniboxResultView, private: +views::ImageView* OmniboxResultView::AddImageView() { + views::ImageView* view = new views::ImageView(); + AddChildView(view); + return view; +} + +OmniboxTextView* OmniboxResultView::AddOmniboxTextView( + const gfx::FontList& font_list) { + OmniboxTextView* view = new OmniboxTextView(this, font_list); + AddChildView(view); + return view; +} + int OmniboxResultView::GetTextHeight() const { return font_height_ + kVerticalPadding; } @@ -418,7 +413,7 @@ bool OmniboxResultView::ShowOnlyKeywordMatch() const { return match_.associated_keyword && - (keyword_icon_->x() <= icon_bounds_.right()); + (keyword_icon_view_->x() <= (icon_view_->x() + icon_view_->width())); } int OmniboxResultView::GetAnswerHeight() const { @@ -427,11 +422,9 @@ GetLayoutConstant(LOCATION_BAR_ICON_INTERIOR_PADDING); const gfx::Image icon = GetIcon(); int icon_width = icon.Width(); - int answer_icon_size = - answer_image_.isNull() - ? 0 - : answer_icon_size = - description_view_->GetLineHeight() + kAnswerIconToTextPadding; + int answer_icon_size = image_view_->visible() + ? image_view_->height() + kAnswerIconToTextPadding + : 0; // TODO(dschuyler): The GetIconAlignmentOffset() is applied an extra time to // match the math in Layout(). This seems like a (minor) mistake. int deduction = (GetIconAlignmentOffset() * 2) + icon_width + @@ -482,8 +475,9 @@ const gfx::Image icon = GetIcon(); const int icon_y = GetVerticalMargin() + (row_height - icon.Height()) / 2; - icon_bounds_.SetRect(start_x, icon_y, icon.Width(), icon.Height()); + icon_view_->SetBounds(start_x, icon_y, icon.Width(), icon.Height()); + icon_view_->SetVisible(!ShowOnlyKeywordMatch()); separator_view_->SetVisible(false); // TODO(dschuyler): Refactor these if/else's into separate pieces of code to @@ -492,14 +486,14 @@ AutocompleteMatch* keyword_match = match_.associated_keyword.get(); if (keyword_match) { // NOTE: While animating the keyword match, both matches may be visible. - const int max_kw_x = end_x - keyword_icon_->width(); + const int max_kw_x = end_x - keyword_icon_view_->width(); int kw_x = animation_->CurrentValueBetween(max_kw_x, start_x); end_x = kw_x; int y = GetVerticalMargin(); kw_x += BackgroundWith1PxBorder::kLocationBarBorderThicknessDip; - keyword_icon_->SetPosition( - gfx::Point(kw_x, (height() - keyword_icon_->height()) / 2)); - kw_x += keyword_icon_->width() + horizontal_padding; + keyword_icon_view_->SetPosition( + gfx::Point(kw_x, (height() - keyword_icon_view_->height()) / 2)); + kw_x += keyword_icon_view_->width() + horizontal_padding; keyword_content_view_->SizeToPreferredSize(); int first_width = keyword_content_view_->GetContentsBounds().width(); @@ -526,7 +520,8 @@ } } - if (tab_switch_button_ && match_.type == AutocompleteMatchType::TAB_SEARCH) { + if (OmniboxFieldTrial::InTabSwitchSuggestionWithButtonTrial() && + match_.type == AutocompleteMatchType::TAB_SEARCH) { const int ts_button_width = tab_switch_button_->GetPreferredSize().width(); const int ts_button_height = height(); tab_switch_button_->SetSize(gfx::Size(ts_button_width, ts_button_height)); @@ -544,17 +539,18 @@ int y = GetVerticalMargin(); if (match_.answer) { content_view_->SetBounds(x, y, end_x - x, text_height); - int answer_icon_size = 0; - if (!answer_image_.isNull()) { + y += text_height; + if (image_view_->visible()) { // The description may be multi-line. Using the view height results in // an image that's too large, so we use the line height here instead. - answer_icon_size = description_view_->GetLineHeight(); - answer_icon_bounds_.SetRect(x, y + (kVerticalPadding / 2) + text_height, - answer_icon_size, answer_icon_size); - answer_icon_size += kAnswerIconToTextPadding; + int image_edge_length = description_view_->GetLineHeight(); + image_view_->SetBounds( + start_x + icon_view_->width() + horizontal_padding, + y + (kVerticalPadding / 2), image_edge_length, image_edge_length); + image_view_->SetImageSize( + gfx::Size(image_edge_length, image_edge_length)); + x += image_view_->width() + kAnswerIconToTextPadding; } - x += answer_icon_size; - y += GetTextHeight(); int description_width = end_x - x; description_view_->SetBounds( x, y, description_width, @@ -609,20 +605,6 @@ Layout(); } -void OmniboxResultView::OnPaint(gfx::Canvas* canvas) { - View::OnPaint(canvas); - if (!ShowOnlyKeywordMatch()) { - canvas->DrawImageInt(GetIcon().AsImageSkia(), - GetMirroredXForRect(icon_bounds_), icon_bounds_.y()); - if (!answer_image_.isNull()) { - canvas->DrawImageInt(answer_image_, 0, 0, answer_image_.width(), - answer_image_.height(), answer_icon_bounds_.x(), - answer_icon_bounds_.y(), answer_icon_bounds_.width(), - answer_icon_bounds_.height(), true); - } - } -} - //////////////////////////////////////////////////////////////////////////////// // OmniboxResultView, gfx::AnimationProgressed overrides, private:
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.h b/chrome/browser/ui/views/omnibox/omnibox_result_view.h index 6acf300..3dc6cb7 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.h +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.h
@@ -22,11 +22,10 @@ #include "ui/views/view.h" class OmniboxPopupContentsView; -enum class OmniboxState; +enum class OmniboxPartState; enum class OmniboxTint; namespace gfx { -class Canvas; class Image; } @@ -38,7 +37,7 @@ public: // Keep these ordered from least dominant (normal) to most dominant // (selected). - // TODO(tapted): Remove these: replace with OmniboxState. + // TODO(tapted): Remove these: replace with OmniboxPartState. enum ResultViewState { NORMAL = 0, HOVERED, @@ -74,7 +73,7 @@ void OnSelected(); ResultViewState GetState() const; - OmniboxState GetThemeState() const; + OmniboxPartState GetThemeState() const; OmniboxTint GetTint() const; // Notification that the match icon has changed and schedules a repaint. @@ -97,6 +96,10 @@ void OnNativeThemeChanged(const ui::NativeTheme* theme) override; private: + // Create instance and add it as a child. + views::ImageView* AddImageView(); + OmniboxTextView* AddOmniboxTextView(const gfx::FontList& font_list); + // Returns the height of the text portion of the result view. int GetTextHeight() const; @@ -122,7 +125,6 @@ void Layout() override; const char* GetClassName() const override; void OnBoundsChanged(const gfx::Rect& previous_bounds) override; - void OnPaint(gfx::Canvas* canvas) override; // gfx::AnimationDelegate: void AnimationProgressed(const gfx::Animation* animation) override; @@ -137,25 +139,22 @@ // Cache the font height as a minor optimization. int font_height_; + // The data this class is built to display (the "Omnibox Result"). AutocompleteMatch match_; - gfx::Rect answer_icon_bounds_; - gfx::Rect icon_bounds_; - - std::unique_ptr<views::ImageView> keyword_icon_; - std::unique_ptr<OmniboxTabSwitchButton> tab_switch_button_; - + // For sliding in the keyword search. std::unique_ptr<gfx::SlideAnimation> animation_; - // If the answer has an icon, cache the image. - gfx::ImageSkia answer_image_; - // Weak pointers for easy reference. + views::ImageView* icon_view_; // Small icon. e.g. favicon. + views::ImageView* image_view_; // Larger image for rich suggestions. + views::ImageView* keyword_icon_view_; // An icon resembling a '>'. + OmniboxTabSwitchButton* tab_switch_button_; OmniboxTextView* content_view_; OmniboxTextView* description_view_; OmniboxTextView* keyword_content_view_; OmniboxTextView* keyword_description_view_; - OmniboxTextView* separator_view_; + OmniboxTextView* separator_view_; // e.g. A hyphen. DISALLOW_COPY_AND_ASSIGN(OmniboxResultView); };
diff --git a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc index 463d97a..ed02820 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.cc
@@ -15,27 +15,27 @@ #include "ui/views/controls/button/label_button_border.h" OmniboxTabSwitchButton::OmniboxTabSwitchButton(OmniboxResultView* result_view) - : LabelButton(this, base::ASCIIToUTF16("Switch to open tab")), + : MdTextButton(this, views::style::CONTEXT_BUTTON_MD), result_view_(result_view) { // TODO: SetTooltipText(text); // SetImageAlignment(ALIGN_CENTER, ALIGN_MIDDLE); SetBackground(std::make_unique<BackgroundWith1PxBorder>(GetBackgroundColor(), SK_ColorBLACK)); + SetBgColorOverride(GetBackgroundColor()); SetImage(STATE_NORMAL, gfx::CreateVectorIcon(omnibox::kSwitchIcon, 16, SK_ColorBLACK)); + SetText(base::ASCIIToUTF16("Switch to open tab")); } void OmniboxTabSwitchButton::SetPressed() { - // Using transparent does nothing, since the result view is also selected. - background()->SetNativeControlColor(color_utils::AlphaBlend( - GetOmniboxColor(OmniboxPart::RESULTS_BACKGROUND, result_view_->GetTint()), + SetBgColorOverride(color_utils::AlphaBlend( + GetOmniboxColor(OmniboxPart::RESULTS_BACKGROUND, result_view_->GetTint(), + OmniboxPartState::SELECTED), SK_ColorBLACK, 0.8 * 255)); - SchedulePaint(); } void OmniboxTabSwitchButton::ClearState() { - background()->SetNativeControlColor(GetBackgroundColor()); - SchedulePaint(); + SetBgColorOverride(GetBackgroundColor()); } bool OmniboxTabSwitchButton::OnMousePressed(const ui::MouseEvent& event) { @@ -67,7 +67,7 @@ } gfx::Size OmniboxTabSwitchButton::CalculatePreferredSize() const { - gfx::Size size = LabelButton::CalculatePreferredSize(); + gfx::Size size = MdTextButton::CalculatePreferredSize(); const int horizontal_padding = GetLayoutConstant(LOCATION_BAR_PADDING) + GetLayoutConstant(LOCATION_BAR_ICON_INTERIOR_PADDING); @@ -76,12 +76,13 @@ } void OmniboxTabSwitchButton::StateChanged(ButtonState old_state) { - background()->SetNativeControlColor(GetBackgroundColor()); - LabelButton::StateChanged(old_state); + SetBgColorOverride(GetBackgroundColor()); + MdTextButton::StateChanged(old_state); } SkColor OmniboxTabSwitchButton::GetBackgroundColor() const { - return GetOmniboxColor( - OmniboxPart::RESULTS_BACKGROUND, result_view_->GetTint(), - state() == STATE_HOVERED ? OmniboxState::HOVERED : OmniboxState::NORMAL); + return GetOmniboxColor(OmniboxPart::RESULTS_BACKGROUND, + result_view_->GetTint(), + state() == STATE_HOVERED ? OmniboxPartState::HOVERED + : OmniboxPartState::NORMAL); }
diff --git a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h index d2e9a72..ebc4717 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h +++ b/chrome/browser/ui/views/omnibox/omnibox_tab_switch_button.h
@@ -5,11 +5,11 @@ #ifndef CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_TAB_SWITCH_BUTTON_H_ #define CHROME_BROWSER_UI_VIEWS_OMNIBOX_OMNIBOX_TAB_SWITCH_BUTTON_H_ -#include "ui/views/controls/button/label_button.h" +#include "ui/views/controls/button/md_text_button.h" class OmniboxResultView; -class OmniboxTabSwitchButton : public views::LabelButton, +class OmniboxTabSwitchButton : public views::MdTextButton, public views::ButtonListener { public: explicit OmniboxTabSwitchButton(OmniboxResultView* result_view);
diff --git a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc index 370a14a..5bc8a1da 100644 --- a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc +++ b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.cc
@@ -7,6 +7,7 @@ #include "build/build_config.h" #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/omnibox/omnibox_theme.h" +#include "chrome/browser/ui/views/frame/browser_view.h" #include "chrome/browser/ui/views/location_bar/background_with_1_px_border.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "ui/compositor/layer.h" @@ -24,12 +25,41 @@ // Value from the spec controlling appearance of the shadow. constexpr int kElevation = 16; +// The layout height (in DIPs) of the view drawing the separator above results. +// The top of this view aligns with the bottom edge of the location bar. +constexpr int kSeparatorViewHeightDIP = 1; + +// View at the top of the frame which paints transparent pixels to make a hole +// so that the location bar shows through. +class TopBackgroundView : public views::View { + public: + explicit TopBackgroundView(SkColor color) { + auto background = + std::make_unique<BackgroundWith1PxBorder>(SK_ColorTRANSPARENT, color); + background->set_blend_mode(SkBlendMode::kSrc); + SetBackground(std::move(background)); + } +}; + +class SeparatorView : public views::View { + public: + explicit SeparatorView(SkColor color) : color_(color) {} + + // Views:View: + void OnPaint(gfx::Canvas* canvas) override { + BrowserView::Paint1pxHorizontalLine(canvas, color_, GetLocalBounds(), true); + } + + private: + const SkColor color_; +}; + // Insets used to position |contents_| within |contents_host_|. gfx::Insets GetContentInsets(views::View* location_bar) { return gfx::Insets( RoundedOmniboxResultsFrame::kLocationBarAlignmentInsets.top(), 0, 0, 0) + - gfx::Insets(location_bar->height(), 0, 0, 0); + gfx::Insets(location_bar->height() + kSeparatorViewHeightDIP, 0, 0, 0); } #if defined(USE_AURA) @@ -51,7 +81,10 @@ RoundedOmniboxResultsFrame::RoundedOmniboxResultsFrame( views::View* contents, LocationBarView* location_bar) - : content_insets_(GetContentInsets(location_bar)), contents_(contents) { + : content_insets_(GetContentInsets(location_bar)), + location_bar_height_(location_bar->height()), + separator_inset_(location_bar->GetTextInsetForNormalInputStart()), + contents_(contents) { // Host the contents in its own View to simplify layout and clipping. contents_host_ = new views::View(); contents_host_->SetPaintToLayer(); @@ -73,19 +106,13 @@ contents_mask_->layer()->SetFillsBoundsOpaquely(false); contents_host_->layer()->SetMaskLayer(contents_mask_->layer()); - // Paint the omnibox border with transparent pixels to make a hole. - views::View* top_background = new views::View(); - auto background = std::make_unique<BackgroundWith1PxBorder>( - SK_ColorTRANSPARENT, background_color); - background->set_blend_mode(SkBlendMode::kSrc); - top_background->SetBackground(std::move(background)); - gfx::Size location_bar_size = location_bar->bounds().size(); - top_background->SetBounds( - kLocationBarAlignmentInsets.left(), kLocationBarAlignmentInsets.top(), - location_bar_size.width(), location_bar_size.height()); - - contents_host_->AddChildView(top_background); + top_background_ = new TopBackgroundView(background_color); + separator_ = new SeparatorView( + GetOmniboxColor(OmniboxPart::RESULTS_SEPARATOR, location_bar->tint())); + contents_host_->AddChildView(top_background_); + contents_host_->AddChildView(separator_); contents_host_->AddChildView(contents_); + AddChildView(contents_host_); } @@ -118,9 +145,20 @@ // the Widget is fast on ChromeOS, but slow on other platforms, and can't be // animated smoothly. // TODO(tapted): Investigate using a static Widget size. - gfx::Rect bounds = GetLocalBounds(); + const gfx::Rect bounds = GetLocalBounds(); contents_host_->SetBoundsRect(bounds); - contents_mask_->layer()->SetBounds(gfx::Rect(bounds.size())); + contents_mask_->layer()->SetBounds(bounds); + + // Manual layout. + gfx::Rect top_bounds = bounds; + top_bounds.Inset(kLocationBarAlignmentInsets); + top_bounds.set_height(location_bar_height_); + top_background_->SetBoundsRect(top_bounds); + + top_bounds.set_y(top_bounds.bottom()); // Shift down. + top_bounds.Inset(separator_inset_, 0); // Inset the width further. + top_bounds.set_height(kSeparatorViewHeightDIP); + separator_->SetBoundsRect(top_bounds); gfx::Rect results_bounds = gfx::Rect(bounds.size()); results_bounds.Inset(content_insets_);
diff --git a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h index d5267b5..fd3f5df 100644 --- a/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h +++ b/chrome/browser/ui/views/omnibox/rounded_omnibox_results_frame.h
@@ -37,10 +37,15 @@ void AddedToWidget() override; private: + // Fixed layout constants. const gfx::Insets content_insets_; + const int location_bar_height_; + const int separator_inset_; std::unique_ptr<ui::LayerOwner> contents_mask_; + views::View* top_background_ = nullptr; + views::View* separator_ = nullptr; views::View* contents_ = nullptr; views::View* contents_host_ = nullptr;
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc index b162963..2425a7b 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
@@ -11,7 +11,6 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/display/manager/display_manager.h" #include "ui/display/screen.h" -#include "ui/views/widget/widget.h" #include "ui/views/widget/widget_delegate.h" // static @@ -29,7 +28,7 @@ ~OverlayWindowWidgetDelegate() override = default; // views::WidgetDelegate: - bool CanResize() const override { return false; } + bool CanResize() const override { return true; } ui::ModalType GetModalType() const override { return ui::MODAL_TYPE_SYSTEM; } base::string16 GetWindowTitle() const override { return l10n_util::GetStringUTF16(IDS_PICTURE_IN_PICTURE_TITLE_TEXT); @@ -45,66 +44,59 @@ DISALLOW_COPY_AND_ASSIGN(OverlayWindowWidgetDelegate); }; -OverlayWindowViews::OverlayWindowViews() { - widget_.reset(new views::Widget()); -} - OverlayWindowViews::~OverlayWindowViews() = default; -void OverlayWindowViews::Init() { - views::Widget::InitParams params( - views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); - params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; - - // These bounds are arbitrary. See OverlayWindowWidget for specified - // constraints. The initial positioning is on the bottom right quadrant - // of the primary display work area. - // The size is a temporary placeholder while video size is currently unused. - // This should also use the display of the initiating WebContents. - // http://crbug/726621 - gfx::Size size(500, 300); +gfx::Rect OverlayWindowViews::CalculateAndUpdateBounds() { gfx::Rect work_area = display::Screen::GetScreen()->GetPrimaryDisplay().work_area(); - int window_diff_width = work_area.width() - size.width(); - int window_diff_height = work_area.height() - size.height(); + + // Upper bound size of the window is 50% of the display width and height. + max_size_ = gfx::Size(work_area.width() / 2, work_area.height() / 2); + + // Lower bound size of the window is a fixed value to allow for minimal sizes + // on UI affordances, such as buttons. This is currently a placeholder value. + min_size_ = gfx::Size(144, 100); + + // Initial size of the window is always 20% of the display width and height, + // constrained by the min and max sizes. Only explicitly update this the first + // time |current_size_| is being calculated. + if (current_size_.IsEmpty()) + current_size_ = gfx::Size(work_area.width() / 5, work_area.height() / 5); + + // TODO(apacible): Take into account the video aspect ratio. + current_size_.set_width(std::min( + max_size_.width(), std::max(min_size_.width(), current_size_.width()))); + current_size_.set_height( + std::min(max_size_.height(), + std::max(min_size_.height(), current_size_.height()))); + + // The initial positioning is on the bottom right quadrant + // of the primary display work area. + int window_diff_width = work_area.width() - current_size_.width(); + int window_diff_height = work_area.height() - current_size_.height(); + // Keep a margin distance of 2% the average of the two window size // differences, keeping the margins consistent. int buffer = (window_diff_width + window_diff_height) / 2 * 0.02; - params.bounds = gfx::Rect( + return gfx::Rect( gfx::Point(window_diff_width - buffer, window_diff_height - buffer), - size); - - params.keep_on_top = true; - params.visible_on_all_workspaces = true; - - // Set WidgetDelegate for more control over |widget_|. - params.delegate = new OverlayWindowWidgetDelegate(widget_.get()); - - widget_->Init(params); + current_size_); } bool OverlayWindowViews::IsActive() const { - return widget_->IsActive(); + return views::Widget::IsActive(); } void OverlayWindowViews::Show() { - widget_->Show(); -} - -void OverlayWindowViews::Hide() { - widget_->Hide(); + views::Widget::Show(); } void OverlayWindowViews::Close() { - widget_->Close(); + views::Widget::Close(); } -void OverlayWindowViews::Activate() { - widget_->Activate(); -} - -bool OverlayWindowViews::IsVisible() { - return widget_->IsVisible(); +bool OverlayWindowViews::IsVisible() const { + return views::Widget::IsVisible(); } bool OverlayWindowViews::IsAlwaysOnTop() const { @@ -112,13 +104,38 @@ } ui::Layer* OverlayWindowViews::GetLayer() { - return widget_->GetLayer(); -} - -gfx::NativeWindow OverlayWindowViews::GetNativeWindow() const { - return widget_->GetNativeWindow(); + return views::Widget::GetLayer(); } gfx::Rect OverlayWindowViews::GetBounds() const { - return widget_->GetRestoredBounds(); + return views::Widget::GetRestoredBounds(); +} + +gfx::Size OverlayWindowViews::GetMinimumSize() const { + return min_size_; +} + +gfx::Size OverlayWindowViews::GetMaximumSize() const { + return max_size_; +} + +void OverlayWindowViews::OnNativeWidgetWorkspaceChanged() { + // TODO(apacible): Update sizes and maybe resize the current + // Picture-in-Picture window. Currently, switching between workspaces on linux + // does not trigger this function. http://crbug.com/819673 +} + +OverlayWindowViews::OverlayWindowViews() { + // TODO(apacible): Change window type to TYPE_WINDOW_FRAMELESS. It is + // temporarily TYPE_WINDOW for resizing purposes. + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); + params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; + params.bounds = CalculateAndUpdateBounds(); + params.keep_on_top = true; + params.visible_on_all_workspaces = true; + + // Set WidgetDelegate for more control over |widget_|. + params.delegate = new OverlayWindowWidgetDelegate(this); + + Init(params); }
diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.h b/chrome/browser/ui/views/overlay/overlay_window_views.h index d0ef3ef..17dbbde6 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_views.h +++ b/chrome/browser/ui/views/overlay/overlay_window_views.h
@@ -7,31 +7,45 @@ #include "chrome/browser/overlay/overlay_window.h" -namespace views { -class Widget; -} +#include "ui/gfx/geometry/size.h" +#include "ui/views/widget/widget.h" // The Views implementation of OverlayWindow. -class OverlayWindowViews : public OverlayWindow { +class OverlayWindowViews : public OverlayWindow, public views::Widget { public: OverlayWindowViews(); ~OverlayWindowViews() override; // OverlayWindow: - void Init() override; bool IsActive() const override; void Show() override; - void Hide() override; void Close() override; - void Activate() override; - bool IsVisible() override; + bool IsVisible() const override; bool IsAlwaysOnTop() const override; ui::Layer* GetLayer() override; - gfx::NativeWindow GetNativeWindow() const override; gfx::Rect GetBounds() const override; + // views::Widget: + gfx::Size GetMinimumSize() const override; + gfx::Size GetMaximumSize() const override; + void OnNativeWidgetWorkspaceChanged() override; + private: - std::unique_ptr<views::Widget> widget_; + // Determine the intended bounds of |this|. This should be called when there + // is reason for the bounds to change, such as switching primary displays or + // playing a new video (i.e. different aspect ratio). This also updates + // |min_size_| and |max_size_|. + gfx::Rect CalculateAndUpdateBounds(); + + // The upper and lower bounds of |current_size_|. These are determined by the + // size of the primary display work area when Picture-in-Picture is initiated. + // TODO(apacible): Update these bounds when the display the window is on + // changes. http://crbug.com/819673 + gfx::Size min_size_; + gfx::Size max_size_; + + // Current size of the Picture-in-Picture window. + gfx::Size current_size_; DISALLOW_COPY_AND_ASSIGN(OverlayWindowViews); };
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc index a5bc63a..3860938 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.cc
@@ -6,17 +6,20 @@ #include "chrome/app/chrome_command_ids.h" #include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/command_updater.h" #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" #include "chrome/browser/ui/views/passwords/password_bubble_view_base.h" #include "chrome/grit/generated_resources.h" #include "components/password_manager/core/common/password_manager_ui.h" +#include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -ManagePasswordsIconViews::ManagePasswordsIconViews(CommandUpdater* updater) - : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE), +ManagePasswordsIconViews::ManagePasswordsIconViews( + CommandUpdater* updater, + BubbleIconView::Delegate* delegate) + : BubbleIconView(updater, IDC_MANAGE_PASSWORDS_FOR_PAGE, delegate), state_(password_manager::ui::INACTIVE_STATE) { + DCHECK(delegate); #if defined(OS_MACOSX) SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); #else @@ -56,6 +59,20 @@ parent()->Layout(); } +views::BubbleDialogDelegateView* ManagePasswordsIconViews::GetBubble() const { + return PasswordBubbleViewBase::manage_password_bubble(); +} + +bool ManagePasswordsIconViews::Refresh() { + if (!GetWebContents()) + return false; + + const bool was_visible = visible(); + ManagePasswordsUIController::FromWebContents(GetWebContents()) + ->UpdateIconAndBubbleState(this); + return was_visible != visible(); +} + void ManagePasswordsIconViews::OnExecuting( BubbleIconView::ExecuteSource source) {} @@ -79,10 +96,6 @@ return BubbleIconView::OnKeyPressed(event); } -views::BubbleDialogDelegateView* ManagePasswordsIconViews::GetBubble() const { - return PasswordBubbleViewBase::manage_password_bubble(); -} - const gfx::VectorIcon& ManagePasswordsIconViews::GetVectorIcon() const { return kKeyIcon; }
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h index d39b4052..663e26f 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_views.h
@@ -18,17 +18,19 @@ class ManagePasswordsIconViews : public ManagePasswordsIconView, public BubbleIconView { public: - explicit ManagePasswordsIconViews(CommandUpdater* updater); + ManagePasswordsIconViews(CommandUpdater* updater, + BubbleIconView::Delegate* delegate); ~ManagePasswordsIconViews() override; // ManagePasswordsIconView: void SetState(password_manager::ui::State state) override; // BubbleIconView: + views::BubbleDialogDelegateView* GetBubble() const override; + bool Refresh() override; void OnExecuting(BubbleIconView::ExecuteSource source) override; bool OnMousePressed(const ui::MouseEvent& event) override; bool OnKeyPressed(const ui::KeyEvent& event) override; - views::BubbleDialogDelegateView* GetBubble() const override; const gfx::VectorIcon& GetVectorIcon() const override; // views::View:
diff --git a/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc b/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc index 2a9667cb..7f203003 100644 --- a/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc +++ b/chrome/browser/ui/views/payments/payment_request_payment_app_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/macros.h" +#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/permissions/permission_request_manager.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -10,6 +11,7 @@ #include "chrome/browser/ui/views/payments/payment_request_dialog_view_ids.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/network_session_configurator/common/network_switches.h" #include "components/payments/content/service_worker_payment_app_factory.h" #include "components/payments/core/test_payment_manifest_downloader.h" @@ -71,6 +73,14 @@ << contents; } + void BlockAlicePay() { + GURL origin = alicepay_.GetURL("alicepay.com", "/app1/").GetOrigin(); + HostContentSettingsMapFactory::GetForProfile(browser()->profile()) + ->SetContentSettingDefaultScope(origin, origin, + CONTENT_SETTINGS_TYPE_PAYMENT_HANDLER, + std::string(), CONTENT_SETTING_BLOCK); + } + // Sets a TestDownloader for alicepay.com, bobpay.com and frankpay.com to // ServiceWorkerPaymentAppFactory, and ignores port in app scope. void SetDownloaderAndIgnorePortInAppScopeForTesting() { @@ -223,6 +233,57 @@ } } +// Test payment apps are not available if they are blocked. +IN_PROC_BROWSER_TEST_F(PaymentRequestPaymentAppTest, BlockAlicePay) { + InstallAlicePayForMethod("https://alicepay.com"); + BlockAlicePay(); + + { + SetDownloaderAndIgnorePortInAppScopeForTesting(); + + NavigateTo("/payment_request_bobpay_test.html"); + + ResetEventWaiterForSequence({DialogEvent::CAN_MAKE_PAYMENT_CALLED, + DialogEvent::CAN_MAKE_PAYMENT_RETURNED}); + ASSERT_TRUE( + content::ExecuteScript(GetActiveWebContents(), "canMakePayment();")); + WaitForObservedEvent(); + ExpectBodyContains({"false"}); + + // A new payment request will be created below, so call + // SetDownloaderAndIgnorePortInAppScopeForTesting again. + SetDownloaderAndIgnorePortInAppScopeForTesting(); + + ResetEventWaiter(DialogEvent::NOT_SUPPORTED_ERROR); + ASSERT_TRUE(content::ExecuteScript(GetActiveWebContents(), "buy();")); + WaitForObservedEvent(); + ExpectBodyContains({"NotSupportedError"}); + } + + // Repeat should have identical results. + { + SetDownloaderAndIgnorePortInAppScopeForTesting(); + + NavigateTo("/payment_request_bobpay_test.html"); + + ResetEventWaiterForSequence({DialogEvent::CAN_MAKE_PAYMENT_CALLED, + DialogEvent::CAN_MAKE_PAYMENT_RETURNED}); + ASSERT_TRUE( + content::ExecuteScript(GetActiveWebContents(), "canMakePayment();")); + WaitForObservedEvent(); + ExpectBodyContains({"false"}); + + // A new payment request will be created below, so call + // SetDownloaderAndIgnorePortInAppScopeForTesting again. + SetDownloaderAndIgnorePortInAppScopeForTesting(); + + ResetEventWaiter(DialogEvent::NOT_SUPPORTED_ERROR); + ASSERT_TRUE(content::ExecuteScript(GetActiveWebContents(), "buy();")); + WaitForObservedEvent(); + ExpectBodyContains({"NotSupportedError"}); + } +} + // Test https://bobpay.com can not be used by https://alicepay.com IN_PROC_BROWSER_TEST_F(PaymentRequestPaymentAppTest, CanNotPayWithBobPay) { InstallAlicePayForMethod("https://bobpay.com");
diff --git a/chrome/browser/ui/views/profiles/dice_accounts_menu.cc b/chrome/browser/ui/views/profiles/dice_accounts_menu.cc index e7f5846..6e59c69 100644 --- a/chrome/browser/ui/views/profiles/dice_accounts_menu.cc +++ b/chrome/browser/ui/views/profiles/dice_accounts_menu.cc
@@ -87,8 +87,8 @@ void DiceAccountsMenu::Show(views::View* anchor_view) { DCHECK(!runner_); - runner_ = std::make_unique<views::MenuRunner>( - &menu_, views::MenuRunner::COMBOBOX | views::MenuRunner::ALWAYS_VIEWS); + runner_ = + std::make_unique<views::MenuRunner>(&menu_, views::MenuRunner::COMBOBOX); // Calculate custom anchor bounds to position the menu. // The menu is aligned along the right edge (left edge in RTL mode) of the // anchor, slightly shifted inside by |kAnchorInset| and overlapping
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc index 73039a7e..1c95793b 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -49,7 +49,7 @@ #include "chrome/browser/ui/views/profiles/badged_profile_photo.h" #include "chrome/browser/ui/views/profiles/signin_view_controller_delegate_views.h" #include "chrome/browser/ui/views/profiles/user_manager_view.h" -#include "chrome/browser/ui/views/sync/dice_signin_button.h" +#include "chrome/browser/ui/views/sync/dice_signin_button_view.h" #include "chrome/browser/ui/webui/signin/login_ui_service.h" #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" #include "chrome/common/pref_names.h" @@ -392,6 +392,7 @@ remove_account_button_ = nullptr; account_removal_cancel_button_ = nullptr; sync_to_another_account_button_ = nullptr; + dice_signin_button_view_ = nullptr; } void ProfileChooserView::Init() { @@ -670,11 +671,10 @@ } else if (sender == signin_current_profile_button_) { ShowViewFromMode(profiles::BUBBLE_VIEW_MODE_GAIA_SIGNIN); } else if (sender == signin_with_gaia_account_button_) { - DCHECK(signin_with_gaia_account_button_->account()); + DCHECK(dice_signin_button_view_->account()); Hide(); signin_ui_util::EnableSync( - browser_, signin_with_gaia_account_button_->account().value(), - access_point_); + browser_, dice_signin_button_view_->account().value(), access_point_); } else if (sender == sync_to_another_account_button_) { // Extract the promo accounts for the submenu, i.e. remove the first // one from the list because it is already shown in a separate button. @@ -1079,19 +1079,13 @@ promotext_top_spacing, kMenuEdgeMargin, 0, kMenuEdgeMargin)); view->AddChildView(promo); - // Create a parent view with border for the sign-in button, because - // |DiceSigninButton| already has its own border and a second border can't be - // added. - views::View* signin_button_view = new views::View(); - signin_button_view->SetLayoutManager(std::make_unique<views::FillLayout>()); - signin_button_view->SetBorder( - views::CreateSolidBorder(kMenuEdgeMargin, SK_ColorTRANSPARENT)); - if (!show_personalized_promo) { // Create a sign-in button without account information. - signin_current_profile_button_ = new DiceSigninButton(this); - signin_button_view->AddChildView(signin_current_profile_button_); - view->AddChildView(signin_button_view); + dice_signin_button_view_ = new DiceSigninButtonView(this); + dice_signin_button_view_->SetBorder( + views::CreateEmptyBorder(gfx::Insets(kMenuEdgeMargin))); + view->AddChildView(dice_signin_button_view_); + signin_current_profile_button_ = dice_signin_button_view_->signin_button(); return view; } // Create a button to sign in the first account of @@ -1104,12 +1098,12 @@ account_icon = ui::ResourceBundle::GetSharedInstance().GetImageNamed( profiles::GetPlaceholderAvatarIconResourceID()); } - signin_with_gaia_account_button_ = - new DiceSigninButton(dice_promo_default_account, account_icon, this, - false /* show drop down arrow */); - - signin_button_view->AddChildView(signin_with_gaia_account_button_); - view->AddChildView(signin_button_view); + dice_signin_button_view_ = + new DiceSigninButtonView(dice_promo_default_account, account_icon, this); + dice_signin_button_view_->SetBorder( + views::CreateEmptyBorder(gfx::Insets(kMenuEdgeMargin))); + view->AddChildView(dice_signin_button_view_); + signin_with_gaia_account_button_ = dice_signin_button_view_->signin_button(); // Create a button to sync to another account. constexpr int kSmallMenuIconSize = 16;
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.h b/chrome/browser/ui/views/profiles/profile_chooser_view.h index 7c5c4565..ef90d02d 100644 --- a/chrome/browser/ui/views/profiles/profile_chooser_view.h +++ b/chrome/browser/ui/views/profiles/profile_chooser_view.h
@@ -35,7 +35,7 @@ } class Browser; -class DiceSigninButton; +class DiceSigninButtonView; // This bubble view is displayed when the user clicks on the avatar button. // It displays a list of profiles and allows users to switch between profiles. @@ -202,7 +202,7 @@ views::LabelButton* manage_accounts_button_; views::LabelButton* signin_current_profile_button_; views::LabelButton* sync_to_another_account_button_; - DiceSigninButton* signin_with_gaia_account_button_; + views::LabelButton* signin_with_gaia_account_button_; // For material design user menu, the active profile card owns the profile // name and photo. @@ -224,6 +224,9 @@ views::LabelButton* remove_account_button_; views::ImageButton* account_removal_cancel_button_; + // View for the signin/turn-on-sync button in the dice promo. + DiceSigninButtonView* dice_signin_button_view_; + // Records the account id to remove. std::string account_id_to_remove_;
diff --git a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc index c6980486..3d34d6e 100644 --- a/chrome/browser/ui/views/screen_capture_notification_ui_views.cc +++ b/chrome/browser/ui/views/screen_capture_notification_ui_views.cc
@@ -329,8 +329,9 @@ std::unique_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create(const base::string16& text) { #if defined(OS_MACOSX) - if (views_mode_controller::IsViewsBrowserCocoa()) - return CreateCocoa(text); + std::unique_ptr<ScreenCaptureNotificationUI> cocoa_ui = CreateCocoa(text); + if (cocoa_ui) + return cocoa_ui; #endif return std::unique_ptr<ScreenCaptureNotificationUI>( new ScreenCaptureNotificationUIViews(text));
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 7a8a69e..eb2d94e5 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
@@ -14,7 +14,7 @@ #include "chrome/browser/signin/signin_ui_util.h" #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" #include "chrome/browser/ui/views/harmony/chrome_typography.h" -#include "chrome/browser/ui/views/sync/dice_signin_button.h" +#include "chrome/browser/ui/views/sync/dice_signin_button_view.h" #include "components/signin/core/browser/account_tracker_service.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -25,7 +25,8 @@ Profile* profile, BubbleSyncPromoDelegate* delegate, int no_accounts_promo_message_resource_id, - int accounts_promo_message_resource_id) + int accounts_promo_message_resource_id, + bool signin_button_prominent) : views::View(), delegate_(delegate) { DCHECK(AccountConsistencyModeManager::IsDiceEnabledForProfile(profile)); @@ -49,7 +50,8 @@ AddChildView(title); if (accounts.empty()) { - signin_button_ = new DiceSigninButton(this); + signin_button_view_ = + new DiceSigninButtonView(this, signin_button_prominent); } else { gfx::Image account_icon = AccountTrackerServiceFactory::GetForProfile(profile)->GetAccountImage( @@ -58,7 +60,8 @@ account_icon = ui::ResourceBundle::GetSharedInstance().GetImageNamed( profiles::GetPlaceholderAvatarIconResourceID()); } - signin_button_ = new DiceSigninButton(accounts[0], account_icon, this); + signin_button_view_ = new DiceSigninButtonView( + accounts[0], account_icon, this, true /* show_drop_down_arrow */); // Store account information for submenu. accounts_for_submenu_.assign(accounts.begin() + 1, accounts.end()); @@ -69,27 +72,19 @@ tracker_service->GetAccountImage(account.account_id)); } } - AddChildView(signin_button_); + AddChildView(signin_button_view_); } DiceBubbleSyncPromoView::~DiceBubbleSyncPromoView() = default; -void DiceBubbleSyncPromoView::SetSigninButtonNonProminent() { - if (!signin_button_->account()) { - // Only the sign-in button can be non prominent (the turn-on-sync button is - // always prominent). - signin_button_->SetProminent(false); - } -} - void DiceBubbleSyncPromoView::ButtonPressed(views::Button* sender, const ui::Event& event) { - if (sender == signin_button_) { - EnableSync(signin_button_->account()); + if (sender == signin_button_view_->signin_button()) { + EnableSync(signin_button_view_->account()); return; } - if (sender == signin_button_->drop_down_arrow()) { + if (sender == signin_button_view_->drop_down_arrow()) { // Display a submenu listing the GAIA web accounts (except the first one). // Using base::Unretained(this) is safe here because |dice_accounts_menu_| // is owned by |DiceBubbleSyncPromoView|, i.e. |this|. @@ -97,7 +92,7 @@ accounts_for_submenu_, images_for_submenu_, base::BindOnce(&DiceBubbleSyncPromoView::EnableSync, base::Unretained(this))); - dice_accounts_menu_->Show(signin_button_); + dice_accounts_menu_->Show(signin_button_view_); return; }
diff --git a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h index 471fb76..4212a635 100644 --- a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h +++ b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.h
@@ -15,7 +15,7 @@ #include "ui/views/view.h" class Profile; -class DiceSigninButton; +class DiceSigninButtonView; // A personalized sync promo used when Desktop Identity Consistency is enabled. // Its display a message informing the user the benefits of enabling sync and @@ -34,16 +34,16 @@ // Chrome has no accounts. // The promo message is set to |accounts_promo_message_resource_id| when // Chrome has at least one account. + // If |signin_button_prominent| is false and a non-personalized signin button + // is shown, the button is set to non-prominent. Otherwise the button remains + // prominent. DiceBubbleSyncPromoView(Profile* profile, BubbleSyncPromoDelegate* delegate, int no_accounts_promo_message_resource_id, - int accounts_promo_message_resource_id); + int accounts_promo_message_resource_id, + bool signin_button_prominent = true); ~DiceBubbleSyncPromoView() override; - // If a non-personalized signin button is shown in the promo, it is set to - // non-prominent. Otherwise, this function does nothing. - void SetSigninButtonNonProminent(); - // views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override; @@ -57,7 +57,7 @@ // Delegate, to handle clicks on the sign-in buttons. BubbleSyncPromoDelegate* delegate_; - DiceSigninButton* signin_button_ = nullptr; + DiceSigninButtonView* signin_button_view_ = nullptr; // Accounts submenu that is shown when |signin_button_->drop_down_arrow()| is // pressed.
diff --git a/chrome/browser/ui/views/sync/dice_signin_button.cc b/chrome/browser/ui/views/sync/dice_signin_button.cc deleted file mode 100644 index eb9cf7fa..0000000 --- a/chrome/browser/ui/views/sync/dice_signin_button.cc +++ /dev/null
@@ -1,211 +0,0 @@ -// Copyright 2018 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/ui/views/sync/dice_signin_button.h" - -#include "base/strings/string16.h" -#include "base/strings/utf_string_conversions.h" -#include "chrome/app/vector_icons/vector_icons.h" -#include "chrome/browser/profiles/profile_avatar_icon_util.h" -#include "chrome/grit/generated_resources.h" -#include "components/vector_icons/vector_icons.h" -#include "third_party/skia/include/core/SkColor.h" -#include "ui/base/l10n/l10n_util.h" -#include "ui/gfx/image/image.h" -#include "ui/gfx/paint_vector_icon.h" -#include "ui/gfx/skbitmap_operations.h" -#include "ui/views/background.h" -#include "ui/views/border.h" - -namespace { - -// Drop down arrow sizes. -constexpr int kDropDownArrowIconSize = 15; -constexpr int kDropDownArrowButtonWidth = 50; - -// Divider sizes -constexpr int kDividerHorizontalPadding = 4; -constexpr int kDividerWidth = 1; -constexpr int kDividerVerticalPadding = 10; - -// Minimum height for the personalized Dice sign-in button. -constexpr int kMinAccountButtonHeight = 64; -constexpr int kMinTextHeight = 20; - -int GetDividerAndArrowReservedWidth() { - return 2 * kDividerHorizontalPadding + kDividerWidth + - kDropDownArrowButtonWidth; -} - -base::string16 GetButtonTitleForAccount(const AccountInfo& account) { - if (!account.given_name.empty()) { - return l10n_util::GetStringFUTF16( - IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON, - base::UTF8ToUTF16(account.given_name)); - } - if (!account.full_name.empty()) { - return l10n_util::GetStringFUTF16( - IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON, - base::UTF8ToUTF16(account.full_name)); - } - return l10n_util::GetStringUTF16( - IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON_NO_NAME); -} - -// Sizes |image| to 40x40, adds a white background in case it is transparent and -// shapes it circular. -gfx::ImageSkia PrepareAvatarImage(const gfx::Image& image) { - // Add white background. - SkBitmap mask; - mask.allocN32Pixels(image.Width(), image.Height()); - mask.eraseARGB(255, 255, 255, 0); - SkBitmap opaque_bitmap = SkBitmapOperations::CreateButtonBackground( - SK_ColorWHITE, image.AsBitmap(), mask); - // Size and shape. - return profiles::GetSizedAvatarIcon( - gfx::Image::CreateFrom1xBitmap(opaque_bitmap), true, 40, 40, - profiles::SHAPE_CIRCLE) - .AsImageSkia(); -} - -} // namespace - -DiceSigninButton::DiceSigninButton(views::ButtonListener* button_listener) - : views::MdTextButton(button_listener, views::style::CONTEXT_BUTTON), - account_(base::nullopt) { - // Regular MD text button when there is not account. - SetText(l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SIGNIN_BUTTON)); - SetFocusForPlatform(); - SetProminent(true); - SetHorizontalAlignment(gfx::ALIGN_CENTER); -} - -DiceSigninButton::DiceSigninButton(const AccountInfo& account, - const gfx::Image& account_icon, - views::ButtonListener* button_listener, - bool show_drop_down_arrow) - : views::MdTextButton(button_listener, views::style::CONTEXT_BUTTON), - account_(account) { - // First create the child views. - subtitle_ = new views::Label(base::ASCIIToUTF16(account_->email)); - subtitle_->SetAutoColorReadabilityEnabled(false); - subtitle_->SetEnabledColor(SK_ColorWHITE); - subtitle_->SetHorizontalAlignment(gfx::ALIGN_LEFT); - AddChildView(subtitle_); - - if (show_drop_down_arrow) { - divider_ = new views::View(); - divider_->SetBackground(views::CreateSolidBackground(SK_ColorWHITE)); - AddChildView(divider_); - - arrow_ = new views::ImageButton(button_listener); - arrow_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, - views::ImageButton ::ALIGN_MIDDLE); - arrow_->SetInkDropMode(views::InkDropHostView::InkDropMode::ON); - arrow_->set_has_ink_drop_action_on_click(true); - arrow_->SetFocusForPlatform(); - arrow_->SetFocusPainter(nullptr); - arrow_->SetImage( - views::Button::STATE_NORMAL, - gfx::CreateVectorIcon(kSigninButtonDropDownArrowIcon, - kDropDownArrowIconSize, SK_ColorWHITE)); - base::string16 arrow_accessible_name = l10n_util::GetStringUTF16( - IDS_PROFILES_DICE_SIGNIN_WITH_ANOTHER_ACCOUNT_BUTTON); - arrow_->SetAccessibleName(arrow_accessible_name); - arrow_->SetTooltipText(arrow_accessible_name); - AddChildView(arrow_); - } - - // Set the title text for main Sign-in button. - SetText(GetButtonTitleForAccount(account)); - SetFocusForPlatform(); - SetProminent(true); - SetHorizontalAlignment(gfx::ALIGN_LEFT); - - // Set the image. - SetImage(views::Button::STATE_NORMAL, PrepareAvatarImage(account_icon)); -} - -DiceSigninButton::~DiceSigninButton() = default; - -gfx::Rect DiceSigninButton::GetChildAreaBounds() { - gfx::Rect child_area = MdTextButton::GetChildAreaBounds(); - if (!arrow_) - return child_area; - - // Make room on the right for the divider and the drop-down arrow. - child_area.set_width(child_area.width() - GetDividerAndArrowReservedWidth()); - return child_area; -} - -int DiceSigninButton::GetHeightForWidth(int width) const { - if (!account_) - return MdTextButton::GetHeightForWidth(width); - - // Title and subtitle are labels with a single line. So their preferred - // height is not affected by |width|. - int height_without_subtitle = MdTextButton::GetHeightForWidth(width); - int title_subtitle_height = - std::max(label()->GetHeightForWidth(width), kMinTextHeight) + - std::max(subtitle_->GetHeightForWidth(width), kMinTextHeight) + - GetInsets().height(); - return std::max({height_without_subtitle, title_subtitle_height, - kMinAccountButtonHeight}); -} - -gfx::Size DiceSigninButton::CalculatePreferredSize() const { - gfx::Size parent_pref_size = MdTextButton::CalculatePreferredSize(); - if (!account_) - return parent_pref_size; - - int pref_width = parent_pref_size.width(); - if (arrow_) { - // Additional width is needed for the divider and the drop-down arrow. - pref_width += GetDividerAndArrowReservedWidth(); - } - - // Additional height is needed for the subtitle. - int pref_height_with_subtitle = - std::max(label()->CalculatePreferredSize().height(), kMinTextHeight) + - std::max(subtitle_->CalculatePreferredSize().height(), kMinTextHeight) + - GetInsets().height(); - int pref_height = - std::max(parent_pref_size.height(), pref_height_with_subtitle); - return gfx::Size(pref_width, std::max(pref_height, kMinAccountButtonHeight)); -} - -void DiceSigninButton::Layout() { - views::MdTextButton::Layout(); - if (!account_) - return; - - // By default, |title| takes the entire height of the button. Shrink |title| - // to make space for |subtitle_|. - views::Label* title = label(); - gfx::Size initial_title_size = title->size(); - int total_height = initial_title_size.height(); - int title_x = title->bounds().x(); - int title_width = initial_title_size.width(); - int title_height = - std::max(title->GetHeightForWidth(title_width), kMinTextHeight); - int subtitle_width = GetChildAreaBounds().width() - title_x; - int subtitle_height = - std::max(subtitle_->GetHeightForWidth(subtitle_width), kMinTextHeight); - int title_y = - std::max(0, (total_height - title_height - subtitle_height) / 2); - title->SetBounds(title_x, title_y, title_width, title_height); - subtitle_->SetBounds(title_x, title->bounds().bottom(), subtitle_width, - subtitle_height); - - if (!arrow_) - return; - // Lay the divider and the arrow on the right. - gfx::Rect bounds = GetLocalBounds(); - int divider_x = bounds.width() - GetDividerAndArrowReservedWidth() + - kDividerHorizontalPadding; - divider_->SetBounds(divider_x, kDividerVerticalPadding, kDividerWidth, - bounds.height() - 2 * kDividerVerticalPadding); - arrow_->SetBounds(divider_x + kDividerWidth + kDividerHorizontalPadding, 0, - kDropDownArrowButtonWidth, bounds.height()); -}
diff --git a/chrome/browser/ui/views/sync/dice_signin_button.h b/chrome/browser/ui/views/sync/dice_signin_button.h deleted file mode 100644 index a83f71d2..0000000 --- a/chrome/browser/ui/views/sync/dice_signin_button.h +++ /dev/null
@@ -1,55 +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. - -#ifndef CHROME_BROWSER_UI_VIEWS_SYNC_DICE_SIGNIN_BUTTON_H_ -#define CHROME_BROWSER_UI_VIEWS_SYNC_DICE_SIGNIN_BUTTON_H_ - -#include "base/macros.h" -#include "base/optional.h" -#include "components/signin/core/browser/account_info.h" -#include "ui/views/controls/button/image_button.h" -#include "ui/views/controls/button/md_text_button.h" -#include "ui/views/controls/label.h" - -// Sign-in button used for Desktop Identity Consistency that presents the -// account information (avatar image and email) and allows the user to -// sign in to Chrome or to enable sync. -// -// The button also presents on the right hand side a drown-down arrow button -// that the user can interact with. -class DiceSigninButton : public views::MdTextButton { - public: - // Create a non-personalized sign-in button. - // |button_listener| is called evey time the user interacts with this button. - explicit DiceSigninButton(views::ButtonListener* button_listener); - - // Creates a sign-in button personalized with the data from |account|. - // |button_listener| will be called for events originating from |this| or from - // |drop_down_arrow|. The drop down arrow will only be shown when - // |show_drop_down_arrow| is true. - DiceSigninButton(const AccountInfo& account_info, - const gfx::Image& account_icon, - views::ButtonListener* button_listener, - bool show_drop_down_arrow = true); - ~DiceSigninButton() override; - - const views::Button* drop_down_arrow() const { return arrow_; } - const base::Optional<AccountInfo> account() const { return account_; } - - // views::MdTextButton: - gfx::Rect GetChildAreaBounds() override; - gfx::Size CalculatePreferredSize() const override; - int GetHeightForWidth(int w) const override; - void Layout() override; - - private: - const base::Optional<AccountInfo> account_; - views::Label* subtitle_ = nullptr; - views::View* divider_ = nullptr; - views::ImageButton* arrow_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(DiceSigninButton); -}; - -#endif // CHROME_BROWSER_UI_VIEWS_SYNC_DICE_SIGNIN_BUTTON_H_
diff --git a/chrome/browser/ui/views/sync/dice_signin_button_view.cc b/chrome/browser/ui/views/sync/dice_signin_button_view.cc new file mode 100644 index 0000000..3194dad9 --- /dev/null +++ b/chrome/browser/ui/views/sync/dice_signin_button_view.cc
@@ -0,0 +1,149 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/views/sync/dice_signin_button_view.h" + +#include "base/strings/string16.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/app/vector_icons/vector_icons.h" +#include "chrome/browser/profiles/profile_avatar_icon_util.h" +#include "chrome/browser/ui/views/hover_button.h" +#include "chrome/grit/generated_resources.h" +#include "ui/base/l10n/l10n_util.h" +#include "ui/gfx/canvas.h" +#include "ui/gfx/image/image.h" +#include "ui/gfx/paint_vector_icon.h" +#include "ui/gfx/skbitmap_operations.h" +#include "ui/views/background.h" +#include "ui/views/border.h" +#include "ui/views/controls/button/md_text_button.h" +#include "ui/views/controls/image_view.h" +#include "ui/views/layout/fill_layout.h" +#include "ui/views/layout/grid_layout.h" + +namespace { + +constexpr int kDropDownArrowIconSize = 12; +constexpr int kDividerVerticalPadding = 10; +constexpr int kButtonCornerRadius = 2; +constexpr SkColor kDividerColor = SK_ColorWHITE; + +base::string16 GetButtonTitleForAccount(const AccountInfo& account) { + if (!account.given_name.empty()) { + return l10n_util::GetStringFUTF16( + IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON, + base::UTF8ToUTF16(account.given_name)); + } + if (!account.full_name.empty()) { + return l10n_util::GetStringFUTF16( + IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON, + base::UTF8ToUTF16(account.full_name)); + } + return l10n_util::GetStringUTF16( + IDS_PROFILES_DICE_SIGNIN_FIRST_ACCOUNT_BUTTON_NO_NAME); +} + +// Sizes |image| to 40x40, adds a white background in case it is transparent and +// shapes it circular. +gfx::ImageSkia PrepareAvatarImage(const gfx::Image& image) { + // Add white background. + SkBitmap mask; + mask.allocN32Pixels(image.Width(), image.Height()); + mask.eraseARGB(255, 255, 255, 0); + SkBitmap opaque_bitmap = SkBitmapOperations::CreateButtonBackground( + SK_ColorWHITE, image.AsBitmap(), mask); + // Size and shape. + return profiles::GetSizedAvatarIcon( + gfx::Image::CreateFrom1xBitmap(opaque_bitmap), true, 40, 40, + profiles::SHAPE_CIRCLE) + .AsImageSkia(); +} + +} // namespace + +DiceSigninButtonView::DiceSigninButtonView( + views::ButtonListener* button_listener, + bool prominent) + : account_(base::nullopt) { + SetLayoutManager(std::make_unique<views::FillLayout>()); + // Regular MD text button when there is no account. + views::MdTextButton* button = views::MdTextButton::Create( + button_listener, + l10n_util::GetStringUTF16(IDS_PROFILES_DICE_SIGNIN_BUTTON), + views::style::CONTEXT_BUTTON); + button->SetProminent(prominent); + AddChildView(button); + signin_button_ = button; +} + +DiceSigninButtonView::DiceSigninButtonView( + const AccountInfo& account, + const gfx::Image& account_icon, + views::ButtonListener* button_listener, + bool show_drop_down_arrow) + : account_(account) { + views::GridLayout* grid_layout = + SetLayoutManager(std::make_unique<views::GridLayout>(this)); + views::ColumnSet* columns = grid_layout->AddColumnSet(0); + grid_layout->StartRow(0, 0); + + // Add a stretching column for the account button. + columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, + views::GridLayout::USE_PREF, 0, 0); + auto icon_view = std::make_unique<views::ImageView>(); + icon_view->SetImage(PrepareAvatarImage(account_icon)); + HoverButton* hover_button = new HoverButton( + button_listener, std::move(icon_view), GetButtonTitleForAccount(account), + base::ASCIIToUTF16(account_->email)); + hover_button->SetStyle(HoverButton::STYLE_PROMINENT); + signin_button_ = hover_button; + grid_layout->AddView(signin_button_); + + if (!show_drop_down_arrow) + return; + + // Add a non-stretching column for the the drop down arrow. + columns->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, 0, + views::GridLayout::USE_PREF, 0, 0); + arrow_ = new HoverButton( + button_listener, + gfx::CreateVectorIcon(kSigninButtonDropDownArrowIcon, + kDropDownArrowIconSize, SK_ColorWHITE), + base::string16()); + arrow_->SetTooltipText(l10n_util::GetStringUTF16( + IDS_PROFILES_DICE_SIGNIN_WITH_ANOTHER_ACCOUNT_BUTTON)); + grid_layout->AddView(arrow_); + + // Make the background of the entire view match the prominent + // |signin_button_|. + SetBackground( + views::CreateSolidBackground(signin_button_->background()->get_color())); + // Make the entire view (including the arrow) highlighted when the + // |signin_button_| is hovered. + hover_button->SetHighlightingView(this); +} + +DiceSigninButtonView::~DiceSigninButtonView() = default; + +void DiceSigninButtonView::OnPaint(gfx::Canvas* canvas) { + views::View::OnPaint(canvas); + if (arrow_) { + // Draw divider between |signin_button_| and |arrow_|. + gfx::Rect bounds = arrow_->GetMirroredBounds(); + bounds.Inset(gfx::Insets(kDividerVerticalPadding, 0)); + if (base::i18n::IsRTL()) + bounds.Inset(bounds.width() - 1, 0, 0, 0); + canvas->DrawLine(bounds.origin(), bounds.bottom_left(), kDividerColor); + } +} + +void DiceSigninButtonView::Layout() { + views::View::Layout(); + // Clip the view to make the corners rounded and to remove the border + // background in case a parent view wants to set a transparent border. + gfx::Path path; + path.addRoundRect(gfx::RectToSkRect(GetContentsBounds()), kButtonCornerRadius, + kButtonCornerRadius); + set_clip_path(path); +}
diff --git a/chrome/browser/ui/views/sync/dice_signin_button_view.h b/chrome/browser/ui/views/sync/dice_signin_button_view.h new file mode 100644 index 0000000..d088d89 --- /dev/null +++ b/chrome/browser/ui/views/sync/dice_signin_button_view.h
@@ -0,0 +1,56 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_VIEWS_SYNC_DICE_SIGNIN_BUTTON_VIEW_H_ +#define CHROME_BROWSER_UI_VIEWS_SYNC_DICE_SIGNIN_BUTTON_VIEW_H_ + +#include "base/macros.h" +#include "base/optional.h" +#include "components/signin/core/browser/account_info.h" +#include "ui/views/controls/button/label_button.h" +#include "ui/views/view.h" + +// Sign-in button view used for Desktop Identity Consistency that presents the +// account information (avatar image and email) and allows the user to +// sign in to Chrome or to enable sync. +// +// The button also presents on the right hand side a drown-down arrow button +// that the user can interact with. +class DiceSigninButtonView : public views::View { + public: + // Create a non-personalized sign-in button. + // |button_listener| is called every time the user interacts with this button. + // The button is prominent by default but can be made non-prominent by setting + // |prominent| to false. + explicit DiceSigninButtonView(views::ButtonListener* button_listener, + bool prominent = true); + + // Creates a sign-in button personalized with the data from |account|. + // |button_listener| will be called for events originating from |this| or from + // |drop_down_arrow|. The drop down arrow will only be shown if + // |show_drop_down_arrow| is true. + DiceSigninButtonView(const AccountInfo& account_info, + const gfx::Image& account_icon, + views::ButtonListener* button_listener, + bool show_drop_down_arrow = false); + ~DiceSigninButtonView() override; + + views::LabelButton* signin_button() const { return signin_button_; } + views::LabelButton* drop_down_arrow() const { return arrow_; } + base::Optional<AccountInfo> account() const { return account_; } + + private: + // views::View override: + void OnPaint(gfx::Canvas* canvas) override; + void Layout() override; + + views::LabelButton* signin_button_ = nullptr; + views::LabelButton* arrow_ = nullptr; + + const base::Optional<AccountInfo> account_; + + DISALLOW_COPY_AND_ASSIGN(DiceSigninButtonView); +}; + +#endif // CHROME_BROWSER_UI_VIEWS_SYNC_DICE_SIGNIN_BUTTON_VIEW_H_
diff --git a/chrome/browser/ui/views/toolbar/browser_action_test_util_views.cc b/chrome/browser/ui/views/toolbar/browser_action_test_util_views.cc index db04e72..9a308fc 100644 --- a/chrome/browser/ui/views/toolbar/browser_action_test_util_views.cc +++ b/chrome/browser/ui/views/toolbar/browser_action_test_util_views.cc
@@ -18,7 +18,6 @@ #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" #include "chrome/browser/ui/views/toolbar/toolbar_action_view.h" #include "chrome/browser/ui/views/toolbar/toolbar_view.h" -#include "ui/aura/window.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image.h" @@ -153,12 +152,6 @@ return popup_owner ? popup_owner->GetPopupNativeView() : nullptr; } -bool BrowserActionTestUtil::WaitForPopup() { - // TODO(tapted): Implement this for MacViews. - NOTIMPLEMENTED(); - return HasPopup(); -} - bool BrowserActionTestUtil::HasPopup() { return GetPopupNativeView() != nullptr; }
diff --git a/chrome/browser/ui/views/toolbar/browser_action_test_util_views_aura.cc b/chrome/browser/ui/views/toolbar/browser_action_test_util_views_aura.cc new file mode 100644 index 0000000..61f74df --- /dev/null +++ b/chrome/browser/ui/views/toolbar/browser_action_test_util_views_aura.cc
@@ -0,0 +1,65 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/extensions/browser_action_test_util.h" + +#include "base/logging.h" +#include "base/run_loop.h" +#include "ui/aura/client/window_types.h" +#include "ui/aura/window.h" +#include "ui/aura/window_observer.h" +#include "ui/wm/core/window_util.h" + +namespace { + +aura::Window* GetPopupAuraWindow(aura::Window* current) { + DCHECK(current); + while (current && (current->type() != aura::client::WINDOW_TYPE_POPUP)) + current = current->parent(); + return current; +} + +class AuraWindowObserver : public aura::WindowObserver { + public: + AuraWindowObserver(const aura::Window* popup_window, base::RunLoop* run_loop) + : popup_window_(popup_window), run_loop_(run_loop) {} + + // aura::WindowObserver: + void OnWindowVisibilityChanged(aura::Window* window, bool visible) override { + if (popup_window_ == window && visible) + run_loop_->QuitWhenIdle(); + } + + private: + const aura::Window* const popup_window_; + base::RunLoop* const run_loop_; + + DISALLOW_COPY_AND_ASSIGN(AuraWindowObserver); +}; + +} // namespace + +bool BrowserActionTestUtil::WaitForPopup() { + // The popup starts out active but invisible, so all we need to really do is + // look for visibility. + aura::Window* native_view = GetPopupNativeView(); + if (!native_view) + return false; + + aura::Window* popup = GetPopupAuraWindow(native_view); + if (!popup) + return false; + + if (popup->IsVisible()) + return true; + + base::RunLoop run_loop; + AuraWindowObserver observer(popup, &run_loop); + popup->AddObserver(&observer); + run_loop.Run(); + DCHECK(wm::IsActiveWindow(popup)); + popup->RemoveObserver(&observer); + + return HasPopup(); +}
diff --git a/chrome/browser/ui/views/toolbar/browser_action_test_util_views_mac.mm b/chrome/browser/ui/views/toolbar/browser_action_test_util_views_mac.mm new file mode 100644 index 0000000..7fce212 --- /dev/null +++ b/chrome/browser/ui/views/toolbar/browser_action_test_util_views_mac.mm
@@ -0,0 +1,27 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/extensions/browser_action_test_util.h" + +#include <AppKit/AppKit.h> + +#import "base/mac/scoped_nsobject.h" +#import "ui/base/test/windowed_nsnotification_observer.h" + +bool BrowserActionTestUtil::WaitForPopup() { + NSWindow* window = [GetPopupNativeView() window]; + if (!window) + return false; + + if ([window isKeyWindow]) + return true; + + base::scoped_nsobject<WindowedNSNotificationObserver> waiter( + [[WindowedNSNotificationObserver alloc] + initForNotification:NSWindowDidBecomeKeyNotification + object:window]); + + BOOL notification_observed = [waiter wait]; + return notification_observed && [window isKeyWindow]; +}
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc index 78b6f07..79a0b5f3 100644 --- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc +++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc
@@ -15,7 +15,6 @@ #include "chrome/browser/ui/layout_constants.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" -#include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/extensions/browser_action_drag_data.h" @@ -30,13 +29,11 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/accessibility/ax_node_data.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/nine_image_painter_factory.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/canvas.h" #include "ui/gfx/geometry/rect.h" #include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/controls/resize_area.h" -#include "ui/views/painter.h" #include "ui/views/widget/widget.h" //////////////////////////////////////////////////////////////////////////////// @@ -81,9 +78,6 @@ AddChildView(resize_area_); } resize_animation_.reset(new gfx::SlideAnimation(this)); - const int kWarningImages[] = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT); - warning_highlight_painter_ = - views::Painter::CreateImageGridPainter(kWarningImages); } } @@ -327,7 +321,7 @@ } void BrowserActionsContainer::Layout() { - if (toolbar_actions_bar_->suppress_layout()) + if (toolbar_actions_bar()->suppress_layout()) return; if (toolbar_action_views_.empty()) { @@ -341,8 +335,8 @@ // The range of visible icons, from start_index (inclusive) to end_index // (exclusive). - size_t start_index = toolbar_actions_bar_->GetStartIndexInBounds(); - size_t end_index = toolbar_actions_bar_->GetEndIndexInBounds(); + size_t start_index = toolbar_actions_bar()->GetStartIndexInBounds(); + size_t end_index = toolbar_actions_bar()->GetEndIndexInBounds(); // Now draw the icons for the actions in the available space. Once all the // variables are in place, the layout works equally well for the main and @@ -352,8 +346,14 @@ if (i < start_index || i >= end_index) { view->SetVisible(false); } else { - view->SetBoundsRect(toolbar_actions_bar_->GetFrameForIndex(i)); + view->SetBoundsRect(toolbar_actions_bar()->GetFrameForIndex(i)); view->SetVisible(true); + if (!ShownInsideMenu()) { + view->AnimateInkDrop(toolbar_actions_bar()->is_highlighting() + ? views::InkDropState::ACTIVATED + : views::InkDropState::HIDDEN, + nullptr); + } } } } @@ -590,14 +590,6 @@ } void BrowserActionsContainer::OnPaint(gfx::Canvas* canvas) { - // If the views haven't been initialized yet, wait for the next call to - // paint (one will be triggered by entering highlight mode). - if (toolbar_actions_bar_->is_highlighting() && - !toolbar_action_views_.empty() && !ShownInsideMenu()) { - views::Painter::PaintPainterAt(canvas, warning_highlight_painter_.get(), - GetLocalBounds()); - } - // TODO(sky/glen): Instead of using a drop indicator, animate the icons while // dragging (like we do for tab dragging). if (drop_position_.get()) {
diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.h b/chrome/browser/ui/views/toolbar/browser_actions_container.h index 15d619f..29426394 100644 --- a/chrome/browser/ui/views/toolbar/browser_actions_container.h +++ b/chrome/browser/ui/views/toolbar/browser_actions_container.h
@@ -279,9 +279,6 @@ // The resize area for the container. views::ResizeArea* resize_area_ = nullptr; - // The painter used when we are highlighting a subset of extensions. - std::unique_ptr<views::Painter> warning_highlight_painter_; - // The animation that happens when the container snaps to place. std::unique_ptr<gfx::SlideAnimation> resize_animation_;
diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc index ea1ec9a4..d7d8c7d1 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc
@@ -20,6 +20,7 @@ #include "ui/base/theme_provider.h" #include "ui/compositor/paint_recorder.h" #include "ui/events/event.h" +#include "ui/gfx/color_palette.h" #include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/image/image_skia_source.h" @@ -102,8 +103,13 @@ ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor); } - return GetThemeProvider()->GetColor( - ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON); + const ui::ThemeProvider* provider = GetThemeProvider(); + + // There may not be a Widget available in the unit tests, thus there will be + // no ThemeProvider. + return provider + ? provider->GetColor(ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON) + : gfx::kChromeIconGrey; } bool ToolbarActionView::ShouldUseFloodFillInkDrop() const {
diff --git a/chrome/browser/ui/views/translate/translate_icon_view.cc b/chrome/browser/ui/views/translate/translate_icon_view.cc index 7cbc95a..0a9809d 100644 --- a/chrome/browser/ui/views/translate/translate_icon_view.cc +++ b/chrome/browser/ui/views/translate/translate_icon_view.cc
@@ -8,33 +8,56 @@ #include "base/strings/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/app/vector_icons/vector_icons.h" +#include "chrome/browser/ui/browser_command_controller.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h" #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/translate/translate_bubble_view.h" #include "chrome/grit/generated_resources.h" +#include "components/translate/core/browser/language_state.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" -TranslateIconView::TranslateIconView(CommandUpdater* command_updater) - : BubbleIconView(command_updater, IDC_TRANSLATE_PAGE) { +TranslateIconView::TranslateIconView(CommandUpdater* command_updater, + BubbleIconView::Delegate* delegate) + : BubbleIconView(command_updater, IDC_TRANSLATE_PAGE, delegate) { + DCHECK(delegate); set_id(VIEW_ID_TRANSLATE_BUTTON); SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_TRANSLATE)); } TranslateIconView::~TranslateIconView() {} +views::BubbleDialogDelegateView* TranslateIconView::GetBubble() const { + return TranslateBubbleView::GetCurrentBubble(); +} + +bool TranslateIconView::Refresh() { + if (!GetWebContents()) + return false; + + const bool was_visible = visible(); + const translate::LanguageState& language_state = + ChromeTranslateClient::FromWebContents(GetWebContents()) + ->GetLanguageState(); + bool enabled = language_state.translate_enabled(); + + // Enable Translate page command or disable icon. + enabled &= SetCommandEnabled(enabled); + SetVisible(enabled); + if (!enabled) + TranslateBubbleView::CloseCurrentBubble(); + + return was_visible != visible(); +} + void TranslateIconView::OnExecuting( BubbleIconView::ExecuteSource execute_source) {} void TranslateIconView::OnPressed(bool activated) { - translate::ReportUiAction((activated + translate::ReportUiAction(activated ? translate::PAGE_ACTION_ICON_ACTIVATED - : translate::PAGE_ACTION_ICON_DEACTIVATED)); -} - -views::BubbleDialogDelegateView* TranslateIconView::GetBubble() const { - return TranslateBubbleView::GetCurrentBubble(); + : translate::PAGE_ACTION_ICON_DEACTIVATED); } const gfx::VectorIcon& TranslateIconView::GetVectorIcon() const {
diff --git a/chrome/browser/ui/views/translate/translate_icon_view.h b/chrome/browser/ui/views/translate/translate_icon_view.h index f05dd1e5..190c044 100644 --- a/chrome/browser/ui/views/translate/translate_icon_view.h +++ b/chrome/browser/ui/views/translate/translate_icon_view.h
@@ -14,14 +14,18 @@ // the page translated. class TranslateIconView : public BubbleIconView { public: - explicit TranslateIconView(CommandUpdater* command_updater); + TranslateIconView(CommandUpdater* command_updater, + BubbleIconView::Delegate* delegate); ~TranslateIconView() override; + // BubbleIconView: + views::BubbleDialogDelegateView* GetBubble() const override; + bool Refresh() override; + protected: // BubbleIconView: void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; void OnPressed(bool activated) override; - views::BubbleDialogDelegateView* GetBubble() const override; const gfx::VectorIcon& GetVectorIcon() const override; private:
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index 3fbed59f..ed35861 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc +++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -86,7 +86,7 @@ #include "content/public/browser/web_ui.h" #include "content/public/common/content_client.h" #include "content/public/common/url_utils.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/features/features.h" #include "printing/features/features.h"
diff --git a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc index f0ed4ed1..d9eb8871 100644 --- a/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc +++ b/chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc
@@ -8,7 +8,7 @@ #include <memory> -#include "ash/public/cpp/ash_switches.h" +#include "ash/public/cpp/ash_features.h" #include "ash/shell.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -337,7 +337,7 @@ source->AddBoolean("voiceInteractionEnabled", chromeos::switches::IsVoiceInteractionEnabled()); source->AddBoolean("displayMoveWindowAccelsEnabled", - ash::switches::IsDisplayMoveWindowAccelsEnabled()); + ash::features::IsDisplayMoveWindowAccelsEnabled()); source->AddBoolean("keyboardOverlayUsesLayout2", ui::DeviceUsesKeyboardLayout2()); ash::Shell* shell = ash::Shell::Get();
diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc index 1164b90..fc20cdc 100644 --- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
@@ -195,7 +195,6 @@ &CoreOobeHandler::HandleSetOobeBootstrappingSlave); AddRawCallback("getPrimaryDisplayNameForTesting", &CoreOobeHandler::HandleGetPrimaryDisplayNameForTesting); - AddCallback("setupDemoMode", &CoreOobeHandler::HandleSetupDemoMode); } void CoreOobeHandler::ShowSignInError( @@ -578,15 +577,6 @@ ResolveJavascriptCallback(*callback_id, base::Value(display_name)); } -void CoreOobeHandler::HandleSetupDemoMode() { - const bool is_demo_mode_enabled = - base::CommandLine::ForCurrentProcess()->HasSwitch( - chromeos::switches::kEnableDemoMode); - if (is_demo_mode_enabled) { - NOTIMPLEMENTED(); - } -} - void CoreOobeHandler::InitDemoModeDetection() { demo_mode_detector_.InitDetection(); }
diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h index 795c016d..2579735 100644 --- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h
@@ -130,7 +130,6 @@ void HandleHeaderBarVisible(); void HandleSetOobeBootstrappingSlave(); void HandleGetPrimaryDisplayNameForTesting(const base::ListValue* args); - void HandleSetupDemoMode(); // When keyboard_utils.js arrow key down event is reached, raise it // to tab/shift-tab event.
diff --git a/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc new file mode 100644 index 0000000..048e993 --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.cc
@@ -0,0 +1,45 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h" + +#include "chrome/browser/chromeos/login/oobe_screen.h" +#include "chrome/browser/chromeos/login/screens/demo_setup_screen.h" +#include "chrome/browser/chromeos/login/wizard_controller.h" + +namespace { + +constexpr char kJsScreenPath[] = "login.DemoSetupScreen"; + +} // namespace + +namespace chromeos { + +DemoSetupScreenHandler::DemoSetupScreenHandler() + : BaseScreenHandler(kScreenId) { + set_call_js_prefix(kJsScreenPath); +} + +DemoSetupScreenHandler::~DemoSetupScreenHandler() { + if (screen_) + screen_->OnViewDestroyed(this); +} + +void DemoSetupScreenHandler::Show() { + ShowScreen(kScreenId); +} + +void DemoSetupScreenHandler::Hide() {} + +void DemoSetupScreenHandler::Bind(DemoSetupScreen* screen) { + screen_ = screen; + BaseScreenHandler::SetBaseScreen(screen); +} + +void DemoSetupScreenHandler::Initialize() {} + +void DemoSetupScreenHandler::DeclareLocalizedValues( + ::login::LocalizedValuesBuilder* builder) {} + +} // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h new file mode 100644 index 0000000..d75084d --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h
@@ -0,0 +1,49 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DEMO_SETUP_SCREEN_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DEMO_SETUP_SCREEN_HANDLER_H_ + +#include "chrome/browser/chromeos/login/screens/demo_setup_screen_view.h" +#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" + +namespace chromeos { + +class DemoSetupScreen; + +// WebUI implementation of DemoSetupScreenView. It controlls UI, receives UI +// events and notifies the Delegate. +class DemoSetupScreenHandler : public BaseScreenHandler, + public DemoSetupScreenView { + public: + DemoSetupScreenHandler(); + ~DemoSetupScreenHandler() override; + + // DemoSetupScreenView: + void Show() override; + void Hide() override; + void Bind(DemoSetupScreen* screen) override; + + // BaseScreenHandler: + void Initialize() override; + void DeclareLocalizedValues( + ::login::LocalizedValuesBuilder* builder) override; + + private: + // Enumeration for UI states. These values have to be kept in sync with JS + // code in oobe_screen_demo_setup.js. + enum class UiState : int { + kError = -1, // Displaying error. + kDefault = 0, // Displaying initial UI. + kProcessing = 1, // Displaying setup in progress. + }; + + DemoSetupScreen* screen_ = nullptr; + + DISALLOW_COPY_AND_ASSIGN(DemoSetupScreenHandler); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_DEMO_SETUP_SCREEN_HANDLER_H_
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc index 87a5e5e..e53fbf0 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -18,6 +18,7 @@ #include "chrome/browser/browser_process_platform_part.h" #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_check_screen_view.h" #include "chrome/browser/chromeos/login/enrollment/enrollment_screen_view.h" +#include "chrome/browser/chromeos/login/screens/demo_setup_screen_view.h" #include "chrome/browser/chromeos/login/screens/error_screen.h" #include "chrome/browser/chromeos/login/ui/login_display_host.h" #include "chrome/browser/chromeos/login/wizard_controller.h" @@ -36,6 +37,7 @@ #include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/controller_pairing_screen_handler.h" +#include "chrome/browser/ui/webui/chromeos/login/demo_setup_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/device_disabled_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h" @@ -290,6 +292,8 @@ AddScreenHandler(std::make_unique<UserBoardScreenHandler>()); + AddScreenHandler(std::make_unique<DemoSetupScreenHandler>()); + policy::BrowserPolicyConnectorChromeOS* connector = g_browser_process->platform_part()->browser_policy_connector_chromeos(); ActiveDirectoryPasswordChangeScreenHandler* @@ -406,6 +410,10 @@ return GetView<ResetScreenHandler>(); } +DemoSetupScreenView* OobeUI::GetDemoSetupScreenView() { + return GetView<DemoSetupScreenHandler>(); +} + KioskAutolaunchScreenView* OobeUI::GetKioskAutolaunchScreenView() { return GetView<KioskAutolaunchScreenHandler>(); }
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h index 4a1eb7d..38483573 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.h +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.h
@@ -54,6 +54,7 @@ class SigninScreenHandlerDelegate; class SupervisedUserCreationScreenHandler; class ResetView; +class DemoSetupScreenView; class SyncConsentScreenView; class TermsOfServiceScreenView; class UserBoardView; @@ -104,6 +105,7 @@ EnableDebuggingScreenView* GetEnableDebuggingScreenView(); EnrollmentScreenView* GetEnrollmentScreenView(); ResetView* GetResetView(); + DemoSetupScreenView* GetDemoSetupScreenView(); KioskAutolaunchScreenView* GetKioskAutolaunchScreenView(); KioskEnableScreenView* GetKioskEnableScreenView(); TermsOfServiceScreenView* GetTermsOfServiceScreenView();
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index 9895fcdd..c27dc41 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -532,8 +532,10 @@ &SigninScreenHandler::HandleFirstIncorrectPasswordAttempt); AddCallback("maxIncorrectPasswordAttempts", &SigninScreenHandler::HandleMaxIncorrectPasswordAttempts); + AddCallback("sendFeedback", &SigninScreenHandler::HandleSendFeedback); AddCallback("sendFeedbackAndResyncUserData", &SigninScreenHandler::HandleSendFeedbackAndResyncUserData); + AddCallback("setupDemoMode", &SigninScreenHandler::HandleSetupDemoMode); // This message is sent by the kiosk app menu, but is handled here // so we can tell the delegate to launch the app. @@ -1285,6 +1287,11 @@ delegate_->ShowEnableDebuggingScreen(); } +void SigninScreenHandler::HandleSetupDemoMode() { + if (delegate_) + delegate_->ShowDemoModeSetupScreen(); +} + void SigninScreenHandler::HandleToggleKioskEnableScreen() { policy::BrowserPolicyConnectorChromeOS* connector = g_browser_process->platform_part()->browser_policy_connector_chromeos(); @@ -1545,16 +1552,27 @@ RecordReauthReason(account_id, ReauthReason::INCORRECT_PASSWORD_ENTERED); } +void SigninScreenHandler::HandleSendFeedback() { + login_feedback_ = + std::make_unique<LoginFeedback>(Profile::FromWebUI(web_ui())); + login_feedback_->Request( + std::string(), base::BindOnce(&SigninScreenHandler::OnFeedbackFinished, + weak_factory_.GetWeakPtr())); +} + void SigninScreenHandler::HandleSendFeedbackAndResyncUserData() { const std::string description = base::StringPrintf( "Auto generated feedback for http://crbug.com/547857.\n" "(uniquifier:%s)", base::Int64ToString(base::Time::Now().ToInternalValue()).c_str()); - login_feedback_.reset(new LoginFeedback(Profile::FromWebUI(web_ui()))); - login_feedback_->Request(description, - base::Bind(&SigninScreenHandler::OnFeedbackFinished, - weak_factory_.GetWeakPtr())); + login_feedback_ = + std::make_unique<LoginFeedback>(Profile::FromWebUI(web_ui())); + login_feedback_->Request( + description, + base::BindOnce( + &SigninScreenHandler::OnUnrecoverableCryptohomeFeedbackFinished, + weak_factory_.GetWeakPtr())); } void SigninScreenHandler::HandleRequestNewNoteAction( @@ -1653,10 +1671,16 @@ } void SigninScreenHandler::OnFeedbackFinished() { + login_feedback_.reset(); +} + +void SigninScreenHandler::OnUnrecoverableCryptohomeFeedbackFinished() { CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); // Recreate user's cryptohome after the feedback is attempted. HandleResyncUserData(); + + login_feedback_.reset(); } void SigninScreenHandler::OnAllowedInputMethodsChanged() {
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h index b2a51bc7..f3fe212 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
@@ -153,6 +153,9 @@ // Shows Enable Developer Features screen. virtual void ShowEnableDebuggingScreen() = 0; + // Shows Demo Mode Setup screen. + virtual void ShowDemoModeSetupScreen() = 0; + // Shows Kiosk Enable screen. virtual void ShowKioskEnableScreen() = 0; @@ -374,6 +377,7 @@ void HandleToggleEnrollmentScreen(); void HandleToggleEnrollmentAd(); void HandleToggleEnableDebuggingScreen(); + void HandleSetupDemoMode(); void HandleToggleKioskEnableScreen(); void HandleToggleResetScreen(); void HandleToggleKioskAutolaunchScreen(); @@ -403,6 +407,7 @@ void HandleLogRemoveUserWarningShown(); void HandleFirstIncorrectPasswordAttempt(const AccountId& account_id); void HandleMaxIncorrectPasswordAttempts(const AccountId& account_id); + void HandleSendFeedback(); void HandleSendFeedbackAndResyncUserData(); void HandleRequestNewNoteAction(const std::string& request_type); void HandleNewNoteLaunchAnimationDone(); @@ -449,6 +454,10 @@ // Callback invoked after the feedback is finished. void OnFeedbackFinished(); + // Callback invoked after the feedback sent from the unrecoverable cryptohome + // page is finished. + void OnUnrecoverableCryptohomeFeedbackFinished(); + // Called when the cros property controlling allowed input methods changes. void OnAllowedInputMethodsChanged();
diff --git a/chrome/browser/ui/webui/constrained_web_dialog_ui.cc b/chrome/browser/ui/webui/constrained_web_dialog_ui.cc index 0e061e8..7f6c2bc 100644 --- a/chrome/browser/ui/webui/constrained_web_dialog_ui.cc +++ b/chrome/browser/ui/webui/constrained_web_dialog_ui.cc
@@ -19,7 +19,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_message_handler.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/web_dialogs/web_dialog_delegate.h" #include "ui/web_dialogs/web_dialog_ui.h"
diff --git a/chrome/browser/ui/webui/cookies_tree_model_util.cc b/chrome/browser/ui/webui/cookies_tree_model_util.cc index f5ff4c3..5dc7e8a5 100644 --- a/chrome/browser/ui/webui/cookies_tree_model_util.cc +++ b/chrome/browser/ui/webui/cookies_tree_model_util.cc
@@ -20,7 +20,7 @@ #include "content/public/browser/cache_storage_context.h" #include "content/public/browser/indexed_db_context.h" #include "content/public/browser/service_worker_context.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/cookies/canonical_cookie.h" #include "storage/common/fileapi/file_system_types.h" #include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/webui/discards/discards_ui.cc b/chrome/browser/ui/webui/discards/discards_ui.cc index 492b1597..9b986af 100644 --- a/chrome/browser/ui/webui/discards/discards_ui.cc +++ b/chrome/browser/ui/webui/discards/discards_ui.cc
@@ -11,9 +11,8 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/resource_coordinator/discard_reason.h" -#include "chrome/browser/resource_coordinator/lifecycle_unit.h" -#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h" #include "chrome/browser/resource_coordinator/tab_manager.h" +#include "chrome/browser/resource_coordinator/tab_stats.h" #include "chrome/browser/resource_coordinator/time.h" #include "chrome/browser/ui/webui/discards/discards.mojom.h" #include "chrome/common/webui_url_constants.h" @@ -45,44 +44,31 @@ void GetTabDiscardsInfo(GetTabDiscardsInfoCallback callback) override { resource_coordinator::TabManager* tab_manager = g_browser_process->GetTabManager(); - const resource_coordinator::LifecycleUnitVector lifecycle_units = - tab_manager->GetSortedLifecycleUnits(); + resource_coordinator::TabStatsList stats = tab_manager->GetTabStats(); std::vector<mojom::TabDiscardsInfoPtr> infos; - infos.reserve(lifecycle_units.size()); + infos.reserve(stats.size()); - const base::TimeTicks now = resource_coordinator::NowTicks(); + base::TimeTicks now = resource_coordinator::NowTicks(); - // Convert the LifecycleUnits to a vector of TabDiscardsInfos. + // Convert the TabStatsList to a vector of TabDiscardsInfos. size_t rank = 1; - for (auto* lifecycle_unit : lifecycle_units) { + for (const auto& tab : stats) { mojom::TabDiscardsInfoPtr info(mojom::TabDiscardsInfo::New()); - resource_coordinator::TabLifecycleUnitExternal* - tab_lifecycle_unit_external = - lifecycle_unit->AsTabLifecycleUnitExternal(); - content::WebContents* contents = - tab_lifecycle_unit_external->GetWebContents(); - - info->tab_url = contents->GetLastCommittedURL().spec(); + info->tab_url = tab.tab_url; // This can be empty for pages without a favicon. The WebUI takes care of // showing the chrome://favicon default in that case. - info->favicon_url = lifecycle_unit->GetIconURL(); - info->title = base::UTF16ToUTF8(lifecycle_unit->GetTitle()); - info->is_media = tab_lifecycle_unit_external->IsMediaTab(); - info->is_discarded = tab_lifecycle_unit_external->IsDiscarded(); - info->discard_count = tab_lifecycle_unit_external->GetDiscardCount(); + info->favicon_url = tab.favicon_url; + info->title = base::UTF16ToUTF8(tab.title); + info->is_media = tab.is_media; + info->is_discarded = tab.is_discarded; + info->discard_count = tab.discard_count; info->utility_rank = rank++; - const base::TimeTicks last_focused_time = - lifecycle_unit->GetSortKey().last_focused_time; - const base::TimeDelta elapsed = - (last_focused_time == base::TimeTicks::Max()) - ? base::TimeDelta() - : (now - last_focused_time); + auto elapsed = now - tab.last_active; info->last_active_seconds = static_cast<int32_t>(elapsed.InSeconds()); - info->is_auto_discardable = - tab_lifecycle_unit_external->IsAutoDiscardable(); - info->id = lifecycle_unit->GetID(); + info->is_auto_discardable = tab.is_auto_discardable; + info->id = tab.id; infos.push_back(std::move(info)); }
diff --git a/chrome/browser/ui/webui/log_web_ui_url.cc b/chrome/browser/ui/webui/log_web_ui_url.cc index 9f7abf49..d4d3ba99 100644 --- a/chrome/browser/ui/webui/log_web_ui_url.cc +++ b/chrome/browser/ui/webui/log_web_ui_url.cc
@@ -10,7 +10,7 @@ #include "base/metrics/histogram_functions.h" #include "chrome/common/url_constants.h" #include "content/public/common/url_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "url/gurl.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/ui/webui/log_web_ui_url_unittest.cc b/chrome/browser/ui/webui/log_web_ui_url_unittest.cc index 76a735fc..8c9bd36 100644 --- a/chrome/browser/ui/webui/log_web_ui_url_unittest.cc +++ b/chrome/browser/ui/webui/log_web_ui_url_unittest.cc
@@ -4,7 +4,7 @@ #include "chrome/browser/ui/webui/log_web_ui_url.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/chrome/browser/ui/webui/net_export_ui.cc b/chrome/browser/ui/webui/net_export_ui.cc index 96b332cd..9adb8914 100644 --- a/chrome/browser/ui/webui/net_export_ui.cc +++ b/chrome/browser/ui/webui/net_export_ui.cc
@@ -36,7 +36,7 @@ #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/log/net_log_capture_mode.h" #include "net/url_request/url_request_context_getter.h" #include "ui/shell_dialogs/select_file_dialog.h"
diff --git a/chrome/browser/ui/webui/policy_ui_handler.cc b/chrome/browser/ui/webui/policy_ui_handler.cc index ccfafe79..8ca7434 100644 --- a/chrome/browser/ui/webui/policy_ui_handler.cc +++ b/chrome/browser/ui/webui/policy_ui_handler.cc
@@ -52,7 +52,7 @@ #include "components/policy/proto/device_management_backend.pb.h" #include "components/strings/grit/components_strings.h" #include "content/public/browser/web_contents.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "google_apis/gaia/gaia_auth_util.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/time_format.h"
diff --git a/chrome/browser/ui/webui/policy_ui_handler.h b/chrome/browser/ui/webui/policy_ui_handler.h index a3f7e8c..025f7704 100644 --- a/chrome/browser/ui/webui/policy_ui_handler.h +++ b/chrome/browser/ui/webui/policy_ui_handler.h
@@ -20,7 +20,7 @@ #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_message_handler.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ui/shell_dialogs/select_file_dialog.h" #if BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index e5bb420..5910e52 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -1499,6 +1499,7 @@ {"editPerson", IDS_SETTINGS_EDIT_PERSON}, {"profileNameAndPicture", IDS_SETTINGS_PROFILE_NAME_AND_PICTURE}, {"showShortcutLabel", IDS_SETTINGS_PROFILE_SHORTCUT_TOGGLE_LABEL}, + {"syncSettingsSavedToast", IDS_SETTINGS_SYNC_SETTINGS_SAVED_TOAST_LABEL}, #endif // defined(OS_CHROMEOS) #if BUILDFLAG(ENABLE_DICE_SUPPORT) {"peopleSignIn", IDS_SETTINGS_PEOPLE_SIGN_IN},
diff --git a/chrome/browser/ui/webui/settings/people_handler.cc b/chrome/browser/ui/webui/settings/people_handler.cc index 8c8cddf..d6fad81 100644 --- a/chrome/browser/ui/webui/settings/people_handler.cc +++ b/chrome/browser/ui/webui/settings/people_handler.cc
@@ -1017,6 +1017,7 @@ // start syncing. sync_blocker_.reset(); service->SetFirstSetupComplete(); + FireWebUIListener("sync-settings-saved"); } } // namespace settings
diff --git a/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc b/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc index 37fc2ac..6a6ab39c 100644 --- a/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc +++ b/chrome/browser/ui/webui/settings/settings_manage_profile_handler.cc
@@ -94,6 +94,12 @@ observer_.RemoveAll(); } +void ManageProfileHandler::OnProfileHighResAvatarLoaded( + const base::FilePath& profile_path) { + // GAIA image is loaded asynchronously. + FireWebUIListener("available-icons-changed", *GetAvailableIcons()); +} + void ManageProfileHandler::OnProfileAvatarChanged( const base::FilePath& profile_path) { // This is necessary to send the potentially updated GAIA photo. @@ -113,9 +119,20 @@ } std::unique_ptr<base::ListValue> ManageProfileHandler::GetAvailableIcons() { - std::unique_ptr<base::ListValue> image_url_list( + std::unique_ptr<base::ListValue> avatars( profiles::GetDefaultProfileAvatarIconsAndLabels()); + PrefService* pref_service = profile_->GetPrefs(); + bool using_gaia = pref_service->GetBoolean(prefs::kProfileUsingGAIAAvatar); + + // Select the avatar from the default set. + if (!using_gaia) { + size_t index = pref_service->GetInteger(prefs::kProfileAvatarIndex); + base::DictionaryValue* avatar = nullptr; + if (avatars->GetDictionary(index, &avatar)) + avatar->SetBoolean("selected", true); + } + // Add the GAIA picture to the beginning of the list if it is available. ProfileAttributesEntry* entry; if (g_browser_process->profile_manager()->GetProfileAttributesStorage(). @@ -130,11 +147,13 @@ "label", l10n_util::GetStringUTF16(IDS_SETTINGS_CHANGE_PICTURE_PROFILE_PHOTO)); gaia_picture_info->SetBoolean("isGaiaAvatar", true); - image_url_list->Insert(0, std::move(gaia_picture_info)); + if (using_gaia) + gaia_picture_info->SetBoolean("selected", true); + avatars->Insert(0, std::move(gaia_picture_info)); } } - return image_url_list; + return avatars; } void ManageProfileHandler::HandleSetProfileIconToGaiaAvatar(
diff --git a/chrome/browser/ui/webui/settings/settings_manage_profile_handler.h b/chrome/browser/ui/webui/settings/settings_manage_profile_handler.h index 0929d3d..659ef79 100644 --- a/chrome/browser/ui/webui/settings/settings_manage_profile_handler.h +++ b/chrome/browser/ui/webui/settings/settings_manage_profile_handler.h
@@ -32,6 +32,10 @@ // ProfileAttributesStorage::Observer: void OnProfileAvatarChanged(const base::FilePath& profile_path) override; + // ProfileAttributesStorage::Observer: + void OnProfileHighResAvatarLoaded( + const base::FilePath& profile_path) override; + private: FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, HandleSetProfileIconToGaiaAvatar); @@ -39,6 +43,8 @@ HandleSetProfileIconToDefaultAvatar); FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, HandleSetProfileName); FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, HandleGetAvailableIcons); + FRIEND_TEST_ALL_PREFIXES(ManageProfileHandlerTest, + HandleGetAvailableIconsGaiaAvatarSelected); // Callback for the "getAvailableIcons" message. // Sends the array of default profile icon URLs and profile names to WebUI.
diff --git a/chrome/browser/ui/webui/settings/settings_manage_profile_handler_unittest.cc b/chrome/browser/ui/webui/settings/settings_manage_profile_handler_unittest.cc index 5a2e216..d981468 100644 --- a/chrome/browser/ui/webui/settings/settings_manage_profile_handler_unittest.cc +++ b/chrome/browser/ui/webui/settings/settings_manage_profile_handler_unittest.cc
@@ -45,7 +45,30 @@ web_ui()->ClearTrackedCalls(); } - void VerifyIconList(const base::Value* value) { + void VerifyIconListWithNoneSelected(const base::Value* value) { + VerifyIconList(value, 0 /* ignored */, true); + } + + void VerifyIconListWithSingleSelection(const base::Value* value, + size_t selected_index) { + VerifyIconList(value, selected_index, false); + } + + content::TestWebUI* web_ui() { return &web_ui_; } + Profile* profile() const { return profile_; } + TestManageProfileHandler* handler() const { return handler_.get(); } + + private: + content::TestBrowserThreadBundle thread_bundle_; + TestingProfileManager profile_manager_; + content::TestWebUI web_ui_; + + Profile* profile_; + std::unique_ptr<TestManageProfileHandler> handler_; + + void VerifyIconList(const base::Value* value, + size_t selected_index, + bool all_not_selected) { const base::ListValue* icons = nullptr; ASSERT_TRUE(value->GetAsList(&icons)); @@ -61,20 +84,16 @@ std::string icon_label; EXPECT_TRUE(icon->GetString("label", &icon_label)); EXPECT_FALSE(icon_label.empty()); + bool icon_selected; + bool has_icon_selected = icon->GetBoolean("selected", &icon_selected); + if (all_not_selected) { + EXPECT_FALSE(has_icon_selected); + } else if (selected_index == i) { + EXPECT_TRUE(has_icon_selected); + EXPECT_TRUE(icon_selected); + } } } - - content::TestWebUI* web_ui() { return &web_ui_; } - Profile* profile() const { return profile_; } - TestManageProfileHandler* handler() const { return handler_.get(); } - - private: - content::TestBrowserThreadBundle thread_bundle_; - TestingProfileManager profile_manager_; - content::TestWebUI web_ui_; - - Profile* profile_; - std::unique_ptr<TestManageProfileHandler> handler_; }; TEST_F(ManageProfileHandlerTest, HandleSetProfileIconToGaiaAvatar) { @@ -106,6 +125,30 @@ } TEST_F(ManageProfileHandlerTest, HandleGetAvailableIcons) { + PrefService* pref_service = profile()->GetPrefs(); + pref_service->SetInteger(prefs::kProfileAvatarIndex, 7); + + base::ListValue list_args_1; + list_args_1.AppendString("get-icons-callback-id"); + handler()->HandleGetAvailableIcons(&list_args_1); + + EXPECT_EQ(1U, web_ui()->call_data().size()); + + const content::TestWebUI::CallData& data_1 = *web_ui()->call_data().back(); + EXPECT_EQ("cr.webUIResponse", data_1.function_name()); + + std::string callback_id_1; + ASSERT_TRUE(data_1.arg1()->GetAsString(&callback_id_1)); + EXPECT_EQ("get-icons-callback-id", callback_id_1); + + VerifyIconListWithSingleSelection(data_1.arg3(), 7); +} + +TEST_F(ManageProfileHandlerTest, HandleGetAvailableIconsGaiaAvatarSelected) { + PrefService* pref_service = profile()->GetPrefs(); + pref_service->SetInteger(prefs::kProfileAvatarIndex, 7); + pref_service->SetBoolean(prefs::kProfileUsingGAIAAvatar, true); + base::ListValue list_args; list_args.AppendString("get-icons-callback-id"); handler()->HandleGetAvailableIcons(&list_args); @@ -119,10 +162,13 @@ ASSERT_TRUE(data.arg1()->GetAsString(&callback_id)); EXPECT_EQ("get-icons-callback-id", callback_id); - VerifyIconList(data.arg3()); + VerifyIconListWithNoneSelected(data.arg3()); } TEST_F(ManageProfileHandlerTest, ProfileAvatarChangedWebUIEvent) { + PrefService* pref_service = profile()->GetPrefs(); + pref_service->SetInteger(prefs::kProfileAvatarIndex, 12); + handler()->OnProfileAvatarChanged(base::FilePath()); EXPECT_EQ(1U, web_ui()->call_data().size()); @@ -133,8 +179,7 @@ std::string event_id; ASSERT_TRUE(data.arg1()->GetAsString(&event_id)); EXPECT_EQ("available-icons-changed", event_id); - - VerifyIconList(data.arg2()); + VerifyIconListWithSingleSelection(data.arg2(), 12); } } // namespace settings
diff --git a/chrome/browser/ui/webui/webapks_handler.cc b/chrome/browser/ui/webui/webapks_handler.cc index 264fe0e4..2510fbe 100644 --- a/chrome/browser/ui/webui/webapks_handler.cc +++ b/chrome/browser/ui/webui/webapks_handler.cc
@@ -65,6 +65,9 @@ result->SetString("themeColor", ColorToString(webapk_info.theme_color)); result->SetString("backgroundColor", ColorToString(webapk_info.background_color)); + result->SetDouble("lastUpdateCheckTimeMs", + webapk_info.last_update_check_time.ToJsTime()); + result->SetBoolean("relaxUpdates", webapk_info.relax_updates); list.Append(std::move(result)); }
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash.cc b/chrome/browser/ui/window_sizer/window_sizer_ash.cc index 09dd86a8..a67f920 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash.cc
@@ -21,6 +21,9 @@ if (ash_util::IsRunningInMash() || !browser_) return false; + // This should not be called on a Browser that already has a window. + DCHECK(!browser_->window()); + bool determined = false; if (bounds->IsEmpty()) { if (browser_->is_type_tabbed()) { @@ -102,14 +105,8 @@ return; } - // The |browser_window| is non NULL when this is called after - // browser's aura window is created. - aura::Window* browser_window = - browser_->window() ? browser_->window()->GetNativeWindow() : NULL; - ash::WindowPositioner::GetBoundsAndShowStateForNewWindow( - browser_window, is_saved_bounds, passed_show_state, bounds_in_screen, - show_state); + is_saved_bounds, passed_show_state, bounds_in_screen, show_state); } gfx::Rect WindowSizer::GetDefaultWindowBoundsAsh(
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc index 7e6d73d..c6521d55d 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
@@ -26,13 +26,26 @@ #include "ui/display/screen.h" #include "ui/wm/public/activation_client.h" -using WindowSizerAshTest = ash::AshTestBase; +class WindowSizerAshTest : public ash::AshTestBase { + public: + WindowSizerAshTest() = default; + ~WindowSizerAshTest() override = default; + + // The window sizing code only works when the window hasn't yet been created. + std::unique_ptr<Browser> CreateWindowlessBrowser( + Browser::CreateParams params) { + params.skip_window_init_for_testing = true; + return std::make_unique<Browser>(params); + } + + private: + DISALLOW_COPY_AND_ASSIGN(WindowSizerAshTest); +}; namespace { -using util = WindowSizerTestUtil; - // Shorten identifiers to improve line wrapping. +using util = WindowSizerTestUtil; const int kDesktopBorderSize = WindowSizer::kDesktopBorderSize; const int kMaximumWindowWidth = WindowSizer::kMaximumWindowWidth; @@ -379,16 +392,13 @@ TEST_F(WindowSizerAshTest, PlaceNewWindows) { // Create a browser to pass into the util::GetWindowBounds function. std::unique_ptr<TestingProfile> profile(new TestingProfile()); - // Creating a popup handler here to make sure it does not interfere with the - // existing windows. Browser::CreateParams native_params(profile.get(), true); - std::unique_ptr<Browser> browser( - CreateBrowserWithTestWindowForParams(&native_params)); + auto browser = CreateWindowlessBrowser(native_params); // Creating a popup handler here to make sure it does not interfere with the // existing windows. Browser::CreateParams params2(profile.get(), true); - std::unique_ptr<Browser> browser2(CreateTestBrowser( + std::unique_ptr<Browser> browser2 = (CreateTestBrowser( CreateTestWindowInShellWithId(0), gfx::Rect(16, 32, 640, 320), ¶ms2)); BrowserWindow* browser_window = browser2->window(); @@ -405,11 +415,16 @@ gfx::Rect(32, 48, 256, 512), ¶ms_panel)); browser_window->Show(); - { // Make sure that popups do not get changed. + + // Make sure that popups do not get changed. + { + Browser::CreateParams params_popup(Browser::TYPE_POPUP, profile.get(), + true); + auto new_popup = CreateWindowlessBrowser(params_popup); gfx::Rect window_bounds; util::GetWindowBounds(p1600x1200, p1600x1200, gfx::Rect(), gfx::Rect(50, 100, 300, 150), bottom_s1600x1200, - PERSISTED, browser_popup.get(), gfx::Rect(), + PERSISTED, new_popup.get(), gfx::Rect(), &window_bounds); EXPECT_EQ("50,100 300x150", window_bounds.ToString()); } @@ -450,8 +465,7 @@ // function. std::unique_ptr<TestingProfile> profile(new TestingProfile()); Browser::CreateParams native_params(profile.get(), true); - std::unique_ptr<Browser> browser( - CreateBrowserWithTestWindowForParams(&native_params)); + auto browser = CreateWindowlessBrowser(native_params); // A common screen size for Chrome OS devices where this behavior is // desirable. @@ -543,8 +557,7 @@ // Creating a new window to verify the new placement. Browser::CreateParams new_params(profile.get(), true); - std::unique_ptr<Browser> new_browser(CreateTestBrowser( - CreateTestWindowInShellWithId(0), gfx::Rect(), &new_params)); + auto new_browser = CreateWindowlessBrowser(new_params); // Make sure the primary root is active. ASSERT_EQ(ash::Shell::GetPrimaryRootWindow(), @@ -612,14 +625,11 @@ // Creating a browser & window to play with. Browser::CreateParams params(Browser::TYPE_TABBED, profile.get(), true); - std::unique_ptr<Browser> browser(CreateTestBrowser( - CreateTestWindowInShellWithId(0), gfx::Rect(16, 32, 640, 320), ¶ms)); + auto browser = CreateWindowlessBrowser(params); // Create also a popup browser since that behaves different. Browser::CreateParams params_popup(Browser::TYPE_POPUP, profile.get(), true); - std::unique_ptr<Browser> browser_popup( - CreateTestBrowser(CreateTestWindowInShellWithId(1), - gfx::Rect(16, 32, 640, 320), ¶ms_popup)); + auto browser_popup = CreateWindowlessBrowser(params_popup); // Tabbed windows should retrieve the saved window state - since there is a // top window. @@ -671,15 +681,11 @@ int min_size = ash::WindowPositioner::GetForceMaximizedWidthLimit() / 2; if (min_size > 0) { const gfx::Rect tiny_screen(0, 0, min_size, min_size); - EXPECT_EQ(ui::SHOW_STATE_DEFAULT, - util::GetWindowShowState( - ui::SHOW_STATE_MAXIMIZED, ui::SHOW_STATE_DEFAULT, BOTH, - browser.get(), tiny_screen, tiny_screen)); - browser->window()->Hide(); + browser2->window()->Hide(); EXPECT_EQ(ui::SHOW_STATE_MAXIMIZED, util::GetWindowShowState( ui::SHOW_STATE_MAXIMIZED, ui::SHOW_STATE_DEFAULT, BOTH, - browser2.get(), tiny_screen, tiny_screen)); + browser.get(), tiny_screen, tiny_screen)); } } @@ -689,15 +695,12 @@ std::unique_ptr<TestingProfile> profile(new TestingProfile()); Browser::CreateParams params(Browser::TYPE_TABBED, profile.get(), true); - std::unique_ptr<Browser> browser(CreateTestBrowser( - CreateTestWindowInShellWithId(0), gfx::Rect(16, 32, 640, 320), ¶ms)); + auto browser = CreateWindowlessBrowser(params); // Create also a popup browser since that behaves slightly different for // defaults. Browser::CreateParams params_popup(Browser::TYPE_POPUP, profile.get(), true); - std::unique_ptr<Browser> browser_popup( - CreateTestBrowser(CreateTestWindowInShellWithId(1), - gfx::Rect(16, 32, 128, 256), ¶ms_popup)); + auto browser_popup = CreateWindowlessBrowser(params_popup); // Check that a browser creation state always get used if not given as // SHOW_STATE_DEFAULT. @@ -744,8 +747,7 @@ // Create a browser to pass into the util::GetWindowBounds function. std::unique_ptr<TestingProfile> profile(new TestingProfile()); Browser::CreateParams native_params(profile.get(), true); - std::unique_ptr<Browser> browser( - CreateBrowserWithTestWindowForParams(&native_params)); + auto browser = CreateWindowlessBrowser(native_params); gfx::Rect display_bounds = display::Screen::GetScreen()->GetPrimaryDisplay().bounds(); @@ -812,9 +814,7 @@ profile.get(), true); trusted_popup_create_params.trusted_source = true; - std::unique_ptr<Browser> trusted_popup(CreateTestBrowser( - CreateTestWindowInShellWithId(1), gfx::Rect(16, 32, 640, 320), - &trusted_popup_create_params)); + auto trusted_popup = CreateWindowlessBrowser(trusted_popup_create_params); // Trusted popup windows should follow the saved show state and ignore the // last show state. EXPECT_EQ(ui::SHOW_STATE_DEFAULT,
diff --git a/chrome/browser/vr/BUILD.gn b/chrome/browser/vr/BUILD.gn index ed0b63c..771ffffa 100644 --- a/chrome/browser/vr/BUILD.gn +++ b/chrome/browser/vr/BUILD.gn
@@ -5,7 +5,7 @@ import("//build/buildflag_header.gni") import("//chrome/browser/vr/features.gni") import("//chrome/common/features.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//testing/test.gni") import("//tools/grit/repack.gni")
diff --git a/chrome/browser/vr/elements/ui_element_name.cc b/chrome/browser/vr/elements/ui_element_name.cc index 4cb1d7e..d01825af 100644 --- a/chrome/browser/vr/elements/ui_element_name.cc +++ b/chrome/browser/vr/elements/ui_element_name.cc
@@ -65,6 +65,7 @@ "kOmniboxOuterLayoutSpacer", "kOmniboxShadow", "k2dBrowsingVisibiltyControlForVoice", + "k2dBrowsingVisibilityControlForPrompt", "k2dBrowsingVisibiltyControlForSiteInfoPrompt", "k2dBrowsingOpacityControlForAudioPermissionPrompt", "k2dBrowsingOpacityControlForNativeDialogPrompt",
diff --git a/chrome/browser/vr/elements/ui_element_name.h b/chrome/browser/vr/elements/ui_element_name.h index 7c02196d..6d5db0f 100644 --- a/chrome/browser/vr/elements/ui_element_name.h +++ b/chrome/browser/vr/elements/ui_element_name.h
@@ -64,6 +64,7 @@ kOmniboxOuterLayoutSpacer, kOmniboxShadow, k2dBrowsingVisibiltyControlForVoice, + k2dBrowsingVisibilityControlForPrompt, k2dBrowsingVisibiltyControlForSiteInfoPrompt, k2dBrowsingOpacityControlForAudioPermissionPrompt, k2dBrowsingOpacityControlForNativeDialogPrompt,
diff --git a/chrome/browser/vr/features.gni b/chrome/browser/vr/features.gni index cf92927..9e16a8c1 100644 --- a/chrome/browser/vr/features.gni +++ b/chrome/browser/vr/features.gni
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/chrome_build.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") assert(enable_vr)
diff --git a/chrome/browser/vr/service/vr_device_manager.cc b/chrome/browser/vr/service/vr_device_manager.cc index 7be2198..7a91126 100644 --- a/chrome/browser/vr/service/vr_device_manager.cc +++ b/chrome/browser/vr/service/vr_device_manager.cc
@@ -14,7 +14,7 @@ #include "chrome/common/chrome_features.h" #include "content/public/common/content_features.h" #include "content/public/common/service_manager_connection.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #include "device/vr/orientation/orientation_device_provider.h" #include "device/vr/vr_device_provider.h"
diff --git a/chrome/browser/vr/testapp/vr_test_context.cc b/chrome/browser/vr/testapp/vr_test_context.cc index 1a9e124..eecd327 100644 --- a/chrome/browser/vr/testapp/vr_test_context.cc +++ b/chrome/browser/vr/testapp/vr_test_context.cc
@@ -201,6 +201,10 @@ case ui::DomCode::US_X: ui_->OnAppButtonClicked(); break; + case ui::DomCode::US_Q: + model_->active_modal_prompt_type = + kModalPromptTypeGenericUnsupportedFeature; + break; default: break; }
diff --git a/chrome/browser/vr/ui_scene_creator.cc b/chrome/browser/vr/ui_scene_creator.cc index e7508b9d..1772b61 100644 --- a/chrome/browser/vr/ui_scene_creator.cc +++ b/chrome/browser/vr/ui_scene_creator.cc
@@ -720,12 +720,23 @@ element = Create<UiElement>(k2dBrowsingVisibiltyControlForVoice, kPhaseNone); scene_->AddUiElement(k2dBrowsingRepositioner, std::move(element)); + element = + Create<UiElement>(k2dBrowsingVisibilityControlForPrompt, kPhaseNone); + VR_BIND_VISIBILITY( + element, + model->active_modal_prompt_type == kModalPromptTypeNone || + model->active_modal_prompt_type == + kModalPromptTypeExitVRForVoiceSearchRecordAudioOsPermission || + model->active_modal_prompt_type == kModalPromptTypeUpdateKeyboard); + scene_->AddUiElement(k2dBrowsingVisibiltyControlForVoice, std::move(element)); + element = Create<UiElement>(k2dBrowsingVisibiltyControlForSiteInfoPrompt, kPhaseNone); VR_BIND_VISIBILITY(element, model->active_modal_prompt_type != kModalPromptTypeExitVRForSiteInfo); - scene_->AddUiElement(k2dBrowsingVisibiltyControlForVoice, std::move(element)); + scene_->AddUiElement(k2dBrowsingVisibilityControlForPrompt, + std::move(element)); element = Create<UiElement>(k2dBrowsingOpacityControlForAudioPermissionPrompt, kPhaseNone);
diff --git a/chrome/browser/vr/vr_tab_helper.cc b/chrome/browser/vr/vr_tab_helper.cc index eca591b..9c447dae 100644 --- a/chrome/browser/vr/vr_tab_helper.cc +++ b/chrome/browser/vr/vr_tab_helper.cc
@@ -7,7 +7,7 @@ #include "base/metrics/histogram_macros.h" #include "content/public/browser/render_view_host.h" #include "content/public/common/web_preferences.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" using content::WebContents; using content::WebPreferences;
diff --git a/chrome/browser/web_applications/web_app_unittest.cc b/chrome/browser/web_applications/web_app_unittest.cc index 9fce522..e93baa8 100644 --- a/chrome/browser/web_applications/web_app_unittest.cc +++ b/chrome/browser/web_applications/web_app_unittest.cc
@@ -13,7 +13,7 @@ #include "chrome/common/render_messages.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "content/public/test/test_renderer_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #if defined(TOOLKIT_VIEWS)
diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni index 94c5f75..c692280 100644 --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni
@@ -4,7 +4,7 @@ import("//build/config/locales.gni") import("//chrome/common/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//ui/base/ui_features.gni") import("chrome_repack_locales.gni")
diff --git a/chrome/chrome_repack_locales.gni b/chrome/chrome_repack_locales.gni index a80f158..d2a02989 100644 --- a/chrome/chrome_repack_locales.gni +++ b/chrome/chrome_repack_locales.gni
@@ -5,7 +5,7 @@ import("//build/config/chrome_build.gni") import("//build/config/features.gni") import("//build/config/ui.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//tools/grit/repack.gni") assert(!is_ios, "Chromium/iOS shouldn't use anything in //chrome")
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn index 63f5851..15645d63 100644 --- a/chrome/common/BUILD.gn +++ b/chrome/common/BUILD.gn
@@ -7,8 +7,8 @@ import("//chrome/common/features.gni") import("//chrome/process_version_rc_template.gni") # For branding_file_path. import("//components/nacl/features.gni") -import("//device/vr/features/features.gni") -import("//extensions/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//pdf/features.gni") @@ -254,8 +254,8 @@ "//components/variations", "//components/visitedlink/common", "//content/public/common", + "//extensions/buildflags", "//extensions/common:common_constants", - "//extensions/features", "//google_apis", "//gpu/command_buffer/service", "//gpu/config", @@ -566,7 +566,7 @@ ":buildflags", ":non_code_constants", "//content/public/common:result_codes", - "//extensions/features", + "//extensions/buildflags", "//printing/features", "//rlz/features", "//ui/base:ui_features", @@ -579,7 +579,7 @@ "//components/bookmarks/common", "//components/nacl/common:switches", "//components/offline_pages/buildflags", - "//device/vr/features", + "//device/vr/buildflags", "//media:media_features", "//media/cdm:cdm_paths", # Needed by chrome_paths.cc. "//ppapi/features", @@ -694,6 +694,7 @@ "//components/content_settings/core/common:mojo_bindings", "//content/public/common:interfaces", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//third_party/WebKit/public:mojo_bindings", "//ui/gfx/geometry/mojo", "//url/mojom:url_mojom_gurl", @@ -722,6 +723,7 @@ public_deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//url/mojom:url_mojom_gurl", ] }
diff --git a/chrome/common/DEPS b/chrome/common/DEPS index d46960f..b4a5a1d 100644 --- a/chrome/common/DEPS +++ b/chrome/common/DEPS
@@ -37,9 +37,9 @@ "+components/translate/core/common", "+components/url_formatter", "+components/version_info", - "+device/vr/features/features.h", + "+device/vr/buildflags/buildflags.h", + "+extensions/buildflags", "+extensions/common", - "+extensions/features", "+gin/public", # For profiling.cc "+google_apis/gaia", # For gaia_switches.h "+media",
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index 750df2f..20afadb 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc
@@ -44,8 +44,8 @@ #include "content/public/common/content_switches.h" #include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "gpu/config/gpu_info.h" #include "gpu/config/gpu_util.h" #include "media/base/media_switches.h"
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index a24ba80e..571b9b19 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -7,7 +7,7 @@ #include "base/command_line.h" #include "build/build_config.h" #include "chrome/common/chrome_switches.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/features/features.h" namespace features {
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 30afa31..6957622 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -12,8 +12,8 @@ #include "build/build_config.h" #include "build/buildflag.h" #include "chrome/common/buildflags.h" -#include "device/vr/features/features.h" -#include "extensions/features/features.h" +#include "device/vr/buildflags/buildflags.h" +#include "extensions/buildflags/buildflags.h" #include "ppapi/features/features.h" #include "printing/features/features.h" #include "ui/base/ui_features.h"
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h index c0e785c..1f6ca74 100644 --- a/chrome/common/common_message_generator.h +++ b/chrome/common/common_message_generator.h
@@ -28,7 +28,7 @@ #endif #include "content/public/common/common_param_traits.h" #include "content/public/common/common_param_traits_macros.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "printing/features/features.h"
diff --git a/chrome/common/extensions/BUILD.gn b/chrome/common/extensions/BUILD.gn index 82b7bd0..d08682a 100644 --- a/chrome/common/extensions/BUILD.gn +++ b/chrome/common/extensions/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//tools/json_schema_compiler/json_features.gni")
diff --git a/chrome/common/extensions/api/BUILD.gn b/chrome/common/extensions/api/BUILD.gn index 059d6b44..2be0fae7 100644 --- a/chrome/common/extensions/api/BUILD.gn +++ b/chrome/common/extensions/api/BUILD.gn
@@ -5,7 +5,7 @@ import("//build/config/features.gni") import("//build/config/ui.gni") import("//chrome/common/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//tools/json_schema_compiler/json_features.gni") import("//tools/json_schema_compiler/json_schema_api.gni")
diff --git a/chrome/common/features.gni b/chrome/common/features.gni index e80be25..04970c1 100644 --- a/chrome/common/features.gni +++ b/chrome/common/features.gni
@@ -7,8 +7,8 @@ import("//build/config/compiler/compiler.gni") import("//build/config/features.gni") import("//build/config/linux/gtk/gtk.gni") -import("//device/vr/features/features.gni") -import("//extensions/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//net/features.gni") import("//ppapi/features/features.gni")
diff --git a/chrome/common/importer/BUILD.gn b/chrome/common/importer/BUILD.gn index 49a38529..74e4eab3 100644 --- a/chrome/common/importer/BUILD.gn +++ b/chrome/common/importer/BUILD.gn
@@ -12,6 +12,7 @@ public_deps = [ "//components/autofill/content/common:mojo_types", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//url/mojom:url_mojom_gurl", ] }
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 80a7b682..1dfa3fd 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -8,7 +8,7 @@ #include "build/build_config.h" #include "chrome/common/buildflags.h" #include "chrome/common/pref_font_webkit_names.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/features/features.h"
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 3f59f93f..5e82ff18 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -12,7 +12,7 @@ #include "build/build_config.h" #include "chrome/common/buildflags.h" #include "components/offline_pages/buildflags/buildflags.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/features/features.h" #include "rlz/features/features.h"
diff --git a/chrome/common/stack_sampling_configuration.cc b/chrome/common/stack_sampling_configuration.cc index b7c3af63..0f97dcc 100644 --- a/chrome/common/stack_sampling_configuration.cc +++ b/chrome/common/stack_sampling_configuration.cc
@@ -12,7 +12,7 @@ #include "chrome/common/chrome_switches.h" #include "components/version_info/version_info.h" #include "content/public/common/content_switches.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if defined(OS_MACOSX) #include "base/mac/mac_util.h"
diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc index 911f6361..5e3c3929 100644 --- a/chrome/common/webui_url_constants.cc +++ b/chrome/common/webui_url_constants.cc
@@ -7,7 +7,7 @@ #include "base/macros.h" #include "components/nacl/common/buildflags.h" #include "components/safe_browsing/web_ui/constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" namespace chrome {
diff --git a/chrome/gpu/BUILD.gn b/chrome/gpu/BUILD.gn index 0610f6a..33909df7 100644 --- a/chrome/gpu/BUILD.gn +++ b/chrome/gpu/BUILD.gn
@@ -21,6 +21,18 @@ "//media/cdm:cdm_paths", "//media/cdm/library_cdm/clear_key_cdm:clear_key_cdm_proxy", ] + + if (is_win) { + sources += [ + "widevine_cdm_proxy_factory.cc", + "widevine_cdm_proxy_factory.h", + ] + deps += [ + "//media", + "//media/gpu", + ] + libs = [ "d3d11.lib" ] + } } if (is_chromeos) {
diff --git a/chrome/gpu/DEPS b/chrome/gpu/DEPS index 82955bee..d3fa63e 100644 --- a/chrome/gpu/DEPS +++ b/chrome/gpu/DEPS
@@ -6,5 +6,7 @@ "+content/public/child", "+content/public/gpu", "+media/cdm", + "+media/gpu", "+services/service_manager/public/cpp", + "+third_party/widevine/cdm/widevine_cdm_common.h", ]
diff --git a/chrome/gpu/chrome_content_gpu_client.cc b/chrome/gpu/chrome_content_gpu_client.cc index 02f92de..d30f94b 100644 --- a/chrome/gpu/chrome_content_gpu_client.cc +++ b/chrome/gpu/chrome_content_gpu_client.cc
@@ -9,13 +9,19 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" +#include "build/build_config.h" #include "content/public/child/child_thread.h" #include "mojo/public/cpp/bindings/strong_binding.h" #if BUILDFLAG(ENABLE_LIBRARY_CDMS) #include "media/cdm/cdm_paths.h" #include "media/cdm/library_cdm/clear_key_cdm/clear_key_cdm_proxy.h" -#endif +#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. +#if defined(WIDEVINE_CDM_AVAILABLE) && defined(OS_WIN) +#include "chrome/gpu/widevine_cdm_proxy_factory.h" +#include "third_party/widevine/cdm/widevine_cdm_common.h" +#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(OS_WIN) +#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) #if defined(OS_CHROMEOS) #include "components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h" @@ -94,10 +100,14 @@ if (cdm_guid == media::kClearKeyCdmGuid) return std::make_unique<media::ClearKeyCdmProxy>(); - // TODO(rkuroiwa): Support creating Widevine specific CDM proxy here. +#if defined(WIDEVINE_CDM_AVAILABLE) && defined(OS_WIN) + if (cdm_guid == kWidevineCdmGuid) + return CreateWidevineCdmProxy(); +#endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(OS_WIN) + return nullptr; } -#endif +#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) #if defined(OS_CHROMEOS) void ChromeContentGpuClient::CreateArcVideoDecodeAccelerator(
diff --git a/chrome/gpu/widevine_cdm_proxy_factory.cc b/chrome/gpu/widevine_cdm_proxy_factory.cc new file mode 100644 index 0000000..bab6fde --- /dev/null +++ b/chrome/gpu/widevine_cdm_proxy_factory.cc
@@ -0,0 +1,82 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/gpu/widevine_cdm_proxy_factory.h" + +#include <comdef.h> +#include <initguid.h> + +#include <iomanip> + +#include "build/build_config.h" +#include "media/cdm/cdm_proxy.h" +#include "media/gpu/windows/d3d11_cdm_proxy.h" + +namespace { + +// Helpers for printing HRESULTs. +struct PrintHr { + explicit PrintHr(HRESULT hr) : hr(hr) {} + HRESULT hr; +}; + +std::ostream& operator<<(std::ostream& os, const PrintHr& phr) { + std::ios_base::fmtflags ff = os.flags(); + os << _com_error(phr.hr).ErrorMessage() << " (" << std::showbase << std::hex + << std::uppercase << std::setfill('0') << std::setw(8) << phr.hr << ")"; + os.flags(ff); + return os; +} + +// clang-format off +DEFINE_GUID(kD3D11ConfigWidevineStreamId, + 0x586e681, 0x4e14, 0x4133, 0x85, 0xe5, 0xa1, 0x4, 0x1f, 0x59, 0x9e, 0x26); +// clang-format on + +} // namespace + +std::unique_ptr<media::CdmProxy> CreateWidevineCdmProxy() { + Microsoft::WRL::ComPtr<ID3D11Device> device; + Microsoft::WRL::ComPtr<ID3D11VideoDevice> video_device; + + // D3D11CdmProxy requires D3D_FEATURE_LEVEL_11_1. + const D3D_FEATURE_LEVEL feature_levels[] = {D3D_FEATURE_LEVEL_11_1}; + + // Create device and pupulate |device|. + HRESULT hresult = D3D11CreateDevice( + nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, feature_levels, + arraysize(feature_levels), D3D11_SDK_VERSION, device.GetAddressOf(), + nullptr, nullptr); + + if (FAILED(hresult)) { + DLOG(ERROR) << "Failed to create the D3D11Device: " << PrintHr(hresult); + return nullptr; + } + + hresult = device.CopyTo(video_device.GetAddressOf()); + if (FAILED(hresult)) { + DLOG(ERROR) << "Failed to get ID3D11VideoDevice: " << PrintHr(hresult); + return nullptr; + } + + D3D11_VIDEO_CONTENT_PROTECTION_CAPS caps = {}; + + // Check whether kD3D11ConfigWidevineStreamId is supported. + // We do not care about decoder support so just use a null decoder profile. + hresult = video_device->GetContentProtectionCaps( + &kD3D11ConfigWidevineStreamId, nullptr, &caps); + if (FAILED(hresult)) { + DLOG(ERROR) << "Failed to GetContentProtectionCaps: " << PrintHr(hresult); + return nullptr; + } + + media::D3D11CdmProxy::FunctionIdMap function_id_map{ + {media::CdmProxy::Function::kIntelNegotiateCryptoSessionKeyExchange, + 0x90000001}}; + + return std::make_unique<media::D3D11CdmProxy>( + kD3D11ConfigWidevineStreamId, + media::CdmProxy::Protocol::kIntelConvergedSecurityAndManageabilityEngine, + std::move(function_id_map)); +}
diff --git a/chrome/gpu/widevine_cdm_proxy_factory.h b/chrome/gpu/widevine_cdm_proxy_factory.h new file mode 100644 index 0000000..e2b3b05 --- /dev/null +++ b/chrome/gpu/widevine_cdm_proxy_factory.h
@@ -0,0 +1,16 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_GPU_WIDEVINE_CDM_PROXY_FACTORY_H_ +#define CHROME_GPU_WIDEVINE_CDM_PROXY_FACTORY_H_ + +#include <memory> + +namespace media { +class CdmProxy; +} + +std::unique_ptr<media::CdmProxy> CreateWidevineCdmProxy(); + +#endif // CHROME_GPU_WIDEVINE_CDM_PROXY_FACTORY_H_
diff --git a/chrome/gpu/widevine_cdm_proxy_factory_unittest.cc b/chrome/gpu/widevine_cdm_proxy_factory_unittest.cc new file mode 100644 index 0000000..41270dc --- /dev/null +++ b/chrome/gpu/widevine_cdm_proxy_factory_unittest.cc
@@ -0,0 +1,14 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/gpu/widevine_cdm_proxy_factory.h" + +#include "media/cdm/cdm_proxy.h" +#include "testing/gtest/include/gtest/gtest.h" + +TEST(WidevineCdmProxyFactoryTest, CreateWidevineCdmProxy) { + // This fucntion may return null on unsupported devices. Hence ignore the + // return value and just make sure we do not crash in all cases. + CreateWidevineCdmProxy(); +}
diff --git a/chrome/renderer/BUILD.gn b/chrome/renderer/BUILD.gn index 53d08fd..f519705 100644 --- a/chrome/renderer/BUILD.gn +++ b/chrome/renderer/BUILD.gn
@@ -6,7 +6,7 @@ import("//chrome/common/features.gni") import("//components/nacl/features.gni") import("//components/spellcheck/spellcheck_build_features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//ppapi/features/features.gni") import("//tools/grit/grit_rule.gni") @@ -140,7 +140,7 @@ "//content/app/strings", "//content/public/common", "//content/public/renderer", - "//extensions/features", + "//extensions/buildflags", "//media", "//media:media_features", "//media/capture", @@ -432,7 +432,7 @@ ":renderer", "//chrome/common:search_mojom", "//content/test:test_support", - "//extensions/features", + "//extensions/buildflags", "//testing/gmock", "//testing/gtest", ]
diff --git a/chrome/renderer/DEPS b/chrome/renderer/DEPS index 2b2d92f..91082f2f 100644 --- a/chrome/renderer/DEPS +++ b/chrome/renderer/DEPS
@@ -47,7 +47,7 @@ "+content/public/common", "+content/public/renderer", "+extensions/common", - "+extensions/features", + "+extensions/buildflags", "+extensions/renderer", "+gin", "+media/base",
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index 5fdd742..3874615c 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -99,8 +99,8 @@ #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_visitor.h" #include "content/public/renderer/render_view.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "ipc/ipc_sync_channel.h" #include "media/base/media_switches.h" #include "media/media_features.h"
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h index b6f280cbf..d3bdf1b 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -24,7 +24,7 @@ #include "components/spellcheck/spellcheck_buildflags.h" #include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/render_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ipc/ipc_channel_proxy.h" #include "media/media_features.h" #include "ppapi/features/features.h"
diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc index 675ffa5a..0f9ee20 100644 --- a/chrome/renderer/chrome_content_renderer_client_unittest.cc +++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc
@@ -20,7 +20,7 @@ #include "chrome/renderer/searchbox/search_bouncer.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h" #include "content/public/common/webplugininfo.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURLResponse.h"
diff --git a/chrome/renderer/chrome_render_thread_observer.cc b/chrome/renderer/chrome_render_thread_observer.cc index ca9ba4e..d81dc01 100644 --- a/chrome/renderer/chrome_render_thread_observer.cc +++ b/chrome/renderer/chrome_render_thread_observer.cc
@@ -47,7 +47,7 @@ #include "content/public/renderer/render_view.h" #include "content/public/renderer/render_view_visitor.h" #include "content/public/renderer/resource_dispatcher_delegate.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "ipc/ipc_sync_channel.h" #include "media/base/localized_strings.h" #include "mojo/public/cpp/bindings/strong_binding.h"
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc index 50a94228..207869e 100644 --- a/chrome/renderer/content_settings_observer.cc +++ b/chrome/renderer/content_settings_observer.cc
@@ -22,7 +22,7 @@ #include "content/public/renderer/document_state.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_view.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "third_party/WebKit/public/common/associated_interfaces/associated_interface_provider.h" #include "third_party/WebKit/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/WebKit/public/platform/URLConversion.h"
diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h index 8030dcd9..0ef24fd 100644 --- a/chrome/renderer/content_settings_observer.h +++ b/chrome/renderer/content_settings_observer.h
@@ -17,7 +17,7 @@ #include "components/content_settings/core/common/content_settings_types.h" #include "content/public/renderer/render_frame_observer.h" #include "content/public/renderer/render_frame_observer_tracker.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "mojo/public/cpp/bindings/associated_binding_set.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "third_party/WebKit/public/platform/WebContentSettingsClient.h"
diff --git a/chrome/renderer/content_settings_observer_unittest.cc b/chrome/renderer/content_settings_observer_unittest.cc index 9f0ceba..6e432101 100644 --- a/chrome/renderer/content_settings_observer_unittest.cc +++ b/chrome/renderer/content_settings_observer_unittest.cc
@@ -6,7 +6,7 @@ #include "chrome/common/url_constants.h" #include "content/public/common/url_constants.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" #include "third_party/WebKit/public/platform/WebURL.h"
diff --git a/chrome/renderer/pepper/pepper_uma_host.cc b/chrome/renderer/pepper/pepper_uma_host.cc index 8e10b4d..5499b29 100644 --- a/chrome/renderer/pepper/pepper_uma_host.cc +++ b/chrome/renderer/pepper/pepper_uma_host.cc
@@ -18,7 +18,7 @@ #include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/renderer_ppapi_host.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "ppapi/c/pp_errors.h" #include "ppapi/features/features.h"
diff --git a/chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc b/chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc index 461eaa9..3fa3aeb 100644 --- a/chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc +++ b/chrome/renderer/printing/chrome_print_render_frame_helper_delegate.cc
@@ -13,7 +13,7 @@ #include "chrome/common/url_constants.h" #include "chrome/renderer/prerender/prerender_helper.h" #include "content/public/renderer/render_frame.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebElement.h"
diff --git a/chrome/services/file_util/public/mojom/BUILD.gn b/chrome/services/file_util/public/mojom/BUILD.gn index dcc4a010..28d78b2 100644 --- a/chrome/services/file_util/public/mojom/BUILD.gn +++ b/chrome/services/file_util/public/mojom/BUILD.gn
@@ -10,10 +10,6 @@ "constants.mojom", ] - if (is_chromeos) { - sources += [ "zip_file_creator.mojom" ] - } - if (safe_browsing_mode == 1) { sources += [ "safe_archive_analyzer.mojom" ] } @@ -21,4 +17,9 @@ public_deps = [ "//mojo/common:common_custom_types", ] + + if (is_chromeos) { + sources += [ "zip_file_creator.mojom" ] + public_deps += [ "//components/filesystem/public/interfaces" ] + } }
diff --git a/chrome/services/printing/public/mojom/BUILD.gn b/chrome/services/printing/public/mojom/BUILD.gn index 024fb41..7b3f1054 100644 --- a/chrome/services/printing/public/mojom/BUILD.gn +++ b/chrome/services/printing/public/mojom/BUILD.gn
@@ -11,12 +11,13 @@ "pdf_to_pwg_raster_converter.mojom", ] - if (is_win) { - sources += [ "pdf_to_emf_converter.mojom" ] - } - deps = [ "//mojo/common:common_custom_types", "//ui/gfx/geometry/mojo", ] + + if (is_win) { + sources += [ "pdf_to_emf_converter.mojom" ] + deps += [ "//mojo/public/mojom/base" ] + } }
diff --git a/chrome/services/util_win/public/mojom/BUILD.gn b/chrome/services/util_win/public/mojom/BUILD.gn index c8f6b39..e6fdab9 100644 --- a/chrome/services/util_win/public/mojom/BUILD.gn +++ b/chrome/services/util_win/public/mojom/BUILD.gn
@@ -12,6 +12,7 @@ public_deps = [ ":constants", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", ] }
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 9b0a550..bf656793 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -15,7 +15,7 @@ import("//components/os_crypt/features.gni") import("//components/signin/features.gni") import("//components/spellcheck/spellcheck_build_features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//media/media_options.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//ppapi/features/features.gni") @@ -152,7 +152,7 @@ "//content/public/renderer", "//content/public/utility", "//content/test:test_support", - "//extensions/features", + "//extensions/buildflags", "//google_apis:test_support", "//gpu/ipc/service", "//ipc:test_support", @@ -350,7 +350,7 @@ "//components/nacl/common:buildflags", "//components/spellcheck:buildflags", "//components/sync:test_support_model", - "//extensions/features", + "//extensions/buildflags", "//media:media_features", "//net:test_support", "//ppapi/features", @@ -676,6 +676,7 @@ "../browser/repost_form_warning_browsertest.cc", "../browser/resource_coordinator/resource_coordinator_render_process_probe_browsertest.cc", "../browser/resource_coordinator/tab_activity_watcher_browsertest.cc", + "../browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc", "../browser/resource_coordinator/tab_manager_browsertest.cc", "../browser/safe_browsing/chrome_cleaner/reporter_runner_browsertest_win.cc", "../browser/safe_browsing/test_safe_browsing_database_helper.cc", @@ -1534,6 +1535,7 @@ "../browser/chromeos/login/bluetooth_host_pairing_browsertest.cc", "../browser/chromeos/login/crash_restore_browsertest.cc", "../browser/chromeos/login/demo_mode/demo_app_launcher_browsertest.cc", + "../browser/chromeos/login/demo_setup_browsertest.cc", "../browser/chromeos/login/enable_debugging_browsertest.cc", "../browser/chromeos/login/enrollment/enrollment_screen_browsertest.cc", "../browser/chromeos/login/enrollment/mock_auto_enrollment_check_screen.cc", @@ -1558,6 +1560,8 @@ "../browser/chromeos/login/resource_loader_browsertest.cc", "../browser/chromeos/login/saml/saml_browsertest.cc", "../browser/chromeos/login/screens/hid_detection_screen_browsertest.cc", + "../browser/chromeos/login/screens/mock_demo_setup_screen.cc", + "../browser/chromeos/login/screens/mock_demo_setup_screen.h", "../browser/chromeos/login/screens/mock_enable_debugging_screen.cc", "../browser/chromeos/login/screens/mock_enable_debugging_screen.h", "../browser/chromeos/login/screens/mock_eula_screen.cc", @@ -2166,6 +2170,8 @@ ] public_deps = [ "//components/autofill/content/common:mojo_types", + "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", ] } } @@ -2396,14 +2402,12 @@ "../browser/notifications/stub_notification_center_mac.mm", "../browser/ntp_snippets/bookmark_last_visit_updater_unittest.cc", "../browser/ntp_snippets/download_suggestions_provider_unittest.cc", - "../browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc", "../browser/page_load_metrics/metrics_web_contents_observer_unittest.cc", "../browser/page_load_metrics/observers/aborts_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/ads_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/amp_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/core_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc", - "../browser/page_load_metrics/observers/delay_navigation_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/document_write_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/from_gws_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/google_captcha_observer_unittest.cc", @@ -2727,7 +2731,7 @@ "//device/base:mocks", "//device/bluetooth:mocks", "//device/usb:test_support", - "//extensions/features", + "//extensions/buildflags", "//google_apis", "//gpu:test_support", "//media:test_support", @@ -3063,6 +3067,7 @@ "../browser/media/router/mojo/media_sink_service_status_unittest.cc", "../browser/media/router/providers/cast/cast_app_availability_tracker_unittest.cc", "../browser/media/router/providers/cast/cast_app_discovery_service_unittest.cc", + "../browser/media/router/providers/cast/cast_media_route_provider_metrics_unittest.cc", "../browser/media/router/providers/cast/dual_media_sink_service_unittest.cc", "../browser/media/router/providers/extension/extension_media_route_provider_proxy_unittest.cc", "../browser/media/router/providers/wired_display/wired_display_media_route_provider_unittest.cc", @@ -4302,12 +4307,17 @@ "../browser/ui/app_list/profile_loader_unittest.cc", "../browser/ui/app_list/search/answer_card/answer_card_result_unittest.cc", "../browser/ui/app_list/search/answer_card/answer_card_search_provider_unittest.cc", - "../browser/ui/app_list/search/app_search_provider_unittest.cc", "../browser/ui/app_list/search/arc/arc_playstore_search_provider_unittest.cc", - "../browser/ui/app_list/search/history_unittest.cc", "../browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_unittest.cc", - "../browser/ui/app_list/search/mixer_unittest.cc", - "../browser/ui/app_list/search/omnibox_result_unittest.cc", + "../browser/ui/app_list/search/tests/app_search_provider_unittest.cc", + "../browser/ui/app_list/search/tests/history_data_store_unittest.cc", + "../browser/ui/app_list/search/tests/history_unittest.cc", + "../browser/ui/app_list/search/tests/mixer_unittest.cc", + "../browser/ui/app_list/search/tests/omnibox_result_unittest.cc", + "../browser/ui/app_list/search/tests/term_break_iterator_unittest.cc", + "../browser/ui/app_list/search/tests/tokenized_string_char_iterator_unittest.cc", + "../browser/ui/app_list/search/tests/tokenized_string_match_unittest.cc", + "../browser/ui/app_list/search/tests/tokenized_string_unittest.cc", "../browser/ui/app_list/test/fake_app_list_model_updater.cc", "../browser/ui/app_list/test/fake_app_list_model_updater.h", "../browser/ui/app_list/test/fake_profile.cc", @@ -4325,6 +4335,11 @@ if (is_win || is_mac || (is_linux && !is_chromeos)) { sources += [ "../browser/password_manager/password_store_signin_notifier_impl_unittest.cc" ] } + + # TODO(crbug.com/349182): Replace "is_chrome_branded" with "enable_widevine". + if (is_chrome_branded && is_win) { + sources += [ "../gpu/widevine_cdm_proxy_factory_unittest.cc" ] + } } static_library("test_support_unit") { @@ -4400,6 +4415,7 @@ "//components/nacl/common:buildflags", "//components/os_crypt:test_support", "//content/public/browser:browser", + "//extensions/buildflags", "//skia", "//testing/gtest", "//third_party/WebKit/public:blink_headers", @@ -4411,6 +4427,10 @@ "ppapi/ppapi_test.h", ] } + + if (enable_extensions) { + deps += [ "//extensions/browser" ] + } } import("//third_party/protobuf/proto_library.gni") @@ -4462,7 +4482,7 @@ "//content/test:test_support", "//crypto:platform", "//crypto:test_support", - "//extensions/features", + "//extensions/buildflags", "//google_apis:test_support", "//net", "//net:net_resources", @@ -4640,7 +4660,7 @@ "//content/test:test_support", "//crypto:platform", "//crypto:test_support", - "//extensions/features", + "//extensions/buildflags", "//google_apis:test_support", "//mojo/edk/system", "//net", @@ -4998,7 +5018,7 @@ "//components/autofill/content/renderer:test_support", "//components/spellcheck:buildflags", "//content/test:test_support", - "//extensions/features", + "//extensions/buildflags", "//media/cast:test_support", "//testing/gmock", "//testing/gtest",
diff --git a/chrome/test/android/BUILD.gn b/chrome/test/android/BUILD.gn index 589e453..4bccc466 100644 --- a/chrome/test/android/BUILD.gn +++ b/chrome/test/android/BUILD.gn
@@ -27,6 +27,7 @@ "javatests/src/org/chromium/chrome/test/util/browser/compositor/layouts/DisableChromeAnimations.java", "javatests/src/org/chromium/chrome/test/util/browser/contextmenu/ContextMenuUtils.java", "javatests/src/org/chromium/chrome/test/util/browser/ChromeHome.java", + "javatests/src/org/chromium/chrome/test/util/browser/ChromeModernDesign.java", "javatests/src/org/chromium/chrome/test/util/browser/Features.java", "javatests/src/org/chromium/chrome/test/util/browser/LocationSettingsTestUtil.java", "javatests/src/org/chromium/chrome/test/util/browser/notifications/MockNotificationManagerProxy.java",
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/ChromeModernDesign.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/ChromeModernDesign.java new file mode 100644 index 0000000..c12b17e1 --- /dev/null +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/ChromeModernDesign.java
@@ -0,0 +1,98 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.test.util.browser; + +import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertNotNull; + +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +import org.chromium.base.StrictModeContext; +import org.chromium.base.test.util.AnnotationRule; +import org.chromium.base.test.util.Restriction; +import org.chromium.chrome.browser.ChromeFeatureList; +import org.chromium.chrome.browser.preferences.ChromePreferenceManager; +import org.chromium.chrome.browser.util.FeatureUtilities; +import org.chromium.ui.test.util.UiRestriction; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Utility annotation and rule to enable or disable ChromeModernDesign. Handles setting and + * resetting the feature flag and the preference. + * + * @see ChromeModernDesign.Processor + * @see FeatureUtilities#isChromeModernDesignEnabled() + */ +public interface ChromeModernDesign { + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.METHOD, ElementType.TYPE}) + @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) + @Features.EnableFeatures(ChromeFeatureList.CHROME_MODERN_DESIGN) + @interface Enable {} + + @Retention(RetentionPolicy.RUNTIME) + @Target({ElementType.METHOD, ElementType.TYPE}) + @Features.DisableFeatures(ChromeFeatureList.CHROME_MODERN_DESIGN) + @interface Disable {} + + /** + * Rule to handle setting and resetting the cached feature state for ChromeModernDesign. Can be + * used by explicitly calling methods ({@link #setPrefs(boolean)} and {@link #clearTestState()}) + * or by using the {@link ChromeModernDesign.Enable} and {@link ChromeModernDesign.Disable} + * annotations on tests. + */ + class Processor extends AnnotationRule { + private Boolean mOldState; + + public Processor() { + super(ChromeModernDesign.Enable.class, ChromeModernDesign.Disable.class); + } + + @Override + public Statement apply(Statement base, Description description) { + Statement wrappedStatement = super.apply(base, description); + return getAnnotations().isEmpty() ? base : wrappedStatement; + } + + @Override + protected void before() throws Throwable { + boolean featureEnabled = getClosestAnnotation() instanceof ChromeModernDesign.Enable; + setPrefs(featureEnabled); + } + + @Override + protected void after() { + clearTestState(); + } + + public void setPrefs(boolean enabled) { + // Chrome relies on a shared preference to determine if the ChromeModernDesign feature + // is enabled during start up, so we need to manually set the preference to enable + // ChromeModernDesign before starting Chrome. + ChromePreferenceManager prefsManager = ChromePreferenceManager.getInstance(); + try (StrictModeContext unused = StrictModeContext.allowDiskReads()) { + mOldState = prefsManager.isChromeModernDesignEnabled(); + } + + FeatureUtilities.resetChromeModernDesignEnabledForTests(); + + // The native library should not be enabled yet, so we set the preference here and + // cache it by checking for the feature. Ideally we instead would call + // FeatureUtilities.cacheChromeModernDesignEnabled() + prefsManager.setChromeModernDesignEnabled(enabled); + assertEquals(enabled, FeatureUtilities.isChromeModernDesignEnabled()); + } + + public void clearTestState() { + assertNotNull(mOldState); + ChromePreferenceManager.getInstance().setChromeModernDesignEnabled(mOldState); + } + } +}
diff --git a/chrome/test/base/chrome_process_util.cc b/chrome/test/base/chrome_process_util.cc index 6866659..40f4df3 100644 --- a/chrome/test/base/chrome_process_util.cc +++ b/chrome/test/base/chrome_process_util.cc
@@ -95,14 +95,6 @@ return result; } -#if !defined(OS_MACOSX) - -size_t ChromeTestProcessMetrics::GetWorkingSetSize() { - return process_metrics_->GetWorkingSetSize(); -} - -#endif // !defined(OS_MACOSX) - ChromeTestProcessMetrics::~ChromeTestProcessMetrics() {} ChromeTestProcessMetrics::ChromeTestProcessMetrics(
diff --git a/chrome/test/base/chrome_process_util.h b/chrome/test/base/chrome_process_util.h index 0949582b..3471ce6 100644 --- a/chrome/test/base/chrome_process_util.h +++ b/chrome/test/base/chrome_process_util.h
@@ -37,8 +37,6 @@ return new ChromeTestProcessMetrics(process); } - size_t GetWorkingSetSize(); - bool GetIOCounters(base::IoCounters* io_counters); base::ProcessHandle process_handle_;
diff --git a/chrome/test/base/chrome_process_util_mac.cc b/chrome/test/base/chrome_process_util_mac.cc index 4c9c393..61e06ee 100644 --- a/chrome/test/base/chrome_process_util_mac.cc +++ b/chrome/test/base/chrome_process_util_mac.cc
@@ -58,43 +58,3 @@ return result; } - -// Common interface for fetching memory values from parsed ps output. -// We fill in both values we may get called for, even though our -// callers typically only care about one, just to keep the code -// simple and because this is a test. -static bool GetMemoryValuesHack(uint32_t process_id, - size_t* virtual_size, - size_t* working_set_size) { - DCHECK(virtual_size && working_set_size); - - std::vector<base::ProcessId> processes; - processes.push_back(process_id); - - MacChromeProcessInfoList process_info = GetRunningMacProcessInfo(processes); - if (process_info.empty()) - return false; - - bool found_process = false; - *virtual_size = 0; - *working_set_size = 0; - - MacChromeProcessInfoList::iterator it = process_info.begin(); - for (; it != process_info.end(); ++it) { - if (it->pid != static_cast<base::ProcessId>(process_id)) - continue; - found_process = true; - *virtual_size = it->vsz_in_kb * 1024; - *working_set_size = it->rsz_in_kb * 1024; - break; - } - - return found_process; -} - -size_t ChromeTestProcessMetrics::GetWorkingSetSize() { - size_t virtual_size; - size_t working_set_size; - GetMemoryValuesHack(process_handle_, &virtual_size, &working_set_size); - return working_set_size; -}
diff --git a/chrome/test/base/chrome_render_view_test.cc b/chrome/test/base/chrome_render_view_test.cc index a29e761f..59ed462 100644 --- a/chrome/test/base/chrome_render_view_test.cc +++ b/chrome/test/base/chrome_render_view_test.cc
@@ -21,7 +21,7 @@ #include "content/public/browser/native_web_keyboard_event.h" #include "content/public/common/renderer_preferences.h" #include "content/public/renderer/render_view.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gmock/include/gmock/gmock.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/platform/WebURLRequest.h"
diff --git a/chrome/test/base/chrome_unit_test_suite.cc b/chrome/test/base/chrome_unit_test_suite.cc index 4adf3ae..f772598 100644 --- a/chrome/test/base/chrome_unit_test_suite.cc +++ b/chrome/test/base/chrome_unit_test_suite.cc
@@ -10,7 +10,6 @@ #include "base/path_service.h" #include "base/process/process_handle.h" #include "build/build_config.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_content_browser_client.h" #include "chrome/browser/profiles/profile_shortcut_manager.h" #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" @@ -22,7 +21,7 @@ #include "components/component_updater/component_updater_paths.h" #include "components/update_client/update_query_params.h" #include "content/public/common/content_paths.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "gpu/ipc/service/image_transport_surface.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/base/resource/resource_bundle.h" @@ -66,10 +65,6 @@ content::SetUtilityClientForTesting(utility_content_client_.get()); TestingBrowserProcess::CreateInstance(); - - // Force TabManager creation before the first tab is created. In production, - // that happens in ChromeBrowserMainParts::PreBrowserStart(). - g_browser_process->GetTabManager(); } void OnTestEnd(const testing::TestInfo& test_info) override {
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index 1e00160c..84dbd43 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc
@@ -60,6 +60,7 @@ #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_launcher.h" #include "content/public/test/test_navigation_observer.h" +#include "extensions/buildflags/buildflags.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "ui/display/display_switches.h" @@ -91,6 +92,10 @@ #include "ui/views/test/test_desktop_screen_x11.h" #endif +#if BUILDFLAG(ENABLE_EXTENSIONS) +#include "extensions/browser/extension_api_frame_id_map.h" +#endif + namespace { // Passed as value of kTestType. @@ -286,6 +291,14 @@ BrowserTestBase::TearDown(); OSCryptMocker::TearDown(); ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(nullptr); + +#if BUILDFLAG(ENABLE_EXTENSIONS) + // By now, all the WebContents should be destroyed, Ensure that we are not + // leaking memory in ExtensionAPIFrameIdMap. crbug.com/817205. + EXPECT_EQ( + 0u, + extensions::ExtensionApiFrameIdMap::Get()->GetFrameDataCountForTesting()); +#endif } void InProcessBrowserTest::CloseBrowserSynchronously(Browser* browser) {
diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc index 656cfe8b..2a64a817 100644 --- a/chrome/test/base/testing_browser_process.cc +++ b/chrome/test/base/testing_browser_process.cc
@@ -17,7 +17,6 @@ #include "chrome/browser/policy/chrome_browser_policy_connector.h" #include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h" #include "chrome/browser/resource_coordinator/tab_manager.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/common/buildflags.h" @@ -30,7 +29,7 @@ #include "components/subresource_filter/content/browser/content_ruleset_service.h" #include "content/public/browser/notification_service.h" #include "content/public/common/network_connection_tracker.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "net/url_request/url_request_context_getter.h" #include "printing/features/features.h" @@ -421,12 +420,8 @@ resource_coordinator::TabManager* TestingBrowserProcess::GetTabManager() { #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) - if (!tab_manager_) { - tab_manager_ = std::make_unique<resource_coordinator::TabManager>(); - tab_lifecycle_unit_source_ = - std::make_unique<resource_coordinator::TabLifecycleUnitSource>(); - tab_lifecycle_unit_source_->AddObserver(tab_manager_.get()); - } + if (!tab_manager_.get()) + tab_manager_.reset(new resource_coordinator::TabManager()); return tab_manager_.get(); #else return nullptr;
diff --git a/chrome/test/base/testing_browser_process.h b/chrome/test/base/testing_browser_process.h index a6e41c16..ea6b4325 100644 --- a/chrome/test/base/testing_browser_process.h +++ b/chrome/test/base/testing_browser_process.h
@@ -20,7 +20,7 @@ #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process_platform_part.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "media/media_features.h" #include "printing/features/features.h" @@ -47,10 +47,6 @@ class PolicyService; } -namespace resource_coordinator { -class TabLifecycleUnitSource; -} - class TestingBrowserProcess : public BrowserProcess { public: // Initializes |g_browser_process| with a new TestingBrowserProcess. @@ -198,8 +194,6 @@ // GetTabManager() is invoked on supported platforms. #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) std::unique_ptr<resource_coordinator::TabManager> tab_manager_; - std::unique_ptr<resource_coordinator::TabLifecycleUnitSource> - tab_lifecycle_unit_source_; #endif // The following objects are not owned by TestingBrowserProcess:
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 1719ba4..1650d5f 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc
@@ -91,8 +91,8 @@ #include "content/public/browser/storage_partition.h" #include "content/public/test/mock_resource_context.h" #include "content/public/test/test_utils.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" -#include "extensions/features/features.h" #include "net/cookies/cookie_store.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h"
diff --git a/chrome/test/base/testing_profile.h b/chrome/test/base/testing_profile.h index 37081ff..f66b447 100644 --- a/chrome/test/base/testing_profile.h +++ b/chrome/test/base/testing_profile.h
@@ -17,7 +17,7 @@ #include "chrome/browser/profiles/profile.h" #include "components/domain_reliability/clear_mode.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "services/network/public/mojom/network_service.mojom.h" #if defined(OS_CHROMEOS)
diff --git a/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-afternoon.Nexus_5-19.png b/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-afternoon.Nexus_5-19.png new file mode 100644 index 0000000..c61a0251c --- /dev/null +++ b/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-afternoon.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-evening.Nexus_5-19.png b/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-evening.Nexus_5-19.png new file mode 100644 index 0000000..932788d7 --- /dev/null +++ b/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-evening.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-morning.Nexus_5-19.png b/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-morning.Nexus_5-19.png new file mode 100644 index 0000000..4730241 --- /dev/null +++ b/chrome/test/data/android/render_tests/AllDismissedItemTest.modern-morning.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/android/render_tests/BookmarkTest.bookmark_manager_one_folder.Nexus_5-19.png b/chrome/test/data/android/render_tests/BookmarkTest.bookmark_manager_one_folder.Nexus_5-19.png index c81f443..f6b7376 100644 --- a/chrome/test/data/android/render_tests/BookmarkTest.bookmark_manager_one_folder.Nexus_5-19.png +++ b/chrome/test/data/android/render_tests/BookmarkTest.bookmark_manager_one_folder.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/android/render_tests/NewTabPageTest.modern-fakebox.Nexus_5-19.png b/chrome/test/data/android/render_tests/NewTabPageTest.modern-fakebox.Nexus_5-19.png new file mode 100644 index 0000000..ec2dfb2 --- /dev/null +++ b/chrome/test/data/android/render_tests/NewTabPageTest.modern-fakebox.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/android/render_tests/NewTabPageTest.modern-most_visited.Nexus_5-19.png b/chrome/test/data/android/render_tests/NewTabPageTest.modern-most_visited.Nexus_5-19.png new file mode 100644 index 0000000..4d4c71c --- /dev/null +++ b/chrome/test/data/android/render_tests/NewTabPageTest.modern-most_visited.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/android/render_tests/NewTabPageTest.modern-new_tab_page.Nexus_5-19.png b/chrome/test/data/android/render_tests/NewTabPageTest.modern-new_tab_page.Nexus_5-19.png new file mode 100644 index 0000000..464ea2d --- /dev/null +++ b/chrome/test/data/android/render_tests/NewTabPageTest.modern-new_tab_page.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/android/render_tests/NewTabPageTest.modern-new_tab_page_scrolled.Nexus_5-19.png b/chrome/test/data/android/render_tests/NewTabPageTest.modern-new_tab_page_scrolled.Nexus_5-19.png new file mode 100644 index 0000000..0da7ede --- /dev/null +++ b/chrome/test/data/android/render_tests/NewTabPageTest.modern-new_tab_page_scrolled.Nexus_5-19.png Binary files differ
diff --git a/chrome/test/data/extensions/api_test/file_system_provider/configure/manifest.json.bak b/chrome/test/data/extensions/api_test/file_system_provider/configure/manifest.json.bak deleted file mode 100644 index 26e2c579..0000000 --- a/chrome/test/data/extensions/api_test/file_system_provider/configure/manifest.json.bak +++ /dev/null
@@ -1,25 +0,0 @@ -{ - // chrome-extension://pkplfbidichfdicaijlchgnapepdginl - "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtDfX9dHNh948bt00YhZBm3P6E5QLaOt+v8kXVtibQfiPtOD2FTScB/f0wX/EQWVO7BkaSOsRkTPcPIgocyMPYr2FLgqGLFlYT9nQpKJZUFNF5oJ5rG6Nv7ppf4zEB3j6da1IBRTz2yOZ+6O1TMZxol/V62/QcqrJeggsHTEPGLdr9Ua4b1Ka0xKJnJngZljsbw93FI1o+P9dAh5BS6wTPiZI/vmJVjvMTkSTnaZ3n9Go2t7A0XLcSxLcVyuLAd2mAvSN0mIviOukdM66wr7llif71nKuUt+4qvlr/r9HfwzN6pA4jkwhtS1UD+3CmB+wsHwsnohNcuu4FIQ6rgq/7QIDAQAB", - "name": "chrome.fileSystemProvider.onAddWatcherRequested", - "version": "0.1", - "manifest_version": 2, - "description": - "Test for chrome.fileSystemProvider.onAddWatcherRequested().", - "permissions": [ - "fileSystemProvider", - { - "fileSystem": ["requestFileSystem", "write"] - }, - "fileManagerPrivate", - "fileBrowserHandler" - ], - "app": { - "background": { - "scripts": [ - "chrome-extension://gfnblenhaahcnmfdbebgincjohfkbnch/test_util.js", - "test.js" - ] - } - } -}
diff --git a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js index 9f69b68..7177a25 100644 --- a/chrome/test/data/extensions/platform_apps/web_view/shim/main.js +++ b/chrome/test/data/extensions/platform_apps/web_view/shim/main.js
@@ -1477,6 +1477,10 @@ window.console.log('guest.consolemessage ' + e.message); }; webview.onloadstop = function() { + // Only consider the first load stop, not the following one due to the + // iframe navigation. + webview.onloadstop = undefined; + window.onmessage = function(e) { if (e.data == 'frames-loaded') { embedder.test.succeed(); @@ -1501,6 +1505,10 @@ window.console.log('guest.consolemessage ' + e.message); }; webview.onloadstop = function() { + // Only consider the first load stop, not the following one due to the + // iframe navigation. + webview.onloadstop = undefined; + window.onmessage = function(e) { if (e.data == 'frames-loaded') { embedder.test.succeed();
diff --git a/chrome/test/data/local_ntp/local_ntp_browsertest.html b/chrome/test/data/local_ntp/local_ntp_browsertest.html index 94f9f301..8999a76 100644 --- a/chrome/test/data/local_ntp/local_ntp_browsertest.html +++ b/chrome/test/data/local_ntp/local_ntp_browsertest.html
@@ -62,34 +62,36 @@ <div id="attribution"><div id="attribution-text"></div></div> </div> - <div id="voice-overlay" class="overlay-hidden" hidden> - <div id="voice-outer" class="outer"> - <div class="inner-container"> - <div id="voice-button-container" class="button-container"> - <!-- The audio level animation. --> - <span id="voice-level" class="level"></span> - <!-- The microphone button. --> - <span id="voice-button" class="button"> - <!-- The microphone icon (in CSS). --> - <div class="microphone"> - <span class="receiver"></span> - <div class="wrapper"> - <span class="stem"></span> - <span class="shell"></span> + <dialog id="voice-overlay-dialog" class="overlay-dialog"> + <div id="voice-overlay" class="overlay-hidden"> + <button id="voice-close-button" class="close-button">×</button> + <div id="voice-outer" class="outer"> + <div class="inner-container"> + <div id="voice-button-container" class="button-container"> + <!-- The audio level animation. --> + <span id="voice-level" class="level"></span> + <!-- The microphone button. --> + <span id="voice-button" class="button"> + <!-- The microphone icon (in CSS). --> + <div class="microphone"> + <span class="receiver"></span> + <div class="wrapper"> + <span class="stem"></span> + <span class="shell"></span> + </div> </div> - </div> - </span> - </div> - <div class="text-container"> - <!-- Low confidence text underneath high confidence text. --> - <span id="voice-text-i" class="voice-text"></span> - <!-- High confidence text on top of low confidence text. --> - <span id="voice-text-f" class="voice-text"></span> + </span> + </div> + <div class="text-container"> + <!-- Low confidence text underneath high confidence text. --> + <span id="voice-text-i" class="voice-text"></span> + <!-- High confidence text on top of low confidence text. --> + <span id="voice-text-f" class="voice-text"></span> + </div> </div> </div> </div> - <div id="voice-close-button" class="close-button">×</div> - </div> + </dialog> </template> </head> <body>
diff --git a/chrome/test/data/local_ntp/voice_browsertest.html b/chrome/test/data/local_ntp/voice_browsertest.html index f214ee3..40641388 100644 --- a/chrome/test/data/local_ntp/voice_browsertest.html +++ b/chrome/test/data/local_ntp/voice_browsertest.html
@@ -33,34 +33,36 @@ </div> </template> <template id="voice-view-template"> - <div id="voice-overlay" class="overlay-hidden" hidden> - <div id="voice-outer" class="outer"> - <div class="inner-container"> - <div id="voice-button-container" class="button-container"> - <!-- The audio level animation. --> - <span id="voice-level" class="level"></span> - <!-- The microphone button. --> - <span id="voice-button" class="button"> - <!-- The microphone icon (in CSS). --> - <div class="microphone"> - <span class="receiver"></span> - <div class="wrapper"> - <span class="stem"></span> - <span class="shell"></span> + <dialog id="voice-overlay-dialog" class="overlay-dialog"> + <div id="voice-overlay" class="overlay-hidden"> + <button id="voice-close-button" class="close-button">×</button> + <div id="voice-outer" class="outer"> + <div class="inner-container"> + <div id="voice-button-container" class="button-container"> + <!-- The audio level animation. --> + <span id="voice-level" class="level"></span> + <!-- The microphone button. --> + <span id="voice-button" class="button"> + <!-- The microphone icon (in CSS). --> + <div class="microphone"> + <span class="receiver"></span> + <div class="wrapper"> + <span class="stem"></span> + <span class="shell"></span> + </div> </div> - </div> - </span> - </div> - <div class="text-container"> - <!-- Low confidence text underneath high confidence text. --> - <span id="voice-text-i" class="voice-text"></span> - <!-- High confidence text on top of low confidence text. --> - <span id="voice-text-f" class="voice-text"></span> + </span> + </div> + <div class="text-container"> + <!-- Low confidence text underneath high confidence text. --> + <span id="voice-text-i" class="voice-text"></span> + <!-- High confidence text on top of low confidence text. --> + <span id="voice-text-f" class="voice-text"></span> + </div> </div> </div> </div> - <div id="voice-close-button" class="close-button">×</div> - </div> + </dialog> </template> <template id="voice-speech-template"> <div id="ntp-contents">
diff --git a/chrome/test/data/local_ntp/voice_speech_browsertest.js b/chrome/test/data/local_ntp/voice_speech_browsertest.js index b1edfb85..db6511d 100644 --- a/chrome/test/data/local_ntp/voice_speech_browsertest.js +++ b/chrome/test/data/local_ntp/voice_speech_browsertest.js
@@ -106,6 +106,13 @@ /** + * Represents the target of the view's window click event. + * @type {object} + */ +test.speech.viewClickTarget = {}; + + +/** * Set up the text DOM and test environment. */ test.speech.setUp = function() { @@ -132,6 +139,9 @@ // Mock view functions. test.speech.stubs.replace(view, 'hide', () => test.speech.viewActiveCount--); test.speech.stubs.replace(view, 'init', () => {}); + test.speech.stubs.replace(view, 'onWindowClick_', (event) => { + test.speech.viewClickTarget = event.target; + }); test.speech.stubs.replace( view, 'setReadyForSpeech', () => test.speech.viewState.ready = true); test.speech.stubs.replace( @@ -246,6 +256,27 @@ test.speech.validateInactive(); }; +/** + * Tests that with everything OK, focusing the Omnibox using keyboard navigation + * does not terminate speech. + */ +test.speech.testOmniboxFocusWithKeyboardNavigationDoesNotAbort = function() { + test.speech.initSpeech(); + const tabKey = new KeyboardEvent('test', {code: 'Tab'}); + speech.start(); + + assertEquals(speech.State_.STARTED, speech.currentState_); + assertEquals(1, test.speech.recognitionActiveCount); + assertEquals(1, test.speech.viewActiveCount); + assertTrue(speech.isRecognizing()); + assertTrue(test.speech.clock.isTimeoutSet(speech.idleTimer_)); + assertFalse(test.speech.clock.isTimeoutSet(speech.errorTimer_)); + + speech.onKeyDown(tabKey); + speech.onOmniboxFocused(); + assertTrue(speech.isRecognizing()); +}; + /** * Tests that when the speech recognition interface is uninitialized, @@ -729,6 +760,57 @@ /** + * Tests keyboard navigation on the support link. + */ +test.speech.testKeyboardNavigationOnSupportLink = function() { + test.speech.initSpeech(); + const fakeKeyboardEvent = { + target: {id: text.SUPPORT_LINK_ID}, + code: KEYCODE.ENTER, + stopPropagation: () => {} + }; + speech.start(); + + speech.onKeyDown(fakeKeyboardEvent); + assertEquals(text.SUPPORT_LINK_ID, test.speech.viewClickTarget.id); +}; + + +/** + * Tests keyboard navigation on the retry link. + */ +test.speech.testKeyboardNavigationOnRetryLink = function() { + test.speech.initSpeech(); + const fakeKeyboardEvent = { + target: {id: text.RETRY_LINK_ID}, + code: KEYCODE.SPACE, + stopPropagation: () => {} + }; + speech.start(); + + speech.onKeyDown(fakeKeyboardEvent); + assertEquals(text.RETRY_LINK_ID, test.speech.viewClickTarget.id); +}; + + +/** + * Tests keyboard navigation on the close button. + */ +test.speech.testKeyboardNavigationOnCloseButton = function() { + test.speech.initSpeech(); + const fakeKeyboardEvent = { + target: {id: view.CLOSE_BUTTON_ID}, + code: KEYCODE.NUMPAD_ENTER, + stopPropagation: () => {} + }; + speech.start(); + + speech.onKeyDown(fakeKeyboardEvent); + assertEquals(view.CLOSE_BUTTON_ID, test.speech.viewClickTarget.id); +}; + + +/** * Tests that when the recognition API cannot match the input to text, * the proper error is displayed and the interface is closed, after a timeout. */
diff --git a/chrome/test/data/local_ntp/voice_text_browsertest.js b/chrome/test/data/local_ntp/voice_text_browsertest.js index a4cd8fc..cdc46401 100644 --- a/chrome/test/data/local_ntp/voice_text_browsertest.js +++ b/chrome/test/data/local_ntp/voice_text_browsertest.js
@@ -103,8 +103,8 @@ const tryAgainError = RecognitionError.NO_MATCH; text.showErrorMessage(tryAgainError); assertEquals( - 'No translation <a class="voice-text-link" id="voice-retry-link">' + - 'Try again</a>', + 'No translation <a class="voice-text-link" id="voice-retry-link" ' + + 'tabindex="0">Try again</a>', text.interim_.innerHTML); assertEquals('', text.final_.innerHTML); };
diff --git a/chrome/test/data/page_cycler/cached_data_dir/Default/Bookmarks.bak b/chrome/test/data/page_cycler/cached_data_dir/Default/Bookmarks.bak deleted file mode 100644 index 6142c46..0000000 --- a/chrome/test/data/page_cycler/cached_data_dir/Default/Bookmarks.bak +++ /dev/null
@@ -1,30 +0,0 @@ -{ - "checksum": "942764d02172e0ac56471532a4f3f57c", - "roots": { - "bookmark_bar": { - "children": [ ], - "date_added": "12978575074515810", - "date_modified": "0", - "id": "1", - "name": "Bookmarks Bar", - "type": "folder" - }, - "other": { - "children": [ ], - "date_added": "12978575074515840", - "date_modified": "0", - "id": "2", - "name": "Other Bookmarks", - "type": "folder" - }, - "synced": { - "children": [ ], - "date_added": "12978575074515852", - "date_modified": "0", - "id": "3", - "name": "Mobile Bookmarks", - "type": "folder" - } - }, - "version": 1 -}
diff --git a/chrome/test/data/webui/extensions/extension_toolbar_test.js b/chrome/test/data/webui/extensions/extension_toolbar_test.js index 4808f2b3..a8e71a4 100644 --- a/chrome/test/data/webui/extensions/extension_toolbar_test.js +++ b/chrome/test/data/webui/extensions/extension_toolbar_test.js
@@ -93,19 +93,14 @@ }) .then(function() { assertFalse(toolbar.$$('cr-toast').open); - assertFalse(toolbar.$.updateNow.disabled); - toolbar.$.updateNow.disabled = true; MockInteractions.tap(toolbar.$.updateNow); - assertTrue(toolbar.$.updateNow.disabled); - toolbar.$.updateNow.disabled = false; - assertFalse(toolbar.$$('cr-toast').open); + // Simulate user rapidly clicking update button multiple times. MockInteractions.tap(toolbar.$.updateNow); - assertTrue(toolbar.$.updateNow.disabled); assertTrue(toolbar.$$('cr-toast').open); return mockDelegate.whenCalled('updateAllExtensions'); }) .then(function() { - assertFalse(toolbar.$.updateNow.disabled); + assertEquals(1, mockDelegate.getCallCount('updateAllExtensions')); const whenTapped = test_util.eventToPromise('pack-tap', toolbar); MockInteractions.tap(toolbar.$.packExtensions); return whenTapped;
diff --git a/chrome/test/data/webui/settings/certificate_manager_test.js b/chrome/test/data/webui/settings/certificate_manager_test.js index 6b54a35..44f0555 100644 --- a/chrome/test/data/webui/settings/certificate_manager_test.js +++ b/chrome/test/data/webui/settings/certificate_manager_test.js
@@ -105,8 +105,7 @@ /** @override */ exportPersonalCertificatePasswordSelected(password) { - this.resolverMap_.get('exportPersonalCertificatePasswordSelected') - .resolve(password); + this.methodCalled('exportPersonalCertificatePasswordSelected', password); return this.fulfillRequest_(); } @@ -118,8 +117,7 @@ /** @override */ importPersonalCertificatePasswordSelected(password) { - this.resolverMap_.get('importPersonalCertificatePasswordSelected') - .resolve(password); + this.methodCalled('importPersonalCertificatePasswordSelected', password); return this.fulfillRequest_(); }
diff --git a/chrome/test/data/webui/settings/people_page_manage_profile_test.js b/chrome/test/data/webui/settings/people_page_manage_profile_test.js index 7066f89..ae7645b 100644 --- a/chrome/test/data/webui/settings/people_page_manage_profile_test.js +++ b/chrome/test/data/webui/settings/people_page_manage_profile_test.js
@@ -31,8 +31,8 @@ this.methodCalled('getAvailableIcons'); return Promise.resolve([ {url: 'fake-icon-1.png', label: 'fake-icon-1'}, - {url: 'fake-icon-2.png', label: 'fake-icon-2'}, - {url: 'gaia-icon.png', label: 'gaia-icon', isGaiaAvatar: true} + {url: 'fake-icon-2.png', label: 'fake-icon-2', selected: true}, + {url: 'gaia-icon.png', label: 'gaia-icon', isGaiaAvatar: true}, ]); } @@ -97,11 +97,10 @@ items = manageProfile.$.selector.$['avatar-grid']. querySelectorAll('.avatar'); - // Initially no item is selected, because of crbug.com/710660. assertFalse(!!manageProfile.profileAvatar); assertEquals(3, items.length); assertFalse(items[0].classList.contains('iron-selected')); - assertFalse(items[1].classList.contains('iron-selected')); + assertTrue(items[1].classList.contains('iron-selected')); assertFalse(items[2].classList.contains('iron-selected')); MockInteractions.tap(items[1]);
diff --git a/chrome/test/data/webui/settings/people_page_test.js b/chrome/test/data/webui/settings/people_page_test.js index 7e6dcf8f..86b8f53 100644 --- a/chrome/test/data/webui/settings/people_page_test.js +++ b/chrome/test/data/webui/settings/people_page_test.js
@@ -83,6 +83,12 @@ teardown(function() { peoplePage.remove(); }); + test('Toast', function() { + assertFalse(peoplePage.$.toast.open); + cr.webUIListenerCallback('sync-settings-saved'); + assertTrue(peoplePage.$.toast.open); + }); + // This makes sure UI meant for DICE-enabled profiles are not leaked to // non-dice profiles. // TODO(scottchen): This should be removed once all profiles are fully
diff --git a/chrome/test/data/webui/test_browser_proxy.js b/chrome/test/data/webui/test_browser_proxy.js index 0247bfd..728c0a1 100644 --- a/chrome/test/data/webui/test_browser_proxy.js +++ b/chrome/test/data/webui/test_browser_proxy.js
@@ -3,6 +3,12 @@ // found in the LICENSE file. /** + * @typedef {{resolver: !PromiseResolver, + * callCount: number}} + */ +let MethodData; + +/** * A base class for all test browser proxies to inherit from. Provides helper * methods for allowing tests to track when a method was called. * @@ -36,10 +42,10 @@ * need to be tracked. */ constructor(methodNames) { - /** @private {!Map<string, !PromiseResolver>} */ + /** @private {!Map<string, !MethodData>} */ this.resolverMap_ = new Map(); methodNames.forEach(methodName => { - this.resolverMap_.set(methodName, new PromiseResolver()); + this.createMethodData_(methodName); }); } @@ -53,7 +59,10 @@ * @protected */ methodCalled(methodName, opt_arg) { - this.getResolver_(methodName).resolve(opt_arg); + const methodData = this.resolverMap_.get(methodName); + methodData.callCount += 1; + this.resolverMap_.set(methodName, methodData); + methodData.resolver.resolve(opt_arg); } /** @@ -62,7 +71,7 @@ * is called. */ whenCalled(methodName) { - return this.getResolver_(methodName).promise; + return this.getMethodData_(methodName).resolver.promise; } /** @@ -70,8 +79,8 @@ * @param {string} methodName */ resetResolver(methodName) { - assert(!!this.resolverMap_.get(methodName), `'${methodName}' not found`); - this.resolverMap_.set(methodName, new PromiseResolver()); + this.getMethodData_(methodName); + this.createMethodData_(methodName); } /** @@ -79,19 +88,42 @@ */ reset() { this.resolverMap_.forEach((value, methodName) => { - this.resolverMap_.set(methodName, new PromiseResolver()); + this.createMethodData_(methodName); }); } /** + * Get number of times method is called. + * @param {string} methodName + * @return {!boolean} + */ + getCallCount(methodName) { + return this.getMethodData_(methodName).callCount; + } + + /** * Try to give programmers help with mistyped methodNames. * @param {string} methodName + * @return {!MethodData} * @private */ - getResolver_(methodName) { - let method = this.resolverMap_.get(methodName); + getMethodData_(methodName) { // Tip: check that the |methodName| is being passed to |this.constructor|. - assert(!!method, `Method '${methodName}' not found in TestBrowserProxy.`); - return method; + const methodData = this.resolverMap_.get(methodName); + assert( + !!methodData, + `Method '${methodName}' not found in TestBrowserProxy.`); + return methodData; + } + + /** + * Creates a new |MethodData| for |methodName|. + * @param {string} methodName + * @private + */ + createMethodData_(methodName) { + this.resolverMap_.set( + methodName, + {resolver: new PromiseResolver(), callCount: 0}); } }
diff --git a/chrome/test/vr/auto_bisect.py b/chrome/test/vr/auto_bisect.py index 688a101d..b14496c9 100755 --- a/chrome/test/vr/auto_bisect.py +++ b/chrome/test/vr/auto_bisect.py
@@ -66,10 +66,22 @@ help='The value of the metric at the bad revision. If ' 'not defined, an extra test iteration will be run ' 'to determine the value') - parser.add_argument('--clank-revision', - help='The Clank revision to sync to during the bisect. ' - 'Only necessary if the revision on ToT is not ' - 'compatible with the revision range of the bisect') + def comma_separated(arg): + split_arg = arg.split(',') + if len(split_arg) != 2: + raise argparse.ArgumentError( + 'Expected two comma-separated strings but ' + 'received %d' % len(split_arg)) + return {split_arg[0]: split_arg[1]} + parser.add_argument('--checkout-override', action='append', + type=comma_separated, dest='checkout_overrides', + help='A comma-separated path/revision key/value pair. ' + 'Each git checkout at the specified path will be ' + 'synced to the specified revision after the normal ' + 'sync. For example, passing ' + 'third_party/android_ndk,abcdefg would cause the ' + 'checkout in //third_party/android_ndk to be synced ' + 'to revision abcdefg.') parser.add_argument('--reset-before-sync', action='store_true', default=False, help='When set, runs "git reset --hard HEAD" before ' @@ -82,14 +94,7 @@ help='The swarming server to trigger the test on') parser.add_argument('--isolate-server', required=True, help='The isolate server to upload the test to') - def dimension(arg): - split_arg = arg.split(',') - if len(split_arg) != 2: - raise argparse.ArgumentError( - 'Expected two comma-separated strings for --dimension, ' - 'received %d' % len(split_arg)) - return {split_arg[0]: split_arg[1]} - parser.add_argument('--dimension', action='append', type=dimension, + parser.add_argument('--dimension', action='append', type=comma_separated, default=[], dest='dimensions', help='A comma-separated swarming dimension key/value ' 'pair. At least one must be provided.') @@ -151,6 +156,10 @@ else: print 'Changing from %f at %s to %f at %s' % (args.good_value, args.good_revision, args.bad_value, args.bad_revision) + if args.checkout_overrides: + for pair in args.checkout_overrides: + for key, val in pair.iteritems(): + print '%s will be synced to revision %s' % (key, val) print '======' print 'The test target %s will be built to %s' % (args.build_target, args.build_output_dir) @@ -363,10 +372,14 @@ 'If these changes are actually yours, please commit or stash them. If ' 'they are not, remove them and try again. If the issue persists, try ' 'running with --reset-before-sync') - if args.clank_revision: - os.chdir('clank') - subprocess.check_output(['git', 'checkout', args.clank_revision]) - os.chdir('..') + + # Checkout any specified revisions. + cwd = os.getcwd() + for override in args.checkout_overrides: + for repo, rev in override.iteritems(): + os.chdir(repo) + subprocess.check_output(['git', 'checkout', rev]) + os.chdir(cwd) print 'Building' subprocess.check_output(['ninja', '-C', args.build_output_dir, '-j', str(args.parallel_jobs),
diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn index 75d7577..730bb824 100644 --- a/chrome/utility/BUILD.gn +++ b/chrome/utility/BUILD.gn
@@ -6,7 +6,7 @@ import("//build/config/features.gni") import("//build/config/sysroot.gni") import("//chrome/common/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//printing/features/features.gni") import("//services/service_manager/public/service_manifest.gni") @@ -39,7 +39,7 @@ "//content/public/child", "//content/public/common", "//content/public/utility", - "//extensions/features", + "//extensions/buildflags", "//ipc", "//media", "//net:net_with_v8",
diff --git a/chrome/utility/DEPS b/chrome/utility/DEPS index 7079729..78243c3a0 100644 --- a/chrome/utility/DEPS +++ b/chrome/utility/DEPS
@@ -28,7 +28,7 @@ "+content/public/child", "+content/public/utility", "+extensions/common", - "+extensions/features", + "+extensions/buildflags", "+extensions/utility", "+media", "+services/network/public",
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index b65d14f0..aabd610 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -25,7 +25,7 @@ #include "content/public/common/service_manager_connection.h" #include "content/public/common/simple_connection_filter.h" #include "content/public/utility/utility_thread.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "services/service_manager/embedder/embedded_service_info.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/sandbox/switches.h"
diff --git a/chrome/utility/extensions/DEPS b/chrome/utility/extensions/DEPS index dbe2482..a62f289 100644 --- a/chrome/utility/extensions/DEPS +++ b/chrome/utility/extensions/DEPS
@@ -1,5 +1,5 @@ include_rules = [ + "+extensions/buildflags", "+extensions/common", - "+extensions/features", "+extensions/utility", ]
diff --git a/chrome/utility/extensions/extensions_handler.h b/chrome/utility/extensions/extensions_handler.h index 471b388..0525878 100644 --- a/chrome/utility/extensions/extensions_handler.h +++ b/chrome/utility/extensions/extensions_handler.h
@@ -6,7 +6,7 @@ #define CHROME_UTILITY_EXTENSIONS_EXTENSIONS_HANDLER_H_ #include "build/build_config.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if !BUILDFLAG(ENABLE_EXTENSIONS) #error "Extensions must be enabled"
diff --git a/chromecast/base/chromecast_switches.cc b/chromecast/base/chromecast_switches.cc index 2e7e80f..9782ab7 100644 --- a/chromecast/base/chromecast_switches.cc +++ b/chromecast/base/chromecast_switches.cc
@@ -16,8 +16,8 @@ const char kSwitchValueFalse[] = "false"; // Server url to upload crash data to. -// Default is "http://clients2.google.com/cr/report" for prod devices. -// Default is "http://clients2.google.com/cr/staging_report" for non prod. +// Default is "https://clients2.google.com/cr/report" for prod devices. +// Default is "https://clients2.google.com/cr/staging_report" for non prod. const char kCrashServerUrl[] = "crash-server-url"; // Enable file accesses. It should not be enabled for most Cast devices.
diff --git a/chromecast/chromecast.gni b/chromecast/chromecast.gni index 884f819..93e1eca3 100644 --- a/chromecast/chromecast.gni +++ b/chromecast/chromecast.gni
@@ -4,7 +4,7 @@ import("//build/config/chromecast_build.gni") import("//build/config/locales.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") # This args block should contain arguments used within the //chromecast # directory. Arguments which are used in other Chrome components should
diff --git a/chromecast/crash/linux/minidump_uploader.cc b/chromecast/crash/linux/minidump_uploader.cc index f993e1d2..d3ecef7c 100644 --- a/chromecast/crash/linux/minidump_uploader.cc +++ b/chromecast/crash/linux/minidump_uploader.cc
@@ -39,8 +39,8 @@ const char kProductName[] = "Eureka"; const char kCrashServerStaging[] = - "http://clients2.google.com/cr/staging_report"; -const char kCrashServerProduction[] = "http://clients2.google.com/cr/report"; + "https://clients2.google.com/cr/staging_report"; +const char kCrashServerProduction[] = "https://clients2.google.com/cr/report"; typedef std::vector<std::unique_ptr<DumpInfo>> DumpList;
diff --git a/chromecast/media/cma/backend/video/BUILD.gn b/chromecast/media/cma/backend/video/BUILD.gn index fcce9d9d..b6c795b 100644 --- a/chromecast/media/cma/backend/video/BUILD.gn +++ b/chromecast/media/cma/backend/video/BUILD.gn
@@ -13,6 +13,7 @@ ] deps = [ + "//chromecast/base:base", "//chromecast/media/cma/backend:for_mixer_audio", "//chromecast/media/cma/backend/alsa:cma_backend_support", "//chromecast/public",
diff --git a/chromecast/media/cma/decoder/cast_audio_decoder.cc b/chromecast/media/cma/decoder/cast_audio_decoder.cc index 238e7f9..c2ac242 100644 --- a/chromecast/media/cma/decoder/cast_audio_decoder.cc +++ b/chromecast/media/cma/decoder/cast_audio_decoder.cc
@@ -70,7 +70,8 @@ decoder_->Initialize( media::DecoderConfigAdapter::ToMediaAudioDecoderConfig(config_), nullptr, base::Bind(&CastAudioDecoderImpl::OnInitialized, self), - base::Bind(&CastAudioDecoderImpl::OnDecoderOutput, self)); + base::Bind(&CastAudioDecoderImpl::OnDecoderOutput, self), + ::media::AudioDecoder::WaitingForDecryptionKeyCB()); // Unfortunately there is no result from decoder_->Initialize() until later // (the pipeline status callback is posted to the task runner). }
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 66421bf..afb36eea 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -10470.0.0 \ No newline at end of file +10471.0.0 \ No newline at end of file
diff --git a/chromeos/services/assistant/BUILD.gn b/chromeos/services/assistant/BUILD.gn index 3776da7c..6417e95 100644 --- a/chromeos/services/assistant/BUILD.gn +++ b/chromeos/services/assistant/BUILD.gn
@@ -45,6 +45,7 @@ deps += [ "//chromeos/assistant/internal", + "//chromeos/assistant/internal/action", "//libassistant/contrib/core", "//libassistant/contrib/platform/audio", "//libassistant/contrib/platform/auth",
diff --git a/chromeos/services/assistant/assistant_manager_service_impl.cc b/chromeos/services/assistant/assistant_manager_service_impl.cc index a38f3d9..879477e9 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl.cc +++ b/chromeos/services/assistant/assistant_manager_service_impl.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/logging.h" +#include "chromeos/assistant/internal/action/cros_action_module.h" #include "chromeos/assistant/internal/internal_constants.h" #include "chromeos/assistant/internal/internal_util.h" #include "libassistant/shared/internal_api/assistant_manager_internal.h" @@ -16,6 +17,7 @@ AssistantManagerServiceImpl::AssistantManagerServiceImpl() : platform_api_(kDefaultConfigStr), + action_module_(std::make_unique<action::CrosActionModule>()), assistant_manager_( assistant_client::AssistantManager::Create(&platform_api_, kDefaultConfigStr)), @@ -35,6 +37,8 @@ }); assistant_manager_internal_->SetDisplayConnection(&display_connection_); + assistant_manager_internal_->RegisterActionModule(action_module_.get()); + SetAccessToken(access_token); assistant_manager_->Start(); }
diff --git a/chromeos/services/assistant/assistant_manager_service_impl.h b/chromeos/services/assistant/assistant_manager_service_impl.h index 413df0b..574a602 100644 --- a/chromeos/services/assistant/assistant_manager_service_impl.h +++ b/chromeos/services/assistant/assistant_manager_service_impl.h
@@ -25,6 +25,10 @@ namespace chromeos { namespace assistant { +namespace action { +class CrosActionModule; +} // namespace action + // Implementation of AssistantManagerService based on libassistant. class AssistantManagerServiceImpl : public AssistantManagerService, public AssistantEventObserver { @@ -49,6 +53,7 @@ private: PlatformApiImpl platform_api_; CrosDisplayConnection display_connection_; + std::unique_ptr<action::CrosActionModule> action_module_; std::unique_ptr<assistant_client::AssistantManager> assistant_manager_; assistant_client::AssistantManagerInternal* const assistant_manager_internal_; mojo::InterfacePtrSet<mojom::AssistantEventSubscriber> subscribers_;
diff --git a/components/arc/common/BUILD.gn b/components/arc/common/BUILD.gn index 267d0fa..3c42f01 100644 --- a/components/arc/common/BUILD.gn +++ b/components/arc/common/BUILD.gn
@@ -57,7 +57,9 @@ public_deps = [ ":media", + "//device/usb/public/mojom", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//ui/gfx/geometry/mojo", ] }
diff --git a/components/arc/common/accessibility_helper.mojom b/components/arc/common/accessibility_helper.mojom index 4df7fa3..bf095d2 100644 --- a/components/arc/common/accessibility_helper.mojom +++ b/components/arc/common/accessibility_helper.mojom
@@ -6,7 +6,7 @@ module arc.mojom; -import "gfx.mojom"; +import "components/arc/common/gfx.mojom"; // For future maintainers, each of the below enums were hand picked // from their equivalents in the Android source. Keep them in the
diff --git a/components/arc/common/app.mojom b/components/arc/common/app.mojom index c00f4c4..874a616e 100644 --- a/components/arc/common/app.mojom +++ b/components/arc/common/app.mojom
@@ -6,8 +6,8 @@ module arc.mojom; -import "gfx.mojom"; -import "scale_factor.mojom"; +import "components/arc/common/gfx.mojom"; +import "components/arc/common/scale_factor.mojom"; // Describes OrientationLock request. // Note: ChromeOS currently assumes the internal panel is always landscape.
diff --git a/components/arc/common/arc_bridge.mojom b/components/arc/common/arc_bridge.mojom index 63783e55..a3db806 100644 --- a/components/arc/common/arc_bridge.mojom +++ b/components/arc/common/arc_bridge.mojom
@@ -4,45 +4,45 @@ module arc.mojom; -import "accessibility_helper.mojom"; -import "app.mojom"; -import "audio.mojom"; -import "auth.mojom"; -import "backup_settings.mojom"; -import "bluetooth.mojom"; -import "boot_phase_monitor.mojom"; -import "cast_receiver.mojom"; -import "cert_store.mojom"; -import "clipboard.mojom"; -import "crash_collector.mojom"; -import "enterprise_reporting.mojom"; -import "file_system.mojom"; -import "ime.mojom"; -import "intent_helper.mojom"; -import "kiosk.mojom"; -import "lock_screen.mojom"; -import "metrics.mojom"; -import "midis.mojom"; -import "net.mojom"; -import "notifications.mojom"; -import "obb_mounter.mojom"; -import "oemcrypto.mojom"; -import "policy.mojom"; -import "power.mojom"; -import "print.mojom"; -import "process.mojom"; -import "rotation_lock.mojom"; -import "screen_capture.mojom"; -import "storage_manager.mojom"; -import "timer.mojom"; -import "tracing.mojom"; -import "tts.mojom"; -import "usb_host.mojom"; -import "video.mojom"; -import "voice_interaction_arc_home.mojom"; -import "voice_interaction_framework.mojom"; -import "volume_mounter.mojom"; -import "wallpaper.mojom"; +import "components/arc/common/accessibility_helper.mojom"; +import "components/arc/common/app.mojom"; +import "components/arc/common/audio.mojom"; +import "components/arc/common/auth.mojom"; +import "components/arc/common/backup_settings.mojom"; +import "components/arc/common/bluetooth.mojom"; +import "components/arc/common/boot_phase_monitor.mojom"; +import "components/arc/common/cast_receiver.mojom"; +import "components/arc/common/cert_store.mojom"; +import "components/arc/common/clipboard.mojom"; +import "components/arc/common/crash_collector.mojom"; +import "components/arc/common/enterprise_reporting.mojom"; +import "components/arc/common/file_system.mojom"; +import "components/arc/common/ime.mojom"; +import "components/arc/common/intent_helper.mojom"; +import "components/arc/common/kiosk.mojom"; +import "components/arc/common/lock_screen.mojom"; +import "components/arc/common/metrics.mojom"; +import "components/arc/common/midis.mojom"; +import "components/arc/common/net.mojom"; +import "components/arc/common/notifications.mojom"; +import "components/arc/common/obb_mounter.mojom"; +import "components/arc/common/oemcrypto.mojom"; +import "components/arc/common/policy.mojom"; +import "components/arc/common/power.mojom"; +import "components/arc/common/print.mojom"; +import "components/arc/common/process.mojom"; +import "components/arc/common/rotation_lock.mojom"; +import "components/arc/common/screen_capture.mojom"; +import "components/arc/common/storage_manager.mojom"; +import "components/arc/common/timer.mojom"; +import "components/arc/common/tracing.mojom"; +import "components/arc/common/tts.mojom"; +import "components/arc/common/usb_host.mojom"; +import "components/arc/common/video.mojom"; +import "components/arc/common/voice_interaction_arc_home.mojom"; +import "components/arc/common/voice_interaction_framework.mojom"; +import "components/arc/common/volume_mounter.mojom"; +import "components/arc/common/wallpaper.mojom"; // Next MinVersion: 37 // Deprecated method IDs: 101, 105
diff --git a/components/arc/common/ime.mojom b/components/arc/common/ime.mojom index b1f2fc0..032f539 100644 --- a/components/arc/common/ime.mojom +++ b/components/arc/common/ime.mojom
@@ -6,7 +6,7 @@ module arc.mojom; -import "gfx.mojom"; +import "components/arc/common/gfx.mojom"; // Represents the type of text input field currently focused. [Extensible]
diff --git a/components/arc/common/intent_helper.mojom b/components/arc/common/intent_helper.mojom index 4cc56de..cef0ca3a 100644 --- a/components/arc/common/intent_helper.mojom +++ b/components/arc/common/intent_helper.mojom
@@ -6,7 +6,7 @@ module arc.mojom; -import "scale_factor.mojom"; +import "components/arc/common/scale_factor.mojom"; // Describes the type of action to invoke. enum ActionType {
diff --git a/components/arc/common/notifications.mojom b/components/arc/common/notifications.mojom index a15c33b..92588d4 100644 --- a/components/arc/common/notifications.mojom +++ b/components/arc/common/notifications.mojom
@@ -6,8 +6,8 @@ module arc.mojom; -import "bitmap.mojom"; -import "gfx.mojom"; +import "components/arc/common/bitmap.mojom"; +import "components/arc/common/gfx.mojom"; // These values must be matched with the NOTIFICATION_EVENT_* constants in // com.android.server.ArcNotificationListenerService.
diff --git a/components/arc/common/oemcrypto_daemon.mojom b/components/arc/common/oemcrypto_daemon.mojom index b75db2d..887c175 100644 --- a/components/arc/common/oemcrypto_daemon.mojom +++ b/components/arc/common/oemcrypto_daemon.mojom
@@ -13,8 +13,8 @@ module arc_oemcrypto.mojom; -import "oemcrypto.mojom"; -import "protected_buffer_manager.mojom"; +import "components/arc/common/oemcrypto.mojom"; +import "components/arc/common/protected_buffer_manager.mojom"; // OemCryptoHostDaemon is implemented by the OemCrypto daemon running in // Chrome OS and has Connect called from the Browser process in Chrome.
diff --git a/components/arc/common/screen_capture.mojom b/components/arc/common/screen_capture.mojom index 0d205e60..8a3bc85 100644 --- a/components/arc/common/screen_capture.mojom +++ b/components/arc/common/screen_capture.mojom
@@ -15,7 +15,7 @@ module arc.mojom; // For gfx::Size. -import "video_common.mojom"; +import "components/arc/common/video_common.mojom"; // Implemented by Chrome in order to allow requesting of permissions to perform // desktop capture as well as creating a session for it.
diff --git a/components/arc/common/video.mojom b/components/arc/common/video.mojom index 5f5015e..75f87ce 100644 --- a/components/arc/common/video.mojom +++ b/components/arc/common/video.mojom
@@ -6,8 +6,8 @@ module arc.mojom; -import "video_decode_accelerator.mojom"; -import "video_encode_accelerator.mojom"; +import "components/arc/common/video_decode_accelerator.mojom"; +import "components/arc/common/video_encode_accelerator.mojom"; // Deprecated method IDs: 0 // Next method ID: 2
diff --git a/components/arc/common/video_decode_accelerator.mojom b/components/arc/common/video_decode_accelerator.mojom index 9a95ce18..498ac8ba 100644 --- a/components/arc/common/video_decode_accelerator.mojom +++ b/components/arc/common/video_decode_accelerator.mojom
@@ -15,8 +15,8 @@ module arc.mojom; -import "gfx.mojom"; -import "video_common.mojom"; +import "components/arc/common/gfx.mojom"; +import "components/arc/common/video_common.mojom"; // Information of the bitstream buffer. struct BitstreamBuffer {
diff --git a/components/arc/common/video_encode_accelerator.mojom b/components/arc/common/video_encode_accelerator.mojom index 308dc38..484e0bad 100644 --- a/components/arc/common/video_encode_accelerator.mojom +++ b/components/arc/common/video_encode_accelerator.mojom
@@ -7,7 +7,7 @@ module arc.mojom; -import "video_common.mojom"; +import "components/arc/common/video_common.mojom"; [Extensible] enum VideoPixelFormat {
diff --git a/components/arc/common/voice_interaction_arc_home.mojom b/components/arc/common/voice_interaction_arc_home.mojom index c1d9695..10d5d57 100644 --- a/components/arc/common/voice_interaction_arc_home.mojom +++ b/components/arc/common/voice_interaction_arc_home.mojom
@@ -6,7 +6,7 @@ module arc.mojom; -import "gfx.mojom"; +import "components/arc/common/gfx.mojom"; import "mojo/public/mojom/base/string16.mojom"; // Represents view structure to be passed to ARC. The view
diff --git a/components/arc/common/voice_interaction_framework.mojom b/components/arc/common/voice_interaction_framework.mojom index 2aedfa1f..56bcc58 100644 --- a/components/arc/common/voice_interaction_framework.mojom +++ b/components/arc/common/voice_interaction_framework.mojom
@@ -6,7 +6,7 @@ module arc.mojom; -import "gfx.mojom"; +import "components/arc/common/gfx.mojom"; // There is another copy of the VoiceInteractionState definition in // //ash/public/interfaces/voice_interaction_controller.mojom
diff --git a/components/autofill/content/common/BUILD.gn b/components/autofill/content/common/BUILD.gn index 0b92807..9067738b 100644 --- a/components/autofill/content/common/BUILD.gn +++ b/components/autofill/content/common/BUILD.gn
@@ -13,6 +13,7 @@ public_deps = [ ":mojo_types", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//ui/gfx/geometry/mojo", "//url/mojom:url_mojom_gurl", ]
diff --git a/components/autofill/content/common/autofill_types.mojom b/components/autofill/content/common/autofill_types.mojom index 23261d7..7ffb633 100644 --- a/components/autofill/content/common/autofill_types.mojom +++ b/components/autofill/content/common/autofill_types.mojom
@@ -96,6 +96,7 @@ DD_TAG, LI_TAG, PLACE_HOLDER, + ARIA_LABEL, COMBINED, VALUE, };
diff --git a/components/autofill/content/common/autofill_types_struct_traits.cc b/components/autofill/content/common/autofill_types_struct_traits.cc index 8a4bc43..6a8cfe6 100644 --- a/components/autofill/content/common/autofill_types_struct_traits.cc +++ b/components/autofill/content/common/autofill_types_struct_traits.cc
@@ -488,6 +488,8 @@ return autofill::mojom::LabelSource::LI_TAG; case autofill::FormFieldData::LabelSource::PLACE_HOLDER: return autofill::mojom::LabelSource::PLACE_HOLDER; + case autofill::FormFieldData::LabelSource::ARIA_LABEL: + return autofill::mojom::LabelSource::ARIA_LABEL; case autofill::FormFieldData::LabelSource::COMBINED: return autofill::mojom::LabelSource::COMBINED; case autofill::FormFieldData::LabelSource::VALUE: @@ -528,6 +530,9 @@ case autofill::mojom::LabelSource::PLACE_HOLDER: *output = autofill::FormFieldData::LabelSource::PLACE_HOLDER; return true; + case autofill::mojom::LabelSource::ARIA_LABEL: + *output = autofill::FormFieldData::LabelSource::ARIA_LABEL; + return true; case autofill::mojom::LabelSource::COMBINED: *output = autofill::FormFieldData::LabelSource::COMBINED; return true;
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc index 7b035ec..bf54309 100644 --- a/components/autofill/content/renderer/form_autofill_util.cc +++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -15,6 +15,7 @@ #include "base/i18n/case_conversion.h" #include "base/logging.h" #include "base/memory/ptr_util.h" +#include "base/no_destructor.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -392,6 +393,16 @@ return base::string16(); } +// Helper for |InferLabelForElement()| that infers a label, if possible, from +// the aria-label. e.g. <input aria-label="foo"> +base::string16 InferLabelFromAriaLabel(const WebFormControlElement& element) { + static const base::NoDestructor<WebString> kAriaLabel("aria-label"); + if (element.HasAttribute(*kAriaLabel)) + return element.GetAttribute(*kAriaLabel).Utf16(); + + return base::string16(); +} + // Helper for |InferLabelForElement()| that infers a label, from // the value attribute when it is present and user has not typed in (if // element's value attribute is same as the element's value). @@ -711,6 +722,14 @@ return true; } + // If we didn't find a placeholder, check for aria-label text. + inferred_label = InferLabelFromAriaLabel(element); + if (IsLabelValid(inferred_label, stop_words)) { + *label_source = FormFieldData::LabelSource::ARIA_LABEL; + *label = std::move(inferred_label); + return true; + } + // For all other searches that involve traversing up the tree, the search // order is based on which tag is the closest ancestor to |element|. std::vector<std::string> tag_names = AncestorTagNames(element);
diff --git a/components/autofill/content/renderer/form_autofill_util_browsertest.cc b/components/autofill/content/renderer/form_autofill_util_browsertest.cc index e75eb68..342069c 100644 --- a/components/autofill/content/renderer/form_autofill_util_browsertest.cc +++ b/components/autofill/content/renderer/form_autofill_util_browsertest.cc
@@ -229,6 +229,8 @@ FormFieldData::LabelSource::P_TAG}, {"PLACE_HOLDER", "<input id='target' placeholder='label'/>", FormFieldData::LabelSource::PLACE_HOLDER}, + {"ARIA_LABEL", "<input id='target' aria-label='label'/>", + FormFieldData::LabelSource::ARIA_LABEL}, {"VALUE", "<input id='target' value='label'/>", FormFieldData::LabelSource::VALUE}, {"LI_TAG", "<li>label<div><input id='target'/></div></li>",
diff --git a/components/autofill/core/common/form_field_data.h b/components/autofill/core/common/form_field_data.h index 5273724..392d474 100644 --- a/components/autofill/core/common/form_field_data.h +++ b/components/autofill/core/common/form_field_data.h
@@ -59,6 +59,7 @@ DD_TAG, LI_TAG, PLACE_HOLDER, + ARIA_LABEL, COMBINED, // Combined with various elements. VALUE, // label is the value of element. };
diff --git a/components/autofill/ios/browser/resources/autofill_controller.js b/components/autofill/ios/browser/resources/autofill_controller.js index a6995b42..3c9d31d 100644 --- a/components/autofill/ios/browser/resources/autofill_controller.js +++ b/components/autofill/ios/browser/resources/autofill_controller.js
@@ -17,34 +17,6 @@ */ goog.provide('__crWeb.autofill'); -/** - * @typedef {{ - * name: string, - * value: string, - * form_control_type: string, - * autocomplete_attributes: string, - * max_length: number, - * is_autofilled: boolean, - * is_checkable: boolean, - * is_focusable: boolean, - * should_autocomplete: boolean, - * role: number, - * option_contents: Array<string>, - * option_values: Array<string> - * }} - */ -var AutofillFormFieldData; - -/** - * @typedef {{ - * name: string, - * origin: string, - * action: string, - * fields: Array<AutofillFormFieldData> - * }} - */ -var AutofillFormData; - /* Beginning of anonymous object. */ (function() { @@ -60,86 +32,6 @@ __gCrWeb['autofill'] = __gCrWeb.autofill; /** - * The maximum length allowed for form data. - * - * This variable is from AutofillTable::kMaxDataLength in - * chromium/src/components/autofill/core/browser/webdata/autofill_table.h - * - * @const {number} - */ -__gCrWeb.autofill.MAX_DATA_LENGTH = 1024; - -/** - * The maximum number of form fields we are willing to parse, due to - * computational costs. Several examples of forms with lots of fields that are - * not relevant to Autofill: (1) the Netflix queue; (2) the Amazon wishlist; - * (3) router configuration pages; and (4) other configuration pages, e.g. for - * Google code project settings. - * - * This variable is |kMaxParseableFields| from - * chromium/src/components/autofill/content/renderer/form_autofill_util.h - * - * @const {number} - */ -__gCrWeb.autofill.MAX_PARSEABLE_FIELDS = 200; - -/** - * A bit field mask to extract data from WebFormControlElement for - * extracting none value. - * - * This variable is from enum ExtractMask in - * chromium/src/components/autofill/content/renderer/form_autofill_util.h - * - * @const {number} - */ -__gCrWeb.autofill.EXTRACT_MASK_NONE = 0; - -/** - * A bit field mask to extract data from WebFormControlElement for - * extracting value from WebFormControlElement. - * - * This variable is from enum ExtractMask in - * chromium/src/components/autofill/content/renderer/form_autofill_util.h - * - * @const {number} - */ -__gCrWeb.autofill.EXTRACT_MASK_VALUE = 1 << 0; - -/** - * A bit field mask to extract data from WebFormControlElement for - * extracting option text from WebFormSelectElement. Only valid when - * EXTRACT_MASK_VALUE is set. This is used for form submission where human - * readable value is captured. - * - * This variable is from enum ExtractMask in - * chromium/src/components/autofill/content/renderer/form_autofill_util.h - * - * @const {number} - */ -__gCrWeb.autofill.EXTRACT_MASK_OPTION_TEXT = 1 << 1; - -/** - * A bit field mask to extract data from WebFormControlElement for - * extracting options from WebFormControlElement. - * - * This variable is from enum ExtractMask in - * chromium/src/components/autofill/content/renderer/form_autofill_util.h - * - * @const {number} - */ -__gCrWeb.autofill.EXTRACT_MASK_OPTIONS = 1 << 2; - -/** - * A value for the "presentation" role. - * - * This variable is from enum RoleAttribute in - * chromium/src/components/autofill/core/common/form_field_data.h - * - * @const {number} - */ -__gCrWeb.autofill.ROLE_ATTRIBUTE_PRESENTATION = 0; - -/** * The delay between filling two fields * * Page need time to propagate the events after setting one field. Add a delay @@ -187,8 +79,8 @@ var parentNode = element.parentNode; while (parentNode) { if ((parentNode.nodeType === Node.ELEMENT_NODE) && - (__gCrWeb.autofill.hasTagName(parentNode, 'form') || - __gCrWeb.autofill.hasTagName(parentNode, 'fieldset'))) { + (__gCrWeb.fill.hasTagName(parentNode, 'form') || + __gCrWeb.fill.hasTagName(parentNode, 'fieldset'))) { return true; } parentNode = parentNode.parentNode; @@ -254,7 +146,7 @@ for (var elementIndex = 0; elementIndex < controlElements.length; ++elementIndex) { var element = controlElements[elementIndex]; - if (!__gCrWeb.autofill.isCheckableElement(element)) { + if (!__gCrWeb.fill.isCheckableElement(element)) { ++numEditableElements; } } @@ -289,7 +181,7 @@ } } - if (__gCrWeb.autofill.hasTagName(elements[i], 'fieldset') && + if (__gCrWeb.fill.hasTagName(elements[i], 'fieldset') && !isElementInsideFormOrFieldSet(elements[i])) { fieldsets.push(elements[i]); } @@ -299,265 +191,6 @@ } /** - * Extracts fields from |controlElements| with |extractMask| to |formFields|. - * The extracted fields are also placed in |elementArray|. - * - * It is based on the logic in - * bool ExtractFieldsFromControlElements( - * const WebVector<WebFormControlElement>& control_elements, - * const FieldValueAndPropertiesMaskMap* field_value_and_properties_map, - * ExtractMask extract_mask, - * std::vector<std::unique_ptr<FormFieldData>>* form_fields, - * std::vector<bool>* fields_extracted, - * std::map<WebFormControlElement, FormFieldData*>* element_map) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc - * - * TODO(thestig): Make |element_map| a Map when Chrome makes iOS 8 and Safari 8 - * part of the minimal requirements. - * - * @param {Array<FormControlElement>} controlElements The control elements that - * will be processed. - * @param {number} extractMask Mask controls what data is extracted from - * controlElements. - * @param {Array<AutofillFormFieldData>} formFields The extracted form fields. - * @param {Array<boolean>} fieldsExtracted Indicates whether the fields were - * extracted. - * @param {Array<?AutofillFormFieldData>} elementArray The extracted form - * fields or null if a particular control has no corresponding field. - * @return {boolean} Whether there are fields and not too many fields in the - * form. - */ -function extractFieldsFromControlElements_( - controlElements, extractMask, formFields, fieldsExtracted, elementArray) { - for (var i = 0; i < controlElements.length; ++i) { - fieldsExtracted[i] = false; - elementArray[i] = null; - - /** @type {FormControlElement} */ - var controlElement = controlElements[i]; - if (!__gCrWeb.autofill.isAutofillableElement(controlElement)) { - continue; - } - - // Create a new AutofillFormFieldData, fill it out and map it to the - // field's name. - var formField = new __gCrWeb['common'].JSONSafeObject; - __gCrWeb.autofill.webFormControlElementToFormField( - controlElement, extractMask, formField); - formFields.push(formField); - elementArray[i] = formField; - fieldsExtracted[i] = true; - - // To avoid overly expensive computation, we impose a maximum number of - // allowable fields. - if (formFields.length > __gCrWeb.autofill.MAX_PARSEABLE_FIELDS) { - return false; - } - } - - return formFields.length > 0; -} - -/** - * Check if the node is visible. - * - * @param {Node} node The node to be processed. - * @return {boolean} Whether the node is visible or not. - */ -function isVisibleNode_(node) { - if (!node) return false; - - if (node.nodeType === Node.ELEMENT_NODE) { - var style = window.getComputedStyle(/** @type {Element} */ (node)); - if (style.visibility == 'hidden' || style.display == 'none') return false; - } - - // Verify all ancestors are focusable. - return !node.parentNode || isVisibleNode_(node.parentNode); -} - -/** - * For each label element, get the corresponding form control element, use the - * form control element along with |controlElements| and |elementArray| to find - * the previously created AutofillFormFieldData and set the - * AutofillFormFieldData's label to the label.firstChild().nodeValue() of the - * label element. - * - * It is based on the logic in - * void MatchLabelsAndFields( - * const WebElementCollection& labels, - * std::map<WebFormControlElement, FormFieldData*>* element_map); - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc - * - * This differs in that it takes a formElement field, instead of calling - * field_element.isFormControlElement(). - * - * This also uses (|controlElements|, |elementArray|) because there is no - * guaranteeded Map support on iOS yet. - * - * @param {NodeList} labels The labels to match. - * @param {HTMLFormElement} formElement The form element being processed. - * @param {Array<FormControlElement>} controlElements The control elements that - * were processed. - * @param {Array<?AutofillFormFieldData>} elementArray The extracted fields. - */ -function matchLabelsAndFields_( - labels, formElement, controlElements, elementArray) { - for (var index = 0; index < labels.length; ++index) { - var label = labels[index]; - var fieldElement = label.control; - var fieldData = null; - if (!fieldElement) { - // Sometimes site authors will incorrectly specify the corresponding - // field element's name rather than its id, so we compensate here. - var elementName = label.htmlFor; - if (!elementName) continue; - // Look through the list for elements with this name. There can actually - // be more than one. In this case, the label may not be particularly - // useful, so just discard it. - for (var elementIndex = 0; elementIndex < elementArray.length; - ++elementIndex) { - var currentFieldData = elementArray[elementIndex]; - if (currentFieldData && currentFieldData['name'] === elementName) { - if (fieldData !== null) { - fieldData = null; - break; - } else { - fieldData = currentFieldData; - } - } - } - } else if ( - fieldElement.form != formElement || fieldElement.type === 'hidden') { - continue; - } else { - // Typical case: look up |fieldData| in |elementArray|. - for (var elementIndex = 0; elementIndex < elementArray.length; - ++elementIndex) { - if (controlElements[elementIndex] === fieldElement) { - fieldData = elementArray[elementIndex]; - break; - } - } - } - - if (!fieldData) continue; - - if (!('label' in fieldData)) { - fieldData['label'] = ''; - } - var labelText = __gCrWeb.autofill.findChildText(label); - // Concatenate labels because some sites might have multiple label - // candidates. - if (fieldData['label'].length > 0 && labelText.length > 0) { - fieldData['label'] += ' '; - } - fieldData['label'] += labelText; - } -} - -/** - * Common function shared by webFormElementToFormData() and - * unownedFormElementsAndFieldSetsToFormData(). Either pass in: - * 1) |formElement|, |formControlElement| and an empty |fieldsets|. - * or - * 2) a non-empty |fieldsets|. - * - * It is based on the logic in - * bool FormOrFieldsetsToFormData( - * const blink::WebFormElement* form_element, - * const blink::WebFormControlElement* form_control_element, - * const std::vector<blink::WebElement>& fieldsets, - * const WebVector<WebFormControlElement>& control_elements, - * ExtractMask extract_mask, - * FormData* form, - * FormFieldData* field) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc - * - * @param {HTMLFormElement} formElement The form element that will be processed. - * @param {FormControlElement} formControlElement A control element in - * formElment, the FormField of which will be returned in field. - * @param {Array<Element>} fieldsets The fieldsets to look through if - * formElement and formControlElement are not specified. - * @param {Array<FormControlElement>} controlElements The control elements that - * will be processed. - * @param {number} extractMask Mask controls what data is extracted from - * formElement. - * @param {AutofillFormData} form Form to fill in the AutofillFormData - * information of formElement. - * @param {?AutofillFormFieldData} field Field to fill in the form field - * information of formControlElement. - * @return {boolean} Whether there are fields and not too many fields in the - * form. - */ -function formOrFieldsetsToFormData_( - formElement, formControlElement, fieldsets, controlElements, extractMask, - form, field) { - // This should be a map from a control element to the AutofillFormFieldData. - // However, without Map support, it's just an Array of AutofillFormFieldData. - var elementArray = []; - - // The extracted FormFields. - var formFields = []; - - // A vector of bools that indicate whether each element in |controlElements| - // meets the requirements and thus will be in the resulting |form|. - var fieldsExtracted = []; - - if (!extractFieldsFromControlElements_( - controlElements, extractMask, formFields, fieldsExtracted, - elementArray)) { - return false; - } - - if (formElement) { - // Loop through the label elements inside the form element. For each label - // element, get the corresponding form control element, use the form control - // element along with |controlElements| and |elementArray| to find the - // previously created AutofillFormFieldData and set the - // AutofillFormFieldData's label. - var labels = formElement.getElementsByTagName('label'); - matchLabelsAndFields_(labels, formElement, controlElements, elementArray); - } else { - // Same as the if block, but for all the labels in fieldset - for (var i = 0; i < fieldsets.length; ++i) { - var labels = fieldsets[i].getElementsByTagName('label'); - matchLabelsAndFields_(labels, formElement, controlElements, elementArray); - } - } - - // Loop through the form control elements, extracting the label text from - // the DOM. We use the |fieldsExtracted| vector to make sure we assign the - // extracted label to the correct field, as it's possible |form_fields| will - // not contain all of the elements in |control_elements|. - for (var i = 0, fieldIdx = 0; - i < controlElements.length && fieldIdx < formFields.length; ++i) { - // This field didn't meet the requirements, so don't try to find a label - // for it. - if (!fieldsExtracted[i]) continue; - - var controlElement = controlElements[i]; - var currentField = formFields[fieldIdx]; - if (!currentField['label']) { - currentField['label'] = - __gCrWeb.autofill.inferLabelForElement(controlElement); - } - if (currentField['label'].length > __gCrWeb.autofill.MAX_DATA_LENGTH) { - currentField['label'] = - currentField['label'].substr(0, __gCrWeb.autofill.MAX_DATA_LENGTH); - } - - if (controlElement === formControlElement) field = formFields[fieldIdx]; - ++fieldIdx; - } - - form['fields'] = formFields; - // Protect against custom implementation of Array.toJSON in host pages. - form['fields'].toJSON = null; - return true; -} - -/** * Scans DOM and returns a JSON string representation of forms and form * extraction results. This is just a wrapper around extractNewForms() to JSON * encode the forms, for convenience. @@ -629,7 +262,7 @@ var delay = 0; for (var i = 0; i < controlElements.length; ++i) { var element = controlElements[i]; - if (!__gCrWeb.autofill.isAutofillableElement(element)) { + if (!__gCrWeb.fill.isAutofillableElement(element)) { continue; } var fieldName = __gCrWeb.form.getFieldIdentifier(element); @@ -638,7 +271,7 @@ // 'select-one' element. 'select-one' elements are always autofilled even // if non-empty; see AutofillManager::FillOrPreviewDataModelForm(). if (element.value && element.value.length > 0 && - !__gCrWeb.autofill.isSelectElement(element) && + !__gCrWeb.fill.isSelectElement(element) && fieldName !== forceFillFieldName) { continue; } @@ -647,9 +280,9 @@ var value = data.fields[fieldName]; if (!value) continue; - if (__gCrWeb.autofill.isTextInput(element) || - __gCrWeb.autofill.isTextAreaElement(element) || - __gCrWeb.autofill.isSelectElement(element)) { + if (__gCrWeb.fill.isTextInput(element) || + __gCrWeb.fill.isTextAreaElement(element) || + __gCrWeb.fill.isSelectElement(element)) { (function (_element, _value, _delay) { window.setTimeout(function() { __gCrWeb.fill.setInputElementValue(_value, _element, true); @@ -658,8 +291,8 @@ _element.addEventListener('input', controlElementInputListener); }, _delay);})(element, value, delay); delay = delay + __gCrWeb.autofill.delayBetweenFieldFillingMs; - } else if (__gCrWeb.autofill.isCheckableElement(element)) { - // TODO(bondd): Handle __gCrWeb.autofill.isCheckableElement(element) == + } else if (__gCrWeb.fill.isCheckableElement(element)) { + // TODO(bondd): Handle __gCrWeb.fill.isCheckableElement(element) == // true. |is_checked| is not currently passed in by the caller. } @@ -708,14 +341,14 @@ if (!element.isAutofilled || element.disabled) continue; var value = null; - if (__gCrWeb.autofill.isTextInput(element) || - __gCrWeb.autofill.isTextAreaElement(element)) { + if (__gCrWeb.fill.isTextInput(element) || + __gCrWeb.fill.isTextAreaElement(element)) { value = ''; - } else if (__gCrWeb.autofill.isSelectElement(element)) { + } else if (__gCrWeb.fill.isSelectElement(element)) { // Reset to the first index. // TODO(bondd): Store initial values and reset to the correct one here. value = element.options[0].value; - } else if (__gCrWeb.autofill.isCheckableElement(element)) { + } else if (__gCrWeb.fill.isCheckableElement(element)) { // TODO(bondd): Handle checkable elements. They aren't properly supported // by iOS Autofill yet. } @@ -762,8 +395,8 @@ /** @type {HTMLCollection} */ var webForms = document.forms; - var extractMask = __gCrWeb.autofill.EXTRACT_MASK_VALUE | - __gCrWeb.autofill.EXTRACT_MASK_OPTIONS; + var extractMask = __gCrWeb.fill.EXTRACT_MASK_VALUE | + __gCrWeb.fill.EXTRACT_MASK_OPTIONS; var numFieldsSeen = 0; for (var formIndex = 0; formIndex < webForms.length; ++formIndex) { /** @type {HTMLFormElement} */ @@ -777,13 +410,13 @@ } var form = new __gCrWeb['common'].JSONSafeObject; - if (!__gCrWeb.autofill.webFormElementToFormData( + if (!__gCrWeb.fill.webFormElementToFormData( window, formElement, null, extractMask, form, null /* field */)) { continue; } numFieldsSeen += form['fields'].length; - if (numFieldsSeen > __gCrWeb.autofill.MAX_PARSEABLE_FIELDS) { + if (numFieldsSeen > __gCrWeb.fill.MAX_PARSEABLE_FIELDS) { break; } @@ -804,7 +437,7 @@ window, fieldsets, unownedControlElements, extractMask, unownedForm); if (hasUnownedForm) { numFieldsSeen += unownedForm['fields'].length; - if (numFieldsSeen <= __gCrWeb.autofill.MAX_PARSEABLE_FIELDS) { + if (numFieldsSeen <= __gCrWeb.fill.MAX_PARSEABLE_FIELDS) { var interesting = isFormInteresting_( unownedForm, numEditableUnownedElements, minimumRequiredFields); if (interesting) { @@ -817,63 +450,6 @@ }; /** - * Fills |form| with the form data object corresponding to the |formElement|. - * If |field| is non-NULL, also fills |field| with the FormField object - * corresponding to the |formControlElement|. - * |extract_mask| controls what data is extracted. - * Returns true if |form| is filled out. Returns false if there are no fields or - * too many fields in the |form|. - * - * It is based on the logic in - * bool WebFormElementToFormData( - * const blink::WebFormElement& form_element, - * const blink::WebFormControlElement& form_control_element, - * ExtractMask extract_mask, - * FormData* form, - * FormFieldData* field) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc - * - * @param {HTMLFrameElement|Window} frame The window or frame where the - * formElement is in. - * @param {HTMLFormElement} formElement The form element that will be processed. - * @param {FormControlElement} formControlElement A control element in - * formElment, the FormField of which will be returned in field. - * @param {number} extractMask Mask controls what data is extracted from - * formElement. - * @param {AutofillFormData} form Form to fill in the AutofillFormData - * information of formElement. - * @param {?AutofillFormFieldData} field Field to fill in the form field - * information of formControlElement. - * @return {boolean} Whether there are fields and not too many fields in the - * form. - */ -__gCrWeb.autofill.webFormElementToFormData = function( - frame, formElement, formControlElement, extractMask, form, field) { - if (!frame) { - return false; - } - - form['name'] = __gCrWeb.form.getFormIdentifier(formElement); - form['origin'] = - __gCrWeb.common.removeQueryAndReferenceFromURL(frame.location.href); - form['action'] = __gCrWeb.common.absoluteURL( - frame.document, formElement.getAttribute('action')); - - // Note different from form_autofill_util.cc version of this method, which - // computes |form.action| using document.completeURL(form_element.action()) - // and falls back to formElement.action() if the computed action is invalid, - // here the action returned by |__gCrWeb.common.absoluteURL| is always - // valid, which is computed by creating a <a> element, and we don't check if - // the action is valid. - - var controlElements = __gCrWeb.form.getFormControlElements(formElement); - - return formOrFieldsetsToFormData_( - formElement, formControlElement, [] /* fieldsets */, controlElements, - extractMask, form, field); -}; - -/** * Fills |form| with the form data object corresponding to the unowned elements * and fieldsets in the document. * |extract_mask| controls what data is extracted. @@ -928,7 +504,7 @@ if (document.documentElement.hasAttribute('lang') && !document.documentElement.getAttribute('lang').toLowerCase().startsWith( 'en')) { - return formOrFieldsetsToFormData_( + return __gCrWeb.fill.formOrFieldsetsToFormData( null /* formElement*/, null /* formControlElement */, fieldsets, controlElements, extractMask, form, null /* field */); } @@ -946,906 +522,18 @@ var keyword = keywords[index]; if (title.includes(keyword) || path.includes(keyword)) { form['is_formless_checkout'] = true; - return formOrFieldsetsToFormData_( + return __gCrWeb.fill.formOrFieldsetsToFormData( null /* formElement*/, null /* formControlElement */, fieldsets, controlElements, extractMask, form, null /* field */); } } - return formOrFieldsetsToFormData_( + return __gCrWeb.fill.formOrFieldsetsToFormData( null /* formElement*/, null /* formControlElement */, fieldsets, controlElements, extractMask, form, null /* field */); } /** - * Returns is the tag of an |element| is tag. - * - * It is based on the logic in - * bool HasTagName(const WebNode& node, const blink::WebString& tag) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {Node} node Node to examine. - * @param {string} tag Tag name. - * @return {boolean} Whether the tag of node is tag. - */ -__gCrWeb.autofill.hasTagName = function(node, tag) { - return node.nodeType === Node.ELEMENT_NODE && - /** @type {Element} */ (node).tagName === tag.toUpperCase(); -}; - -/** - * Checks if an element is autofillable. - * - * It is based on the logic in - * bool IsAutofillableElement(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {boolean} Whether element is one of the element types that can be - * autofilled. - */ -__gCrWeb.autofill.isAutofillableElement = function(element) { - return __gCrWeb.autofill.isAutofillableInputElement(element) || - __gCrWeb.autofill.isSelectElement(element) || - __gCrWeb.autofill.isTextAreaElement(element); -}; - -/** - * Trims whitespace from the start of the input string. - * Simplified version of string_util::TrimWhitespace. - * @param {string} input String to trim. - * @return {string} The |input| string without leading whitespace. - */ -__gCrWeb.autofill.trimWhitespaceLeading = function(input) { - return input.replace(/^\s+/gm, ''); -}; - -/** - * Trims whitespace from the end of the input string. - * Simplified version of string_util::TrimWhitespace. - * @param {string} input String to trim. - * @return {string} The |input| string without trailing whitespace. - */ -__gCrWeb.autofill.trimWhitespaceTrailing = function(input) { - return input.replace(/\s+$/gm, ''); -}; - -/** - * Appends |suffix| to |prefix| so that any intermediary whitespace is collapsed - * to a single space. If |force_whitespace| is true, then the resulting string - * is guaranteed to have a space between |prefix| and |suffix|. Otherwise, the - * result includes a space only if |prefix| has trailing whitespace or |suffix| - * has leading whitespace. - * - * A few examples: - * CombineAndCollapseWhitespace('foo', 'bar', false) -> 'foobar' - * CombineAndCollapseWhitespace('foo', 'bar', true) -> 'foo bar' - * CombineAndCollapseWhitespace('foo ', 'bar', false) -> 'foo bar' - * CombineAndCollapseWhitespace('foo', ' bar', false) -> 'foo bar' - * CombineAndCollapseWhitespace('foo', ' bar', true) -> 'foo bar' - * CombineAndCollapseWhitespace('foo ', ' bar', false) -> 'foo bar' - * CombineAndCollapseWhitespace(' foo', 'bar ', false) -> ' foobar ' - * CombineAndCollapseWhitespace(' foo', 'bar ', true) -> ' foo bar ' - * - * It is based on the logic in - * const string16 CombineAndCollapseWhitespace(const string16& prefix, - * const string16& suffix, - * bool force_whitespace) - * @param {string} prefix The prefix string in the string combination. - * @param {string} suffix The suffix string in the string combination. - * @param {boolean} forceWhitespace A boolean indicating if whitespace should - * be added as separator in the combination. - * @return {string} The combined string. - */ -__gCrWeb.autofill.combineAndCollapseWhitespace = function( - prefix, suffix, forceWhitespace) { - var prefixTrimmed = __gCrWeb.autofill.trimWhitespaceTrailing(prefix); - var prefixTrailingWhitespace = prefixTrimmed != prefix; - var suffixTrimmed = __gCrWeb.autofill.trimWhitespaceLeading(suffix); - var suffixLeadingWhitespace = suffixTrimmed != suffix; - if (prefixTrailingWhitespace || suffixLeadingWhitespace || forceWhitespace) { - return prefixTrimmed + ' ' + suffixTrimmed; - } else { - return prefixTrimmed + suffixTrimmed; - } -}; - -/** - * This is a helper function for the findChildText() function (see below). - * Search depth is limited with the |depth| parameter. - * - * Based on form_autofill_util::FindChildTextInner(). - * - * @param {Node} node The node to fetch the text content from. - * @param {number} depth The maximum depth to descend on the DOM. - * @param {Array<Node>} divsToSkip List of <div> tags to ignore if encountered. - * @return {string} The discovered and adapted string. - */ -__gCrWeb.autofill.findChildTextInner = function(node, depth, divsToSkip) { - if (depth <= 0 || !node) { - return ''; - } - - // Skip over comments. - if (node.nodeType === Node.COMMENT_NODE) { - return __gCrWeb.autofill.findChildTextInner( - node.nextSibling, depth - 1, divsToSkip); - } - - if (node.nodeType !== Node.ELEMENT_NODE && node.nodeType !== Node.TEXT_NODE) { - return ''; - } - - // Ignore elements known not to contain inferable labels. - if (node.nodeType === Node.ELEMENT_NODE) { - if (node.tagName === 'OPTION' || node.tagName === 'SCRIPT' || - node.tagName === 'NOSCRIPT') { - return ''; - } - if (__gCrWeb.form.isFormControlElement(/** @type {Element} */ (node))) { - var input = /** @type {FormControlElement} */ (node); - if (__gCrWeb.autofill.isAutofillableElement(input)) { - return ''; - } - } - } - - if (node.tagName === 'DIV') { - for (var i = 0; i < divsToSkip.length; ++i) { - if (node === divsToSkip[i]) { - return ''; - } - } - } - - // Extract the text exactly at this node. - var nodeText = __gCrWeb.autofill.nodeValue(node); - if (node.nodeType === Node.TEXT_NODE && !nodeText) { - // In the C++ version, this text node would have been stripped completely. - // Just pass the buck. - return __gCrWeb.autofill.findChildTextInner( - node.nextSibling, depth, divsToSkip); - } - - // Recursively compute the children's text. - // Preserve inter-element whitespace separation. - var childText = __gCrWeb.autofill.findChildTextInner( - node.firstChild, depth - 1, divsToSkip); - var addSpace = node.nodeType === Node.TEXT_NODE && !nodeText; - // Emulate apparently incorrect Chromium behavior tracked in crbug 239819. - addSpace = false; - nodeText = __gCrWeb.autofill.combineAndCollapseWhitespace( - nodeText, childText, addSpace); - - // Recursively compute the siblings' text. - // Again, preserve inter-element whitespace separation. - var siblingText = __gCrWeb.autofill.findChildTextInner( - node.nextSibling, depth - 1, divsToSkip); - addSpace = node.nodeType === Node.TEXT_NODE && !nodeText; - // Emulate apparently incorrect Chromium behavior tracked in crbug 239819. - addSpace = false; - nodeText = __gCrWeb.autofill.combineAndCollapseWhitespace( - nodeText, siblingText, addSpace); - - return nodeText; -}; - -/** - * Same as findChildText() below, but with a list of div nodes to skip. - * - * It is based on the logic in - * string16 FindChildTextWithIgnoreList( - * const WebNode& node, - * const std::set<WebNode>& divs_to_skip) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {Node} node A node of which the child text will be return. - * @param {Array<Node>} divsToSkip List of <div> tags to ignore if encountered. - * @return {string} The child text. - */ -__gCrWeb.autofill.findChildTextWithIgnoreList = function(node, divsToSkip) { - if (node.nodeType === Node.TEXT_NODE) - return __gCrWeb.autofill.nodeValue(node); - - var child = node.firstChild; - var kChildSearchDepth = 10; - var nodeText = __gCrWeb.autofill.findChildTextInner( - child, kChildSearchDepth, divsToSkip); - nodeText = nodeText.trim(); - return nodeText; -}; - -/** - * Returns the aggregated values of the descendants of |element| that are - * non-empty text nodes. - * - * It is based on the logic in - * string16 FindChildText(const WebNode& node) - * chromium/src/components/autofill/content/renderer/form_autofill_util.cc, - * which is a faster alternative to |innerText()| for performance critical - * operations. - * - * @param {Node} node A node of which the child text will be return. - * @return {string} The child text. - */ -__gCrWeb.autofill.findChildText = function(node) { - return __gCrWeb.autofill.findChildTextWithIgnoreList(node, []); -}; - -/** - * Shared function for InferLabelFromPrevious() and InferLabelFromNext(). - * - * It is based on the logic in - * string16 InferLabelFromSibling(const WebFormControlElement& element, - * bool forward) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @param {boolean} forward whether to search for the next or previous element. - * @return {string} The label of element or an empty string if there is no - * sibling or no label. - */ -__gCrWeb.autofill.inferLabelFromSibling = function(element, forward) { - var inferredLabel = ''; - var sibling = element; - if (!sibling) { - return ''; - } - - while (true) { - if (forward) { - sibling = sibling.nextSibling; - } else { - sibling = sibling.previousSibling; - } - - if (!sibling) { - break; - } - - // Skip over comments. - var nodeType = sibling.nodeType; - if (nodeType === Node.COMMENT_NODE) { - continue; - } - - // Otherwise, only consider normal HTML elements and their contents. - if (nodeType != Node.TEXT_NODE && nodeType != Node.ELEMENT_NODE) { - break; - } - - // A label might be split across multiple "lightweight" nodes. - // Coalesce any text contained in multiple consecutive - // (a) plain text nodes or - // (b) inline HTML elements that are essentially equivalent to text nodes. - if (nodeType === Node.TEXT_NODE || - __gCrWeb.autofill.hasTagName(sibling, 'b') || - __gCrWeb.autofill.hasTagName(sibling, 'strong') || - __gCrWeb.autofill.hasTagName(sibling, 'span') || - __gCrWeb.autofill.hasTagName(sibling, 'font')) { - var value = __gCrWeb.autofill.findChildText(sibling); - // A text node's value will be empty if it is for a line break. - var addSpace = nodeType === Node.TEXT_NODE && value.length === 0; - inferredLabel = __gCrWeb.autofill.combineAndCollapseWhitespace( - value, inferredLabel, addSpace); - continue; - } - - // If we have identified a partial label and have reached a non-lightweight - // element, consider the label to be complete. - var trimmedLabel = inferredLabel.trim(); - if (trimmedLabel.length > 0) { - break; - } - - // <img> and <br> tags often appear between the input element and its - // label text, so skip over them. - if (__gCrWeb.autofill.hasTagName(sibling, 'img') || - __gCrWeb.autofill.hasTagName(sibling, 'br')) { - continue; - } - - // We only expect <p> and <label> tags to contain the full label text. - if (__gCrWeb.autofill.hasTagName(sibling, 'p') || - __gCrWeb.autofill.hasTagName(sibling, 'label')) { - inferredLabel = __gCrWeb.autofill.findChildText(sibling); - } - break; - } - return inferredLabel.trim(); -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * a previous sibling of |element|, - * e.g. Some Text <input ...> - * or Some <span>Text</span> <input ...> - * or <p>Some Text</p><input ...> - * or <label>Some Text</label> <input ...> - * or Some Text <img><input ...> - * or <b>Some Text</b><br/> <input ...>. - * - * It is based on the logic in - * string16 InferLabelFromPrevious(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromPrevious = function(element) { - return __gCrWeb.autofill.inferLabelFromSibling(element, false); -}; - -/** - * Same as InferLabelFromPrevious(), but in the other direction. - * Useful for cases like: <span><input type="checkbox">Label For Checkbox</span> - * - * It is based on the logic in - * string16 InferLabelFromNext(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromNext = function(element) { - return __gCrWeb.autofill.inferLabelFromSibling(element, true); -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * the placeholder attribute. - * - * It is based on the logic in - * string16 InferLabelFromPlaceholder(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromPlaceholder = function(element) { - if (!element) { - return ''; - } - - return element.placeholder || element.getAttribute('placeholder') || ''; -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * the value attribute when it is present and user has not typed in (if - * element's value attribute is same as the element's value). - * - * It is based on the logic in - * string16 InferLabelFromValueAttr(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.InferLabelFromValueAttr = function(element) { - if (!element || !element.value || !element.hasAttribute('value') || - element.value != element.getAttribute('value')) { - return ''; - } - - return element.value; -}; - -/** - * Helper for |InferLabelForElement()| that tests if an inferred label is valid - * or not. A valid label is a label that does not only contains special - * characters. - * - * It is based on the logic in - * bool IsLabelValid(base::StringPiece16 inferred_label, - * const std::vector<base::char16>& stop_words) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * The list of characters that are considered special is hard-coded in a regexp. - * - * @param {string} label An element to examine. - * @return {boolean} Whether the label contains not special characters. - */ -__gCrWeb.autofill.IsLabelValid = function(label) { - return label.search(/[^ *:()\u2013-]/) >= 0; -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * enclosing list item, e.g. - * <li>Some Text<input ...><input ...><input ...></li> - * - * It is based on the logic in - * string16 InferLabelFromListItem(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromListItem = function(element) { - if (!element) { - return ''; - } - - var parentNode = element.parentNode; - while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && - !__gCrWeb.autofill.hasTagName(parentNode, 'li')) { - parentNode = parentNode.parentNode; - } - - if (parentNode && __gCrWeb.autofill.hasTagName(parentNode, 'li')) - return __gCrWeb.autofill.findChildText(parentNode); - - return ''; -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * surrounding table structure, - * e.g. <tr><td>Some Text</td><td><input ...></td></tr> - * or <tr><th>Some Text</th><td><input ...></td></tr> - * or <tr><td><b>Some Text</b></td><td><b><input ...></b></td></tr> - * or <tr><th><b>Some Text</b></th><td><b><input ...></b></td></tr> - * - * It is based on the logic in - * string16 InferLabelFromTableColumn(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromTableColumn = function(element) { - if (!element) { - return ''; - } - - var parentNode = element.parentNode; - while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && - !__gCrWeb.autofill.hasTagName(parentNode, 'td')) { - parentNode = parentNode.parentNode; - } - - if (!parentNode) { - return ''; - } - - // Check all previous siblings, skipping non-element nodes, until we find a - // non-empty text block. - var inferredLabel = ''; - var previous = parentNode.previousSibling; - while (inferredLabel.length === 0 && previous) { - if (__gCrWeb.autofill.hasTagName(previous, 'td') || - __gCrWeb.autofill.hasTagName(previous, 'th')) { - inferredLabel = __gCrWeb.autofill.findChildText(previous); - } - previous = previous.previousSibling; - } - - return inferredLabel; -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * surrounding table structure, - * e.g. <tr><td>Some Text</td></tr><tr><td><input ...></td></tr> - * - * If there are multiple cells and the row with the input matches up with the - * previous row, then look for a specific cell within the previous row. - * e.g. <tr><td>Input 1 label</td><td>Input 2 label</td></tr> - * <tr><td><input name="input 1"></td><td><input name="input2"></td></tr> - * - * It is based on the logic in - * string16 InferLabelFromTableRow(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromTableRow = function(element) { - if (!element) { - return ''; - } - - var cell = element.parentNode; - while (cell) { - if (cell.nodeType === Node.ELEMENT_NODE && - __gCrWeb.autofill.hasTagName(cell, 'td')) { - break; - } - cell = cell.parentNode; - } - - // Not in a cell - bail out. - if (!cell) { - return ''; - } - - // Count the cell holding |element|. - var cellCount = cell.colSpan; - var cellPosition = 0; - var cellPositionEnd = cellCount - 1; - - // Count cells to the left to figure out |element|'s cell's position. - var cellIterator = cell.previousSibling; - while (cellIterator) { - if (cellIterator.nodeType === Node.ELEMENT_NODE && - __gCrWeb.autofill.hasTagName(cellIterator, 'td')) { - cellPosition += cellIterator.colSpan; - } - cellIterator = cellIterator.previousSibling; - } - - // Count cells to the right. - cellIterator = cell.nextSibling; - while (cellIterator) { - if (cellIterator.nodeType === Node.ELEMENT_NODE && - __gCrWeb.autofill.hasTagName(cellIterator, 'td')) { - cellCount += cellIterator.colSpan; - } - cellIterator = cellIterator.nextSibling; - } - - // Combine left + right. - cellCount += cellPosition; - cellPositionEnd += cellPosition; - - // Find the current row. - var parentNode = element.parentNode; - while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && - !__gCrWeb.autofill.hasTagName(parentNode, 'tr')) { - parentNode = parentNode.parentNode; - } - - if (!parentNode) { - return ''; - } - - // Now find the previous row. - var rowIt = parentNode.previousSibling; - while (rowIt) { - if (rowIt.nodeType === Node.ELEMENT_NODE && - __gCrWeb.autofill.hasTagName(parentNode, 'tr')) { - break; - } - rowIt = rowIt.previousSibling; - } - - // If there exists a previous row, check its cells and size. If they align - // with the current row, infer the label from the cell above. - if (rowIt) { - var matchingCell = null; - var prevRowCount = 0; - var prevRowIt = rowIt.firstChild; - while (prevRowIt) { - if (prevRowIt.nodeType === Node.ELEMENT_NODE) { - if (__gCrWeb.autofill.hasTagName(prevRowIt, 'td') || - __gCrWeb.autofill.hasTagName(prevRowIt, 'th')) { - var span = prevRowIt.colSpan; - var prevRowCountEnd = prevRowCount + span - 1; - if (prevRowCount === cellPosition && - prevRowCountEnd === cellPositionEnd) { - matchingCell = prevRowIt; - } - prevRowCount += span; - } - } - prevRowIt = prevRowIt.nextSibling; - } - if (cellCount === prevRowCount && matchingCell) { - var inferredLabel = __gCrWeb.autofill.findChildText(matchingCell); - if (inferredLabel.length > 0) { - return inferredLabel; - } - } - } - - // If there is no previous row, or if the previous row and current row do not - // align, check all previous siblings, skipping non-element nodes, until we - // find a non-empty text block. - var inferredLabel = ''; - var previous = parentNode.previousSibling; - while (inferredLabel.length === 0 && previous) { - if (__gCrWeb.autofill.hasTagName(previous, 'tr')) { - inferredLabel = __gCrWeb.autofill.findChildText(previous); - } - previous = previous.previousSibling; - } - return inferredLabel; -}; - -/** - * Returns true if |node| is an element and it is a container type that - * inferLabelForElement() can traverse. - * - * It is based on the logic in - * bool IsTraversableContainerElement(const WebNode& node); - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {!Node} node The node to be examined. - * @return {boolean} Whether it can be traversed. - */ -__gCrWeb.autofill.isTraversableContainerElement = function(node) { - if (node.nodeType !== Node.ELEMENT_NODE) { - return false; - } - - var tagName = /** @type {Element} */ (node).tagName; - return ( - tagName === 'DD' || tagName === 'DIV' || tagName === 'FIELDSET' || - tagName === 'LI' || tagName === 'TD' || tagName === 'TABLE'); -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * an enclosing label. - * e.g. <label>Some Text<span><input ...></span></label> - * - * It is based on the logic in - * string16 InferLabelFromEnclosingLabel( - * const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromEnclosingLabel = function(element) { - if (!element) { - return ''; - } - var node = element.parentNode; - while (node && !__gCrWeb.autofill.hasTagName(node, 'label')) { - node = node.parentNode; - } - if (node) { - return __gCrWeb.autofill.findChildText(node); - } - return ''; -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * a surrounding div table, - * e.g. <div>Some Text<span><input ...></span></div> - * e.g. <div>Some Text</div><div><input ...></div> - * - * Because this is already traversing the <div> structure, if it finds a <label> - * sibling along the way, infer from that <label>. - * - * It is based on the logic in - * string16 InferLabelFromDivTable(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromDivTable = function(element) { - if (!element) { - return ''; - } - - var node = element.parentNode; - var lookingForParent = true; - var divsToSkip = []; - - // Search the sibling and parent <div>s until we find a candidate label. - var inferredLabel = ''; - while (inferredLabel.length === 0 && node) { - if (__gCrWeb.autofill.hasTagName(node, 'div')) { - if (lookingForParent) { - inferredLabel = - __gCrWeb.autofill.findChildTextWithIgnoreList(node, divsToSkip); - } else { - inferredLabel = __gCrWeb.autofill.findChildText(node); - } - // Avoid sibling DIVs that contain autofillable fields. - if (!lookingForParent && inferredLabel.length > 0) { - var resultElement = node.querySelector('input, select, textarea'); - if (resultElement) { - inferredLabel = ''; - var addDiv = true; - for (var i = 0; i < divsToSkip.length; ++i) { - if (node === divsToSkip[i]) { - addDiv = false; - break; - } - } - if (addDiv) { - divsToSkip.push(node); - } - } - } - - lookingForParent = false; - } else if ( - !lookingForParent && __gCrWeb.autofill.hasTagName(node, 'label')) { - if (!node.control) { - inferredLabel = __gCrWeb.autofill.findChildText(node); - } - } else if ( - lookingForParent && - __gCrWeb.autofill.isTraversableContainerElement(node)) { - // If the element is in a non-div container, its label most likely is too. - break; - } - - if (!node.previousSibling) { - // If there are no more siblings, continue walking up the tree. - lookingForParent = true; - } - - if (lookingForParent) { - node = node.parentNode; - } else { - node = node.previousSibling; - } - } - - return inferredLabel; -}; - -/** - * Helper for |InferLabelForElement()| that infers a label, if possible, from - * a surrounding definition list, - * e.g. <dl><dt>Some Text</dt><dd><input ...></dd></dl> - * e.g. <dl><dt><b>Some Text</b></dt><dd><b><input ...></b></dd></dl> - * - * It is based on the logic in - * string16 InferLabelFromDefinitionList( - * const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The label of element. - */ -__gCrWeb.autofill.inferLabelFromDefinitionList = function(element) { - if (!element) { - return ''; - } - - var parentNode = element.parentNode; - while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && - !__gCrWeb.autofill.hasTagName(parentNode, 'dd')) { - parentNode = parentNode.parentNode; - } - - if (!parentNode || !__gCrWeb.autofill.hasTagName(parentNode, 'dd')) { - return ''; - } - - // Skip by any intervening text nodes. - var previous = parentNode.previousSibling; - while (previous && previous.nodeType === Node.TEXT_NODE) { - previous = previous.previousSibling; - } - - if (!previous || !__gCrWeb.autofill.hasTagName(previous, 'dt')) return ''; - - return __gCrWeb.autofill.findChildText(previous); -}; - -/** - * Returns the element type for all ancestor nodes in CAPS, starting with the - * parent node. - * - * It is based on the logic in - * std::vector<std::string> AncestorTagNames( - * const WebFormControlElement& element); - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {Array} The element types for all ancestors. - */ -__gCrWeb.autofill.ancestorTagNames = function(element) { - var tagNames = []; - var parentNode = element.parentNode; - while (parentNode) { - if (parentNode.nodeType === Node.ELEMENT_NODE) - tagNames.push(parentNode.tagName); - parentNode = parentNode.parentNode; - } - return tagNames; -}; - -/** - * Infers corresponding label for |element| from surrounding context in the DOM, - * e.g. the contents of the preceding <p> tag or text element. - * - * It is based on the logic in - * string16 InferLabelForElement(const WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {FormControlElement} element An element to examine. - * @return {string} The inferred label of element, or '' if none could be found. - */ -__gCrWeb.autofill.inferLabelForElement = function(element) { - var inferredLabel; - if (__gCrWeb.autofill.isCheckableElement(element)) { - inferredLabel = __gCrWeb.autofill.inferLabelFromNext(element); - if (__gCrWeb.autofill.IsLabelValid(inferredLabel)) { - return inferredLabel; - } - } - - inferredLabel = __gCrWeb.autofill.inferLabelFromPrevious(element); - if (__gCrWeb.autofill.IsLabelValid(inferredLabel)) { - return inferredLabel; - } - - // If we didn't find a label, check for the placeholder case. - inferredLabel = __gCrWeb.autofill.inferLabelFromPlaceholder(element); - if (__gCrWeb.autofill.IsLabelValid(inferredLabel)) { - return inferredLabel; - } - - // For all other searches that involve traversing up the tree, the search - // order is based on which tag is the closest ancestor to |element|. - var tagNames = __gCrWeb.autofill.ancestorTagNames(element); - var seenTagNames = {}; - for (var index = 0; index < tagNames.length; ++index) { - var tagName = tagNames[index]; - if (tagName in seenTagNames) { - continue; - } - - seenTagNames[tagName] = true; - if (tagName === 'LABEL') { - inferredLabel = __gCrWeb.autofill.inferLabelFromEnclosingLabel(element); - } else if (tagName === 'DIV') { - inferredLabel = __gCrWeb.autofill.inferLabelFromDivTable(element); - } else if (tagName === 'TD') { - inferredLabel = __gCrWeb.autofill.inferLabelFromTableColumn(element); - if (!__gCrWeb.autofill.IsLabelValid(inferredLabel)) - inferredLabel = __gCrWeb.autofill.inferLabelFromTableRow(element); - } else if (tagName === 'DD') { - inferredLabel = __gCrWeb.autofill.inferLabelFromDefinitionList(element); - } else if (tagName === 'LI') { - inferredLabel = __gCrWeb.autofill.inferLabelFromListItem(element); - } else if (tagName === 'FIELDSET') { - break; - } - - if (__gCrWeb.autofill.IsLabelValid(inferredLabel)) { - return inferredLabel; - } - } - // If we didn't find a label, check for the value attribute case. - inferredLabel = __gCrWeb.autofill.InferLabelFromValueAttr(element); - if (__gCrWeb.autofill.IsLabelValid(inferredLabel)) { - return inferredLabel; - } - - return ''; -}; - -/** - * Fills |field| data with the values of the <option> elements present in - * |selectElement|. - * - * It is based on the logic in - * void GetOptionStringsFromElement(const WebSelectElement& select_element, - * std::vector<string16>* option_values, - * std::vector<string16>* option_contents) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. - * - * @param {Element} selectElement A select element from which option data are - * extracted. - * @param {Object} field A field that will contain the extracted option - * information. - */ -__gCrWeb.autofill.getOptionStringsFromElement = function(selectElement, field) { - field['option_values'] = []; - // Protect against custom implementation of Array.toJSON in host pages. - field['option_values'].toJSON = null; - field['option_contents'] = []; - field['option_contents'].toJSON = null; - var options = selectElement.options; - for (var i = 0; i < options.length; ++i) { - var option = options[i]; - field['option_values'].push(option['value']); - field['option_contents'].push(option['text']); - } -}; - -/** * Sets the |field|'s value to the value in |data|. * Also sets the "autofilled" attribute. * @@ -1867,160 +555,30 @@ return; } - if (__gCrWeb.autofill.isTextInput(field) || - __gCrWeb.autofill.isTextAreaElement(field)) { + if (__gCrWeb.fill.isTextInput(field) || + __gCrWeb.fill.isTextAreaElement(field)) { var sanitizedValue = data['value']; - if (__gCrWeb.autofill.isTextInput(field)) { + if (__gCrWeb.fill.isTextInput(field)) { // If the 'max_length' attribute contains a negative value, the default // maxlength value is used. var maxLength = data['max_length']; if (maxLength < 0) { - maxLength = __gCrWeb.autofill.MAX_DATA_LENGTH; + maxLength = __gCrWeb.fill.MAX_DATA_LENGTH; } sanitizedValue = data['value'].substr(0, maxLength); } __gCrWeb.fill.setInputElementValue(sanitizedValue, field, true); field.isAutofilled = true; - } else if (__gCrWeb.autofill.isSelectElement(field)) { + } else if (__gCrWeb.fill.isSelectElement(field)) { __gCrWeb.fill.setInputElementValue(data['value'], field, true); - } else if (__gCrWeb.autofill.isCheckableElement(field)) { + } else if (__gCrWeb.fill.isCheckableElement(field)) { __gCrWeb.fill.setInputElementValue(data['is_checked'], field, true); } }; /** - * Returns true if |element| is a text input element. - * - * It is based on the logic in - * bool IsTextInput(const blink::WebInputElement* element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. - * - * @param {FormControlElement} element An element to examine. - * @return {boolean} Whether element is a text input field. - */ -__gCrWeb.autofill.isTextInput = function(element) { - if (!element) { - return false; - } - return __gCrWeb.common.isTextField(element); -}; - -/** - * Returns true if |element| is a 'select' element. - * - * It is based on the logic in - * bool IsSelectElement(const blink::WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. - * - * @param {FormControlElement} element An element to examine. - * @return {boolean} Whether element is a 'select' element. - */ -__gCrWeb.autofill.isSelectElement = function(element) { - if (!element) { - return false; - } - return element.type === 'select-one'; -}; - -/** - * Returns true if |element| is a 'textarea' element. - * - * It is based on the logic in - * bool IsTextAreaElement(const blink::WebFormControlElement& element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. - * - * @param {FormControlElement} element An element to examine. - * @return {boolean} Whether element is a 'textarea' element. - */ -__gCrWeb.autofill.isTextAreaElement = function(element) { - if (!element) { - return false; - } - return element.type === 'textarea'; -}; - -/** - * Returns true if |element| is a checkbox or a radio button element. - * - * It is based on the logic in - * bool IsCheckableElement(const blink::WebInputElement* element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. - * - * @param {FormControlElement} element An element to examine. - * @return {boolean} Whether element is a checkbox or a radio button. - */ -__gCrWeb.autofill.isCheckableElement = function(element) { - if (!element) { - return false; - } - return element.type === 'checkbox' || element.type === 'radio'; -}; - -/** - * Returns true if |element| is one of the input element types that can be - * autofilled. {Text, Radiobutton, Checkbox}. - * - * It is based on the logic in - * bool IsAutofillableInputElement(const blink::WebInputElement* element) - * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. - * - * @param {FormControlElement} element An element to examine. - * @return {boolean} Whether element is one of the input element types that - * can be autofilled. - */ -__gCrWeb.autofill.isAutofillableInputElement = function(element) { - return __gCrWeb.autofill.isTextInput(element) || - __gCrWeb.autofill.isCheckableElement(element); -}; - -/** - * Returns the nodeValue in a way similar to the C++ version of node.nodeValue, - * used in src/components/autofill/content/renderer/form_autofill_util.h. - * Newlines and tabs are stripped. - * - * @param {Node} node A node to examine. - * @return {string} The text contained in |element|. - */ -__gCrWeb.autofill.nodeValue = function(node) { - return (node.nodeValue || '').replace(/[\n\t]/gm, ''); -}; - -/** - * Returns the value in a way similar to the C++ version of node.value, - * used in src/components/autofill/content/renderer/form_autofill_util.h. - * Newlines and tabs are stripped. - * - * Note: this method tries to match the behavior of Blink for the select - * element. On Blink, a select element with a first option that is disabled and - * not explicitly selected will automatically select the second element. - * On WebKit, the disabled element is enabled until user interacts with it. - * As the result of this method will be used by code written for Blink, match - * the behavior on it. - * - * @param {Element} element An element to examine. - * @return {string} The value for |element|. - */ -__gCrWeb.autofill.value = function(element) { - var value = element.value; - if (__gCrWeb.autofill.isSelectElement(element)) { - if (element.options.length > 0 && element.selectedIndex == 0 && - element.options[0].disabled && - !element.options[0].hasAttribute('selected')) { - for (var i = 0; i < element.options.length; i++) { - if (!element.options[i].disabled || - element.options[i].hasAttribute('selected')) { - value = element.options[i].value; - break; - } - } - } - } - return (value || '').replace(/[\n\t]/gm, ''); -}; - -/** * Returns the auto-fillable form control elements in |formElement|. * * It is based on the logic in: @@ -2037,7 +595,7 @@ var autofillableElements = []; for (var i = 0; i < controlElements.length; ++i) { var element = controlElements[i]; - if (!__gCrWeb.autofill.isAutofillableElement(element)) { + if (!__gCrWeb.fill.isAutofillableElement(element)) { continue; } autofillableElements.push(element); @@ -2062,112 +620,6 @@ }; /** - * Fills out a FormField object from a given form control element. - * - * It is based on the logic in - * void WebFormControlElementToFormField( - * const blink::WebFormControlElement& element, - * ExtractMask extract_mask, - * FormFieldData* field); - * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. - * - * @param {FormControlElement} element The element to be processed. - * @param {number} extractMask A bit field mask to extract data from |element|. - * See the document on variable __gCrWeb.autofill.EXTRACT_MASK_NONE, - * __gCrWeb.autofill.EXTRACT_MASK_VALUE, - * __gCrWeb.autofill.EXTRACT_MASK_OPTION_TEXT and - * __gCrWeb.autofill.EXTRACT_MASK_OPTIONS. - * @param {AutofillFormFieldData} field Field to fill in the element - * information. - */ -__gCrWeb.autofill.webFormControlElementToFormField = function( - element, extractMask, field) { - if (!field || !element) { - return; - } - // The label is not officially part of a form control element; however, the - // labels for all form control elements are scraped from the DOM and set in - // form data. - field['name'] = __gCrWeb.form.getFieldIdentifier(element); - field['form_control_type'] = element.type; - var autocomplete_attribute = element.getAttribute('autocomplete'); - if (autocomplete_attribute) { - field['autocomplete_attribute'] = autocomplete_attribute; - } - if (field['autocomplete_attribute'] != null && - field['autocomplete_attribute'].length > - __gCrWeb.autofill.MAX_DATA_LENGTH) { - // Discard overly long attribute values to avoid DOS-ing the browser - // process. However, send over a default string to indicate that the - // attribute was present. - field['autocomplete_attribute'] = 'x-max-data-length-exceeded'; - } - - var role_attribute = element.getAttribute('role'); - if (role_attribute && role_attribute.toLowerCase() == 'presentation') { - field['role'] = __gCrWeb.autofill.ROLE_ATTRIBUTE_PRESENTATION; - } - - if (!__gCrWeb.autofill.isAutofillableElement(element)) { - return; - } - - if (__gCrWeb.autofill.isAutofillableInputElement(element) || - __gCrWeb.autofill.isTextAreaElement(element) || - __gCrWeb.autofill.isSelectElement(element)) { - field['is_autofilled'] = element.isAutofilled; - field['should_autocomplete'] = __gCrWeb.fill.autoComplete(element); - field['is_focusable'] = !element.disabled && !element.readOnly && - element.tabIndex >= 0 && isVisibleNode_(element); - } - - if (__gCrWeb.autofill.isAutofillableInputElement(element)) { - if (__gCrWeb.autofill.isTextInput(element)) { - field['max_length'] = element.maxLength; - if (field['max_length'] == -1) { - // Take default value as defined by W3C. - field['max_length'] = 524288; - } - } - field['is_checkable'] = __gCrWeb.autofill.isCheckableElement(element); - } else if (__gCrWeb.autofill.isTextAreaElement(element)) { - // Nothing more to do in this case. - } else if (extractMask & __gCrWeb.autofill.EXTRACT_MASK_OPTIONS) { - __gCrWeb.autofill.getOptionStringsFromElement(element, field); - } - - if (!(extractMask & __gCrWeb.autofill.EXTRACT_MASK_VALUE)) { - return; - } - - var value = __gCrWeb.autofill.value(element); - - if (__gCrWeb.autofill.isSelectElement(element) && - (extractMask & __gCrWeb.autofill.EXTRACT_MASK_OPTION_TEXT)) { - // Convert the |select_element| value to text if requested. - var options = element.options; - for (var index = 0; index < options.length; ++index) { - var optionElement = options[index]; - if (__gCrWeb.autofill.value(optionElement) === value) { - value = optionElement.text; - break; - } - } - } - - // There is a constraint on the maximum data length in method - // WebFormControlElementToFormField() in form_autofill_util.h in order to - // prevent a malicious site from DOS'ing the browser: http://crbug.com/49332, - // which isn't really meaningful here, but we need to follow the same logic to - // get the same form signature wherever possible (to get the benefits of the - // existing crowdsourced field detection corpus). - if (value.length > __gCrWeb.autofill.MAX_DATA_LENGTH) { - value = value.substr(0, __gCrWeb.autofill.MAX_DATA_LENGTH); - } - field['value'] = value; -}; - -/** * For debugging purposes, annotate forms on the page with prediction data using * the placeholder attribute. * @@ -2181,7 +633,7 @@ var controlElements = __gCrWeb.form.getFormControlElements(form); for (var i = 0; i < controlElements.length; ++i) { var element = controlElements[i]; - if (!__gCrWeb.autofill.isAutofillableElement(element)) { + if (!__gCrWeb.fill.isAutofillableElement(element)) { continue; } var elementName = __gCrWeb.form.getFieldIdentifier(element);
diff --git a/components/autofill/ios/fill/resources/fill.js b/components/autofill/ios/fill/resources/fill.js index 2993cec..b9121d42 100644 --- a/components/autofill/ios/fill/resources/fill.js +++ b/components/autofill/ios/fill/resources/fill.js
@@ -7,6 +7,34 @@ goog.module('__crWeb.fill'); /** + * @typedef {{ + * name: string, + * value: string, + * form_control_type: string, + * autocomplete_attributes: string, + * max_length: number, + * is_autofilled: boolean, + * is_checkable: boolean, + * is_focusable: boolean, + * should_autocomplete: boolean, + * role: number, + * option_contents: Array<string>, + * option_values: Array<string> + * }} + */ +var AutofillFormFieldData; + +/** + * @typedef {{ + * name: string, + * origin: string, + * action: string, + * fields: Array<AutofillFormFieldData> + * }} + */ +var AutofillFormData; + +/** * Namespace for this file. It depends on |__gCrWeb| having already been * injected. String 'fill' is used in |__gCrWeb['fill']| as it needs to be * accessed in Objective-C code. @@ -22,6 +50,86 @@ (function() { /** + * The maximum length allowed for form data. + * + * This variable is from AutofillTable::kMaxDataLength in + * chromium/src/components/autofill/core/browser/webdata/autofill_table.h + * + * @const {number} + */ +__gCrWeb.fill.MAX_DATA_LENGTH = 1024; + +/** + * The maximum number of form fields we are willing to parse, due to + * computational costs. Several examples of forms with lots of fields that are + * not relevant to Autofill: (1) the Netflix queue; (2) the Amazon wishlist; + * (3) router configuration pages; and (4) other configuration pages, e.g. for + * Google code project settings. + * + * This variable is |kMaxParseableFields| from + * chromium/src/components/autofill/content/renderer/form_autofill_util.h + * + * @const {number} + */ +__gCrWeb.fill.MAX_PARSEABLE_FIELDS = 200; + +/** + * A bit field mask to extract data from WebFormControlElement for + * extracting none value. + * + * This variable is from enum ExtractMask in + * chromium/src/components/autofill/content/renderer/form_autofill_util.h + * + * @const {number} + */ +__gCrWeb.fill.EXTRACT_MASK_NONE = 0; + +/** + * A bit field mask to extract data from WebFormControlElement for + * extracting value from WebFormControlElement. + * + * This variable is from enum ExtractMask in + * chromium/src/components/autofill/content/renderer/form_autofill_util.h + * + * @const {number} + */ +__gCrWeb.fill.EXTRACT_MASK_VALUE = 1 << 0; + +/** + * A bit field mask to extract data from WebFormControlElement for + * extracting option text from WebFormSelectElement. Only valid when + * EXTRACT_MASK_VALUE is set. This is used for form submission where human + * readable value is captured. + * + * This variable is from enum ExtractMask in + * chromium/src/components/autofill/content/renderer/form_autofill_util.h + * + * @const {number} + */ +__gCrWeb.fill.EXTRACT_MASK_OPTION_TEXT = 1 << 1; + +/** + * A bit field mask to extract data from WebFormControlElement for + * extracting options from WebFormControlElement. + * + * This variable is from enum ExtractMask in + * chromium/src/components/autofill/content/renderer/form_autofill_util.h + * + * @const {number} + */ +__gCrWeb.fill.EXTRACT_MASK_OPTIONS = 1 << 2; + +/** + * A value for the "presentation" role. + * + * This variable is from enum RoleAttribute in + * chromium/src/components/autofill/core/common/form_field_data.h + * + * @const {number} + */ +__gCrWeb.fill.ROLE_ATTRIBUTE_PRESENTATION = 0; + +/** * Returns true if an element can be autocompleted. * * This method aims to provide the same logic as method @@ -309,5 +417,1472 @@ element.dispatchEvent(changeEvent); }; +/** + * Extracts fields from |controlElements| with |extractMask| to |formFields|. + * The extracted fields are also placed in |elementArray|. + * + * It is based on the logic in + * bool ExtractFieldsFromControlElements( + * const WebVector<WebFormControlElement>& control_elements, + * const FieldValueAndPropertiesMaskMap* field_value_and_properties_map, + * ExtractMask extract_mask, + * std::vector<std::unique_ptr<FormFieldData>>* form_fields, + * std::vector<bool>* fields_extracted, + * std::map<WebFormControlElement, FormFieldData*>* element_map) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc + * + * TODO(thestig): Make |element_map| a Map when Chrome makes iOS 8 and Safari 8 + * part of the minimal requirements. + * + * @param {Array<FormControlElement>} controlElements The control elements that + * will be processed. + * @param {number} extractMask Mask controls what data is extracted from + * controlElements. + * @param {Array<AutofillFormFieldData>} formFields The extracted form fields. + * @param {Array<boolean>} fieldsExtracted Indicates whether the fields were + * extracted. + * @param {Array<?AutofillFormFieldData>} elementArray The extracted form + * fields or null if a particular control has no corresponding field. + * @return {boolean} Whether there are fields and not too many fields in the + * form. + */ +function extractFieldsFromControlElements_( + controlElements, extractMask, formFields, fieldsExtracted, elementArray) { + for (var i = 0; i < controlElements.length; ++i) { + fieldsExtracted[i] = false; + elementArray[i] = null; + + /** @type {FormControlElement} */ + var controlElement = controlElements[i]; + if (!__gCrWeb.fill.isAutofillableElement(controlElement)) { + continue; + } + + // Create a new AutofillFormFieldData, fill it out and map it to the + // field's name. + var formField = new __gCrWeb['common'].JSONSafeObject; + __gCrWeb.fill.webFormControlElementToFormField( + controlElement, extractMask, formField); + formFields.push(formField); + elementArray[i] = formField; + fieldsExtracted[i] = true; + + // To avoid overly expensive computation, we impose a maximum number of + // allowable fields. + if (formFields.length > __gCrWeb.fill.MAX_PARSEABLE_FIELDS) { + return false; + } + } + + return formFields.length > 0; +} + +/** + * Check if the node is visible. + * + * @param {Node} node The node to be processed. + * @return {boolean} Whether the node is visible or not. + */ +function isVisibleNode_(node) { + if (!node) return false; + + if (node.nodeType === Node.ELEMENT_NODE) { + var style = window.getComputedStyle(/** @type {Element} */ (node)); + if (style.visibility == 'hidden' || style.display == 'none') return false; + } + + // Verify all ancestors are focusable. + return !node.parentNode || isVisibleNode_(node.parentNode); +} + +/** + * For each label element, get the corresponding form control element, use the + * form control element along with |controlElements| and |elementArray| to find + * the previously created AutofillFormFieldData and set the + * AutofillFormFieldData's label to the label.firstChild().nodeValue() of the + * label element. + * + * It is based on the logic in + * void MatchLabelsAndFields( + * const WebElementCollection& labels, + * std::map<WebFormControlElement, FormFieldData*>* element_map); + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc + * + * This differs in that it takes a formElement field, instead of calling + * field_element.isFormControlElement(). + * + * This also uses (|controlElements|, |elementArray|) because there is no + * guaranteeded Map support on iOS yet. + * + * @param {NodeList} labels The labels to match. + * @param {HTMLFormElement} formElement The form element being processed. + * @param {Array<FormControlElement>} controlElements The control elements that + * were processed. + * @param {Array<?AutofillFormFieldData>} elementArray The extracted fields. + */ +function matchLabelsAndFields_( + labels, formElement, controlElements, elementArray) { + for (var index = 0; index < labels.length; ++index) { + var label = labels[index]; + var fieldElement = label.control; + var fieldData = null; + if (!fieldElement) { + // Sometimes site authors will incorrectly specify the corresponding + // field element's name rather than its id, so we compensate here. + var elementName = label.htmlFor; + if (!elementName) continue; + // Look through the list for elements with this name. There can actually + // be more than one. In this case, the label may not be particularly + // useful, so just discard it. + for (var elementIndex = 0; elementIndex < elementArray.length; + ++elementIndex) { + var currentFieldData = elementArray[elementIndex]; + if (currentFieldData && currentFieldData['name'] === elementName) { + if (fieldData !== null) { + fieldData = null; + break; + } else { + fieldData = currentFieldData; + } + } + } + } else if ( + fieldElement.form != formElement || fieldElement.type === 'hidden') { + continue; + } else { + // Typical case: look up |fieldData| in |elementArray|. + for (var elementIndex = 0; elementIndex < elementArray.length; + ++elementIndex) { + if (controlElements[elementIndex] === fieldElement) { + fieldData = elementArray[elementIndex]; + break; + } + } + } + + if (!fieldData) continue; + + if (!('label' in fieldData)) { + fieldData['label'] = ''; + } + var labelText = __gCrWeb.fill.findChildText(label); + // Concatenate labels because some sites might have multiple label + // candidates. + if (fieldData['label'].length > 0 && labelText.length > 0) { + fieldData['label'] += ' '; + } + fieldData['label'] += labelText; + } +} + +/** + * Common function shared by webFormElementToFormData() and + * unownedFormElementsAndFieldSetsToFormData(). Either pass in: + * 1) |formElement|, |formControlElement| and an empty |fieldsets|. + * or + * 2) a non-empty |fieldsets|. + * + * It is based on the logic in + * bool FormOrFieldsetsToFormData( + * const blink::WebFormElement* form_element, + * const blink::WebFormControlElement* form_control_element, + * const std::vector<blink::WebElement>& fieldsets, + * const WebVector<WebFormControlElement>& control_elements, + * ExtractMask extract_mask, + * FormData* form, + * FormFieldData* field) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc + * + * @param {HTMLFormElement} formElement The form element that will be processed. + * @param {FormControlElement} formControlElement A control element in + * formElment, the FormField of which will be returned in field. + * @param {Array<Element>} fieldsets The fieldsets to look through if + * formElement and formControlElement are not specified. + * @param {Array<FormControlElement>} controlElements The control elements that + * will be processed. + * @param {number} extractMask Mask controls what data is extracted from + * formElement. + * @param {AutofillFormData} form Form to fill in the AutofillFormData + * information of formElement. + * @param {?AutofillFormFieldData} field Field to fill in the form field + * information of formControlElement. + * @return {boolean} Whether there are fields and not too many fields in the + * form. + */ +__gCrWeb.fill.formOrFieldsetsToFormData = function( + formElement, formControlElement, fieldsets, controlElements, extractMask, + form, field) { + // This should be a map from a control element to the AutofillFormFieldData. + // However, without Map support, it's just an Array of AutofillFormFieldData. + var elementArray = []; + + // The extracted FormFields. + var formFields = []; + + // A vector of bools that indicate whether each element in |controlElements| + // meets the requirements and thus will be in the resulting |form|. + var fieldsExtracted = []; + + if (!extractFieldsFromControlElements_( + controlElements, extractMask, formFields, fieldsExtracted, + elementArray)) { + return false; + } + + if (formElement) { + // Loop through the label elements inside the form element. For each label + // element, get the corresponding form control element, use the form control + // element along with |controlElements| and |elementArray| to find the + // previously created AutofillFormFieldData and set the + // AutofillFormFieldData's label. + var labels = formElement.getElementsByTagName('label'); + matchLabelsAndFields_(labels, formElement, controlElements, elementArray); + } else { + // Same as the if block, but for all the labels in fieldset + for (var i = 0; i < fieldsets.length; ++i) { + var labels = fieldsets[i].getElementsByTagName('label'); + matchLabelsAndFields_(labels, formElement, controlElements, elementArray); + } + } + + // Loop through the form control elements, extracting the label text from + // the DOM. We use the |fieldsExtracted| vector to make sure we assign the + // extracted label to the correct field, as it's possible |form_fields| will + // not contain all of the elements in |control_elements|. + for (var i = 0, fieldIdx = 0; + i < controlElements.length && fieldIdx < formFields.length; ++i) { + // This field didn't meet the requirements, so don't try to find a label + // for it. + if (!fieldsExtracted[i]) continue; + + var controlElement = controlElements[i]; + var currentField = formFields[fieldIdx]; + if (!currentField['label']) { + currentField['label'] = + __gCrWeb.fill.inferLabelForElement(controlElement); + } + if (currentField['label'].length > __gCrWeb.fill.MAX_DATA_LENGTH) { + currentField['label'] = + currentField['label'].substr(0, __gCrWeb.fill.MAX_DATA_LENGTH); + } + + if (controlElement === formControlElement) field = formFields[fieldIdx]; + ++fieldIdx; + } + + form['fields'] = formFields; + // Protect against custom implementation of Array.toJSON in host pages. + form['fields'].toJSON = null; + return true; +} + +/** + * Fills |form| with the form data object corresponding to the |formElement|. + * If |field| is non-NULL, also fills |field| with the FormField object + * corresponding to the |formControlElement|. + * |extract_mask| controls what data is extracted. + * Returns true if |form| is filled out. Returns false if there are no fields or + * too many fields in the |form|. + * + * It is based on the logic in + * bool WebFormElementToFormData( + * const blink::WebFormElement& form_element, + * const blink::WebFormControlElement& form_control_element, + * ExtractMask extract_mask, + * FormData* form, + * FormFieldData* field) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc + * + * @param {HTMLFrameElement|Window} frame The window or frame where the + * formElement is in. + * @param {HTMLFormElement} formElement The form element that will be processed. + * @param {FormControlElement} formControlElement A control element in + * formElment, the FormField of which will be returned in field. + * @param {number} extractMask Mask controls what data is extracted from + * formElement. + * @param {AutofillFormData} form Form to fill in the AutofillFormData + * information of formElement. + * @param {?AutofillFormFieldData} field Field to fill in the form field + * information of formControlElement. + * @return {boolean} Whether there are fields and not too many fields in the + * form. + */ +__gCrWeb.fill.webFormElementToFormData = function( + frame, formElement, formControlElement, extractMask, form, field) { + if (!frame) { + return false; + } + + form['name'] = __gCrWeb.form.getFormIdentifier(formElement); + form['origin'] = + __gCrWeb.common.removeQueryAndReferenceFromURL(frame.location.href); + form['action'] = __gCrWeb.common.absoluteURL( + frame.document, formElement.getAttribute('action')); + + // Note different from form_autofill_util.cc version of this method, which + // computes |form.action| using document.completeURL(form_element.action()) + // and falls back to formElement.action() if the computed action is invalid, + // here the action returned by |__gCrWeb.common.absoluteURL| is always + // valid, which is computed by creating a <a> element, and we don't check if + // the action is valid. + + var controlElements = __gCrWeb.form.getFormControlElements(formElement); + + return __gCrWeb.fill.formOrFieldsetsToFormData( + formElement, formControlElement, [] /* fieldsets */, controlElements, + extractMask, form, field); +}; + +/** + * Returns is the tag of an |element| is tag. + * + * It is based on the logic in + * bool HasTagName(const WebNode& node, const blink::WebString& tag) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {Node} node Node to examine. + * @param {string} tag Tag name. + * @return {boolean} Whether the tag of node is tag. + */ +__gCrWeb.fill.hasTagName = function(node, tag) { + return node.nodeType === Node.ELEMENT_NODE && + /** @type {Element} */ (node).tagName === tag.toUpperCase(); +}; + +/** + * Checks if an element is autofillable. + * + * It is based on the logic in + * bool IsAutofillableElement(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {boolean} Whether element is one of the element types that can be + * autofilled. + */ +__gCrWeb.fill.isAutofillableElement = function(element) { + return __gCrWeb.fill.isAutofillableInputElement(element) || + __gCrWeb.fill.isSelectElement(element) || + __gCrWeb.fill.isTextAreaElement(element); +}; + +/** + * Trims whitespace from the start of the input string. + * Simplified version of string_util::TrimWhitespace. + * @param {string} input String to trim. + * @return {string} The |input| string without leading whitespace. + */ +__gCrWeb.fill.trimWhitespaceLeading = function(input) { + return input.replace(/^\s+/gm, ''); +}; + +/** + * Trims whitespace from the end of the input string. + * Simplified version of string_util::TrimWhitespace. + * @param {string} input String to trim. + * @return {string} The |input| string without trailing whitespace. + */ +__gCrWeb.fill.trimWhitespaceTrailing = function(input) { + return input.replace(/\s+$/gm, ''); +}; + +/** + * Appends |suffix| to |prefix| so that any intermediary whitespace is collapsed + * to a single space. If |force_whitespace| is true, then the resulting string + * is guaranteed to have a space between |prefix| and |suffix|. Otherwise, the + * result includes a space only if |prefix| has trailing whitespace or |suffix| + * has leading whitespace. + * + * A few examples: + * CombineAndCollapseWhitespace('foo', 'bar', false) -> 'foobar' + * CombineAndCollapseWhitespace('foo', 'bar', true) -> 'foo bar' + * CombineAndCollapseWhitespace('foo ', 'bar', false) -> 'foo bar' + * CombineAndCollapseWhitespace('foo', ' bar', false) -> 'foo bar' + * CombineAndCollapseWhitespace('foo', ' bar', true) -> 'foo bar' + * CombineAndCollapseWhitespace('foo ', ' bar', false) -> 'foo bar' + * CombineAndCollapseWhitespace(' foo', 'bar ', false) -> ' foobar ' + * CombineAndCollapseWhitespace(' foo', 'bar ', true) -> ' foo bar ' + * + * It is based on the logic in + * const string16 CombineAndCollapseWhitespace(const string16& prefix, + * const string16& suffix, + * bool force_whitespace) + * @param {string} prefix The prefix string in the string combination. + * @param {string} suffix The suffix string in the string combination. + * @param {boolean} forceWhitespace A boolean indicating if whitespace should + * be added as separator in the combination. + * @return {string} The combined string. + */ +__gCrWeb.fill.combineAndCollapseWhitespace = function( + prefix, suffix, forceWhitespace) { + var prefixTrimmed = __gCrWeb.fill.trimWhitespaceTrailing(prefix); + var prefixTrailingWhitespace = prefixTrimmed != prefix; + var suffixTrimmed = __gCrWeb.fill.trimWhitespaceLeading(suffix); + var suffixLeadingWhitespace = suffixTrimmed != suffix; + if (prefixTrailingWhitespace || suffixLeadingWhitespace || forceWhitespace) { + return prefixTrimmed + ' ' + suffixTrimmed; + } else { + return prefixTrimmed + suffixTrimmed; + } +}; + +/** + * This is a helper function for the findChildText() function (see below). + * Search depth is limited with the |depth| parameter. + * + * Based on form_autofill_util::FindChildTextInner(). + * + * @param {Node} node The node to fetch the text content from. + * @param {number} depth The maximum depth to descend on the DOM. + * @param {Array<Node>} divsToSkip List of <div> tags to ignore if encountered. + * @return {string} The discovered and adapted string. + */ +__gCrWeb.fill.findChildTextInner = function(node, depth, divsToSkip) { + if (depth <= 0 || !node) { + return ''; + } + + // Skip over comments. + if (node.nodeType === Node.COMMENT_NODE) { + return __gCrWeb.fill.findChildTextInner( + node.nextSibling, depth - 1, divsToSkip); + } + + if (node.nodeType !== Node.ELEMENT_NODE && node.nodeType !== Node.TEXT_NODE) { + return ''; + } + + // Ignore elements known not to contain inferable labels. + if (node.nodeType === Node.ELEMENT_NODE) { + if (node.tagName === 'OPTION' || node.tagName === 'SCRIPT' || + node.tagName === 'NOSCRIPT') { + return ''; + } + if (__gCrWeb.form.isFormControlElement(/** @type {Element} */ (node))) { + var input = /** @type {FormControlElement} */ (node); + if (__gCrWeb.fill.isAutofillableElement(input)) { + return ''; + } + } + } + + if (node.tagName === 'DIV') { + for (var i = 0; i < divsToSkip.length; ++i) { + if (node === divsToSkip[i]) { + return ''; + } + } + } + + // Extract the text exactly at this node. + var nodeText = __gCrWeb.fill.nodeValue(node); + if (node.nodeType === Node.TEXT_NODE && !nodeText) { + // In the C++ version, this text node would have been stripped completely. + // Just pass the buck. + return __gCrWeb.fill.findChildTextInner( + node.nextSibling, depth, divsToSkip); + } + + // Recursively compute the children's text. + // Preserve inter-element whitespace separation. + var childText = __gCrWeb.fill.findChildTextInner( + node.firstChild, depth - 1, divsToSkip); + var addSpace = node.nodeType === Node.TEXT_NODE && !nodeText; + // Emulate apparently incorrect Chromium behavior tracked in + // https://crbug.com/239819. + addSpace = false; + nodeText = __gCrWeb.fill.combineAndCollapseWhitespace( + nodeText, childText, addSpace); + + // Recursively compute the siblings' text. + // Again, preserve inter-element whitespace separation. + var siblingText = __gCrWeb.fill.findChildTextInner( + node.nextSibling, depth - 1, divsToSkip); + addSpace = node.nodeType === Node.TEXT_NODE && !nodeText; + // Emulate apparently incorrect Chromium behavior tracked in + // https://crbug.com/239819. + addSpace = false; + nodeText = __gCrWeb.fill.combineAndCollapseWhitespace( + nodeText, siblingText, addSpace); + + return nodeText; +}; + +/** + * Same as findChildText() below, but with a list of div nodes to skip. + * + * It is based on the logic in + * string16 FindChildTextWithIgnoreList( + * const WebNode& node, + * const std::set<WebNode>& divs_to_skip) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {Node} node A node of which the child text will be return. + * @param {Array<Node>} divsToSkip List of <div> tags to ignore if encountered. + * @return {string} The child text. + */ +__gCrWeb.fill.findChildTextWithIgnoreList = function(node, divsToSkip) { + if (node.nodeType === Node.TEXT_NODE) + return __gCrWeb.fill.nodeValue(node); + + var child = node.firstChild; + var kChildSearchDepth = 10; + var nodeText = __gCrWeb.fill.findChildTextInner( + child, kChildSearchDepth, divsToSkip); + nodeText = nodeText.trim(); + return nodeText; +}; + +/** + * Returns the aggregated values of the descendants of |element| that are + * non-empty text nodes. + * + * It is based on the logic in + * string16 FindChildText(const WebNode& node) + * chromium/src/components/autofill/content/renderer/form_autofill_util.cc, + * which is a faster alternative to |innerText()| for performance critical + * operations. + * + * @param {Node} node A node of which the child text will be return. + * @return {string} The child text. + */ +__gCrWeb.fill.findChildText = function(node) { + return __gCrWeb.fill.findChildTextWithIgnoreList(node, []); +}; + +/** + * Shared function for InferLabelFromPrevious() and InferLabelFromNext(). + * + * It is based on the logic in + * string16 InferLabelFromSibling(const WebFormControlElement& element, + * bool forward) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @param {boolean} forward whether to search for the next or previous element. + * @return {string} The label of element or an empty string if there is no + * sibling or no label. + */ +__gCrWeb.fill.inferLabelFromSibling = function(element, forward) { + var inferredLabel = ''; + var sibling = element; + if (!sibling) { + return ''; + } + + while (true) { + if (forward) { + sibling = sibling.nextSibling; + } else { + sibling = sibling.previousSibling; + } + + if (!sibling) { + break; + } + + // Skip over comments. + var nodeType = sibling.nodeType; + if (nodeType === Node.COMMENT_NODE) { + continue; + } + + // Otherwise, only consider normal HTML elements and their contents. + if (nodeType != Node.TEXT_NODE && nodeType != Node.ELEMENT_NODE) { + break; + } + + // A label might be split across multiple "lightweight" nodes. + // Coalesce any text contained in multiple consecutive + // (a) plain text nodes or + // (b) inline HTML elements that are essentially equivalent to text nodes. + if (nodeType === Node.TEXT_NODE || + __gCrWeb.fill.hasTagName(sibling, 'b') || + __gCrWeb.fill.hasTagName(sibling, 'strong') || + __gCrWeb.fill.hasTagName(sibling, 'span') || + __gCrWeb.fill.hasTagName(sibling, 'font')) { + var value = __gCrWeb.fill.findChildText(sibling); + // A text node's value will be empty if it is for a line break. + var addSpace = nodeType === Node.TEXT_NODE && value.length === 0; + inferredLabel = __gCrWeb.fill.combineAndCollapseWhitespace( + value, inferredLabel, addSpace); + continue; + } + + // If we have identified a partial label and have reached a non-lightweight + // element, consider the label to be complete. + var trimmedLabel = inferredLabel.trim(); + if (trimmedLabel.length > 0) { + break; + } + + // <img> and <br> tags often appear between the input element and its + // label text, so skip over them. + if (__gCrWeb.fill.hasTagName(sibling, 'img') || + __gCrWeb.fill.hasTagName(sibling, 'br')) { + continue; + } + + // We only expect <p> and <label> tags to contain the full label text. + if (__gCrWeb.fill.hasTagName(sibling, 'p') || + __gCrWeb.fill.hasTagName(sibling, 'label')) { + inferredLabel = __gCrWeb.fill.findChildText(sibling); + } + break; + } + return inferredLabel.trim(); +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * a previous sibling of |element|, + * e.g. Some Text <input ...> + * or Some <span>Text</span> <input ...> + * or <p>Some Text</p><input ...> + * or <label>Some Text</label> <input ...> + * or Some Text <img><input ...> + * or <b>Some Text</b><br/> <input ...>. + * + * It is based on the logic in + * string16 InferLabelFromPrevious(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromPrevious = function(element) { + return __gCrWeb.fill.inferLabelFromSibling(element, false); +}; + +/** + * Same as InferLabelFromPrevious(), but in the other direction. + * Useful for cases like: <span><input type="checkbox">Label For Checkbox</span> + * + * It is based on the logic in + * string16 InferLabelFromNext(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromNext = function(element) { + return __gCrWeb.fill.inferLabelFromSibling(element, true); +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * the placeholder attribute. + * + * It is based on the logic in + * string16 InferLabelFromPlaceholder(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromPlaceholder = function(element) { + if (!element) { + return ''; + } + + return element.placeholder || element.getAttribute('placeholder') || ''; +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * the aria-label attribute. + * + * It is based on the logic in + * string16 InferLabelFromAriaLabel(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromAriaLabel = function(element) { + if (!element) { + return ''; + } + + return element.getAttribute('aria-label') || ''; +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * the value attribute when it is present and user has not typed in (if + * element's value attribute is same as the element's value). + * + * It is based on the logic in + * string16 InferLabelFromValueAttr(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.InferLabelFromValueAttr = function(element) { + if (!element || !element.value || !element.hasAttribute('value') || + element.value != element.getAttribute('value')) { + return ''; + } + + return element.value; +}; + +/** + * Helper for |InferLabelForElement()| that tests if an inferred label is valid + * or not. A valid label is a label that does not only contains special + * characters. + * + * It is based on the logic in + * bool IsLabelValid(base::StringPiece16 inferred_label, + * const std::vector<base::char16>& stop_words) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * The list of characters that are considered special is hard-coded in a regexp. + * + * @param {string} label An element to examine. + * @return {boolean} Whether the label contains not special characters. + */ +__gCrWeb.fill.IsLabelValid = function(label) { + return label.search(/[^ *:()\u2013-]/) >= 0; +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * enclosing list item, e.g. + * <li>Some Text<input ...><input ...><input ...></li> + * + * It is based on the logic in + * string16 InferLabelFromListItem(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromListItem = function(element) { + if (!element) { + return ''; + } + + var parentNode = element.parentNode; + while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && + !__gCrWeb.fill.hasTagName(parentNode, 'li')) { + parentNode = parentNode.parentNode; + } + + if (parentNode && __gCrWeb.fill.hasTagName(parentNode, 'li')) + return __gCrWeb.fill.findChildText(parentNode); + + return ''; +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * surrounding table structure, + * e.g. <tr><td>Some Text</td><td><input ...></td></tr> + * or <tr><th>Some Text</th><td><input ...></td></tr> + * or <tr><td><b>Some Text</b></td><td><b><input ...></b></td></tr> + * or <tr><th><b>Some Text</b></th><td><b><input ...></b></td></tr> + * + * It is based on the logic in + * string16 InferLabelFromTableColumn(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromTableColumn = function(element) { + if (!element) { + return ''; + } + + var parentNode = element.parentNode; + while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && + !__gCrWeb.fill.hasTagName(parentNode, 'td')) { + parentNode = parentNode.parentNode; + } + + if (!parentNode) { + return ''; + } + + // Check all previous siblings, skipping non-element nodes, until we find a + // non-empty text block. + var inferredLabel = ''; + var previous = parentNode.previousSibling; + while (inferredLabel.length === 0 && previous) { + if (__gCrWeb.fill.hasTagName(previous, 'td') || + __gCrWeb.fill.hasTagName(previous, 'th')) { + inferredLabel = __gCrWeb.fill.findChildText(previous); + } + previous = previous.previousSibling; + } + + return inferredLabel; +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * surrounding table structure, + * e.g. <tr><td>Some Text</td></tr><tr><td><input ...></td></tr> + * + * If there are multiple cells and the row with the input matches up with the + * previous row, then look for a specific cell within the previous row. + * e.g. <tr><td>Input 1 label</td><td>Input 2 label</td></tr> + * <tr><td><input name="input 1"></td><td><input name="input2"></td></tr> + * + * It is based on the logic in + * string16 InferLabelFromTableRow(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromTableRow = function(element) { + if (!element) { + return ''; + } + + var cell = element.parentNode; + while (cell) { + if (cell.nodeType === Node.ELEMENT_NODE && + __gCrWeb.fill.hasTagName(cell, 'td')) { + break; + } + cell = cell.parentNode; + } + + // Not in a cell - bail out. + if (!cell) { + return ''; + } + + // Count the cell holding |element|. + var cellCount = cell.colSpan; + var cellPosition = 0; + var cellPositionEnd = cellCount - 1; + + // Count cells to the left to figure out |element|'s cell's position. + var cellIterator = cell.previousSibling; + while (cellIterator) { + if (cellIterator.nodeType === Node.ELEMENT_NODE && + __gCrWeb.fill.hasTagName(cellIterator, 'td')) { + cellPosition += cellIterator.colSpan; + } + cellIterator = cellIterator.previousSibling; + } + + // Count cells to the right. + cellIterator = cell.nextSibling; + while (cellIterator) { + if (cellIterator.nodeType === Node.ELEMENT_NODE && + __gCrWeb.fill.hasTagName(cellIterator, 'td')) { + cellCount += cellIterator.colSpan; + } + cellIterator = cellIterator.nextSibling; + } + + // Combine left + right. + cellCount += cellPosition; + cellPositionEnd += cellPosition; + + // Find the current row. + var parentNode = element.parentNode; + while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && + !__gCrWeb.fill.hasTagName(parentNode, 'tr')) { + parentNode = parentNode.parentNode; + } + + if (!parentNode) { + return ''; + } + + // Now find the previous row. + var rowIt = parentNode.previousSibling; + while (rowIt) { + if (rowIt.nodeType === Node.ELEMENT_NODE && + __gCrWeb.fill.hasTagName(parentNode, 'tr')) { + break; + } + rowIt = rowIt.previousSibling; + } + + // If there exists a previous row, check its cells and size. If they align + // with the current row, infer the label from the cell above. + if (rowIt) { + var matchingCell = null; + var prevRowCount = 0; + var prevRowIt = rowIt.firstChild; + while (prevRowIt) { + if (prevRowIt.nodeType === Node.ELEMENT_NODE) { + if (__gCrWeb.fill.hasTagName(prevRowIt, 'td') || + __gCrWeb.fill.hasTagName(prevRowIt, 'th')) { + var span = prevRowIt.colSpan; + var prevRowCountEnd = prevRowCount + span - 1; + if (prevRowCount === cellPosition && + prevRowCountEnd === cellPositionEnd) { + matchingCell = prevRowIt; + } + prevRowCount += span; + } + } + prevRowIt = prevRowIt.nextSibling; + } + if (cellCount === prevRowCount && matchingCell) { + var inferredLabel = __gCrWeb.fill.findChildText(matchingCell); + if (inferredLabel.length > 0) { + return inferredLabel; + } + } + } + + // If there is no previous row, or if the previous row and current row do not + // align, check all previous siblings, skipping non-element nodes, until we + // find a non-empty text block. + var inferredLabel = ''; + var previous = parentNode.previousSibling; + while (inferredLabel.length === 0 && previous) { + if (__gCrWeb.fill.hasTagName(previous, 'tr')) { + inferredLabel = __gCrWeb.fill.findChildText(previous); + } + previous = previous.previousSibling; + } + return inferredLabel; +}; + +/** + * Returns true if |node| is an element and it is a container type that + * inferLabelForElement() can traverse. + * + * It is based on the logic in + * bool IsTraversableContainerElement(const WebNode& node); + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {!Node} node The node to be examined. + * @return {boolean} Whether it can be traversed. + */ +__gCrWeb.fill.isTraversableContainerElement = function(node) { + if (node.nodeType !== Node.ELEMENT_NODE) { + return false; + } + + var tagName = /** @type {Element} */ (node).tagName; + return ( + tagName === 'DD' || tagName === 'DIV' || tagName === 'FIELDSET' || + tagName === 'LI' || tagName === 'TD' || tagName === 'TABLE'); +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * an enclosing label. + * e.g. <label>Some Text<span><input ...></span></label> + * + * It is based on the logic in + * string16 InferLabelFromEnclosingLabel( + * const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromEnclosingLabel = function(element) { + if (!element) { + return ''; + } + var node = element.parentNode; + while (node && !__gCrWeb.fill.hasTagName(node, 'label')) { + node = node.parentNode; + } + if (node) { + return __gCrWeb.fill.findChildText(node); + } + return ''; +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * a surrounding div table, + * e.g. <div>Some Text<span><input ...></span></div> + * e.g. <div>Some Text</div><div><input ...></div> + * + * Because this is already traversing the <div> structure, if it finds a <label> + * sibling along the way, infer from that <label>. + * + * It is based on the logic in + * string16 InferLabelFromDivTable(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromDivTable = function(element) { + if (!element) { + return ''; + } + + var node = element.parentNode; + var lookingForParent = true; + var divsToSkip = []; + + // Search the sibling and parent <div>s until we find a candidate label. + var inferredLabel = ''; + while (inferredLabel.length === 0 && node) { + if (__gCrWeb.fill.hasTagName(node, 'div')) { + if (lookingForParent) { + inferredLabel = + __gCrWeb.fill.findChildTextWithIgnoreList(node, divsToSkip); + } else { + inferredLabel = __gCrWeb.fill.findChildText(node); + } + // Avoid sibling DIVs that contain autofillable fields. + if (!lookingForParent && inferredLabel.length > 0) { + var resultElement = node.querySelector('input, select, textarea'); + if (resultElement) { + inferredLabel = ''; + var addDiv = true; + for (var i = 0; i < divsToSkip.length; ++i) { + if (node === divsToSkip[i]) { + addDiv = false; + break; + } + } + if (addDiv) { + divsToSkip.push(node); + } + } + } + + lookingForParent = false; + } else if ( + !lookingForParent && __gCrWeb.fill.hasTagName(node, 'label')) { + if (!node.control) { + inferredLabel = __gCrWeb.fill.findChildText(node); + } + } else if ( + lookingForParent && + __gCrWeb.fill.isTraversableContainerElement(node)) { + // If the element is in a non-div container, its label most likely is too. + break; + } + + if (!node.previousSibling) { + // If there are no more siblings, continue walking up the tree. + lookingForParent = true; + } + + if (lookingForParent) { + node = node.parentNode; + } else { + node = node.previousSibling; + } + } + + return inferredLabel; +}; + +/** + * Helper for |InferLabelForElement()| that infers a label, if possible, from + * a surrounding definition list, + * e.g. <dl><dt>Some Text</dt><dd><input ...></dd></dl> + * e.g. <dl><dt><b>Some Text</b></dt><dd><b><input ...></b></dd></dl> + * + * It is based on the logic in + * string16 InferLabelFromDefinitionList( + * const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The label of element. + */ +__gCrWeb.fill.inferLabelFromDefinitionList = function(element) { + if (!element) { + return ''; + } + + var parentNode = element.parentNode; + while (parentNode && parentNode.nodeType === Node.ELEMENT_NODE && + !__gCrWeb.fill.hasTagName(parentNode, 'dd')) { + parentNode = parentNode.parentNode; + } + + if (!parentNode || !__gCrWeb.fill.hasTagName(parentNode, 'dd')) { + return ''; + } + + // Skip by any intervening text nodes. + var previous = parentNode.previousSibling; + while (previous && previous.nodeType === Node.TEXT_NODE) { + previous = previous.previousSibling; + } + + if (!previous || !__gCrWeb.fill.hasTagName(previous, 'dt')) return ''; + + return __gCrWeb.fill.findChildText(previous); +}; + +/** + * Returns the element type for all ancestor nodes in CAPS, starting with the + * parent node. + * + * It is based on the logic in + * std::vector<std::string> AncestorTagNames( + * const WebFormControlElement& element); + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {Array} The element types for all ancestors. + */ +__gCrWeb.fill.ancestorTagNames = function(element) { + var tagNames = []; + var parentNode = element.parentNode; + while (parentNode) { + if (parentNode.nodeType === Node.ELEMENT_NODE) + tagNames.push(parentNode.tagName); + parentNode = parentNode.parentNode; + } + return tagNames; +}; + +/** + * Infers corresponding label for |element| from surrounding context in the DOM, + * e.g. the contents of the preceding <p> tag or text element. + * + * It is based on the logic in + * string16 InferLabelForElement(const WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {FormControlElement} element An element to examine. + * @return {string} The inferred label of element, or '' if none could be found. + */ +__gCrWeb.fill.inferLabelForElement = function(element) { + var inferredLabel; + if (__gCrWeb.fill.isCheckableElement(element)) { + inferredLabel = __gCrWeb.fill.inferLabelFromNext(element); + if (__gCrWeb.fill.IsLabelValid(inferredLabel)) { + return inferredLabel; + } + } + + inferredLabel = __gCrWeb.fill.inferLabelFromPrevious(element); + if (__gCrWeb.fill.IsLabelValid(inferredLabel)) { + return inferredLabel; + } + + // If we didn't find a label, check for the placeholder case. + inferredLabel = __gCrWeb.fill.inferLabelFromPlaceholder(element); + if (__gCrWeb.fill.IsLabelValid(inferredLabel)) { + return inferredLabel; + } + + // If we didn't find a placeholder, check for the aria-label case. + inferredLabel = __gCrWeb.fill.inferLabelFromAriaLabel(element); + if (__gCrWeb.fill.IsLabelValid(inferredLabel)) { + return inferredLabel; + } + + // For all other searches that involve traversing up the tree, the search + // order is based on which tag is the closest ancestor to |element|. + var tagNames = __gCrWeb.fill.ancestorTagNames(element); + var seenTagNames = {}; + for (var index = 0; index < tagNames.length; ++index) { + var tagName = tagNames[index]; + if (tagName in seenTagNames) { + continue; + } + + seenTagNames[tagName] = true; + if (tagName === 'LABEL') { + inferredLabel = __gCrWeb.fill.inferLabelFromEnclosingLabel(element); + } else if (tagName === 'DIV') { + inferredLabel = __gCrWeb.fill.inferLabelFromDivTable(element); + } else if (tagName === 'TD') { + inferredLabel = __gCrWeb.fill.inferLabelFromTableColumn(element); + if (!__gCrWeb.fill.IsLabelValid(inferredLabel)) + inferredLabel = __gCrWeb.fill.inferLabelFromTableRow(element); + } else if (tagName === 'DD') { + inferredLabel = __gCrWeb.fill.inferLabelFromDefinitionList(element); + } else if (tagName === 'LI') { + inferredLabel = __gCrWeb.fill.inferLabelFromListItem(element); + } else if (tagName === 'FIELDSET') { + break; + } + + if (__gCrWeb.fill.IsLabelValid(inferredLabel)) { + return inferredLabel; + } + } + // If we didn't find a label, check for the value attribute case. + inferredLabel = __gCrWeb.fill.InferLabelFromValueAttr(element); + if (__gCrWeb.fill.IsLabelValid(inferredLabel)) { + return inferredLabel; + } + + return ''; +}; + +/** + * Fills |field| data with the values of the <option> elements present in + * |selectElement|. + * + * It is based on the logic in + * void GetOptionStringsFromElement(const WebSelectElement& select_element, + * std::vector<string16>* option_values, + * std::vector<string16>* option_contents) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.cc. + * + * @param {Element} selectElement A select element from which option data are + * extracted. + * @param {Object} field A field that will contain the extracted option + * information. + */ +__gCrWeb.fill.getOptionStringsFromElement = function(selectElement, field) { + field['option_values'] = []; + // Protect against custom implementation of Array.toJSON in host pages. + field['option_values'].toJSON = null; + field['option_contents'] = []; + field['option_contents'].toJSON = null; + var options = selectElement.options; + for (var i = 0; i < options.length; ++i) { + var option = options[i]; + field['option_values'].push(option['value']); + field['option_contents'].push(option['text']); + } +}; + +/** + * Returns true if |element| is a text input element. + * + * It is based on the logic in + * bool IsTextInput(const blink::WebInputElement* element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. + * + * @param {FormControlElement} element An element to examine. + * @return {boolean} Whether element is a text input field. + */ +__gCrWeb.fill.isTextInput = function(element) { + if (!element) { + return false; + } + return __gCrWeb.common.isTextField(element); +}; + +/** + * Returns true if |element| is a 'select' element. + * + * It is based on the logic in + * bool IsSelectElement(const blink::WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. + * + * @param {FormControlElement|HTMLOptionElement} element An element to examine. + * @return {boolean} Whether element is a 'select' element. + */ +__gCrWeb.fill.isSelectElement = function(element) { + if (!element) { + return false; + } + return element.type === 'select-one'; +}; + +/** + * Returns true if |element| is a 'textarea' element. + * + * It is based on the logic in + * bool IsTextAreaElement(const blink::WebFormControlElement& element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. + * + * @param {FormControlElement} element An element to examine. + * @return {boolean} Whether element is a 'textarea' element. + */ +__gCrWeb.fill.isTextAreaElement = function(element) { + if (!element) { + return false; + } + return element.type === 'textarea'; +}; + +/** + * Returns true if |element| is a checkbox or a radio button element. + * + * It is based on the logic in + * bool IsCheckableElement(const blink::WebInputElement* element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. + * + * @param {FormControlElement} element An element to examine. + * @return {boolean} Whether element is a checkbox or a radio button. + */ +__gCrWeb.fill.isCheckableElement = function(element) { + if (!element) { + return false; + } + return element.type === 'checkbox' || element.type === 'radio'; +}; + +/** + * Returns true if |element| is one of the input element types that can be + * autofilled. {Text, Radiobutton, Checkbox}. + * + * It is based on the logic in + * bool IsAutofillableInputElement(const blink::WebInputElement* element) + * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. + * + * @param {FormControlElement} element An element to examine. + * @return {boolean} Whether element is one of the input element types that + * can be autofilled. + */ +__gCrWeb.fill.isAutofillableInputElement = function(element) { + return __gCrWeb.fill.isTextInput(element) || + __gCrWeb.fill.isCheckableElement(element); +}; + +/** + * Returns the nodeValue in a way similar to the C++ version of node.nodeValue, + * used in src/components/autofill/content/renderer/form_autofill_util.h. + * Newlines and tabs are stripped. + * + * @param {Node} node A node to examine. + * @return {string} The text contained in |element|. + */ +__gCrWeb.fill.nodeValue = function(node) { + return (node.nodeValue || '').replace(/[\n\t]/gm, ''); +}; + +/** + * Returns the value in a way similar to the C++ version of node.value, + * used in src/components/autofill/content/renderer/form_autofill_util.h. + * Newlines and tabs are stripped. + * + * Note: this method tries to match the behavior of Blink for the select + * element. On Blink, a select element with a first option that is disabled and + * not explicitly selected will automatically select the second element. + * On WebKit, the disabled element is enabled until user interacts with it. + * As the result of this method will be used by code written for Blink, match + * the behavior on it. + * + * @param {FormControlElement|HTMLOptionElement} element An element to examine. + * @return {string} The value for |element|. + */ +__gCrWeb.fill.value = function(element) { + var value = element.value; + if (__gCrWeb.fill.isSelectElement(element)) { + if (element.options.length > 0 && element.selectedIndex == 0 && + element.options[0].disabled && + !element.options[0].hasAttribute('selected')) { + for (var i = 0; i < element.options.length; i++) { + if (!element.options[i].disabled || + element.options[i].hasAttribute('selected')) { + value = element.options[i].value; + break; + } + } + } + } + return (value || '').replace(/[\n\t]/gm, ''); +}; + +/** + * Fills out a FormField object from a given form control element. + * + * It is based on the logic in + * void WebFormControlElementToFormField( + * const blink::WebFormControlElement& element, + * ExtractMask extract_mask, + * FormFieldData* field); + * in chromium/src/components/autofill/content/renderer/form_autofill_util.h. + * + * @param {FormControlElement} element The element to be processed. + * @param {number} extractMask A bit field mask to extract data from |element|. + * See the document on variable __gCrWeb.fill.EXTRACT_MASK_NONE, + * __gCrWeb.fill.EXTRACT_MASK_VALUE, + * __gCrWeb.fill.EXTRACT_MASK_OPTION_TEXT and + * __gCrWeb.fill.EXTRACT_MASK_OPTIONS. + * @param {AutofillFormFieldData} field Field to fill in the element + * information. + */ +__gCrWeb.fill.webFormControlElementToFormField = function( + element, extractMask, field) { + if (!field || !element) { + return; + } + // The label is not officially part of a form control element; however, the + // labels for all form control elements are scraped from the DOM and set in + // form data. + field['name'] = __gCrWeb.form.getFieldIdentifier(element); + field['form_control_type'] = element.type; + var autocomplete_attribute = element.getAttribute('autocomplete'); + if (autocomplete_attribute) { + field['autocomplete_attribute'] = autocomplete_attribute; + } + if (field['autocomplete_attribute'] != null && + field['autocomplete_attribute'].length > + __gCrWeb.fill.MAX_DATA_LENGTH) { + // Discard overly long attribute values to avoid DOS-ing the browser + // process. However, send over a default string to indicate that the + // attribute was present. + field['autocomplete_attribute'] = 'x-max-data-length-exceeded'; + } + + var role_attribute = element.getAttribute('role'); + if (role_attribute && role_attribute.toLowerCase() == 'presentation') { + field['role'] = __gCrWeb.fill.ROLE_ATTRIBUTE_PRESENTATION; + } + + if (!__gCrWeb.fill.isAutofillableElement(element)) { + return; + } + + if (__gCrWeb.fill.isAutofillableInputElement(element) || + __gCrWeb.fill.isTextAreaElement(element) || + __gCrWeb.fill.isSelectElement(element)) { + field['is_autofilled'] = element["isAutofilled"]; + field['should_autocomplete'] = __gCrWeb.fill.autoComplete(element); + field['is_focusable'] = !element.disabled && !element.readOnly && + element.tabIndex >= 0 && isVisibleNode_(element); + } + + if (__gCrWeb.fill.isAutofillableInputElement(element)) { + if (__gCrWeb.fill.isTextInput(element)) { + field['max_length'] = element.maxLength; + if (field['max_length'] == -1) { + // Take default value as defined by W3C. + field['max_length'] = 524288; + } + } + field['is_checkable'] = __gCrWeb.fill.isCheckableElement(element); + } else if (__gCrWeb.fill.isTextAreaElement(element)) { + // Nothing more to do in this case. + } else if (extractMask & __gCrWeb.fill.EXTRACT_MASK_OPTIONS) { + __gCrWeb.fill.getOptionStringsFromElement(element, field); + } + + if (!(extractMask & __gCrWeb.fill.EXTRACT_MASK_VALUE)) { + return; + } + + var value = __gCrWeb.fill.value(element); + + if (__gCrWeb.fill.isSelectElement(element) && + (extractMask & __gCrWeb.fill.EXTRACT_MASK_OPTION_TEXT)) { + // Convert the |select_element| value to text if requested. + var options = element.options; + for (var index = 0; index < options.length; ++index) { + var optionElement = options[index]; + if (__gCrWeb.fill.value(optionElement) === value) { + value = optionElement.text; + break; + } + } + } + + // There is a constraint on the maximum data length in method + // WebFormControlElementToFormField() in form_autofill_util.h in order to + // prevent a malicious site from DOS'ing the browser: http://crbug.com/49332, + // which isn't really meaningful here, but we need to follow the same logic to + // get the same form signature wherever possible (to get the benefits of the + // existing crowdsourced field detection corpus). + if (value.length > __gCrWeb.fill.MAX_DATA_LENGTH) { + value = value.substr(0, __gCrWeb.fill.MAX_DATA_LENGTH); + } + field['value'] = value; +}; + }()); // End of anonymous object
diff --git a/components/content_settings/core/browser/BUILD.gn b/components/content_settings/core/browser/BUILD.gn index 97df967f..b764d00 100644 --- a/components/content_settings/core/browser/BUILD.gn +++ b/components/content_settings/core/browser/BUILD.gn
@@ -53,7 +53,7 @@ "//components/pref_registry:pref_registry", "//components/prefs", "//components/url_formatter", - "//extensions/features", + "//extensions/buildflags", "//net", "//services/preferences/public/cpp", "//url", @@ -88,7 +88,7 @@ "//components/pref_registry:pref_registry", "//components/prefs", "//components/sync_preferences:test_support", - "//extensions/features", + "//extensions/buildflags", "//testing/gtest", "//url", ]
diff --git a/components/content_settings/core/browser/DEPS b/components/content_settings/core/browser/DEPS index 01dbe2a..1cd4d4e 100644 --- a/components/content_settings/core/browser/DEPS +++ b/components/content_settings/core/browser/DEPS
@@ -5,7 +5,7 @@ "+components/pref_registry", "+components/sync_preferences", "+components/url_formatter", - "+extensions/features", + "+extensions/buildflags", "+net/base", "+net/cookies", "+services/preferences/public",
diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc index 124c51b..6ee6053d 100644 --- a/components/content_settings/core/browser/cookie_settings.cc +++ b/components/content_settings/core/browser/cookie_settings.cc
@@ -13,7 +13,7 @@ #include "components/content_settings/core/common/pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "net/base/net_errors.h" #include "net/base/static_cookie_policy.h" #include "url/gurl.h"
diff --git a/components/content_settings/core/browser/cookie_settings_unittest.cc b/components/content_settings/core/browser/cookie_settings_unittest.cc index b073e79..87f8fbe04 100644 --- a/components/content_settings/core/browser/cookie_settings_unittest.cc +++ b/components/content_settings/core/browser/cookie_settings_unittest.cc
@@ -9,7 +9,7 @@ #include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/pref_names.h" #include "components/sync_preferences/testing_pref_service_syncable.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h"
diff --git a/components/download/internal/common/BUILD.gn b/components/download/internal/common/BUILD.gn index 5939ee7..0521275 100644 --- a/components/download/internal/common/BUILD.gn +++ b/components/download/internal/common/BUILD.gn
@@ -22,6 +22,7 @@ "download_ukm_helper.cc", "download_utils.cc", "rate_estimator.cc", + "stream_handle_input_stream.cc", ] public_deps = [ @@ -32,6 +33,7 @@ "//base", "//components/download/public/common:interfaces", "//components/download/quarantine", + "//mojo/public/c/system", "//net", "//services/metrics/public/cpp:ukm_builders", ]
diff --git a/components/download/internal/common/DEPS b/components/download/internal/common/DEPS index 496ddc61..a22fea9b 100644 --- a/components/download/internal/common/DEPS +++ b/components/download/internal/common/DEPS
@@ -4,6 +4,7 @@ "+components/download/quarantine", "+components/ukm/test_ukm_recorder.h", "+crypto", + "+mojo/public/c/system", "+net/base/filename_util.h", "+net/http/http_content_disposition.h", "+net/http/http_response_headers.h",
diff --git a/components/download/internal/common/stream_handle_input_stream.cc b/components/download/internal/common/stream_handle_input_stream.cc new file mode 100644 index 0000000..eeea7be --- /dev/null +++ b/components/download/internal/common/stream_handle_input_stream.cc
@@ -0,0 +1,114 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/download/public/common/stream_handle_input_stream.h" + +#include "base/bind.h" +#include "components/download/public/common/download_interrupt_reasons_utils.h" +#include "mojo/public/c/system/types.h" + +namespace download { + +namespace { +// Data length to read from data pipe. +const int kBytesToRead = 4096; +} // namespace + +StreamHandleInputStream::StreamHandleInputStream( + mojom::DownloadStreamHandlePtr stream_handle) + : stream_handle_(std::move(stream_handle)), + is_response_completed_(false), + completion_status_(DOWNLOAD_INTERRUPT_REASON_NONE) { + DETACH_FROM_SEQUENCE(sequence_checker_); +} + +StreamHandleInputStream::~StreamHandleInputStream() = default; + +void StreamHandleInputStream::Initialize() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + binding_ = std::make_unique<mojo::Binding<mojom::DownloadStreamClient>>( + this, std::move(stream_handle_->client_request)); + binding_->set_connection_error_handler(base::BindOnce( + &StreamHandleInputStream::OnStreamCompleted, base::Unretained(this), + mojom::NetworkRequestStatus::USER_CANCELED)); + handle_watcher_ = std::make_unique<mojo::SimpleWatcher>( + FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC); +} + +bool StreamHandleInputStream::IsEmpty() { + return !stream_handle_; +} + +void StreamHandleInputStream::RegisterDataReadyCallback( + const mojo::SimpleWatcher::ReadyCallback& callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (handle_watcher_) { + handle_watcher_->Watch(stream_handle_->stream.get(), + MOJO_HANDLE_SIGNAL_READABLE, callback); + } +} + +void StreamHandleInputStream::ClearDataReadyCallback() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (handle_watcher_) + handle_watcher_->Cancel(); +} + +void StreamHandleInputStream::RegisterCompletionCallback( + base::OnceClosure callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + completion_callback_ = std::move(callback); +} + +InputStream::StreamState StreamHandleInputStream::Read( + scoped_refptr<net::IOBuffer>* data, + size_t* length) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!handle_watcher_) + return InputStream::EMPTY; + + *length = kBytesToRead; + *data = new net::IOBuffer(kBytesToRead); + MojoResult mojo_result = stream_handle_->stream->ReadData( + (*data)->data(), (uint32_t*)length, MOJO_READ_DATA_FLAG_NONE); + // TODO(qinmin): figure out when COMPLETE should be returned. + switch (mojo_result) { + case MOJO_RESULT_OK: + return InputStream::HAS_DATA; + case MOJO_RESULT_SHOULD_WAIT: + return InputStream::EMPTY; + case MOJO_RESULT_FAILED_PRECONDITION: + if (is_response_completed_) + return InputStream::COMPLETE; + stream_handle_->stream.reset(); + ClearDataReadyCallback(); + return InputStream::WAIT_FOR_COMPLETION; + case MOJO_RESULT_INVALID_ARGUMENT: + case MOJO_RESULT_OUT_OF_RANGE: + case MOJO_RESULT_BUSY: + NOTREACHED(); + return InputStream::COMPLETE; + } + return InputStream::EMPTY; +} + +DownloadInterruptReason StreamHandleInputStream::GetCompletionStatus() { + return completion_status_; +} + +void StreamHandleInputStream::OnStreamCompleted( + mojom::NetworkRequestStatus status) { + // This can be called before or after data pipe is completely drained. + OnResponseCompleted(ConvertMojoNetworkRequestStatusToInterruptReason(status)); +} + +void StreamHandleInputStream::OnResponseCompleted( + DownloadInterruptReason status) { + completion_status_ = status; + is_response_completed_ = true; + if (completion_callback_) + std::move(completion_callback_).Run(); +} + +} // namespace download
diff --git a/components/download/public/common/BUILD.gn b/components/download/public/common/BUILD.gn index 71382d8..a082a38 100644 --- a/components/download/public/common/BUILD.gn +++ b/components/download/public/common/BUILD.gn
@@ -19,6 +19,8 @@ "download_content.h", "download_create_info.h", "download_danger_type.h", + "download_destination_observer.cc", + "download_destination_observer.h", "download_interrupt_reason_values.h", "download_interrupt_reasons.h", "download_interrupt_reasons_utils.h", @@ -34,8 +36,10 @@ "download_url_parameters.cc", "download_url_parameters.h", "download_utils.h", + "input_stream.h", "rate_estimator.h", "resume_mode.h", + "stream_handle_input_stream.h", ] configs += [ ":components_download_implementation" ]
diff --git a/components/download/public/common/DEPS b/components/download/public/common/DEPS index 64737e5..f653f97 100644 --- a/components/download/public/common/DEPS +++ b/components/download/public/common/DEPS
@@ -1,5 +1,8 @@ include_rules = [ "+crypto", + "+mojo/public/cpp/bindings", + "+mojo/public/cpp/system", + "+net/base/io_buffer.h", "+net/base/net_errors.h", "+net/cert/cert_status_flags.h", "+net/http/http_response_headers.h",
diff --git a/components/download/public/common/download_destination_observer.cc b/components/download/public/common/download_destination_observer.cc new file mode 100644 index 0000000..2281cf3 --- /dev/null +++ b/components/download/public/common/download_destination_observer.cc
@@ -0,0 +1,12 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/download/public/common/download_destination_observer.h" + +namespace download { + +DownloadDestinationObserver::~DownloadDestinationObserver() = default; + +} // namespace download +
diff --git a/content/browser/download/download_destination_observer.h b/components/download/public/common/download_destination_observer.h similarity index 66% rename from content/browser/download/download_destination_observer.h rename to components/download/public/common/download_destination_observer.h index 224adc1..f65cc26e 100644 --- a/content/browser/download/download_destination_observer.h +++ b/components/download/public/common/download_destination_observer.h
@@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_DESTINATION_OBSERVER_H_ -#define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_DESTINATION_OBSERVER_H_ +#ifndef COMPONENTS_DOWNLOAD_PUBLIC_COMMON_DOWNLOAD_DESTINATION_OBSERVER_H_ +#define COMPONENTS_DOWNLOAD_PUBLIC_COMMON_DOWNLOAD_DESTINATION_OBSERVER_H_ #include <stdint.h> #include <memory> -#include <string> +#include "components/download/public/common/download_export.h" #include "components/download/public/common/download_interrupt_reasons.h" #include "components/download/public/common/download_item.h" #include "crypto/secure_hash.h" -namespace content { +namespace download { // Class that receives asynchronous events from a DownloadDestination about // downloading progress and completion. These should report status when the @@ -23,19 +23,20 @@ // is doing on the data described by |bytes_so_far| and DestinationCompleted // should only be called once that is true for all data. // -// All methods are invoked on the UI thread. +// All methods are invoked on the same thread the observer was created. // // Note that this interface does not deal with cross-thread lifetime issues. -class DownloadDestinationObserver { +class COMPONENTS_DOWNLOAD_EXPORT DownloadDestinationObserver { public: + virtual ~DownloadDestinationObserver(); + virtual void DestinationUpdate( int64_t bytes_so_far, int64_t bytes_per_sec, - const std::vector<download::DownloadItem::ReceivedSlice>& - received_slices) = 0; + const std::vector<DownloadItem::ReceivedSlice>& received_slices) = 0; virtual void DestinationError( - download::DownloadInterruptReason reason, + DownloadInterruptReason reason, int64_t bytes_so_far, std::unique_ptr<crypto::SecureHash> hash_state) = 0; @@ -44,6 +45,6 @@ std::unique_ptr<crypto::SecureHash> hash_state) = 0; }; -} // namespace content +} // namespace download -#endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_DESTINATION_OBSERVER_H_ +#endif // COMPONENTS_DOWNLOAD_PUBLIC_COMMON_DOWNLOAD_DESTINATION_OBSERVER_H_
diff --git a/components/download/public/common/input_stream.h b/components/download/public/common/input_stream.h new file mode 100644 index 0000000..e6c88dd --- /dev/null +++ b/components/download/public/common/input_stream.h
@@ -0,0 +1,57 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_DOWNLOAD_PUBLIC_COMMON_INPUT_STREAM_H_ +#define COMPONENTS_DOWNLOAD_PUBLIC_COMMON_INPUT_STREAM_H_ + +#include "components/download/public/common/download_export.h" +#include "components/download/public/common/download_interrupt_reasons.h" +#include "mojo/public/cpp/system/simple_watcher.h" +#include "net/base/io_buffer.h" + +namespace download { + +// Input stream for the download system to read after network response is +// received. +class COMPONENTS_DOWNLOAD_EXPORT InputStream { + public: + // Results for reading the InputStream. + enum StreamState { + EMPTY = 0, + HAS_DATA, + WAIT_FOR_COMPLETION, // No more data to read, waiting for completion status + COMPLETE, + }; + + virtual ~InputStream() = default; + + // Initializes the inputStream object. + virtual void Initialize() {} + + // Returns true if the input stream contains no data, or false otherwise. + virtual bool IsEmpty() = 0; + + // Register/clear callbacks when data become available. + virtual void RegisterDataReadyCallback( + const mojo::SimpleWatcher::ReadyCallback& callback) {} + virtual void ClearDataReadyCallback() {} + + // Registers stream completion callback if needed. + virtual void RegisterCompletionCallback(base::OnceClosure callback) {} + + // Reads data from the stream into |data|, |length| is the number of bytes + // returned. + virtual StreamState Read(scoped_refptr<net::IOBuffer>* data, + size_t* length) = 0; + + // Returns the completion status. + virtual DownloadInterruptReason GetCompletionStatus() = 0; + + // Mark the InputStream as completed and set the completion status. + virtual void OnResponseCompleted(DownloadInterruptReason status){}; +}; + +} // namespace download + +#endif // COMPONENTS_DOWNLOAD_PUBLIC_COMMON_INPUT_STREAM_H_
diff --git a/components/download/public/common/stream_handle_input_stream.h b/components/download/public/common/stream_handle_input_stream.h new file mode 100644 index 0000000..810ed005 --- /dev/null +++ b/components/download/public/common/stream_handle_input_stream.h
@@ -0,0 +1,62 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_DOWNLOAD_PUBLIC_COMMON_STREAM_HANDLE_INPUT_STREAM_H_ +#define COMPONENTS_DOWNLOAD_PUBLIC_COMMON_STREAM_HANDLE_INPUT_STREAM_H_ + +#include "components/download/public/common/download_export.h" +#include "components/download/public/common/download_stream.mojom.h" +#include "components/download/public/common/input_stream.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "mojo/public/cpp/system/simple_watcher.h" + +namespace download { + +// Download input stream backed by a DownloadStreamHandle. +class COMPONENTS_DOWNLOAD_EXPORT StreamHandleInputStream + : public InputStream, + public mojom::DownloadStreamClient { + public: + explicit StreamHandleInputStream( + mojom::DownloadStreamHandlePtr stream_handle); + ~StreamHandleInputStream() override; + + // InputStream + void Initialize() override; + bool IsEmpty() override; + void RegisterDataReadyCallback( + const mojo::SimpleWatcher::ReadyCallback& callback) override; + void ClearDataReadyCallback() override; + void RegisterCompletionCallback(base::OnceClosure callback) override; + InputStream::StreamState Read(scoped_refptr<net::IOBuffer>* data, + size_t* length) override; + DownloadInterruptReason GetCompletionStatus() override; + void OnResponseCompleted(DownloadInterruptReason status) override; + + // mojom::DownloadStreamClient + void OnStreamCompleted(mojom::NetworkRequestStatus status) override; + + private: + // Objects for consuming a mojo data pipe. + mojom::DownloadStreamHandlePtr stream_handle_; + std::unique_ptr<mojo::SimpleWatcher> handle_watcher_; + std::unique_ptr<mojo::Binding<mojom::DownloadStreamClient>> binding_; + + // Whether the producer has completed handling the response. + bool is_response_completed_; + + // Status when the response completes, used by data pipe. + DownloadInterruptReason completion_status_; + + // Callback to run when stream completes. + base::OnceClosure completion_callback_; + + SEQUENCE_CHECKER(sequence_checker_); + + DISALLOW_COPY_AND_ASSIGN(StreamHandleInputStream); +}; + +} // namespace download + +#endif // COMPONENTS_DOWNLOAD_PUBLIC_COMMON_STREAM_HANDLE_INPUT_STREAM_H_
diff --git a/components/exo/wayland/clients/client_base.cc b/components/exo/wayland/clients/client_base.cc index a086aca..ceec942 100644 --- a/components/exo/wayland/clients/client_base.cc +++ b/components/exo/wayland/clients/client_base.cc
@@ -108,7 +108,7 @@ wl_registry_bind(registry, id, &zaura_shell_interface, 1))); } else if (strcmp(interface, "zwp_linux_dmabuf_v1") == 0) { globals->linux_dmabuf.reset(static_cast<zwp_linux_dmabuf_v1*>( - wl_registry_bind(registry, id, &zwp_linux_dmabuf_v1_interface, 1))); + wl_registry_bind(registry, id, &zwp_linux_dmabuf_v1_interface, 2))); } else if (strcmp(interface, "wl_subcompositor") == 0) { globals->subcompositor.reset(static_cast<wl_subcompositor*>( wl_registry_bind(registry, id, &wl_subcompositor_interface, 1)));
diff --git a/components/feed/BUILD.gn b/components/feed/BUILD.gn index 02f28c14..380266a 100644 --- a/components/feed/BUILD.gn +++ b/components/feed/BUILD.gn
@@ -8,8 +8,8 @@ # This file is in a separate target so all targets in the build can refer to the # buildflag header to get the necessary preprocessor defines without bringing in # any of the feed targets. -buildflag_header("features") { - header = "features.h" +buildflag_header("buildflags") { + header = "buildflags.h" flags = [ "ENABLE_FEED_IN_CHROME=$enable_feed_in_chrome" ] }
diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn index add18cd..0dafa9d 100644 --- a/components/metrics/BUILD.gn +++ b/components/metrics/BUILD.gn
@@ -113,7 +113,7 @@ "//components/prefs", "//components/variations", "//components/version_info:version_info", - "//extensions/features:features", + "//extensions/buildflags", "//third_party/zlib/google:compression_utils", ] @@ -368,7 +368,7 @@ "//components/metrics/public/cpp:call_stack_unit_tests", "//components/prefs:test_support", "//components/variations", - "//extensions/features:features", + "//extensions/buildflags", "//mojo/public/cpp/bindings", "//net:test_support", "//services/service_manager/public/cpp",
diff --git a/components/metrics/DEPS b/components/metrics/DEPS index d367a02..1457333 100644 --- a/components/metrics/DEPS +++ b/components/metrics/DEPS
@@ -10,7 +10,7 @@ "+components/variations", "+components/version_info", "+content/public/test", - "+extensions/features", + "+extensions/buildflags", "+mojo/public/cpp", "+services/service_manager/public/cpp", "+third_party/metrics_proto",
diff --git a/components/metrics/stability_metrics_helper.cc b/components/metrics/stability_metrics_helper.cc index 3ecadcc..4fbcf10b 100644 --- a/components/metrics/stability_metrics_helper.cc +++ b/components/metrics/stability_metrics_helper.cc
@@ -17,7 +17,7 @@ #include "components/metrics/metrics_pref_names.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_service.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "third_party/metrics_proto/system_profile.pb.h" #if defined(OS_WIN)
diff --git a/components/metrics/stability_metrics_helper_unittest.cc b/components/metrics/stability_metrics_helper_unittest.cc index a70d1ca..010aa90 100644 --- a/components/metrics/stability_metrics_helper_unittest.cc +++ b/components/metrics/stability_metrics_helper_unittest.cc
@@ -10,7 +10,7 @@ #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/prefs/testing_pref_service.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/metrics_proto/system_profile.pb.h"
diff --git a/components/omnibox/browser/BUILD.gn b/components/omnibox/browser/BUILD.gn index 2cbe288..f232f879 100644 --- a/components/omnibox/browser/BUILD.gn +++ b/components/omnibox/browser/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/buildflag_header.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//third_party/protobuf/proto_library.gni") import("//components/vector_icons/vector_icons.gni")
diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnibox/browser/autocomplete_input.cc index 6c7e7c4..42e80de 100644 --- a/components/omnibox/browser/autocomplete_input.cc +++ b/components/omnibox/browser/autocomplete_input.cc
@@ -523,17 +523,21 @@ base::string16 AutocompleteInput::FormattedStringWithEquivalentMeaning( const GURL& url, const base::string16& formatted_url, - const AutocompleteSchemeClassifier& scheme_classifier) { + const AutocompleteSchemeClassifier& scheme_classifier, + size_t* offset) { if (!url_formatter::CanStripTrailingSlash(url)) return formatted_url; const base::string16 url_with_path(formatted_url + base::char16('/')); - return (AutocompleteInput::Parse( - formatted_url, std::string(), scheme_classifier, nullptr, nullptr, - nullptr) == AutocompleteInput::Parse(url_with_path, std::string(), - scheme_classifier, nullptr, - nullptr, nullptr)) - ? formatted_url - : url_with_path; + if (AutocompleteInput::Parse(formatted_url, std::string(), scheme_classifier, + nullptr, nullptr, nullptr) == + AutocompleteInput::Parse(url_with_path, std::string(), scheme_classifier, + nullptr, nullptr, nullptr)) { + return formatted_url; + } + // If offset is past the addition, shift it. + if (offset && *offset == formatted_url.size()) + ++(*offset); + return url_with_path; } // static
diff --git a/components/omnibox/browser/autocomplete_input.h b/components/omnibox/browser/autocomplete_input.h index 85bf295..f1220c3 100644 --- a/components/omnibox/browser/autocomplete_input.h +++ b/components/omnibox/browser/autocomplete_input.h
@@ -93,11 +93,13 @@ // formatted string with the same meaning as the original URL (i.e. it will // re-append a slash if necessary). Because this uses Parse() under the hood // to determine the meaning of the different strings, callers need to supply a - // |scheme_classifier| to pass to Parse(). + // |scheme_classifier| to pass to Parse(). If |offset| is non-null, it will + // be updated with any changes that shift it. static base::string16 FormattedStringWithEquivalentMeaning( const GURL& url, const base::string16& formatted_url, - const AutocompleteSchemeClassifier& scheme_classifier); + const AutocompleteSchemeClassifier& scheme_classifier, + size_t* offset); // Returns the number of non-empty components in |parts| besides the host. static int NumNonHostComponents(const url::Parsed& parts);
diff --git a/components/omnibox/browser/history_quick_provider.cc b/components/omnibox/browser/history_quick_provider.cc index 4978aa1b..d61e821 100644 --- a/components/omnibox/browser/history_quick_provider.cc +++ b/components/omnibox/browser/history_quick_provider.cc
@@ -229,18 +229,12 @@ url_formatter::FormatUrl(info.url(), fill_into_edit_format_types, net::UnescapeRule::SPACES, nullptr, nullptr, &inline_autocomplete_offset), - client()->GetSchemeClassifier()); + client()->GetSchemeClassifier(), &inline_autocomplete_offset); // Set |inline_autocompletion| and |allowed_to_be_default_match| if possible. if (inline_autocomplete_offset != base::string16::npos) { - // |inline_autocomplete_offset| may be beyond the end of the - // |match.fill_into_edit| if the user has typed an URL with a scheme and the - // last character typed is a slash. That slash is removed by the - // FormatUrlWithOffsets call above. - if (inline_autocomplete_offset < match.fill_into_edit.length()) { - match.inline_autocompletion = - match.fill_into_edit.substr(inline_autocomplete_offset); - } + match.inline_autocompletion = + match.fill_into_edit.substr(inline_autocomplete_offset); match.allowed_to_be_default_match = match.inline_autocompletion.empty() || !PreventInlineAutocomplete(autocomplete_input_); }
diff --git a/components/omnibox/browser/history_quick_provider.h b/components/omnibox/browser/history_quick_provider.h index ee0156e..8609f13 100644 --- a/components/omnibox/browser/history_quick_provider.h +++ b/components/omnibox/browser/history_quick_provider.h
@@ -53,6 +53,8 @@ FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, DontTrimHttpsSchemeIfInputHasScheme); FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, DoTrimHttpsScheme); + FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, + CorrectAutocompleteWithTrailingSlash); ~HistoryQuickProvider() override;
diff --git a/components/omnibox/browser/history_quick_provider_unittest.cc b/components/omnibox/browser/history_quick_provider_unittest.cc index 6346bbc..886845ae 100644 --- a/components/omnibox/browser/history_quick_provider_unittest.cc +++ b/components/omnibox/browser/history_quick_provider_unittest.cc
@@ -823,6 +823,22 @@ EXPECT_EQ(ASCIIToUTF16("facebook.com"), match.contents); } +TEST_F(HistoryQuickProviderTest, CorrectAutocompleteWithTrailingSlash) { + provider().autocomplete_input_ = AutocompleteInput( + base::ASCIIToUTF16("cr/"), metrics::OmniboxEventProto::OTHER, + TestSchemeClassifier()); + RowWordStarts word_starts; + word_starts.url_word_starts_ = {0}; + ScoredHistoryMatch sh_match(history::URLRow(GURL("http://cr/")), + VisitInfoVector(), ASCIIToUTF16("cr/"), + {ASCIIToUTF16("cr")}, {0}, word_starts, false, 0, + base::Time()); + AutocompleteMatch ac_match(provider().QuickMatchToACMatch(sh_match, 0)); + EXPECT_EQ(base::ASCIIToUTF16("cr/"), ac_match.fill_into_edit); + EXPECT_EQ(base::ASCIIToUTF16(""), ac_match.inline_autocompletion); + EXPECT_TRUE(ac_match.allowed_to_be_default_match); +} + // HQPOrderingTest ------------------------------------------------------------- class HQPOrderingTest : public HistoryQuickProviderTest {
diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc index 02778a6f..9670d85 100644 --- a/components/omnibox/browser/history_url_provider.cc +++ b/components/omnibox/browser/history_url_provider.cc
@@ -624,7 +624,8 @@ const size_t offset = trim_http ? TrimHttpPrefix(&display_string) : 0; match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning( - destination_url, display_string, client()->GetSchemeClassifier()); + destination_url, display_string, client()->GetSchemeClassifier(), + nullptr); // The what-you-typed match is generally only allowed to be default for // URL inputs or when there is no default search provider. (It's also // allowed to be default for UNKNOWN inputs where the destination is a known @@ -1240,7 +1241,7 @@ url_formatter::FormatUrl(info.url(), fill_into_edit_format_types, net::UnescapeRule::SPACES, nullptr, nullptr, &inline_autocomplete_offset), - client()->GetSchemeClassifier()); + client()->GetSchemeClassifier(), &inline_autocomplete_offset); // |inline_autocomplete_offset| was guaranteed not to be npos before the call // to FormatUrl(). If it is npos now, that means the represented location no // longer exists as such in the formatted string, e.g. if the offset pointed
diff --git a/components/omnibox/browser/physical_web_provider.cc b/components/omnibox/browser/physical_web_provider.cc index ec07a363..7a7018e 100644 --- a/components/omnibox/browser/physical_web_provider.cc +++ b/components/omnibox/browser/physical_web_provider.cc
@@ -248,7 +248,8 @@ match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning( - url, url_formatter::FormatUrl(url), client_->GetSchemeClassifier()); + url, url_formatter::FormatUrl(url), client_->GetSchemeClassifier(), + nullptr); match.description = title; match.description_class.push_back( @@ -318,7 +319,7 @@ match.fill_into_edit = AutocompleteInput::FormattedStringWithEquivalentMeaning( - url, match.contents, client_->GetSchemeClassifier()); + url, match.contents, client_->GetSchemeClassifier(), nullptr); match.description = l10n_util::GetStringUTF16(IDS_PHYSICAL_WEB_OVERFLOW_DESCRIPTION);
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc index 6ca8dbcc..b86cb21d 100644 --- a/components/omnibox/browser/search_provider.cc +++ b/components/omnibox/browser/search_provider.cc
@@ -1473,7 +1473,7 @@ url_formatter::FormatUrl(navigation.url(), format_types, net::UnescapeRule::SPACES, nullptr, nullptr, &inline_autocomplete_offset), - client()->GetSchemeClassifier()); + client()->GetSchemeClassifier(), &inline_autocomplete_offset); if (inline_autocomplete_offset != base::string16::npos) { DCHECK(inline_autocomplete_offset <= match.fill_into_edit.length()); match.inline_autocompletion =
diff --git a/components/omnibox/browser/search_suggestion_parser.cc b/components/omnibox/browser/search_suggestion_parser.cc index 1bfae522..e448b2e 100644 --- a/components/omnibox/browser/search_suggestion_parser.cc +++ b/components/omnibox/browser/search_suggestion_parser.cc
@@ -255,7 +255,8 @@ nullptr, nullptr, nullptr), - scheme_classifier)), + scheme_classifier, + nullptr)), description_(description) { DCHECK(url_.is_valid()); CalculateAndClassifyMatchContents(true, input_text);
diff --git a/components/omnibox/browser/titled_url_match_utils.cc b/components/omnibox/browser/titled_url_match_utils.cc index f567d1b3..5d878b51 100644 --- a/components/omnibox/browser/titled_url_match_utils.cc +++ b/components/omnibox/browser/titled_url_match_utils.cc
@@ -105,16 +105,10 @@ url_formatter::FormatUrl(url, fill_into_edit_format_types, net::UnescapeRule::SPACES, nullptr, nullptr, &inline_autocomplete_offset), - scheme_classifier); + scheme_classifier, &inline_autocomplete_offset); if (inline_autocomplete_offset != base::string16::npos) { - // |inline_autocomplete_offset| may be beyond the end of the - // |fill_into_edit| if the user has typed an URL with a scheme and the - // last character typed is a slash. That slash is removed by the - // FormatURLWithOffsets call above. - if (inline_autocomplete_offset < match.fill_into_edit.length()) { - match.inline_autocompletion = - match.fill_into_edit.substr(inline_autocomplete_offset); - } + match.inline_autocompletion = + match.fill_into_edit.substr(inline_autocomplete_offset); match.allowed_to_be_default_match = match.inline_autocompletion.empty() || !HistoryProvider::PreventInlineAutocomplete(input);
diff --git a/components/omnibox/browser/zero_suggest_provider.cc b/components/omnibox/browser/zero_suggest_provider.cc index c39da7c..803e8f0 100644 --- a/components/omnibox/browser/zero_suggest_provider.cc +++ b/components/omnibox/browser/zero_suggest_provider.cc
@@ -375,7 +375,7 @@ match.fill_into_edit += AutocompleteInput::FormattedStringWithEquivalentMeaning( navigation.url(), url_formatter::FormatUrl(navigation.url()), - client()->GetSchemeClassifier()); + client()->GetSchemeClassifier(), nullptr); AutocompleteMatch::ClassifyLocationInString(base::string16::npos, 0, match.contents.length(), ACMatchClassification::URL,
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn index 2f260de..c801f16d 100644 --- a/components/password_manager/core/browser/BUILD.gn +++ b/components/password_manager/core/browser/BUILD.gn
@@ -206,8 +206,6 @@ sources += [ "hsts_query.cc", "hsts_query.h", - "http_data_cleaner.cc", - "http_data_cleaner.h", ] } @@ -375,10 +373,7 @@ if (is_ios) { sources += [ "login_database_ios_unittest.cc" ] } else { - sources += [ - "hsts_query_unittest.cc", - "http_data_cleaner_unittest.cc", - ] + sources += [ "hsts_query_unittest.cc" ] } if (password_reuse_detection_support) { sources += [
diff --git a/components/password_manager/core/browser/hsts_query_unittest.cc b/components/password_manager/core/browser/hsts_query_unittest.cc index 3f5f0a1b..aab0144 100644 --- a/components/password_manager/core/browser/hsts_query_unittest.cc +++ b/components/password_manager/core/browser/hsts_query_unittest.cc
@@ -19,6 +19,42 @@ #include "url/gurl.h" namespace password_manager { +namespace { + +// Auxiliary class to automatically set and reset the HSTS state for a given +// host. +class HSTSStateManager { + public: + HSTSStateManager(net::TransportSecurityState* state, + bool is_hsts, + std::string host); + ~HSTSStateManager(); + + private: + net::TransportSecurityState* state_; + const bool is_hsts_; + const std::string host_; + + DISALLOW_COPY_AND_ASSIGN(HSTSStateManager); +}; + +HSTSStateManager::HSTSStateManager(net::TransportSecurityState* state, + bool is_hsts, + std::string host) + : state_(state), is_hsts_(is_hsts), host_(std::move(host)) { + if (is_hsts_) { + base::Time expiry = base::Time::Max(); + bool include_subdomains = false; + state_->AddHSTS(host_, expiry, include_subdomains); + } +} + +HSTSStateManager::~HSTSStateManager() { + if (is_hsts_) + state_->DeleteDynamicDataForHost(host_); +} + +} // namespace class HSTSQueryTest : public testing::Test { public:
diff --git a/components/password_manager/core/browser/http_data_cleaner.cc b/components/password_manager/core/browser/http_data_cleaner.cc deleted file mode 100644 index f57f8413..0000000 --- a/components/password_manager/core/browser/http_data_cleaner.cc +++ /dev/null
@@ -1,273 +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 "components/password_manager/core/browser/http_data_cleaner.h" - -#include <algorithm> -#include <iterator> -#include <memory> -#include <tuple> -#include <utility> -#include <vector> - -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/logging.h" -#include "base/macros.h" -#include "base/stl_util.h" -#include "components/autofill/core/common/password_form.h" -#include "components/keyed_service/core/service_access_type.h" -#include "components/password_manager/core/browser/hsts_query.h" -#include "components/password_manager/core/browser/password_store.h" -#include "components/password_manager/core/browser/password_store_consumer.h" -#include "components/password_manager/core/browser/statistics_table.h" -#include "components/password_manager/core/common/password_manager_pref_names.h" -#include "components/prefs/pref_service.h" - -using autofill::PasswordForm; - -namespace password_manager { - -namespace { - -constexpr int kDefaultDelay = 40; - -// Utility function that moves all elements from a specified iterator into a new -// vector and returns it. The moved elements are deleted from the original -// vector. -std::vector<std::unique_ptr<PasswordForm>> SplitFormsFrom( - std::vector<std::unique_ptr<PasswordForm>>::iterator from, - std::vector<std::unique_ptr<PasswordForm>>* forms) { - const auto end_forms = std::end(*forms); - std::vector<std::unique_ptr<PasswordForm>> result; - result.reserve(std::distance(from, end_forms)); - std::move(from, end_forms, std::back_inserter(result)); - forms->erase(from, end_forms); - return result; -} - -void RemoveLoginIfHSTS(const scoped_refptr<PasswordStore>& store, - const PasswordForm& form, - bool is_hsts) { - if (is_hsts) - store->RemoveLogin(form); -} - -void RemoveSiteStatsIfHSTS(const scoped_refptr<PasswordStore>& store, - const InteractionsStats& stats, - bool is_hsts) { - if (is_hsts) - store->RemoveSiteStats(stats.origin_domain); -} - -// This class removes obsolete HTTP data from a password store. HTTP data is -// obsolete if the corresponding host migrated to HTTPS and has HSTS enabled. -class ObsoleteHttpCleaner : public password_manager::PasswordStoreConsumer { - public: - // Constructing a ObsoleteHttpCleaner will result in issuing the clean up - // tasks already. - ObsoleteHttpCleaner( - const scoped_refptr<PasswordStore>& store, - const scoped_refptr<net::URLRequestContextGetter>& request_context); - ~ObsoleteHttpCleaner() override; - - // PasswordStoreConsumer: - // This will be called for both autofillable logins as well as blacklisted - // logins. Blacklisted logins are removed iff the scheme is HTTP and HSTS is - // enabled for the host. - // Autofillable logins are removed iff the scheme is HTTP and there exists - // another HTTPS login with active HSTS that has the same host as well as the - // same username and password. - void OnGetPasswordStoreResults( - std::vector<std::unique_ptr<PasswordForm>> results) override; - - // This will remove all stats for HTTP sites for which HSTS is active. - void OnGetSiteStatistics(std::vector<InteractionsStats> stats) override; - - PasswordStore* store() { return store_.get(); } - - const scoped_refptr<net::URLRequestContextGetter>& request_context() { - return request_context_; - } - - bool finished_cleaning() const { return remaining_cleaning_tasks_ == 0; } - - private: - scoped_refptr<PasswordStore> store_; - scoped_refptr<net::URLRequestContextGetter> request_context_; - // There are 3 cleaning tasks initiated in the constructor. - int remaining_cleaning_tasks_ = 3; - - DISALLOW_COPY_AND_ASSIGN(ObsoleteHttpCleaner); -}; - -ObsoleteHttpCleaner::ObsoleteHttpCleaner( - const scoped_refptr<PasswordStore>& password_store, - const scoped_refptr<net::URLRequestContextGetter>& request_context) - : store_(password_store), request_context_(request_context) { - DCHECK(store_); - DCHECK(request_context_.get()); - store()->GetBlacklistLogins(this); - store()->GetAutofillableLogins(this); - store()->GetAllSiteStats(this); -} - -ObsoleteHttpCleaner::~ObsoleteHttpCleaner() = default; - -void ObsoleteHttpCleaner::OnGetPasswordStoreResults( - std::vector<std::unique_ptr<PasswordForm>> results) { - --remaining_cleaning_tasks_; - // Non HTTP or HTTPS credentials are ignored. - base::EraseIf(results, [](const std::unique_ptr<PasswordForm>& form) { - return !form->origin.SchemeIsHTTPOrHTTPS(); - }); - - // Move HTTPS forms into their own container. - auto https_forms = SplitFormsFrom( - std::partition(std::begin(results), std::end(results), - [](const std::unique_ptr<PasswordForm>& form) { - return form->origin.SchemeIs(url::kHttpScheme); - }), - &results); - - // Move blacklisted HTTP forms into their own container. - const auto blacklisted_http_forms = SplitFormsFrom( - std::partition(std::begin(results), std::end(results), - [](const std::unique_ptr<PasswordForm>& form) { - return !form->blacklisted_by_user; - }), - &results); - - // Remove blacklisted HTTP forms from the password store when HSTS is active - // for the given host. - for (const auto& form : blacklisted_http_forms) { - PostHSTSQueryForHostAndRequestContext( - form->origin, request_context(), - base::Bind(&RemoveLoginIfHSTS, base::WrapRefCounted(store()), *form)); - } - - // Return early if there are no non-blacklisted HTTP forms. - if (results.empty()) - return; - - // Sort HTTPS forms according to custom comparison function. Consider two - // forms equivalent if they have the same host, as well as the same username - // and password. - const auto form_cmp = [](const std::unique_ptr<PasswordForm>& lhs, - const std::unique_ptr<PasswordForm>& rhs) { - return std::forward_as_tuple(lhs->origin.host_piece(), lhs->username_value, - lhs->password_value) < - std::forward_as_tuple(rhs->origin.host_piece(), rhs->username_value, - rhs->password_value); - }; - - std::sort(std::begin(https_forms), std::end(https_forms), form_cmp); - - // Iterate through HTTP forms and remove them from the password store if there - // exists an equivalent HTTPS form that has HSTS enabled. - for (const auto& form : results) { - if (std::binary_search(std::begin(https_forms), std::end(https_forms), form, - form_cmp)) { - PostHSTSQueryForHostAndRequestContext( - form->origin, request_context(), - base::Bind(&RemoveLoginIfHSTS, base::WrapRefCounted(store()), *form)); - } - } -} - -void ObsoleteHttpCleaner::OnGetSiteStatistics( - std::vector<InteractionsStats> stats) { - --remaining_cleaning_tasks_; - for (const auto& stat : stats) { - if (stat.origin_domain.SchemeIs(url::kHttpScheme)) { - PostHSTSQueryForHostAndRequestContext( - stat.origin_domain, request_context(), - base::Bind(&RemoveSiteStatsIfHSTS, base::WrapRefCounted(store()), - stat)); - } - } -} - -void WaitUntilCleaningIsDone(std::unique_ptr<ObsoleteHttpCleaner> cleaner, - PrefService* prefs) { - // Given the async nature of the cleaning tasks it is non-trivial to determine - // when they are all done. In this method we make use of the fact that as long - // the cleaning is not completed, weak pointers to the cleaner object exist - // (the scheduled, but not yet executed tasks hold them). If the cleaning is - // not done yet, this method schedules a task on the password store, which - // will be behind the cleaning tasks in the task queue. When the scheduled - // task gets executed, this method is called again. Now it is guaranteed that - // the initial scheduled cleaning tasks will have been executed, but it might - // be the case that they wait for the result of other scheduled tasks (e.g. on - // Windows there could be async calls to GetIE7Login). In this case another - // round trip of tasks will be scheduled. Finally, when no weak ptrs remain, - // this method sets a boolean preference flag and returns. - if (cleaner->HasWeakPtrs()) { - scoped_refptr<base::SequencedTaskRunner> main_thread_runner = - base::SequencedTaskRunnerHandle::Get(); - const auto post_to_thread = - [](std::unique_ptr<ObsoleteHttpCleaner> cleaner, PrefService* prefs, - scoped_refptr<base::SequencedTaskRunner> thread_runner) { - thread_runner->PostTask(FROM_HERE, - base::BindOnce(&WaitUntilCleaningIsDone, - std::move(cleaner), prefs)); - }; - - // Calling |ScheduleTask| through the raw pointer is necessary, because - // |std::move(cleaner)| might be executed before |cleaner->store()|. - // However, at this point cleaner is moved from, leading to a crash. Using a - // raw pointer avoids this issue. - ObsoleteHttpCleaner* raw_cleaner = cleaner.get(); - raw_cleaner->store()->ScheduleTask( - base::Bind(post_to_thread, base::Passed(std::move(cleaner)), prefs, - main_thread_runner)); - return; - } - - DCHECK(cleaner->finished_cleaning()); - prefs->SetBoolean(password_manager::prefs::kWasObsoleteHttpDataCleaned, true); -} - -void InitiateCleaning( - const scoped_refptr<PasswordStore>& store, - PrefService* prefs, - const scoped_refptr<net::URLRequestContextGetter>& request_context) { - WaitUntilCleaningIsDone( - std::make_unique<ObsoleteHttpCleaner>(store, request_context), prefs); -} - -void DelayCleanObsoleteHttpDataForPasswordStoreAndPrefsImpl( - PasswordStore* store, - PrefService* prefs, - const scoped_refptr<net::URLRequestContextGetter>& request_context, - int delay_in_seconds) { - if (!prefs->GetBoolean( - password_manager::prefs::kWasObsoleteHttpDataCleaned)) { - base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( - FROM_HERE, - base::Bind(&InitiateCleaning, base::WrapRefCounted(store), prefs, - request_context), - base::TimeDelta::FromSeconds(delay_in_seconds)); - } -} - -} // namespace - -void DelayCleanObsoleteHttpDataForPasswordStoreAndPrefs( - PasswordStore* store, - PrefService* prefs, - const scoped_refptr<net::URLRequestContextGetter>& request_context) { - DelayCleanObsoleteHttpDataForPasswordStoreAndPrefsImpl( - store, prefs, request_context, kDefaultDelay); -} - -void CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting( - PasswordStore* store, - PrefService* prefs, - const scoped_refptr<net::URLRequestContextGetter>& request_context) { - DelayCleanObsoleteHttpDataForPasswordStoreAndPrefsImpl(store, prefs, - request_context, 0); -} - -} // namespace password_manager
diff --git a/components/password_manager/core/browser/http_data_cleaner.h b/components/password_manager/core/browser/http_data_cleaner.h deleted file mode 100644 index 2aa6a07e..0000000 --- a/components/password_manager/core/browser/http_data_cleaner.h +++ /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. - -#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HTTP_DATA_CLEANER_H_ -#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HTTP_DATA_CLEANER_H_ - -#include "base/memory/ref_counted.h" -#include "net/url_request/url_request_context_getter.h" - -class PrefService; - -namespace password_manager { - -class PasswordStore; - -void DelayCleanObsoleteHttpDataForPasswordStoreAndPrefs( - PasswordStore* store, - PrefService* prefs, - const scoped_refptr<net::URLRequestContextGetter>& request_context); - -void CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting( - PasswordStore* store, - PrefService* prefs, - const scoped_refptr<net::URLRequestContextGetter>& request_context); - -} // namespace password_manager - -#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_HTTP_DATA_CLEANER_H_
diff --git a/components/password_manager/core/browser/http_data_cleaner_unittest.cc b/components/password_manager/core/browser/http_data_cleaner_unittest.cc deleted file mode 100644 index 59506e1e..0000000 --- a/components/password_manager/core/browser/http_data_cleaner_unittest.cc +++ /dev/null
@@ -1,244 +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 "components/password_manager/core/browser/http_data_cleaner.h" - -#include <memory> - -#include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/strings/utf_string_conversions.h" -#include "base/test/scoped_task_environment.h" -#include "components/password_manager/core/browser/mock_password_store.h" -#include "components/password_manager/core/browser/password_manager_test_utils.h" -#include "components/password_manager/core/common/password_manager_pref_names.h" -#include "components/prefs/pref_registry_simple.h" -#include "components/prefs/testing_pref_service.h" -#include "net/url_request/url_request_context.h" -#include "net/url_request/url_request_test_util.h" -#include "testing/gmock/include/gmock/gmock.h" -#include "testing/gtest/include/gtest/gtest.h" - -using autofill::PasswordForm; -using testing::Invoke; -using testing::Message; -using testing::Mock; -using testing::NiceMock; -using testing::_; - -namespace password_manager { - -constexpr char kTestHttpURL[] = "http://example.org/"; -constexpr char kTestHttpsURL[] = "https://example.org/"; - -PasswordForm CreateTestHTTPForm() { - PasswordForm form; - form.origin = GURL(kTestHttpURL); - form.signon_realm = form.origin.spec(); - form.action = form.origin; - form.username_value = base::ASCIIToUTF16("user"); - form.password_value = base::ASCIIToUTF16("password"); - return form; -} - -PasswordForm CreateTestHTTPSForm() { - PasswordForm form; - form.origin = GURL(kTestHttpsURL); - form.signon_realm = form.origin.spec(); - form.action = form.origin; - form.username_value = base::ASCIIToUTF16("user"); - form.password_value = base::ASCIIToUTF16("password"); - return form; -} - -InteractionsStats CreateTestHTTPStats() { - InteractionsStats stats; - stats.origin_domain = GURL(kTestHttpURL); - stats.username_value = base::ASCIIToUTF16("user"); - return stats; -} - -InteractionsStats CreateTestHTTPSStats() { - InteractionsStats stats; - stats.origin_domain = GURL(kTestHttpsURL); - stats.username_value = base::ASCIIToUTF16("user"); - return stats; -} - -class HTTPDataCleanerTest : public testing::Test { - public: - HTTPDataCleanerTest() - : store_(new NiceMock<MockPasswordStore>), - prefs_(std::make_unique<TestingPrefServiceSimple>()), - request_context_(new net::TestURLRequestContextGetter( - base::ThreadTaskRunnerHandle::Get())) { - prefs()->registry()->RegisterBooleanPref(prefs::kWasObsoleteHttpDataCleaned, - false); - store_->Init(syncer::SyncableService::StartSyncFlare(), nullptr); - } - - ~HTTPDataCleanerTest() override { store_->ShutdownOnUIThread(); } - - MockPasswordStore* store() { return store_.get(); } - - TestingPrefServiceSimple* prefs() { return prefs_.get(); } - - const scoped_refptr<net::TestURLRequestContextGetter>& request_context() { - return request_context_; - } - - void WaitUntilIdle() { scoped_task_environment_.RunUntilIdle(); } - - private: - base::test::ScopedTaskEnvironment scoped_task_environment_; - scoped_refptr<MockPasswordStore> store_; - std::unique_ptr<TestingPrefServiceSimple> prefs_; - scoped_refptr<net::TestURLRequestContextGetter> request_context_; - - DISALLOW_COPY_AND_ASSIGN(HTTPDataCleanerTest); -}; - -TEST_F(HTTPDataCleanerTest, TestBlacklistDeletion) { - for (bool is_http : {false, true}) { - for (bool is_hsts : {false, true}) { - SCOPED_TRACE(Message() << std::boolalpha << "(is_http, is_hsts): (" - << is_http << ", " << is_hsts << ")"); - - prefs()->SetBoolean(prefs::kWasObsoleteHttpDataCleaned, false); - - const bool should_be_deleted = is_http && is_hsts; - - PasswordForm form = - is_http ? CreateTestHTTPForm() : CreateTestHTTPSForm(); - form.blacklisted_by_user = true; - form.username_value.clear(); - form.password_value.clear(); - - HSTSStateManager manager( - request_context()->GetURLRequestContext()->transport_security_state(), - is_hsts, form.origin.host()); - - EXPECT_CALL(*store(), FillBlacklistLogins(_)) - .WillOnce(Invoke( - [&form]( - std::vector<std::unique_ptr<autofill::PasswordForm>>* forms) { - *forms = WrapForms({form}); - return true; - })); - - EXPECT_CALL(*store(), RemoveLogin(form)).Times(should_be_deleted); - - // Initiate clean up and make sure all aync tasks are run until - // completion. - CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting( - store(), prefs(), request_context()); - WaitUntilIdle(); - - // Verify and clear all expectations as well as the preference. - Mock::VerifyAndClearExpectations(store()); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kWasObsoleteHttpDataCleaned)); - } - } -} - -TEST_F(HTTPDataCleanerTest, TestAutofillableDeletion) { - for (bool is_hsts : {false, true}) { - for (bool same_host : {false, true}) { - for (bool same_user : {false, true}) { - for (bool same_pass : {false, true}) { - SCOPED_TRACE(Message() - << std::boolalpha - << "(is_hsts, same_host, same_user, same_pass): (" - << is_hsts << ", " << same_host << ", " << same_user - << ", " << same_pass); - - prefs()->SetBoolean(prefs::kWasObsoleteHttpDataCleaned, false); - - const bool should_be_deleted = - is_hsts && same_host && same_user && same_pass; - - PasswordForm http_form = CreateTestHTTPForm(); - PasswordForm https_form = CreateTestHTTPSForm(); - - if (!same_host) { - GURL::Replacements rep; - rep.SetHostStr("a-totally-different-host"); - http_form.origin = http_form.origin.ReplaceComponents(rep); - } - - if (!same_user) - http_form.username_value = base::ASCIIToUTF16("different-user"); - - if (!same_pass) - http_form.password_value = base::ASCIIToUTF16("different-pass"); - - HSTSStateManager manager(request_context() - ->GetURLRequestContext() - ->transport_security_state(), - is_hsts, https_form.origin.host()); - - EXPECT_CALL(*store(), FillAutofillableLogins(_)) - .WillOnce(Invoke( - [&http_form, &https_form]( - std::vector<std::unique_ptr<autofill::PasswordForm>>* - forms) { - *forms = WrapForms({http_form, https_form}); - return true; - })); - - EXPECT_CALL(*store(), RemoveLogin(http_form)) - .Times(should_be_deleted); - - // Initiate clean up and make sure all aync tasks are run until - // completion. - CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting( - store(), prefs(), request_context()); - WaitUntilIdle(); - - // Verify and clear all expectations as well as the preference. - Mock::VerifyAndClearExpectations(store()); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kWasObsoleteHttpDataCleaned)); - } - } - } - } -} - -TEST_F(HTTPDataCleanerTest, TestSiteStatsDeletion) { - for (bool is_http : {false, true}) { - for (bool is_hsts : {false, true}) { - SCOPED_TRACE(Message() << std::boolalpha << "(is_http, is_hsts): (" - << is_http << ", " << is_hsts); - - prefs()->SetBoolean(prefs::kWasObsoleteHttpDataCleaned, false); - - const bool should_be_deleted = is_http && is_hsts; - - InteractionsStats stats = - is_http ? CreateTestHTTPStats() : CreateTestHTTPSStats(); - - HSTSStateManager manager( - request_context()->GetURLRequestContext()->transport_security_state(), - is_hsts, stats.origin_domain.host()); - - EXPECT_CALL(*store(), GetAllSiteStatsImpl()).WillOnce(Invoke([&stats]() { - return std::vector<InteractionsStats>({stats}); - })); - EXPECT_CALL(*store(), RemoveSiteStatsImpl(stats.origin_domain)) - .Times(should_be_deleted); - - // Initiate clean up and make sure all async tasks are run until - // completion. - CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting( - store(), prefs(), request_context()); - WaitUntilIdle(); - - // Verify and clear all expectations as well as the preference. - Mock::VerifyAndClearExpectations(store()); - EXPECT_TRUE(prefs()->GetBoolean(prefs::kWasObsoleteHttpDataCleaned)); - } - } -} - -} // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 38152f7..70c418ce 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -249,7 +249,6 @@ registry->RegisterBooleanPref( prefs::kCredentialsEnableAutosignin, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); - registry->RegisterBooleanPref(prefs::kWasObsoleteHttpDataCleaned, false); registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(), PrefRegistry::NO_REGISTRATION_FLAGS); registry->RegisterStringPref(prefs::kSyncPasswordLengthAndHashSalt, @@ -258,6 +257,7 @@ registry->RegisterBooleanPref( prefs::kWasAutoSignInFirstRunExperienceShown, false, user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); + registry->RegisterBooleanPref(prefs::kBlacklistedCredentialsStripped, false); #if defined(OS_MACOSX) registry->RegisterIntegerPref( prefs::kKeychainMigrationStatus,
diff --git a/components/password_manager/core/browser/password_manager_test_utils.cc b/components/password_manager/core/browser/password_manager_test_utils.cc index 818cf6c..3d9d307 100644 --- a/components/password_manager/core/browser/password_manager_test_utils.cc +++ b/components/password_manager/core/browser/password_manager_test_utils.cc
@@ -12,7 +12,6 @@ #include "base/feature_list.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" -#include "base/time/time.h" using autofill::PasswordForm; @@ -61,17 +60,6 @@ return form; } -std::vector<std::unique_ptr<PasswordForm>> WrapForms( - std::vector<PasswordForm> forms) { - std::vector<std::unique_ptr<PasswordForm>> results; - results.reserve(forms.size()); - std::transform(forms.begin(), forms.end(), std::back_inserter(results), - [](PasswordForm& form) { - return std::make_unique<PasswordForm>(std::move(form)); - }); - return results; -} - bool ContainsEqualPasswordFormsUnordered( const std::vector<std::unique_ptr<PasswordForm>>& expectations, const std::vector<std::unique_ptr<PasswordForm>>& actual_values, @@ -124,19 +112,4 @@ MockPasswordReuseDetectorConsumer::~MockPasswordReuseDetectorConsumer() {} #endif -HSTSStateManager::HSTSStateManager(net::TransportSecurityState* state, - bool is_hsts, - const std::string& host) - : state_(state), is_hsts_(is_hsts), host_(host) { - if (is_hsts_) { - base::Time expiry = base::Time::Max(); - bool include_subdomains = false; - state_->AddHSTS(host_, expiry, include_subdomains); - } -} - -HSTSStateManager::~HSTSStateManager() { - if (is_hsts_) - state_->DeleteDynamicDataForHost(host_); -} } // namespace password_manager
diff --git a/components/password_manager/core/browser/password_manager_test_utils.h b/components/password_manager/core/browser/password_manager_test_utils.h index 8e877c2..d1e714c 100644 --- a/components/password_manager/core/browser/password_manager_test_utils.h +++ b/components/password_manager/core/browser/password_manager_test_utils.h
@@ -6,15 +6,12 @@ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_TEST_UTILS_H_ #include <iosfwd> -#include <string> #include <vector> #include "base/feature_list.h" -#include "base/macros.h" #include "base/memory/ref_counted.h" #include "components/autofill/core/common/password_form.h" #include "components/password_manager/core/browser/password_store.h" -#include "net/http/transport_security_state.h" #include "testing/gmock/include/gmock/gmock.h" namespace password_manager { @@ -60,11 +57,6 @@ const PasswordFormData& form_data, bool use_federated_login = false); -// Convenience method that wraps the passed in forms in unique ptrs and returns -// the result. -std::vector<std::unique_ptr<autofill::PasswordForm>> WrapForms( - std::vector<autofill::PasswordForm> forms); - // Checks whether the PasswordForms pointed to in |actual_values| are in some // permutation pairwise equal to those in |expectations|. Returns true in case // of a perfect match; otherwise returns false and writes details of mismatches @@ -101,23 +93,6 @@ }; #endif -// Auxiliary class to automatically set and reset the HSTS state for a given -// host. -class HSTSStateManager { - public: - HSTSStateManager(net::TransportSecurityState* state, - bool is_hsts, - const std::string& host); - ~HSTSStateManager(); - - private: - net::TransportSecurityState* state_; - const bool is_hsts_; - const std::string host_; - - DISALLOW_COPY_AND_ASSIGN(HSTSStateManager); -}; - } // namespace password_manager #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_TEST_UTILS_H_
diff --git a/components/password_manager/core/browser/password_manager_util.cc b/components/password_manager/core/browser/password_manager_util.cc index 3cccd72..5fa6d320 100644 --- a/components/password_manager/core/browser/password_manager_util.cc +++ b/components/password_manager/core/browser/password_manager_util.cc
@@ -6,6 +6,7 @@ #include <algorithm> +#include "base/metrics/histogram_macros.h" #include "base/stl_util.h" #include "components/autofill/core/browser/autofill_client.h" #include "components/autofill/core/browser/popup_item_ids.h" @@ -14,10 +15,64 @@ #include "components/password_manager/core/browser/log_manager.h" #include "components/password_manager/core/browser/password_manager_client.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_store_consumer.h" #include "components/password_manager/core/common/password_manager_features.h" +#include "components/password_manager/core/common/password_manager_pref_names.h" +#include "components/prefs/pref_service.h" #include "components/sync/driver/sync_service.h" namespace password_manager_util { +namespace { + +// Clears username/password on the blacklisted credentials. +class BlacklistedCredentialsCleaner + : public password_manager::PasswordStoreConsumer { + public: + BlacklistedCredentialsCleaner(password_manager::PasswordStore* store, + PrefService* prefs) + : store_(store), prefs_(prefs) { + store_->GetBlacklistLogins(this); + } + ~BlacklistedCredentialsCleaner() override = default; + + void OnGetPasswordStoreResults( + std::vector<std::unique_ptr<autofill::PasswordForm>> results) override { + bool cleaned_something = false; + for (const auto& form : results) { + DCHECK(form->blacklisted_by_user); + if (!form->username_value.empty() || !form->password_value.empty()) { + cleaned_something = true; + store_->RemoveLogin(*form); + form->username_value.clear(); + form->password_value.clear(); + store_->AddLogin(*form); + } + } + + // Update the pref if no forms were handled. The password store is async, + // therefore, one can't be sure that the changes applied cleanly. + if (!cleaned_something) { + prefs_->SetBoolean( + password_manager::prefs::kBlacklistedCredentialsStripped, true); + } + delete this; + } + + private: + password_manager::PasswordStore* store_; + PrefService* prefs_; + + DISALLOW_COPY_AND_ASSIGN(BlacklistedCredentialsCleaner); +}; + +void StartCleaningBlacklisted( + const scoped_refptr<password_manager::PasswordStore>& store, + PrefService* prefs) { + // The object will delete itself once the credentials are retrieved. + new BlacklistedCredentialsCleaner(store.get(), prefs); +} + +} // namespace password_manager::PasswordSyncState GetPasswordSyncState( const syncer::SyncService* sync_service) { @@ -128,4 +183,21 @@ autofill::password_generation::PASSWORD_GENERATION_CONTEXT_MENU_PRESSED); } +void CleanUserDataInBlacklistedCredentials( + password_manager::PasswordStore* store, + PrefService* prefs, + int delay_in_seconds) { + bool need_to_clean = !prefs->GetBoolean( + password_manager::prefs::kBlacklistedCredentialsStripped); + UMA_HISTOGRAM_BOOLEAN("PasswordManager.BlacklistedSites.NeedToBeCleaned", + need_to_clean); + if (need_to_clean) { + base::SequencedTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, + base::BindOnce(&StartCleaningBlacklisted, base::WrapRefCounted(store), + prefs), + base::TimeDelta::FromSeconds(delay_in_seconds)); + } +} + } // namespace password_manager_util
diff --git a/components/password_manager/core/browser/password_manager_util.h b/components/password_manager/core/browser/password_manager_util.h index 1fa020d..07620f0e 100644 --- a/components/password_manager/core/browser/password_manager_util.h +++ b/components/password_manager/core/browser/password_manager_util.h
@@ -19,12 +19,15 @@ namespace password_manager { class PasswordManagerClient; +class PasswordStore; } namespace syncer { class SyncService; } +class PrefService; + namespace password_manager_util { // Reports whether and how passwords are currently synced. In particular, for a @@ -71,6 +74,13 @@ void UserTriggeredManualGenerationFromContextMenu( password_manager::PasswordManagerClient* password_manager_client); +// Clean up the blacklisted entries in the password store. Those shouldn't +// contain username/password pair. https://crbug.com/817754 +void CleanUserDataInBlacklistedCredentials( + password_manager::PasswordStore* store, + PrefService* prefs, + int delay_in_seconds); + } // namespace password_manager_util #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_UTIL_H_
diff --git a/components/password_manager/core/browser/password_manager_util_unittest.cc b/components/password_manager/core/browser/password_manager_util_unittest.cc index 8382700..3301b891 100644 --- a/components/password_manager/core/browser/password_manager_util_unittest.cc +++ b/components/password_manager/core/browser/password_manager_util_unittest.cc
@@ -8,17 +8,24 @@ #include "base/macros.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_task_environment.h" +#include "components/password_manager/core/browser/mock_password_store.h" #include "components/password_manager/core/browser/password_manager_test_utils.h" +#include "components/password_manager/core/common/password_manager_pref_names.h" +#include "components/prefs/pref_registry_simple.h" +#include "components/prefs/testing_pref_service.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +namespace password_manager_util { namespace { -const char kTestAndroidRealm[] = "android://hash@com.example.beta.android"; -const char kTestFederationURL[] = "https://google.com/"; -const char kTestUsername[] = "Username"; -const char kTestUsername2[] = "Username2"; -const char kTestPassword[] = "12345"; +constexpr char kTestAndroidRealm[] = "android://hash@com.example.beta.android"; +constexpr char kTestFederationURL[] = "https://google.com/"; +constexpr char kTestURL[] = "https://example.com/"; +constexpr char kTestUsername[] = "Username"; +constexpr char kTestUsername2[] = "Username2"; +constexpr char kTestPassword[] = "12345"; autofill::PasswordForm GetTestAndroidCredentials(const char* signon_realm) { autofill::PasswordForm form; @@ -29,9 +36,18 @@ return form; } +// The argument is std::vector<autofill::PasswordForm*>*. The caller is +// responsible for the lifetime of all the password forms. +ACTION_P(AppendForm, form) { + arg0->push_back(std::make_unique<autofill::PasswordForm>(form)); +} + } // namespace using password_manager::UnorderedPasswordFormElementsAre; +using testing::_; +using testing::DoAll; +using testing::Return; TEST(PasswordManagerUtil, TrimUsernameOnlyCredentials) { std::vector<std::unique_ptr<autofill::PasswordForm>> forms; @@ -55,7 +71,61 @@ expected_forms.push_back( std::make_unique<autofill::PasswordForm>(username_only)); - password_manager_util::TrimUsernameOnlyCredentials(&forms); + TrimUsernameOnlyCredentials(&forms); EXPECT_THAT(forms, UnorderedPasswordFormElementsAre(&expected_forms)); } + +TEST(PasswordManagerUtil, CleanBlacklistedUsernamePassword) { + autofill::PasswordForm blacklisted; + blacklisted.blacklisted_by_user = true; + blacklisted.signon_realm = kTestURL; + blacklisted.origin = GURL(kTestURL); + + autofill::PasswordForm blacklisted_with_username = blacklisted; + blacklisted_with_username.username_value = base::ASCIIToUTF16(kTestUsername); + + autofill::PasswordForm blacklisted_with_password = blacklisted; + blacklisted_with_password.password_value = base::ASCIIToUTF16(kTestPassword); + + base::test::ScopedTaskEnvironment scoped_task_environment; + TestingPrefServiceSimple prefs; + prefs.registry()->RegisterBooleanPref( + password_manager::prefs::kBlacklistedCredentialsStripped, false); + auto password_store = base::MakeRefCounted< + testing::StrictMock<password_manager::MockPasswordStore>>(); + ASSERT_TRUE( + password_store->Init(syncer::SyncableService::StartSyncFlare(), nullptr)); + + EXPECT_CALL(*password_store, FillBlacklistLogins(_)) + .WillOnce(DoAll(AppendForm(blacklisted), + AppendForm(blacklisted_with_username), + AppendForm(blacklisted_with_password), Return(true))); + // Wrong credentials are to be cleaned. + EXPECT_CALL(*password_store, RemoveLogin(blacklisted_with_username)); + EXPECT_CALL(*password_store, RemoveLogin(blacklisted_with_password)); + EXPECT_CALL(*password_store, AddLogin(blacklisted)).Times(2); + CleanUserDataInBlacklistedCredentials(password_store.get(), &prefs, 0); + scoped_task_environment.RunUntilIdle(); + + EXPECT_FALSE(prefs.GetBoolean( + password_manager::prefs::kBlacklistedCredentialsStripped)); + + // Clean up with no credentials to be updated. + EXPECT_CALL(*password_store, FillBlacklistLogins(_)) + .WillOnce(DoAll(AppendForm(blacklisted), Return(true))); + CleanUserDataInBlacklistedCredentials(password_store.get(), &prefs, 0); + scoped_task_environment.RunUntilIdle(); + + EXPECT_TRUE(prefs.GetBoolean( + password_manager::prefs::kBlacklistedCredentialsStripped)); + + // Clean up again. Nothing should happen. + EXPECT_CALL(*password_store, FillBlacklistLogins(_)).Times(0); + CleanUserDataInBlacklistedCredentials(password_store.get(), &prefs, 0); + scoped_task_environment.RunUntilIdle(); + + password_store->ShutdownOnUIThread(); +} + +} // namespace password_manager_util
diff --git a/components/password_manager/core/browser/password_store_consumer.h b/components/password_manager/core/browser/password_store_consumer.h index 19f942f9..780e587b 100644 --- a/components/password_manager/core/browser/password_store_consumer.h +++ b/components/password_manager/core/browser/password_store_consumer.h
@@ -46,8 +46,6 @@ return weak_ptr_factory_.GetWeakPtr(); } - bool HasWeakPtrs() const { return weak_ptr_factory_.HasWeakPtrs(); } - void CancelAllRequests(); protected:
diff --git a/components/password_manager/core/common/password_manager_pref_names.cc b/components/password_manager/core/common/password_manager_pref_names.cc index 6d8e945..6b982af 100644 --- a/components/password_manager/core/common/password_manager_pref_names.cc +++ b/components/password_manager/core/common/password_manager_pref_names.cc
@@ -28,9 +28,6 @@ const char kWasAutoSignInFirstRunExperienceShown[] = "profile.was_auto_sign_in_first_run_experience_shown"; -const char kWasObsoleteHttpDataCleaned[] = - "profile.was_obsolete_http_data_cleaned"; - const char kWasSignInPasswordPromoClicked[] = "profile.was_sign_in_password_promo_clicked"; @@ -42,5 +39,8 @@ const char kSyncPasswordLengthAndHashSalt[] = "profile.sync_password_length_and_hash_salt"; +const char kBlacklistedCredentialsStripped[] = + "profile.blacklisted_credentials_stripped"; + } // namespace prefs } // namespace password_manager
diff --git a/components/password_manager/core/common/password_manager_pref_names.h b/components/password_manager/core/common/password_manager_pref_names.h index 4a69c5d..4565ae8 100644 --- a/components/password_manager/core/common/password_manager_pref_names.h +++ b/components/password_manager/core/common/password_manager_pref_names.h
@@ -48,9 +48,6 @@ // prompt was shown or not. extern const char kWasAutoSignInFirstRunExperienceShown[]; -// Boolean that indicated if obsolete HTTP data has been cleaned in the past. -extern const char kWasObsoleteHttpDataCleaned[]; - // Boolean that indicated if user interacted with the Chrome Sign in promo. extern const char kWasSignInPasswordPromoClicked[]; @@ -65,6 +62,9 @@ // int>.<16 char salt>". extern const char kSyncPasswordLengthAndHashSalt[]; +// Whether Chrome cleaned up username/password in the blacklisted credentials. +extern const char kBlacklistedCredentialsStripped[]; + } // namespace prefs } // namespace password_manager
diff --git a/components/pdf/common/BUILD.gn b/components/pdf/common/BUILD.gn index 4d11977..1b045383d 100644 --- a/components/pdf/common/BUILD.gn +++ b/components/pdf/common/BUILD.gn
@@ -12,6 +12,7 @@ public_deps = [ "//third_party/WebKit/public:mojo_bindings", + "//ui/gfx/geometry/mojo", "//url/mojom:url_mojom_gurl", ]
diff --git a/components/policy/core/common/BUILD.gn b/components/policy/core/common/BUILD.gn index c7b73b79..f60a7ad 100644 --- a/components/policy/core/common/BUILD.gn +++ b/components/policy/core/common/BUILD.gn
@@ -146,7 +146,7 @@ "//components/data_use_measurement/core", "//components/json_schema", "//components/prefs", - "//extensions/features", + "//extensions/buildflags", "//google_apis", "//net", "//third_party/re2", @@ -283,7 +283,7 @@ source_set("unit_tests") { testonly = true sources = [ - "//extensions/features", + "//extensions/buildflags", "cloud/cloud_policy_client_unittest.cc", "cloud/cloud_policy_core_unittest.cc", "cloud/cloud_policy_manager_unittest.cc", @@ -357,7 +357,7 @@ "//base/test:test_support", "//components/policy:generated", "//components/prefs:test_support", - "//extensions/features", + "//extensions/buildflags", "//google_apis", "//net:test_support", "//testing/gmock",
diff --git a/components/policy/core/common/DEPS b/components/policy/core/common/DEPS index 9c603e3e..36bb2216 100644 --- a/components/policy/core/common/DEPS +++ b/components/policy/core/common/DEPS
@@ -2,5 +2,5 @@ "-components/policy/core/browser", "+components/crash/core/common/crash_key.h", # Remove once https://crbug.com/685996 is fixed. "+components/data_use_measurement/core", - "+extensions/features", + "+extensions/buildflags", ]
diff --git a/components/policy/core/common/schema_registry.cc b/components/policy/core/common/schema_registry.cc index d23f8db..e44f3d7 100644 --- a/components/policy/core/common/schema_registry.cc +++ b/components/policy/core/common/schema_registry.cc
@@ -5,7 +5,7 @@ #include "components/policy/core/common/schema_registry.h" #include "base/logging.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" namespace policy {
diff --git a/components/policy/core/common/schema_registry_unittest.cc b/components/policy/core/common/schema_registry_unittest.cc index b9fdbf1..062da926 100644 --- a/components/policy/core/common/schema_registry_unittest.cc +++ b/components/policy/core/common/schema_registry_unittest.cc
@@ -8,7 +8,7 @@ #include "components/policy/core/common/policy_namespace.h" #include "components/policy/core/common/schema.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto index b1625fa9..cc65cd0 100644 --- a/components/policy/proto/device_management_backend.proto +++ b/components/policy/proto/device_management_backend.proto
@@ -1531,22 +1531,23 @@ // Event type. Set for all log events. optional EventType event_type = 2; - // System state. Set for event types SERVER_REQUEST, - // CLOUDDPS_RESPONSE and SUCCESS. - optional SystemState system_state = 3; + // Total and available space on the stateful partition, in bytes. Set for + // event types SERVER_REQUEST, CLOUDDPS_RESPONSE and SUCCESS. + optional int64 stateful_total = 3; + optional int64 stateful_free = 4; // CloudDPS response. Set for event type CLOUDDPS_RESPONSE. - optional int32 clouddps_response = 4; + optional int32 clouddps_response = 5; // Log line written by Phonesky. Set for event type PHONESKY_LOG. - optional string phonesky_log = 5; + optional string phonesky_log = 6; // Network state. Set for event type SESSION_STATE_CHANGE of type LOGIN and // CONNECTIVITY_CHANGE. - optional bool online = 6; + optional bool online = 7; // Type of session state change. Set for event type SESSION_STATE_CHANGE. - optional SessionStateChangeType session_state_change_type = 7; + optional SessionStateChangeType session_state_change_type = 8; } // Log bucket for an app.
diff --git a/components/spellcheck/common/BUILD.gn b/components/spellcheck/common/BUILD.gn index 05c37de39..9bc49da 100644 --- a/components/spellcheck/common/BUILD.gn +++ b/components/spellcheck/common/BUILD.gn
@@ -42,6 +42,7 @@ public_deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", ] enabled_features = []
diff --git a/components/sync/BUILD.gn b/components/sync/BUILD.gn index 38ecd72..fcc1896 100644 --- a/components/sync/BUILD.gn +++ b/components/sync/BUILD.gn
@@ -720,6 +720,8 @@ "model/fake_sync_change_processor.h", "model/fake_syncable_service.cc", "model/fake_syncable_service.h", + "model/mock_model_type_change_processor.cc", + "model/mock_model_type_change_processor.h", "model/model_type_store_test_util.cc", "model/model_type_store_test_util.h", "model/recording_model_type_change_processor.cc",
diff --git a/components/sync/model/mock_model_type_change_processor.cc b/components/sync/model/mock_model_type_change_processor.cc new file mode 100644 index 0000000..fdf7d4e --- /dev/null +++ b/components/sync/model/mock_model_type_change_processor.cc
@@ -0,0 +1,93 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/sync/model/mock_model_type_change_processor.h" + +#include <utility> + +#include "base/bind.h" +#include "base/memory/ptr_util.h" +#include "components/sync/model/metadata_batch.h" + +namespace syncer { +namespace { + +class ForwardingModelTypeChangeProcessor : public ModelTypeChangeProcessor { + public: + // |other| must not be nullptr and must outlive this object. + explicit ForwardingModelTypeChangeProcessor(ModelTypeChangeProcessor* other) + : other_(other) {} + ~ForwardingModelTypeChangeProcessor() override{}; + + void Put(const std::string& client_tag, + std::unique_ptr<EntityData> entity_data, + MetadataChangeList* metadata_change_list) override { + other_->Put(client_tag, std::move(entity_data), metadata_change_list); + } + + void Delete(const std::string& client_tag, + MetadataChangeList* metadata_change_list) override { + other_->Delete(client_tag, metadata_change_list); + } + + void UpdateStorageKey(const EntityData& entity_data, + const std::string& storage_key, + MetadataChangeList* metadata_change_list) override { + other_->UpdateStorageKey(entity_data, storage_key, metadata_change_list); + } + + void UntrackEntity(const EntityData& entity_data) override { + other_->UntrackEntity(entity_data); + } + + void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override { + other_->ModelReadyToSync(std::move(batch)); + } + + void OnSyncStarting(const ModelErrorHandler& error_handler, + const StartCallback& callback) override { + other_->OnSyncStarting(error_handler, callback); + } + + void DisableSync() override { other_->DisableSync(); } + + bool IsTrackingMetadata() override { return other_->IsTrackingMetadata(); } + + void ReportError(const ModelError& error) override { + other_->ReportError(error); + } + + private: + ModelTypeChangeProcessor* other_; +}; + +} // namespace + +MockModelTypeChangeProcessor::MockModelTypeChangeProcessor() {} + +MockModelTypeChangeProcessor::~MockModelTypeChangeProcessor() {} + +void MockModelTypeChangeProcessor::Put( + const std::string& storage_key, + std::unique_ptr<EntityData> entity_data, + MetadataChangeList* metadata_change_list) { + DoPut(storage_key, entity_data.get(), metadata_change_list); +} + +void MockModelTypeChangeProcessor::ModelReadyToSync( + std::unique_ptr<MetadataBatch> batch) { + DoModelReadyToSync(batch.get()); +} + +ModelTypeSyncBridge::ChangeProcessorFactory +MockModelTypeChangeProcessor::FactoryForBridgeTest() { + return base::BindRepeating( + [](ModelTypeChangeProcessor* processor, ModelType, ModelTypeSyncBridge*) { + return base::WrapUnique<ModelTypeChangeProcessor>( + new ForwardingModelTypeChangeProcessor(processor)); + }, + base::Unretained(this)); +} + +} // namespace syncer
diff --git a/components/sync/model/mock_model_type_change_processor.h b/components/sync/model/mock_model_type_change_processor.h new file mode 100644 index 0000000..289886b2 --- /dev/null +++ b/components/sync/model/mock_model_type_change_processor.h
@@ -0,0 +1,57 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_SYNC_MODEL_MOCK_MODEL_TYPE_CHANGE_PROCESSOR_H_ +#define COMPONENTS_SYNC_MODEL_MOCK_MODEL_TYPE_CHANGE_PROCESSOR_H_ + +#include <memory> +#include <string> + +#include "components/sync/model/model_type_change_processor.h" +#include "components/sync/model/model_type_sync_bridge.h" +#include "testing/gmock/include/gmock/gmock.h" + +namespace syncer { + +class MockModelTypeChangeProcessor : public ModelTypeChangeProcessor { + public: + MockModelTypeChangeProcessor(); + virtual ~MockModelTypeChangeProcessor(); + + // TODO(crbug.com/729950): Use unique_ptr here direclty once move-only + // arguments are supported in gMock. + MOCK_METHOD3(DoPut, + void(const std::string& storage_key, + EntityData* entity_data, + MetadataChangeList* metadata_change_list)); + void Put(const std::string& storage_key, + std::unique_ptr<EntityData> entity_data, + MetadataChangeList* metadata_change_list) override; + MOCK_METHOD2(Delete, + void(const std::string& storage_key, + MetadataChangeList* metadata_change_list)); + MOCK_METHOD3(UpdateStorageKey, + void(const EntityData& entity_data, + const std::string& storage_key, + MetadataChangeList* metadata_change_list)); + MOCK_METHOD1(UntrackEntity, void(const EntityData& entity_data)); + // TODO(crbug.com/729950): Use unique_ptr here direclty once move-only + // arguments are supported in gMock. + MOCK_METHOD1(DoModelReadyToSync, void(MetadataBatch* batch)); + void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override; + MOCK_METHOD2(OnSyncStarting, + void(const ModelErrorHandler& error_handler, + const StartCallback& callback)); + MOCK_METHOD0(DisableSync, void()); + MOCK_METHOD0(IsTrackingMetadata, bool()); + MOCK_METHOD1(ReportError, void(const ModelError& error)); + + // Returns a callback that constructs a processor that forwards all calls to + // |this|. |*this| must outlive the returned factory. + ModelTypeSyncBridge::ChangeProcessorFactory FactoryForBridgeTest(); +}; + +} // namespace syncer + +#endif // COMPONENTS_SYNC_MODEL_MOCK_MODEL_TYPE_CHANGE_PROCESSOR_H_
diff --git a/components/sync/model/model_type_sync_bridge_unittest.cc b/components/sync/model/model_type_sync_bridge_unittest.cc index 44ba0ff..8297a25 100644 --- a/components/sync/model/model_type_sync_bridge_unittest.cc +++ b/components/sync/model/model_type_sync_bridge_unittest.cc
@@ -7,8 +7,9 @@ #include <utility> #include "base/bind.h" -#include "components/sync/model/fake_model_type_change_processor.h" +#include "base/bind_helpers.h" #include "components/sync/model/metadata_batch.h" +#include "components/sync/model/mock_model_type_change_processor.h" #include "components/sync/model/stub_model_type_sync_bridge.h" #include "components/sync/protocol/model_type_state.pb.h" #include "testing/gmock/include/gmock/gmock.h" @@ -17,149 +18,56 @@ namespace syncer { namespace { -// A mock MTCP that lets verify DisableSync and ModelReadyToSync were called in -// the ways that we expect. -class MockModelTypeChangeProcessor : public FakeModelTypeChangeProcessor { - public: - explicit MockModelTypeChangeProcessor(const base::Closure& disabled_callback) - : disabled_callback_(disabled_callback) {} - ~MockModelTypeChangeProcessor() override {} +using testing::Return; +using testing::_; - void DisableSync() override { disabled_callback_.Run(); } - - bool IsTrackingMetadata() override { return metadata_batch_ != nullptr; } - - void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override { - EXPECT_NE(nullptr, batch); - metadata_batch_ = std::move(batch); - } - - MetadataBatch* metadata_batch() { return metadata_batch_.get(); } - - private: - // This callback is invoked when DisableSync() is called, instead of - // remembering that this event happened in our own state. The reason for this - // is that after DisableSync() is called on us, the bridge is going to - // destroy this processor instance, and any state would be lost. The callback - // allows this information to reach somewhere safe instead. - base::Closure disabled_callback_; - - std::unique_ptr<MetadataBatch> metadata_batch_; -}; - -class MockModelTypeSyncBridge : public StubModelTypeSyncBridge { - public: - MockModelTypeSyncBridge() - : StubModelTypeSyncBridge( - base::Bind(&MockModelTypeSyncBridge::CreateProcessor, - base::Unretained(this))) {} - ~MockModelTypeSyncBridge() override {} - - MockModelTypeChangeProcessor* change_processor() const { - return static_cast<MockModelTypeChangeProcessor*>( - ModelTypeSyncBridge::change_processor()); - } - - bool processor_disable_sync_called() const { - return processor_disable_sync_called_; - } - - private: - std::unique_ptr<ModelTypeChangeProcessor> CreateProcessor( - ModelType type, - ModelTypeSyncBridge* bridge) { - return std::make_unique<MockModelTypeChangeProcessor>( - base::Bind(&MockModelTypeSyncBridge::OnProcessorDisableSync, - base::Unretained(this))); - } - - void OnProcessorDisableSync() { processor_disable_sync_called_ = true; } - - bool processor_disable_sync_called_ = false; -}; +MATCHER(IsEmptyMetadataBatch, "") { + return arg != nullptr && + sync_pb::ModelTypeState().SerializeAsString() == + arg->GetModelTypeState().SerializeAsString() && + arg->TakeAllMetadata().empty(); +} class ModelTypeSyncBridgeTest : public ::testing::Test { public: - ModelTypeSyncBridgeTest() {} + ModelTypeSyncBridgeTest() : bridge_(mock_processor_.FactoryForBridgeTest()) {} ~ModelTypeSyncBridgeTest() override {} void OnSyncStarting() { - bridge_.OnSyncStarting( - ModelErrorHandler(), - base::Bind(&ModelTypeSyncBridgeTest::OnProcessorStarted, - base::Unretained(this))); + bridge_.OnSyncStarting(ModelErrorHandler(), base::DoNothing()); } - bool start_callback_called() const { return start_callback_called_; } - MockModelTypeSyncBridge* bridge() { return &bridge_; } + StubModelTypeSyncBridge* bridge() { return &bridge_; } + MockModelTypeChangeProcessor* processor() { return &mock_processor_; } private: - void OnProcessorStarted( - std::unique_ptr<ActivationContext> activation_context) { - start_callback_called_ = true; - } - - bool start_callback_called_ = false; - MockModelTypeSyncBridge bridge_; + testing::NiceMock<MockModelTypeChangeProcessor> mock_processor_; + StubModelTypeSyncBridge bridge_; }; // OnSyncStarting should create a processor and call OnSyncStarting on it. TEST_F(ModelTypeSyncBridgeTest, OnSyncStarting) { - EXPECT_FALSE(start_callback_called()); + EXPECT_CALL(*processor(), OnSyncStarting(_, _)); OnSyncStarting(); - - // FakeModelTypeProcessor is the one that calls the callback, so if it was - // called then we know the call on the processor was made. - EXPECT_TRUE(start_callback_called()); } -// DisableSync should call DisableSync on the processor and then delete it. +// DisableSync should call DisableSync on the processor. TEST_F(ModelTypeSyncBridgeTest, DisableSync) { - ASSERT_FALSE(bridge()->processor_disable_sync_called()); + EXPECT_CALL(*processor(), DisableSync()); bridge()->DisableSync(); - - // Disabling also wipes out metadata, and the bridge should have told the new - // processor about this. - EXPECT_TRUE(bridge()->processor_disable_sync_called()); - EXPECT_EQ(nullptr, bridge()->change_processor()->metadata_batch()); } // DisableSync should propagate the model readiness (IsTrackingMetadata()). TEST_F(ModelTypeSyncBridgeTest, PropagateModelReadyToSyncInDisableSync) { - ASSERT_EQ(nullptr, bridge()->change_processor()->metadata_batch()); - ASSERT_FALSE(bridge()->change_processor()->IsTrackingMetadata()); - // Model is not ready to sync, so it should remain so after DisableSync(). + ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(false)); + EXPECT_CALL(*processor(), DoModelReadyToSync(_)).Times(0); bridge()->DisableSync(); - EXPECT_EQ(nullptr, bridge()->change_processor()->metadata_batch()); - EXPECT_FALSE(bridge()->change_processor()->IsTrackingMetadata()); - // Mimic the model being ready to sync. - sync_pb::ModelTypeState initial_state; - initial_state.set_initial_sync_done(true); - auto initial_batch = std::make_unique<MetadataBatch>(); - initial_batch->SetModelTypeState(initial_state); - bridge()->change_processor()->ModelReadyToSync(std::move(initial_batch)); - - ASSERT_TRUE(bridge()->change_processor()->IsTrackingMetadata()); - ASSERT_NE(nullptr, bridge()->change_processor()->metadata_batch()); - ASSERT_TRUE(bridge() - ->change_processor() - ->metadata_batch() - ->GetModelTypeState() - .initial_sync_done()); - - // Model is ready to sync, so it should remain so after DisableSync(). - // However, the metadata should have been cleared. + // If the Model is ready to sync, so it should remain so after DisableSync(). + ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(true)); + EXPECT_CALL(*processor(), DoModelReadyToSync(IsEmptyMetadataBatch())); bridge()->DisableSync(); - EXPECT_TRUE(bridge()->change_processor()->IsTrackingMetadata()); - MetadataBatch* batch = bridge()->change_processor()->metadata_batch(); - ASSERT_NE(nullptr, batch); - - EXPECT_FALSE(batch->GetModelTypeState().initial_sync_done()); - EXPECT_EQ(sync_pb::ModelTypeState().SerializeAsString(), - batch->GetModelTypeState().SerializeAsString()); - EXPECT_EQ(0U, batch->TakeAllMetadata().size()); } // ResolveConflicts should return USE_REMOTE unless the remote data is deleted.
diff --git a/components/sync/model_impl/client_tag_based_model_type_processor.cc b/components/sync/model_impl/client_tag_based_model_type_processor.cc index 30cdd08..f634fd8 100644 --- a/components/sync/model_impl/client_tag_based_model_type_processor.cc +++ b/components/sync/model_impl/client_tag_based_model_type_processor.cc
@@ -117,6 +117,9 @@ // First time syncing; initialize metadata. model_type_state_.mutable_progress_marker()->set_data_type_id( GetSpecificsFieldNumberFromModelType(type_)); + // For commit-only types, no updates are expected and hence we can consider + // initial_sync_done(). + model_type_state_.set_initial_sync_done(commit_only_); } ConnectIfReady();
diff --git a/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc b/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc index f7be613..a36ee5a 100644 --- a/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc +++ b/components/sync/model_impl/client_tag_based_model_type_processor_unittest.cc
@@ -713,6 +713,7 @@ TEST_F(ClientTagBasedModelTypeProcessorTest, CommitOnlySimple) { ResetState(false, true); InitializeToReadyState(); + EXPECT_TRUE(db().model_type_state().initial_sync_done()); bridge()->WriteItem(kKey1, kValue1); worker()->VerifyPendingCommits({kHash1});
diff --git a/components/sync/user_events/user_event_sync_bridge.cc b/components/sync/user_events/user_event_sync_bridge.cc index 797310b..62ef2a0 100644 --- a/components/sync/user_events/user_event_sync_bridge.cc +++ b/components/sync/user_events/user_event_sync_bridge.cc
@@ -145,6 +145,7 @@ } void UserEventSyncBridge::DisableSync() { + ModelTypeSyncBridge::DisableSync(); // No data should be retained through sign out. store_->ReadAllData(base::BindOnce( &UserEventSyncBridge::OnReadAllDataToDelete, base::AsWeakPtr(this))); @@ -213,15 +214,6 @@ if (error) { change_processor()->ReportError(*error); } else { - if (!metadata_batch->GetModelTypeState().initial_sync_done()) { - // We have never initialized before, force it to true. We are not going to - // ever have a GetUpdates because our type is commit only. - // TODO(skym): Do we need to worry about saving this back ourselves? Or - // does that get taken care for us? - ModelTypeState state = metadata_batch->GetModelTypeState(); - state.set_initial_sync_done(true); - metadata_batch->SetModelTypeState(state); - } change_processor()->ModelReadyToSync(std::move(metadata_batch)); } }
diff --git a/components/sync/user_events/user_event_sync_bridge_unittest.cc b/components/sync/user_events/user_event_sync_bridge_unittest.cc index 47862ec8..6e631ca 100644 --- a/components/sync/user_events/user_event_sync_bridge_unittest.cc +++ b/components/sync/user_events/user_event_sync_bridge_unittest.cc
@@ -13,50 +13,45 @@ #include "base/run_loop.h" #include "components/sync/driver/fake_sync_service.h" #include "components/sync/model/data_batch.h" +#include "components/sync/model/mock_model_type_change_processor.h" #include "components/sync/model/model_type_store_test_util.h" -#include "components/sync/model/recording_model_type_change_processor.h" #include "components/sync/protocol/sync.pb.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using sync_pb::UserEventSpecifics; - namespace syncer { - namespace { -void VerifyEqual(const UserEventSpecifics& s1, const UserEventSpecifics& s2) { - EXPECT_EQ(s1.event_time_usec(), s2.event_time_usec()); - EXPECT_EQ(s1.navigation_id(), s2.navigation_id()); - EXPECT_EQ(s1.session_id(), s2.session_id()); -} +using sync_pb::UserEventSpecifics; +using testing::ElementsAre; +using testing::Invoke; +using testing::IsEmpty; +using testing::IsNull; +using testing::NotNull; +using testing::Pair; +using testing::Pointee; +using testing::Return; +using testing::SaveArg; +using testing::SizeIs; +using testing::UnorderedElementsAre; +using testing::_; -void VerifyDataBatchCount(int expected_count, - std::unique_ptr<DataBatch> batch) { - int actual_count = 0; - while (batch->HasNext()) { - ++actual_count; - batch->Next(); +MATCHER_P(MatchesUserEvent, expected, "") { + if (!arg.has_user_event()) { + *result_listener << "which is not a user event"; + return false; } - EXPECT_EQ(expected_count, actual_count); -} - -void VerifyDataBatch(std::map<std::string, UserEventSpecifics> expected, - std::unique_ptr<DataBatch> batch) { - while (batch->HasNext()) { - const KeyAndData& pair = batch->Next(); - auto iter = expected.find(pair.first); - ASSERT_NE(iter, expected.end()); - VerifyEqual(iter->second, pair.second->specifics.user_event()); - // Removing allows us to verify we don't see the same item multiple times, - // and that we saw everything we expected. - expected.erase(iter); + const UserEventSpecifics& actual = arg.user_event(); + if (actual.event_time_usec() != expected.event_time_usec()) { + return false; } - EXPECT_TRUE(expected.empty()); -} - -base::Callback<void(std::unique_ptr<DataBatch> batch)> VerifyCallback( - std::map<std::string, UserEventSpecifics> expected) { - return base::Bind(&VerifyDataBatch, expected); + if (actual.navigation_id() != expected.navigation_id()) { + return false; + } + if (actual.session_id() != expected.session_id()) { + return false; + } + return true; } UserEventSpecifics CreateSpecifics(int64_t event_time_usec, @@ -102,14 +97,8 @@ UserEventSyncBridgeTest() { bridge_ = std::make_unique<UserEventSyncBridge>( ModelTypeStoreTestUtil::FactoryForInMemoryStoreForTest(), - RecordingModelTypeChangeProcessor::FactoryForBridgeTest(&processor_), - &test_global_id_mapper_); - } - - ~UserEventSyncBridgeTest() override { - // Get[All]Data() calls are async, so this will run the verification they - // call in their callbacks. - base::RunLoop().RunUntilIdle(); + mock_processor_.FactoryForBridgeTest(), &test_global_id_mapper_); + ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(true)); } std::string GetStorageKey(const UserEventSpecifics& specifics) { @@ -119,67 +108,135 @@ } UserEventSyncBridge* bridge() { return bridge_.get(); } - RecordingModelTypeChangeProcessor* processor() { return processor_; } + MockModelTypeChangeProcessor* processor() { return &mock_processor_; } TestGlobalIdMapper* mapper() { return &test_global_id_mapper_; } + std::map<std::string, sync_pb::EntitySpecifics> GetAllData() { + base::RunLoop loop; + std::unique_ptr<DataBatch> batch; + bridge_->GetAllData(base::BindOnce( + [](base::RunLoop* loop, std::unique_ptr<DataBatch>* out_batch, + std::unique_ptr<DataBatch> batch) { + *out_batch = std::move(batch); + loop->Quit(); + }, + &loop, &batch)); + loop.Run(); + EXPECT_NE(nullptr, batch); + + std::map<std::string, sync_pb::EntitySpecifics> storage_key_to_specifics; + if (batch != nullptr) { + while (batch->HasNext()) { + const syncer::KeyAndData& pair = batch->Next(); + storage_key_to_specifics[pair.first] = pair.second->specifics; + } + } + return storage_key_to_specifics; + } + + std::unique_ptr<sync_pb::EntitySpecifics> GetData( + const std::string& storage_key) { + base::RunLoop loop; + std::unique_ptr<DataBatch> batch; + bridge_->GetData( + {storage_key}, + base::BindOnce( + [](base::RunLoop* loop, std::unique_ptr<DataBatch>* out_batch, + std::unique_ptr<DataBatch> batch) { + *out_batch = std::move(batch); + loop->Quit(); + }, + &loop, &batch)); + loop.Run(); + EXPECT_NE(nullptr, batch); + + std::unique_ptr<sync_pb::EntitySpecifics> specifics; + if (batch != nullptr && batch->HasNext()) { + const syncer::KeyAndData& pair = batch->Next(); + specifics = + std::make_unique<sync_pb::EntitySpecifics>(pair.second->specifics); + EXPECT_FALSE(batch->HasNext()); + } + return specifics; + } + private: std::unique_ptr<UserEventSyncBridge> bridge_; - RecordingModelTypeChangeProcessor* processor_; + testing::NiceMock<MockModelTypeChangeProcessor> mock_processor_; TestGlobalIdMapper test_global_id_mapper_; base::MessageLoop message_loop_; }; TEST_F(UserEventSyncBridgeTest, MetadataIsInitialized) { + EXPECT_CALL(*processor(), DoModelReadyToSync(NotNull())); base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(processor()->metadata()->GetModelTypeState().initial_sync_done()); } TEST_F(UserEventSyncBridgeTest, SingleRecord) { const UserEventSpecifics specifics(CreateSpecifics(1u, 2u, 3u)); + std::string storage_key; + EXPECT_CALL(*processor(), DoPut(_, _, _)).WillOnce(SaveArg<0>(&storage_key)); bridge()->RecordUserEvent(std::make_unique<UserEventSpecifics>(specifics)); - EXPECT_EQ(1u, processor()->put_multimap().size()); - const std::string storage_key = processor()->put_multimap().begin()->first; - bridge()->GetData({storage_key}, VerifyCallback({{storage_key, specifics}})); - bridge()->GetData({"bogus"}, base::Bind(&VerifyDataBatchCount, 0)); - bridge()->GetAllData(VerifyCallback({{storage_key, specifics}})); + EXPECT_THAT(GetData(storage_key), Pointee(MatchesUserEvent(specifics))); + EXPECT_THAT(GetData("bogus"), IsNull()); + EXPECT_THAT(GetAllData(), + ElementsAre(Pair(storage_key, MatchesUserEvent(specifics)))); +} +TEST_F(UserEventSyncBridgeTest, DisableSync) { + const UserEventSpecifics specifics(CreateSpecifics(1u, 2u, 3u)); + bridge()->RecordUserEvent(std::make_unique<UserEventSpecifics>(specifics)); + ASSERT_THAT(GetAllData(), SizeIs(1)); + + EXPECT_CALL(*processor(), DisableSync()); bridge()->DisableSync(); // Disabling deletes records through multiple round trips, if we quickly call // GetAllData() we're going to beat the deletions to the storage task. base::RunLoop().RunUntilIdle(); - bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 0)); - EXPECT_EQ(0u, processor()->delete_set().size()); + EXPECT_THAT(GetAllData(), IsEmpty()); } TEST_F(UserEventSyncBridgeTest, MultipleRecords) { + std::set<std::string> unique_storage_keys; + EXPECT_CALL(*processor(), DoPut(_, _, _)) + .Times(4) + .WillRepeatedly( + Invoke([&unique_storage_keys]( + const std::string& storage_key, EntityData* entity_data, + MetadataChangeList* metadata_change_list) { + unique_storage_keys.insert(storage_key); + })); + bridge()->RecordUserEvent(SpecificsUniquePtr(1u, 1u, 1u)); bridge()->RecordUserEvent(SpecificsUniquePtr(1u, 1u, 2u)); bridge()->RecordUserEvent(SpecificsUniquePtr(1u, 2u, 2u)); bridge()->RecordUserEvent(SpecificsUniquePtr(2u, 2u, 2u)); - EXPECT_EQ(4u, processor()->put_multimap().size()); - std::set<std::string> unique_storage_keys; - for (const auto& kv : processor()->put_multimap()) { - unique_storage_keys.insert(kv.first); - } EXPECT_EQ(2u, unique_storage_keys.size()); - bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 2)); + EXPECT_THAT(GetAllData(), SizeIs(2)); } TEST_F(UserEventSyncBridgeTest, ApplySyncChanges) { + std::string storage_key1; + std::string storage_key2; + EXPECT_CALL(*processor(), DoPut(_, _, _)) + .WillOnce(SaveArg<0>(&storage_key1)) + .WillOnce(SaveArg<0>(&storage_key2)); + bridge()->RecordUserEvent(SpecificsUniquePtr(1u, 1u, 1u)); bridge()->RecordUserEvent(SpecificsUniquePtr(2u, 2u, 2u)); - bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 2)); + EXPECT_THAT(GetAllData(), SizeIs(2)); - const std::string storage_key = processor()->put_multimap().begin()->first; auto error_on_delete = bridge()->ApplySyncChanges(bridge()->CreateMetadataChangeList(), - {EntityChange::CreateDelete(storage_key)}); + {EntityChange::CreateDelete(storage_key1)}); EXPECT_FALSE(error_on_delete); - bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 1)); + EXPECT_THAT(GetAllData(), SizeIs(1)); + EXPECT_THAT(GetData(storage_key1), IsNull()); + EXPECT_THAT(GetData(storage_key2), NotNull()); } TEST_F(UserEventSyncBridgeTest, HandleGlobalIdChange) { @@ -188,31 +245,34 @@ int64_t third_id = 13; int64_t fourth_id = 14; + std::string storage_key; + EXPECT_CALL(*processor(), DoPut(_, _, _)).WillOnce(SaveArg<0>(&storage_key)); + // This id update should be applied to the event as it is initially recorded. mapper()->ChangeId(first_id, second_id); bridge()->RecordUserEvent(SpecificsUniquePtr(1u, first_id, 2u)); - const std::string storage_key = processor()->put_multimap().begin()->first; - EXPECT_EQ(1u, processor()->put_multimap().size()); - bridge()->GetAllData( - VerifyCallback({{storage_key, CreateSpecifics(1u, second_id, 2u)}})); + EXPECT_THAT(GetAllData(), + ElementsAre(Pair(storage_key, MatchesUserEvent(CreateSpecifics( + 1u, second_id, 2u))))); // This id update is done while the event is "in flight", and should result in // it being updated and re-sent to sync. + EXPECT_CALL(*processor(), DoPut(storage_key, _, _)); mapper()->ChangeId(second_id, third_id); - EXPECT_EQ(2u, processor()->put_multimap().size()); - bridge()->GetAllData( - VerifyCallback({{storage_key, CreateSpecifics(1u, third_id, 2u)}})); + EXPECT_THAT(GetAllData(), + ElementsAre(Pair(storage_key, MatchesUserEvent(CreateSpecifics( + 1u, third_id, 2u))))); auto error_on_delete = bridge()->ApplySyncChanges(bridge()->CreateMetadataChangeList(), {EntityChange::CreateDelete(storage_key)}); EXPECT_FALSE(error_on_delete); - bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 0)); + EXPECT_THAT(GetAllData(), IsEmpty()); // This id update should be ignored, since we received commit confirmation // above. + EXPECT_CALL(*processor(), DoPut(_, _, _)).Times(0); mapper()->ChangeId(third_id, fourth_id); - EXPECT_EQ(2u, processor()->put_multimap().size()); - bridge()->GetAllData(base::Bind(&VerifyDataBatchCount, 0)); + EXPECT_THAT(GetAllData(), IsEmpty()); } TEST_F(UserEventSyncBridgeTest, MulipleEventsChanging) { @@ -220,37 +280,46 @@ int64_t second_id = 12; int64_t third_id = 13; int64_t fourth_id = 14; - const UserEventSpecifics specifics1 = CreateSpecifics(1u, first_id, 2u); - const UserEventSpecifics specifics2 = CreateSpecifics(1u, first_id, 2u); - const UserEventSpecifics specifics3 = CreateSpecifics(1u, first_id, 2u); + const UserEventSpecifics specifics1 = CreateSpecifics(101u, first_id, 2u); + const UserEventSpecifics specifics2 = CreateSpecifics(102u, second_id, 4u); + const UserEventSpecifics specifics3 = CreateSpecifics(103u, third_id, 6u); const std::string key1 = GetStorageKey(specifics1); const std::string key2 = GetStorageKey(specifics2); const std::string key3 = GetStorageKey(specifics3); + ASSERT_NE(key1, key2); + ASSERT_NE(key1, key3); + ASSERT_NE(key2, key3); bridge()->RecordUserEvent(std::make_unique<UserEventSpecifics>(specifics1)); bridge()->RecordUserEvent(std::make_unique<UserEventSpecifics>(specifics2)); bridge()->RecordUserEvent(std::make_unique<UserEventSpecifics>(specifics3)); - bridge()->GetAllData(VerifyCallback( - {{key1, specifics1}, {key2, specifics2}, {key3, specifics3}})); + ASSERT_THAT(GetAllData(), + UnorderedElementsAre(Pair(key1, MatchesUserEvent(specifics1)), + Pair(key2, MatchesUserEvent(specifics2)), + Pair(key3, MatchesUserEvent(specifics3)))); mapper()->ChangeId(second_id, fourth_id); - bridge()->GetAllData( - VerifyCallback({{key1, specifics1}, - {key2, CreateSpecifics(3u, fourth_id, 4u)}, - {key3, specifics3}})); + EXPECT_THAT( + GetAllData(), + UnorderedElementsAre( + Pair(key1, MatchesUserEvent(specifics1)), + Pair(key2, MatchesUserEvent(CreateSpecifics(102u, fourth_id, 4u))), + Pair(key3, MatchesUserEvent(specifics3)))); mapper()->ChangeId(first_id, fourth_id); mapper()->ChangeId(third_id, fourth_id); - bridge()->GetAllData( - VerifyCallback({{key1, CreateSpecifics(1u, fourth_id, 2u)}, - {key2, CreateSpecifics(3u, fourth_id, 4u)}, - {key3, CreateSpecifics(5u, fourth_id, 6u)}})); + EXPECT_THAT( + GetAllData(), + UnorderedElementsAre( + Pair(key1, MatchesUserEvent(CreateSpecifics(101u, fourth_id, 2u))), + Pair(key2, MatchesUserEvent(CreateSpecifics(102u, fourth_id, 4u))), + Pair(key3, MatchesUserEvent(CreateSpecifics(103u, fourth_id, 6u))))); } TEST_F(UserEventSyncBridgeTest, RecordBeforeMetadataLoads) { - processor()->SetIsTrackingMetadata(false); + ON_CALL(*processor(), IsTrackingMetadata()).WillByDefault(Return(false)); bridge()->RecordUserEvent(SpecificsUniquePtr(1u, 2u, 3u)); - bridge()->GetAllData(VerifyCallback({})); + EXPECT_THAT(GetAllData(), IsEmpty()); } } // namespace
diff --git a/components/test/data/autofill/heuristics/input/117_cc_checkout_macys.com.html b/components/test/data/autofill/heuristics/input/117_cc_checkout_macys.com.html index 22fe92a..95833d7f 100644 --- a/components/test/data/autofill/heuristics/input/117_cc_checkout_macys.com.html +++ b/components/test/data/autofill/heuristics/input/117_cc_checkout_macys.com.html
@@ -241,7 +241,7 @@ </div> <div class="row"> <div class="small-4 small-offset-1 columns"> - <select name="creditCard.expMonth" id="rc-payment-card-month" aria-required="true" aria-label="”Expiration" date="" month”="" title="overall type: CREDIT_CARD_EXP_MONTH + <select name="creditCard.expMonth" id="rc-payment-card-month" aria-required="true" aria-label="Expiration" date="" month”="" title="overall type: CREDIT_CARD_EXP_MONTH server type: CREDIT_CARD_EXP_MONTH heuristic type: CREDIT_CARD_EXP_MONTH field signature: 989675451 @@ -274,7 +274,7 @@ </select> </div> <div class="small-5 columns end"> - <select name="creditCard.expYear" id="rc-payment-card-year" aria-required="true" aria-label="”Expiration" date="" year”="" title="overall type: CREDIT_CARD_EXP_4_DIGIT_YEAR + <select name="creditCard.expYear" id="rc-payment-card-year" aria-required="true" aria-label="Expiration" date="" year”="" title="overall type: CREDIT_CARD_EXP_4_DIGIT_YEAR server type: CREDIT_CARD_EXP_4_DIGIT_YEAR heuristic type: CREDIT_CARD_EXP_4_DIGIT_YEAR field signature: 891328465
diff --git a/components/test/data/autofill/heuristics/output/117_cc_checkout_macys.com.out b/components/test/data/autofill/heuristics/output/117_cc_checkout_macys.com.out index 5b5fa4876..b2a633d 100644 --- a/components/test/data/autofill/heuristics/output/117_cc_checkout_macys.com.out +++ b/components/test/data/autofill/heuristics/output/117_cc_checkout_macys.com.out
@@ -1,9 +1,9 @@ UNKNOWN_TYPE | payment.type | Credit Card | CREDITCARD | payment.type_1-default -UNKNOWN_TYPE | payment.type | Choose Payment Method | PAYPAL | payment.type_1-default +UNKNOWN_TYPE | payment.type | Paypal | PAYPAL | payment.type_1-default CREDIT_CARD_TYPE | creditCard.cardType.code | Card type | -1 | credit-card-cc CREDIT_CARD_NUMBER | creditCard.cardNumber | Card number | | credit-card-cc -CREDIT_CARD_EXP_MONTH | creditCard.expMonth | Expiration date | 01 | credit-card-cc -CREDIT_CARD_EXP_4_DIGIT_YEAR | creditCard.expYear | Expiration date | 2016 | credit-card-cc +CREDIT_CARD_EXP_MONTH | creditCard.expMonth | Expiration | 01 | credit-card-cc +CREDIT_CARD_EXP_4_DIGIT_YEAR | creditCard.expYear | Expiration | 2016 | credit-card-cc CREDIT_CARD_VERIFICATION_CODE | fake-password | Security code | | credit-card-cc CREDIT_CARD_VERIFICATION_CODE | creditCard.securityCode | Security code | | credit-card-cc UNKNOWN_TYPE | useMyShippingAddress | Use my shipping address | false | payment.type_1-default
diff --git a/components/test/data/autofill/heuristics/output/125_bug_462080.out b/components/test/data/autofill/heuristics/output/125_bug_462080.out index db9d620..d75977b 100644 --- a/components/test/data/autofill/heuristics/output/125_bug_462080.out +++ b/components/test/data/autofill/heuristics/output/125_bug_462080.out
@@ -1,5 +1,5 @@ -UNKNOWN_TYPE | | Copy link | | _1-default -UNKNOWN_TYPE | | Copy link | | _1-default +UNKNOWN_TYPE | | Link to share | | _1-default +UNKNOWN_TYPE | | Link to share | | _1-default UNKNOWN_TYPE | | Can edit Access level for invited people. | | _1-default UNKNOWN_TYPE | | Enter names or email addresses... | | _1-default UNKNOWN_TYPE | :z | Add a note | | _1-default
diff --git a/components/toolbar/BUILD.gn b/components/toolbar/BUILD.gn index 82cd988..d2859e4 100644 --- a/components/toolbar/BUILD.gn +++ b/components/toolbar/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/buildflag_header.gni") import("//build/config/ui.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//components/vector_icons/vector_icons.gni") buildflag_header("buildflags") {
diff --git a/components/translate/content/common/BUILD.gn b/components/translate/content/common/BUILD.gn index b9b11eb..0487c53 100644 --- a/components/translate/content/common/BUILD.gn +++ b/components/translate/content/common/BUILD.gn
@@ -11,6 +11,7 @@ public_deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//url/mojom:url_mojom_gurl", ] }
diff --git a/components/variations/BUILD.gn b/components/variations/BUILD.gn index bd2a7fbb..e919b97b 100644 --- a/components/variations/BUILD.gn +++ b/components/variations/BUILD.gn
@@ -48,6 +48,8 @@ "synthetic_trials_active_group_id_provider.h", "variations_associated_data.cc", "variations_associated_data.h", + "variations_crash_keys.cc", + "variations_crash_keys.h", "variations_experiment_util.cc", "variations_experiment_util.h", "variations_http_header_provider.cc", @@ -66,8 +68,6 @@ "variations_switches.h", "variations_url_constants.cc", "variations_url_constants.h", - "variations_util.cc", - "variations_util.h", ] if (is_android || is_ios) { @@ -133,6 +133,7 @@ "study_filtering_unittest.cc", "synthetic_trial_registry_unittest.cc", "variations_associated_data_unittest.cc", + "variations_crash_keys_unittest.cc", "variations_http_header_provider_unittest.cc", "variations_id_collection_unittest.cc", "variations_request_scheduler_unittest.cc", @@ -150,6 +151,7 @@ "net", "proto", "//base/test:test_support", + "//components/crash/core/common:crash_key", "//components/prefs:test_support", "//components/variations/field_trial_config:field_trial_config", "//testing/gmock",
diff --git a/components/variations/child_process_field_trial_syncer.cc b/components/variations/child_process_field_trial_syncer.cc index 9315825e..0694ccf8 100644 --- a/components/variations/child_process_field_trial_syncer.cc +++ b/components/variations/child_process_field_trial_syncer.cc
@@ -9,7 +9,7 @@ #include "base/base_switches.h" #include "base/command_line.h" -#include "components/variations/variations_util.h" +#include "components/variations/variations_crash_keys.h" namespace variations { @@ -22,7 +22,7 @@ void ChildProcessFieldTrialSyncer::InitFieldTrialObserving( const base::CommandLine& command_line) { // Set up initial set of crash dump data for field trials in this process. - SetVariationListCrashKeys(); + variations::InitCrashKeys(); // Listen for field trial activations to report them to the browser. base::FieldTrialList::AddObserver(observer_); @@ -54,7 +54,6 @@ // Ensure the trial is marked as "used" by calling group() on it if it is // marked as activated. trial->group(); - SetVariationListCrashKeys(); } } // namespace variations
diff --git a/components/variations/synthetic_trial_registry.h b/components/variations/synthetic_trial_registry.h index db37ade0..31e54ad 100644 --- a/components/variations/synthetic_trial_registry.h +++ b/components/variations/synthetic_trial_registry.h
@@ -40,6 +40,7 @@ RegisterSyntheticMultiGroupFieldTrial); FRIEND_TEST_ALL_PREFIXES(SyntheticTrialRegistryTest, GetSyntheticFieldTrialActiveGroups); + FRIEND_TEST_ALL_PREFIXES(VariationsCrashKeysTest, BasicFunctionality); // Registers a field trial name and group to be used to annotate a UMA report // with a particular Chrome configuration state. A UMA report will be
diff --git a/components/variations/synthetic_trial_registry_unittest.cc b/components/variations/synthetic_trial_registry_unittest.cc index e7ef847..d9623fb 100644 --- a/components/variations/synthetic_trial_registry_unittest.cc +++ b/components/variations/synthetic_trial_registry_unittest.cc
@@ -4,10 +4,14 @@ #include "components/variations/synthetic_trial_registry.h" +#include <string> + +#include "base/metrics/field_trial.h" #include "base/strings/stringprintf.h" #include "components/variations/active_field_trials.h" #include "components/variations/hashing.h" #include "components/variations/synthetic_trials_active_group_id_provider.h" +#include "components/variations/variations_crash_keys.h" #include "testing/gtest/include/gtest/gtest.h" namespace variations { @@ -16,6 +20,9 @@ class SyntheticTrialRegistryTest : public ::testing::Test { public: + SyntheticTrialRegistryTest() : field_trial_list_(nullptr) { InitCrashKeys(); } + ~SyntheticTrialRegistryTest() override { ClearCrashKeysInstanceForTesting(); } + // Returns true if there is a synthetic trial in the given vector that matches // the given trial name and trial group; returns false otherwise. bool HasSyntheticTrial(const std::vector<ActiveGroupId>& synthetic_trials, @@ -37,6 +44,11 @@ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(1)); } } + + private: + base::FieldTrialList field_trial_list_; + + DISALLOW_COPY_AND_ASSIGN(SyntheticTrialRegistryTest); }; } // namespace
diff --git a/components/variations/synthetic_trials_active_group_id_provider.cc b/components/variations/synthetic_trials_active_group_id_provider.cc index 527425f7..3a51591 100644 --- a/components/variations/synthetic_trials_active_group_id_provider.cc +++ b/components/variations/synthetic_trials_active_group_id_provider.cc
@@ -6,7 +6,7 @@ #include "base/memory/singleton.h" #include "components/variations/variations_associated_data.h" -#include "components/variations/variations_util.h" +#include "components/variations/variations_crash_keys.h" namespace variations { @@ -19,6 +19,18 @@ SyntheticTrialsActiveGroupIdProvider::~SyntheticTrialsActiveGroupIdProvider() {} +void SyntheticTrialsActiveGroupIdProvider::GetActiveGroupIds( + std::vector<ActiveGroupId>* output) { + base::AutoLock scoped_lock(lock_); + for (const auto& group_id : synthetic_trials_) + output->push_back(group_id); +} + +void SyntheticTrialsActiveGroupIdProvider::ResetForTesting() { + base::AutoLock scoped_lock(lock_); + synthetic_trials_.clear(); +} + void SyntheticTrialsActiveGroupIdProvider::OnSyntheticTrialsChanged( const std::vector<SyntheticTrialGroup>& groups) { { @@ -27,16 +39,9 @@ for (const auto& group : groups) synthetic_trials_.push_back(group.id); } - // Update the experiments lists for crash reports to include the newly added - // group. - SetVariationListCrashKeys(); -} -void SyntheticTrialsActiveGroupIdProvider::GetActiveGroupIds( - std::vector<ActiveGroupId>* output) { - base::AutoLock scoped_lock(lock_); - for (const auto& group_id : synthetic_trials_) - output->push_back(group_id); + // Update the experiments list for crash reports. + UpdateCrashKeysWithSyntheticTrials(groups); } } // namespace variations
diff --git a/components/variations/synthetic_trials_active_group_id_provider.h b/components/variations/synthetic_trials_active_group_id_provider.h index 33bf551..365cacc 100644 --- a/components/variations/synthetic_trials_active_group_id_provider.h +++ b/components/variations/synthetic_trials_active_group_id_provider.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_VARIATIONS_SYNTEHTIC_TRIALS_ACTIVE_GROUP_ID_PROVIDER_H_ -#define COMPONENTS_VARIATIONS_SYNTEHTIC_TRIALS_ACTIVE_GROUP_ID_PROVIDER_H_ +#ifndef COMPONENTS_VARIATIONS_SYNTHETIC_TRIALS_ACTIVE_GROUP_ID_PROVIDER_H_ +#define COMPONENTS_VARIATIONS_SYNTHETIC_TRIALS_ACTIVE_GROUP_ID_PROVIDER_H_ #include <vector> @@ -30,6 +30,9 @@ // cannot be nullptr. void GetActiveGroupIds(std::vector<ActiveGroupId>* output); + // Clears state for testing. + void ResetForTesting(); + private: friend struct base::DefaultSingletonTraits< SyntheticTrialsActiveGroupIdProvider>; @@ -50,4 +53,4 @@ } // namespace variations -#endif // COMPONENTS_VARIATIONS_SYNTEHTIC_TRIALS_ACTIVE_GROUP_ID_PROVIDER_H_ +#endif // COMPONENTS_VARIATIONS_SYNTHETIC_TRIALS_ACTIVE_GROUP_ID_PROVIDER_H_
diff --git a/components/variations/variations_crash_keys.cc b/components/variations/variations_crash_keys.cc new file mode 100644 index 0000000..350d35e --- /dev/null +++ b/components/variations/variations_crash_keys.cc
@@ -0,0 +1,175 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/variations/variations_crash_keys.h" + +#include <string> + +#include "base/debug/leak_annotations.h" +#include "base/sequence_checker.h" +#include "base/strings/string_number_conversions.h" +#include "base/strings/string_piece.h" +#include "base/strings/stringprintf.h" +#include "components/crash/core/common/crash_key.h" +#include "components/variations/active_field_trials.h" +#include "components/variations/synthetic_trials.h" + +namespace variations { + +namespace { + +// Size of the "num-experiments" crash key in bytes. 2048 bytes should be able +// to hold about 113 entries, given each entry is 18 bytes long (due to being +// of the form "8e7abfb0-c16397b7,"). +constexpr size_t kVariationsKeySize = 2048; + +// Crash key reporting the number of experiments. 8 is the size of the crash key +// in bytes, which is used to hold an int as a string. +crash_reporter::CrashKeyString<8> g_num_variations_crash_key("num-experiments"); + +// Crash key reporting the variations state. +crash_reporter::CrashKeyString<kVariationsKeySize> g_variations_crash_key( + "variations"); + +std::string ActiveGroupToString(const ActiveGroupId& active_group) { + return base::StringPrintf("%x-%x,", active_group.name, active_group.group); +} + +class VariationsCrashKeys final : public base::FieldTrialList::Observer { + public: + VariationsCrashKeys(); + ~VariationsCrashKeys() override; + + // base::FieldTrialList::Observer: + void OnFieldTrialGroupFinalized(const std::string& field_trial_name, + const std::string& group_name) override; + + // Notifies the object that the list of synthetic field trial groups has + // changed. Note: This matches the SyntheticTrialObserver interface, but this + // object isn't a direct observer, so doesn't implement it. + void OnSyntheticTrialsChanged(const std::vector<SyntheticTrialGroup>& groups); + + private: + // Updates crash keys based on internal state. + void UpdateCrashKeys(); + + // A serialized string containing the variations state. + std::string variations_string_; + + // Number of entries in |variations_string_|. + size_t num_variations_ = 0; + + // A serialized string containing the synthetic trials state. + std::string synthetic_trials_string_; + + // Number of entries in |synthetic_trials_string_|. + size_t num_synthetic_trials_ = 0; + + SEQUENCE_CHECKER(sequence_checker_); + + DISALLOW_COPY_AND_ASSIGN(VariationsCrashKeys); +}; + +VariationsCrashKeys::VariationsCrashKeys() { + // Note: We are calling OnFieldTrialGroupFinalized(), which is virtual, in + // the constructor. Since this class is marked final, this is safe to do, but + // if this is changed and a subclass is introduced that wants to override the + // method, this work should be moved to a dedicated Init() method. + base::FieldTrial::ActiveGroups active_groups; + base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups); + for (const auto& entry : active_groups) { + OnFieldTrialGroupFinalized(entry.trial_name, entry.group_name); + } + + bool success = base::FieldTrialList::AddObserver(this); + // Ensure the observer was actually registered. + DCHECK(success); +} + +VariationsCrashKeys::~VariationsCrashKeys() { + base::FieldTrialList::RemoveObserver(this); + g_num_variations_crash_key.Clear(); + g_variations_crash_key.Clear(); +} + +void VariationsCrashKeys::OnFieldTrialGroupFinalized( + const std::string& trial_name, + const std::string& group_name) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + auto active_group_id = MakeActiveGroupId(trial_name, group_name); + auto variation = ActiveGroupToString(active_group_id); + + variations_string_ += variation; + ++num_variations_; + + UpdateCrashKeys(); +} + +void VariationsCrashKeys::UpdateCrashKeys() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + g_num_variations_crash_key.Set( + base::NumberToString(num_variations_ + num_synthetic_trials_)); + + std::string combined_string; + combined_string.reserve(variations_string_.size() + + synthetic_trials_string_.size()); + combined_string.append(variations_string_); + combined_string.append(synthetic_trials_string_); + + if (combined_string.size() > kVariationsKeySize) { + // If size exceeded, truncate to the last full entry. + int comma_index = combined_string.substr(0, kVariationsKeySize).rfind(','); + combined_string.resize(comma_index + 1); + // NOTREACHED() will let us know of the problem and adjust the limit. + NOTREACHED(); + return; + } + + g_variations_crash_key.Set(combined_string); +} + +void VariationsCrashKeys::OnSyntheticTrialsChanged( + const std::vector<SyntheticTrialGroup>& synthetic_trials) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // Note: This part is inefficient as each time synthetic trials change, this + // code recomputes all their name hashes. However, given that there should + // not be too many synthetic trials, this is not too big of an issue. + synthetic_trials_string_.clear(); + for (const auto& synthetic_trial : synthetic_trials) { + synthetic_trials_string_ += ActiveGroupToString(synthetic_trial.id); + } + num_synthetic_trials_ = synthetic_trials.size(); + + UpdateCrashKeys(); +} + +// Singletone crash key manager. Allocated once at process start up and +// intentionally leaked since it needs to live for the duration of the process +// there's no benefit in cleaning it up at exit. +VariationsCrashKeys* g_variations_crash_keys = nullptr; + +} // namespace + +void InitCrashKeys() { + DCHECK(!g_variations_crash_keys); + g_variations_crash_keys = new VariationsCrashKeys(); + ANNOTATE_LEAKING_OBJECT_PTR(g_variations_crash_keys); +} + +void UpdateCrashKeysWithSyntheticTrials( + const std::vector<SyntheticTrialGroup>& synthetic_trials) { + DCHECK(g_variations_crash_keys); + g_variations_crash_keys->OnSyntheticTrialsChanged(synthetic_trials); +} + +void ClearCrashKeysInstanceForTesting() { + DCHECK(g_variations_crash_keys); + delete g_variations_crash_keys; + g_variations_crash_keys = nullptr; +} + +} // namespace variations
diff --git a/components/variations/variations_crash_keys.h b/components/variations/variations_crash_keys.h new file mode 100644 index 0000000..499acd8 --- /dev/null +++ b/components/variations/variations_crash_keys.h
@@ -0,0 +1,31 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VARIATIONS_VARIATIONS_CRASH_KEYS_H_ +#define COMPONENTS_VARIATIONS_VARIATIONS_CRASH_KEYS_H_ + +#include <vector> + +namespace variations { + +struct SyntheticTrialGroup; + +// Initializes crash keys that report the current set of active FieldTrial +// groups (aka variations) for crash reports. After initialization, an observer +// will be registered on FieldTrialList that will keep the crash keys up-to-date +// with newly-activated trials. Synthetic trials must be manually updated using +// the API below. +void InitCrashKeys(); + +// Updates variations crash keys by replacing the list of synthetic trials with +// the specified list. Does not affect non-synthetic trials. +void UpdateCrashKeysWithSyntheticTrials( + const std::vector<SyntheticTrialGroup>& synthetic_trials); + +// Clears the internal instance, for testing. +void ClearCrashKeysInstanceForTesting(); + +} // namespace variations + +#endif // COMPONENTS_VARIATIONS_VARIATIONS_CRASH_KEYS_H_
diff --git a/components/variations/variations_crash_keys_unittest.cc b/components/variations/variations_crash_keys_unittest.cc new file mode 100644 index 0000000..5a5cab5 --- /dev/null +++ b/components/variations/variations_crash_keys_unittest.cc
@@ -0,0 +1,100 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/variations/variations_crash_keys.h" + +#include <string> + +#include "base/message_loop/message_loop.h" +#include "base/metrics/field_trial.h" +#include "base/run_loop.h" +#include "components/crash/core/common/crash_key.h" +#include "components/variations/hashing.h" +#include "components/variations/synthetic_trial_registry.h" +#include "components/variations/synthetic_trials_active_group_id_provider.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace variations { + +namespace { + +std::string GetVariationsCrashKey() { + return crash_reporter::GetCrashKeyValue("variations"); +} + +std::string GetNumExperimentsCrashKey() { + return crash_reporter::GetCrashKeyValue("num-experiments"); +} + +class VariationsCrashKeysTest : public ::testing::Test { + public: + VariationsCrashKeysTest() : field_trial_list_(nullptr) {} + + ~VariationsCrashKeysTest() override { + SyntheticTrialsActiveGroupIdProvider::GetInstance()->ResetForTesting(); + ClearCrashKeysInstanceForTesting(); + } + + private: + base::MessageLoop loop_; + + base::FieldTrialList field_trial_list_; + + DISALLOW_COPY_AND_ASSIGN(VariationsCrashKeysTest); +}; + +} // namespace + +TEST_F(VariationsCrashKeysTest, BasicFunctionality) { + SyntheticTrialRegistry registry; + registry.AddSyntheticTrialObserver( + SyntheticTrialsActiveGroupIdProvider::GetInstance()); + + // Start with 2 trials, one active and one not + base::FieldTrialList::CreateFieldTrial("Trial1", "Group1")->group(); + base::FieldTrialList::CreateFieldTrial("Trial2", "Group2"); + + InitCrashKeys(); + + EXPECT_EQ("1", GetNumExperimentsCrashKey()); + EXPECT_EQ("8e7abfb0-c16397b7,", GetVariationsCrashKey()); + + // Now, active Trial2. + EXPECT_EQ("Group2", base::FieldTrialList::FindFullName("Trial2")); + base::RunLoop().RunUntilIdle(); + + EXPECT_EQ("2", GetNumExperimentsCrashKey()); + EXPECT_EQ("8e7abfb0-c16397b7,277f2a3d-d77354d0,", GetVariationsCrashKey()); + + // Add two synthetic trials and confirm that they show up in the list. + SyntheticTrialGroup synth_trial(HashName("Trial3"), HashName("Group3")); + registry.RegisterSyntheticFieldTrial(synth_trial); + + EXPECT_EQ("3", GetNumExperimentsCrashKey()); + EXPECT_EQ("8e7abfb0-c16397b7,277f2a3d-d77354d0,9f339c9d-746c2ad4,", + GetVariationsCrashKey()); + + // Add another regular trial. + base::FieldTrialList::CreateFieldTrial("Trial4", "Group4")->group(); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ("4", GetNumExperimentsCrashKey()); + EXPECT_EQ( + "8e7abfb0-c16397b7,277f2a3d-d77354d0,21710f4c-99b90b01," + "9f339c9d-746c2ad4,", + GetVariationsCrashKey()); + + // Replace synthetic trial group and add one more. + SyntheticTrialGroup synth_trial2(HashName("Trial3"), HashName("Group3_A")); + registry.RegisterSyntheticFieldTrial(synth_trial2); + SyntheticTrialGroup synth_trial3(HashName("Trial4"), HashName("Group4")); + registry.RegisterSyntheticFieldTrial(synth_trial3); + + EXPECT_EQ("5", GetNumExperimentsCrashKey()); + EXPECT_EQ( + "8e7abfb0-c16397b7,277f2a3d-d77354d0,21710f4c-99b90b01," + "9f339c9d-3250dddc,21710f4c-99b90b01,", + GetVariationsCrashKey()); +} + +} // namespace variations
diff --git a/components/variations/variations_util.cc b/components/variations/variations_util.cc deleted file mode 100644 index e0ef0552..0000000 --- a/components/variations/variations_util.cc +++ /dev/null
@@ -1,42 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "components/variations/variations_util.h" - -#include <vector> - -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_piece.h" -#include "components/crash/core/common/crash_key.h" -#include "components/variations/active_field_trials.h" - -namespace variations { - -void SetVariationListCrashKeys() { - std::vector<std::string> variations; - GetFieldTrialActiveGroupIdsAsStrings(base::StringPiece(), &variations); - GetSyntheticTrialGroupIdsAsString(&variations); - - static crash_reporter::CrashKeyString<8> num_variations_key( - "num-experiments"); - num_variations_key.Set(base::NumberToString(variations.size())); - - static constexpr size_t kVariationsKeySize = 2048; - static crash_reporter::CrashKeyString<kVariationsKeySize> crash_key( - "variations"); - - std::string variations_string; - variations_string.reserve(kVariationsKeySize); - - for (const auto& variation : variations) { - // Do not truncate an individual experiment. - if (variations_string.size() + variation.size() >= kVariationsKeySize) - break; - variations_string += variation; - variations_string += ","; - } - crash_key.Set(variations_string); -} - -} // namespace variations
diff --git a/components/variations/variations_util.h b/components/variations/variations_util.h deleted file mode 100644 index c2d969d..0000000 --- a/components/variations/variations_util.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_VARIATIONS_VARIATIONS_UTIL_H_ -#define COMPONENTS_VARIATIONS_VARIATIONS_UTIL_H_ - -#include <string> - -namespace variations { - -// Get the current set of chosen FieldTrial groups (aka variations) and send -// them to the logging module so it can save it for crash dumps. -void SetVariationListCrashKeys(); - -} // namespace variations - -#endif // COMPONENTS_VARIATIONS_VARIATIONS_UTIL_H_
diff --git a/components/viz/host/BUILD.gn b/components/viz/host/BUILD.gn index ae98fa9..f5362cb 100644 --- a/components/viz/host/BUILD.gn +++ b/components/viz/host/BUILD.gn
@@ -3,6 +3,7 @@ # found in the LICENSE file. import("//components/viz/viz.gni") +import("//testing/libfuzzer/fuzzer_test.gni") viz_component("host") { defines = [ "VIZ_HOST_IMPLEMENTATION" ] @@ -69,3 +70,18 @@ "//components/viz/service", ] } + +fuzzer_test("hit_test_query_fuzzer") { + sources = [ + "hit_test/hit_test_query_fuzzer.cc", + ] + + libfuzzer_options = [ "max_len=4096" ] + + deps = [ + ":host", + "//base/test:test_support", + "//components/viz/test:test_support", + "//mojo/edk/system", + ] +}
diff --git a/components/viz/host/hit_test/DEPS b/components/viz/host/hit_test/DEPS index 649497d..a5b0089 100644 --- a/components/viz/host/hit_test/DEPS +++ b/components/viz/host/hit_test/DEPS
@@ -3,3 +3,9 @@ include_rules = [ "+services/viz/public/interfaces", ] + +specific_include_rules = { + "hit_test_query_fuzzer.cc": [ + "+mojo/edk/embedder", + ] +}
diff --git a/components/viz/host/hit_test/hit_test_query_fuzzer.cc b/components/viz/host/hit_test/hit_test_query_fuzzer.cc new file mode 100644 index 0000000..a601639 --- /dev/null +++ b/components/viz/host/hit_test/hit_test_query_fuzzer.cc
@@ -0,0 +1,91 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <stddef.h> +#include <stdint.h> +#include <string.h> + +#include "base/command_line.h" +#include "base/test/fuzzed_data_provider.h" +#include "components/viz/host/hit_test/hit_test_query.h" +#include "mojo/edk/embedder/embedder.h" + +namespace { + +uint32_t GetNextUInt32(base::FuzzedDataProvider* fuzz) { + return fuzz->ConsumeUint32InRange(std::numeric_limits<uint32_t>::min(), + std::numeric_limits<uint32_t>::max()); +} + +void AddHitTestRegion(base::FuzzedDataProvider* fuzz, + std::vector<viz::AggregatedHitTestRegion>* regions, + std::vector<viz::FrameSinkId>* frame_sink_ids) { + if (fuzz->remaining_bytes() < sizeof(viz::AggregatedHitTestRegion)) + return; + viz::FrameSinkId frame_sink_id(GetNextUInt32(fuzz), GetNextUInt32(fuzz)); + uint32_t flags = GetNextUInt32(fuzz); + gfx::Rect rect(fuzz->ConsumeUint8(), fuzz->ConsumeUint8(), + fuzz->ConsumeUint16(), fuzz->ConsumeUint16()); + int32_t child_count = fuzz->ConsumeUint32InRange(0, 10); + gfx::Transform transform; + if (fuzz->ConsumeBool() && fuzz->remaining_bytes() >= sizeof(transform)) { + std::string matrix_bytes = fuzz->ConsumeBytes(sizeof(gfx::Transform)); + memcpy(&transform, matrix_bytes.data(), sizeof(gfx::Transform)); + } + regions->emplace_back(frame_sink_id, flags, rect, transform, child_count); + // Always add the first frame sink id, because the root needs to be in the + // list of FrameSinkId. + if (regions->size() == 1 || fuzz->ConsumeBool()) + frame_sink_ids->push_back(frame_sink_id); + while (child_count-- > 0) + AddHitTestRegion(fuzz, regions, frame_sink_ids); +} + +} // namespace + +extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t num_bytes) { + // If there isn't enough memory to have a single AggregatedHitTestRegion, then + // skip. + if (num_bytes < sizeof(viz::AggregatedHitTestRegion)) + return 0; + + // Initialize environment so that we can create the mojo shared memory + // handles. + base::CommandLine::Init(0, nullptr); + mojo::edk::Init(); + + // Create the list of AggregatedHitTestRegion objects. + std::vector<viz::AggregatedHitTestRegion> regions; + std::vector<viz::FrameSinkId> frame_sink_ids; + base::FuzzedDataProvider fuzz(data, num_bytes); + AddHitTestRegion(&fuzz, ®ions, &frame_sink_ids); + + // Put the regions into shared memory. + size_t regions_in_bytes = + regions.size() * sizeof(viz::AggregatedHitTestRegion); + auto shared_buffer = mojo::SharedBufferHandle::Create(regions_in_bytes); + auto buffer = shared_buffer->Map(regions_in_bytes); + memcpy(buffer.get(), regions.data(), regions_in_bytes); + buffer = nullptr; + auto backup_buffer = mojo::SharedBufferHandle::Create(regions_in_bytes); + + // Create the HitTestQuery and inject the shared memory into it. + viz::HitTestQuery query; + query.OnAggregatedHitTestRegionListUpdated( + shared_buffer->Clone(mojo::SharedBufferHandle::AccessMode::READ_ONLY), + regions.size(), + backup_buffer->Clone(mojo::SharedBufferHandle::AccessMode::READ_ONLY), + regions.size()); + + for (float x = 0; x < 1000.; x += 10) { + for (float y = 0; y < 1000.; y += 10) { + gfx::PointF location(x, y); + query.FindTargetForLocation(viz::EventSource::MOUSE, location); + query.TransformLocationForTarget(viz::EventSource::MOUSE, frame_sink_ids, + location, &location); + } + } + + return 0; +}
diff --git a/components/viz/service/display/surface_aggregator.cc b/components/viz/service/display/surface_aggregator.cc index 4ceddaa..094cd40 100644 --- a/components/viz/service/display/surface_aggregator.cc +++ b/components/viz/service/display/surface_aggregator.cc
@@ -194,7 +194,6 @@ bool* damage_rect_in_quad_space_valid) { SurfaceId primary_surface_id = surface_quad->primary_surface_id; Surface* primary_surface = manager_->GetSurfaceForId(primary_surface_id); - if (primary_surface && primary_surface->HasActiveFrame()) { EmitSurfaceContent(primary_surface, parent_device_scale_factor, surface_quad->shared_quad_state, surface_quad->rect, @@ -328,7 +327,10 @@ const auto& child_to_parent_map = provider_ ? provider_->GetChildToParentMap(ChildIdForSurface(surface)) : empty_map; - bool merge_pass = source_sqs->opacity == 1.f && copy_requests.empty(); + gfx::Transform combined_transform = scaled_quad_to_target_transform; + combined_transform.ConcatTransform(target_transform); + bool merge_pass = source_sqs->opacity == 1.f && copy_requests.empty() && + combined_transform.Preserves2dAxisAlignment(); const RenderPassList& referenced_passes = render_pass_list; // TODO(fsamuel): Move this to a separate helper function.
diff --git a/components/viz/service/display/surface_aggregator_unittest.cc b/components/viz/service/display/surface_aggregator_unittest.cc index dabf723..74b1ef807 100644 --- a/components/viz/service/display/surface_aggregator_unittest.cc +++ b/components/viz/service/display/surface_aggregator_unittest.cc
@@ -123,12 +123,29 @@ const SurfaceId& fallback_surface_id, SkColor default_background_color, const gfx::Rect& primary_surface_rect, + bool stretch_content_to_fill_bounds) { + Quad quad; + quad.material = DrawQuad::SURFACE_CONTENT; + quad.primary_surface_rect = primary_surface_rect; + quad.primary_surface_id = primary_surface_id; + quad.fallback_surface_id = fallback_surface_id; + quad.default_background_color = default_background_color; + quad.stretch_content_to_fill_bounds = stretch_content_to_fill_bounds; + return quad; + } + + static Quad SurfaceQuad(const SurfaceId& primary_surface_id, + const SurfaceId& fallback_surface_id, + SkColor default_background_color, + const gfx::Rect& primary_surface_rect, float opacity, + const gfx::Transform& transform, bool stretch_content_to_fill_bounds) { Quad quad; quad.material = DrawQuad::SURFACE_CONTENT; quad.primary_surface_rect = primary_surface_rect; quad.opacity = opacity; + quad.to_target_transform = transform; quad.primary_surface_id = primary_surface_id; quad.fallback_surface_id = fallback_surface_id; quad.default_background_color = default_background_color; @@ -151,6 +168,7 @@ bool stretch_content_to_fill_bounds; gfx::Rect primary_surface_rect; float opacity; + gfx::Transform to_target_transform; // Set when material==DrawQuad::SOLID_COLOR. SkColor color; gfx::Rect rect; @@ -193,8 +211,8 @@ break; case DrawQuad::SURFACE_CONTENT: AddSurfaceQuad(pass, desc.primary_surface_rect, desc.opacity, - desc.primary_surface_id, desc.fallback_surface_id, - desc.default_background_color, + desc.to_target_transform, desc.primary_surface_id, + desc.fallback_surface_id, desc.default_background_color, desc.stretch_content_to_fill_bounds); break; case DrawQuad::RENDER_PASS: @@ -273,11 +291,12 @@ static void AddSurfaceQuad(RenderPass* pass, const gfx::Rect& primary_surface_rect, float opacity, + const gfx::Transform& transform, const SurfaceId& primary_surface_id, const SurfaceId& fallback_surface_id, SkColor default_background_color, bool stretch_content_to_fill_bounds) { - gfx::Transform layer_to_target_transform; + gfx::Transform layer_to_target_transform = transform; gfx::Rect layer_bounds(primary_surface_rect); gfx::Rect visible_layer_rect(primary_surface_rect); gfx::Rect clip_rect(primary_surface_rect); @@ -446,6 +465,8 @@ testing::Mock::VerifyAndClearExpectations(&aggregated_damage_callback); } +// Test that when surface is translucent and we need the render surface to apply +// the opacity, we would keep the render surface. TEST_F(SurfaceAggregatorValidSurfaceTest, OpacityCopied) { auto embedded_support = std::make_unique<CompositorFrameSinkSupport>( nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot, @@ -466,7 +487,7 @@ Quad quads[] = {Quad::SurfaceQuad(embedded_surface_id, InvalidSurfaceId(), SK_ColorWHITE, gfx::Rect(5, 5), .5f, - false)}; + gfx::Transform(), false)}; Pass passes[] = {Pass(quads, arraysize(quads), SurfaceSize())}; SubmitCompositorFrame(support_.get(), passes, arraysize(passes), @@ -487,6 +508,46 @@ EXPECT_EQ(.5f, shared_quad_state_list2.ElementAt(0)->opacity); } +// Test that when surface is rotated and we need the render surface to apply the +// clip, we would keep the render surface. +TEST_F(SurfaceAggregatorValidSurfaceTest, RotatedClip) { + auto embedded_support = std::make_unique<CompositorFrameSinkSupport>( + nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot, + kNeedsSyncPoints); + LocalSurfaceId embedded_local_surface_id = allocator_.GenerateId(); + SurfaceId embedded_surface_id(embedded_support->frame_sink_id(), + embedded_local_surface_id); + + Quad embedded_quads[] = {Quad::SolidColorQuad(SK_ColorGREEN, gfx::Rect(5, 5)), + Quad::SolidColorQuad(SK_ColorBLUE, gfx::Rect(5, 5))}; + Pass embedded_passes[] = { + Pass(embedded_quads, arraysize(embedded_quads), SurfaceSize())}; + + constexpr float device_scale_factor = 1.0f; + SubmitCompositorFrame(embedded_support.get(), embedded_passes, + arraysize(embedded_passes), embedded_local_surface_id, + device_scale_factor); + gfx::Transform rotate; + rotate.Rotate(30); + Quad quads[] = {Quad::SurfaceQuad(embedded_surface_id, InvalidSurfaceId(), + SK_ColorWHITE, gfx::Rect(5, 5), 1.f, rotate, + false)}; + Pass passes[] = {Pass(quads, arraysize(quads), SurfaceSize())}; + + SubmitCompositorFrame(support_.get(), passes, arraysize(passes), + root_local_surface_id_, device_scale_factor); + + SurfaceId root_surface_id(support_->frame_sink_id(), root_local_surface_id_); + CompositorFrame aggregated_frame = aggregator_.Aggregate(root_surface_id); + + auto& render_pass_list = aggregated_frame.render_pass_list; + EXPECT_EQ(2u, render_pass_list.size()); + + auto& shared_quad_state_list2 = + render_pass_list.back()->shared_quad_state_list; + EXPECT_EQ(rotate, shared_quad_state_list2.front()->quad_to_target_transform); +} + TEST_F(SurfaceAggregatorValidSurfaceTest, MultiPassSimpleFrame) { Quad quads[][2] = {{Quad::SolidColorQuad(SK_ColorWHITE, gfx::Rect(5, 5)), Quad::SolidColorQuad(SK_ColorLTGRAY, gfx::Rect(5, 5))}, @@ -583,7 +644,7 @@ Quad root_quads[] = { Quad::SolidColorQuad(SK_ColorWHITE, gfx::Rect(5, 5)), Quad::SurfaceQuad(embedded_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false), + gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorBLACK, gfx::Rect(5, 5))}; Pass root_passes[] = {Pass(root_quads, arraysize(root_quads), SurfaceSize())}; @@ -639,7 +700,7 @@ constexpr gfx::Rect surface_quad_rect(12, 15); Quad root_quads[] = { Quad::SurfaceQuad(primary_child_surface_id, fallback_child_surface_id, - SK_ColorWHITE, surface_quad_rect, 1.f, false)}; + SK_ColorWHITE, surface_quad_rect, false)}; Pass root_passes[] = {Pass(root_quads, arraysize(root_quads), SurfaceSize())}; MockAggregatedDamageCallback aggregated_damage_callback; @@ -778,7 +839,7 @@ constexpr gfx::Rect surface_quad_rect(10, 5); Quad root_quads[] = { Quad::SurfaceQuad(primary_child_surface_id, primary_child_surface_id, - SK_ColorWHITE, surface_quad_rect, 1.f, true)}; + SK_ColorWHITE, surface_quad_rect, true)}; Pass root_passes[] = {Pass(root_quads, arraysize(root_quads), SurfaceSize())}; MockAggregatedDamageCallback aggregated_damage_callback; @@ -843,7 +904,7 @@ constexpr gfx::Rect surface_quad_rect(10, 5); Quad root_quads[] = { Quad::SurfaceQuad(primary_child_surface_id, primary_child_surface_id, - SK_ColorWHITE, surface_quad_rect, 1.f, true)}; + SK_ColorWHITE, surface_quad_rect, true)}; Pass root_passes[] = {Pass(root_quads, arraysize(root_quads), SurfaceSize())}; MockAggregatedDamageCallback aggregated_damage_callback; @@ -909,7 +970,7 @@ constexpr gfx::Rect surface_quad_rect(10, 5); Quad root_quads[] = { Quad::SurfaceQuad(primary_child_surface_id, primary_child_surface_id, - SK_ColorWHITE, surface_quad_rect, 1.f, true)}; + SK_ColorWHITE, surface_quad_rect, true)}; Pass root_passes[] = {Pass(root_quads, arraysize(root_quads), SurfaceSize())}; MockAggregatedDamageCallback aggregated_damage_callback; @@ -986,7 +1047,7 @@ // |fallback_child_surface_id|. Quad root_quads[] = { Quad::SurfaceQuad(primary_child_surface_id, fallback_child_surface_id, - SK_ColorWHITE, gfx::Rect(5, 5), 1.f, false)}; + SK_ColorWHITE, gfx::Rect(5, 5), false)}; constexpr gfx::Size root_size(75, 75); Pass root_passes[] = { Pass(root_quads, arraysize(root_quads), root_size, NoDamage())}; @@ -1059,7 +1120,7 @@ Quad root_quads[] = { Quad::SolidColorQuad(SK_ColorWHITE, gfx::Rect(5, 5)), Quad::SurfaceQuad(embedded_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false), + gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorBLACK, gfx::Rect(5, 5))}; Pass root_passes[] = {Pass(root_quads, arraysize(root_quads), SurfaceSize())}; @@ -1119,7 +1180,7 @@ Quad root_quads[] = { Quad::SolidColorQuad(SK_ColorWHITE, gfx::Rect(5, 5)), Quad::SurfaceQuad(embedded_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false), + gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorBLACK, gfx::Rect(5, 5))}; Quad root_quads2[] = {Quad::SolidColorQuad(SK_ColorRED, gfx::Rect(5, 5))}; Pass root_passes[] = { @@ -1207,7 +1268,7 @@ Quad parent_quads[] = { Quad::SolidColorQuad(SK_ColorGRAY, gfx::Rect(5, 5)), Quad::SurfaceQuad(embedded_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false), + gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorLTGRAY, gfx::Rect(5, 5))}; Pass parent_passes[] = { Pass(parent_quads, arraysize(parent_quads), SurfaceSize())}; @@ -1299,7 +1360,7 @@ {Quad::SolidColorQuad(5, gfx::Rect(5, 5)), Quad::SolidColorQuad(6, gfx::Rect(5, 5))}, {Quad::SurfaceQuad(embedded_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false), + gfx::Rect(5, 5), false), Quad::RenderPassQuad(pass_ids[0])}, {Quad::SolidColorQuad(7, gfx::Rect(5, 5)), Quad::RenderPassQuad(pass_ids[1])}}; @@ -1419,7 +1480,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, InvalidSurfaceReference) { Quad quads[] = {Quad::SolidColorQuad(SK_ColorGREEN, gfx::Rect(5, 5)), Quad::SurfaceQuad(InvalidSurfaceId(), InvalidSurfaceId(), - SK_ColorWHITE, gfx::Rect(5, 5), 1.f, false), + SK_ColorWHITE, gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorBLUE, gfx::Rect(5, 5))}; Pass passes[] = {Pass(quads, arraysize(quads), SurfaceSize())}; @@ -1447,7 +1508,7 @@ Quad quads[] = { Quad::SolidColorQuad(SK_ColorGREEN, gfx::Rect(5, 5)), Quad::SurfaceQuad(surface_with_no_frame_id, InvalidSurfaceId(), - SK_ColorYELLOW, gfx::Rect(5, 5), 1.f, false), + SK_ColorYELLOW, gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorBLUE, gfx::Rect(5, 5))}; Pass passes[] = {Pass(quads, arraysize(quads), SurfaceSize())}; @@ -1477,7 +1538,7 @@ Quad quads[] = {Quad::SurfaceQuad(surface_with_no_frame_id, surface_with_no_frame_id, SK_ColorYELLOW, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass passes[] = {Pass(quads, arraysize(quads), SurfaceSize())}; constexpr float device_scale_factor = 1.0f; @@ -1504,7 +1565,7 @@ TEST_F(SurfaceAggregatorValidSurfaceTest, SimpleCyclicalReference) { SurfaceId root_surface_id(support_->frame_sink_id(), root_local_surface_id_); Quad quads[] = {Quad::SurfaceQuad(root_surface_id, InvalidSurfaceId(), - SK_ColorWHITE, gfx::Rect(5, 5), 1.f, false), + SK_ColorWHITE, gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorYELLOW, gfx::Rect(5, 5))}; Pass passes[] = {Pass(quads, arraysize(quads), SurfaceSize())}; @@ -1530,7 +1591,7 @@ Quad parent_quads[] = { Quad::SolidColorQuad(SK_ColorBLUE, gfx::Rect(5, 5)), Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false), + gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorCYAN, gfx::Rect(5, 5))}; Pass parent_passes[] = { Pass(parent_quads, arraysize(parent_quads), SurfaceSize())}; @@ -1543,7 +1604,7 @@ Quad child_quads[] = { Quad::SolidColorQuad(SK_ColorGREEN, gfx::Rect(5, 5)), Quad::SurfaceQuad(root_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false), + gfx::Rect(5, 5), false), Quad::SolidColorQuad(SK_ColorMAGENTA, gfx::Rect(5, 5))}; Pass child_passes[] = { Pass(child_quads, arraysize(child_quads), SurfaceSize())}; @@ -1595,7 +1656,7 @@ RenderPassId parent_pass_id[] = {3u, 2u}; Quad parent_quad[][1] = { {Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}, + gfx::Rect(5, 5), false)}, {Quad::RenderPassQuad(parent_pass_id[0])}}; Pass parent_passes[] = {Pass(parent_quad[0], arraysize(parent_quad[0]), parent_pass_id[0], SurfaceSize()), @@ -1863,7 +1924,7 @@ { Quad middle_quads[] = {Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass middle_passes[] = { Pass(middle_quads, arraysize(middle_quads), SurfaceSize()), }; @@ -1888,7 +1949,7 @@ Quad secondary_quads[] = { Quad::SolidColorQuad(1, gfx::Rect(5, 5)), Quad::SurfaceQuad(middle_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Quad root_quads[] = {Quad::SolidColorQuad(1, gfx::Rect(5, 5))}; Pass root_passes[] = { Pass(secondary_quads, arraysize(secondary_quads), SurfaceSize()), @@ -2009,7 +2070,7 @@ Quad parent_surface_quads[] = { Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass parent_surface_passes[] = {Pass( parent_surface_quads, arraysize(parent_surface_quads), 1, SurfaceSize())}; @@ -2027,7 +2088,7 @@ Quad root_surface_quads[] = { Quad::SurfaceQuad(parent_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Quad root_render_pass_quads[] = {Quad::RenderPassQuad(1)}; Pass root_passes[] = { @@ -2180,7 +2241,7 @@ Quad parent_surface_quads[] = { Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass parent_surface_passes[] = {Pass( parent_surface_quads, arraysize(parent_surface_quads), 1, SurfaceSize())}; @@ -2198,7 +2259,7 @@ Quad root_surface_quads[] = { Quad::SurfaceQuad(parent_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(50, 50), 1.f, true)}; + gfx::Rect(50, 50), true)}; Quad root_render_pass_quads[] = {Quad::RenderPassQuad(1)}; Pass root_passes[] = { @@ -2283,7 +2344,7 @@ Quad parent_surface_quads[] = { Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass parent_surface_passes[] = {Pass( parent_surface_quads, arraysize(parent_surface_quads), 1, SurfaceSize())}; @@ -2301,7 +2362,7 @@ Quad root_surface_quads[] = { Quad::SurfaceQuad(parent_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(200, 200), 1.f, true)}; + gfx::Rect(200, 200), true)}; Quad root_render_pass_quads[] = {Quad::RenderPassQuad(1)}; Pass root_passes[] = { @@ -2488,7 +2549,7 @@ { Quad root_quads[] = {Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), - SK_ColorWHITE, gfx::Rect(5, 5), 1.f, + SK_ColorWHITE, gfx::Rect(5, 5), false)}; Pass root_passes[] = { @@ -2522,7 +2583,7 @@ // Create a root surface with a smaller damage rect. { Quad root_quads[] = {Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), - SK_ColorWHITE, gfx::Rect(5, 5), 1.f, + SK_ColorWHITE, gfx::Rect(5, 5), false)}; Pass root_passes[] = { @@ -2625,7 +2686,7 @@ int root_pass_ids[] = {1, 2, 3}; Quad root_quads1[] = {Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Quad root_quads2[] = {Quad::RenderPassQuad(root_pass_ids[0])}; Quad root_quads3[] = {Quad::RenderPassQuad(root_pass_ids[1])}; Pass root_passes[] = {Pass(root_quads1, arraysize(root_quads1), @@ -2677,7 +2738,7 @@ Quad root_quads2[] = { Quad::RenderPassQuad(root_pass_ids[0]), Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass root_passes[] = {Pass(root_quads1, arraysize(root_quads1), root_pass_ids[0], SurfaceSize()), Pass(root_quads2, arraysize(root_quads2), @@ -2728,7 +2789,7 @@ Quad root_quads2[] = { Quad::RenderPassQuad(root_pass_ids[0]), Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass root_passes[] = {Pass(root_quads1, arraysize(root_quads1), root_pass_ids[0], SurfaceSize()), Pass(root_quads2, arraysize(root_quads2), @@ -3150,7 +3211,7 @@ Quad root_surface_quads[] = { Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass root_passes[] = {Pass(root_surface_quads, arraysize(root_surface_quads), 1, SurfaceSize())}; @@ -3226,7 +3287,7 @@ Quad root_surface_quads[] = { Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass root_passes[] = {Pass(root_surface_quads, arraysize(root_surface_quads), 1, SurfaceSize())}; @@ -3266,7 +3327,7 @@ Quad new_child_surface_quads[] = { child_surface_quads[0], Quad::SurfaceQuad(grand_child_surface_id, InvalidSurfaceId(), - SK_ColorWHITE, gfx::Rect(5, 5), 1.f, false)}; + SK_ColorWHITE, gfx::Rect(5, 5), false)}; Pass new_child_surface_passes[] = {Pass(new_child_surface_quads, arraysize(new_child_surface_quads), 1, SurfaceSize())}; @@ -3338,7 +3399,7 @@ Quad root_surface_quads[] = { Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Quad root_render_pass_quads[] = {Quad::RenderPassQuad(1)}; Pass root_passes[] = { @@ -3499,7 +3560,7 @@ Quad root_surface_quads[] = { Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}; + gfx::Rect(5, 5), false)}; Pass root_passes[] = {Pass(root_surface_quads, arraysize(root_surface_quads), 1, SurfaceSize())}; @@ -3621,7 +3682,7 @@ int pass_id[] = {1, 2}; Quad root_quads[][1] = { {Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}, + gfx::Rect(5, 5), false)}, {Quad::RenderPassQuad(pass_id[0])}, }; Pass root_passes[] = {Pass(root_quads[0], arraysize(root_quads[0]), @@ -3660,7 +3721,7 @@ int pass_id[] = {1, 2}; Quad root_quads[][1] = { {Quad::SurfaceQuad(child_surface_id, InvalidSurfaceId(), SK_ColorWHITE, - gfx::Rect(5, 5), 1.f, false)}, + gfx::Rect(5, 5), false)}, {Quad::RenderPassQuad(pass_id[0])}, }; Pass root_passes[] = {Pass(root_quads[0], arraysize(root_quads[0]),
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 56dbc8da..7992ec8 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -688,7 +688,8 @@ "dom_storage/session_storage_database_adapter.h", "dom_storage/session_storage_namespace_impl.cc", "dom_storage/session_storage_namespace_impl.h", - "download/download_destination_observer.h", + "download/byte_stream_input_stream.cc", + "download/byte_stream_input_stream.h", "download/download_file.h", "download/download_file_factory.cc", "download/download_file_factory.h",
diff --git a/content/browser/accessibility/snapshot_ax_tree_browsertest.cc b/content/browser/accessibility/snapshot_ax_tree_browsertest.cc index b3ef5608..7a5a487 100644 --- a/content/browser/accessibility/snapshot_ax_tree_browsertest.cc +++ b/content/browser/accessibility/snapshot_ax_tree_browsertest.cc
@@ -74,9 +74,8 @@ static_cast<WebContentsImpl*>(shell()->web_contents()); AXTreeSnapshotWaiter waiter; - web_contents->RequestAXTreeSnapshot( - base::Bind(&AXTreeSnapshotWaiter::ReceiveSnapshot, - base::Unretained(&waiter))); + web_contents->RequestAXTreeSnapshot(base::BindOnce( + &AXTreeSnapshotWaiter::ReceiveSnapshot, base::Unretained(&waiter))); waiter.Wait(); // Dump the whole tree if one of the assertions below fails @@ -109,9 +108,8 @@ "/accessibility/snapshot/inner.html")); AXTreeSnapshotWaiter waiter; - web_contents->RequestAXTreeSnapshot( - base::Bind(&AXTreeSnapshotWaiter::ReceiveSnapshot, - base::Unretained(&waiter))); + web_contents->RequestAXTreeSnapshot(base::BindOnce( + &AXTreeSnapshotWaiter::ReceiveSnapshot, base::Unretained(&waiter))); waiter.Wait(); // Dump the whole tree if one of the assertions below fails
diff --git a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc index b16afc8e..1e817f8 100644 --- a/content/browser/devtools/protocol/devtools_protocol_browsertest.cc +++ b/content/browser/devtools/protocol/devtools_protocol_browsertest.cc
@@ -848,7 +848,7 @@ // integer precision. gfx::Size view_size = static_cast<RenderWidgetHostViewBase*>( shell()->web_contents()->GetRenderWidgetHostView()) - ->GetPhysicalBackingSize(); + ->GetCompositorViewportPixelSize(); expected_bitmap.allocN32Pixels(view_size.width(), view_size.height()); expected_bitmap.eraseColor(SkColorSetRGB(0x12, 0x34, 0x56)); CaptureScreenshotAndCompareTo(expected_bitmap, ENCODING_PNG, false); @@ -871,7 +871,7 @@ // integer precision. gfx::Size view_size = static_cast<RenderWidgetHostViewBase*>( shell()->web_contents()->GetRenderWidgetHostView()) - ->GetPhysicalBackingSize(); + ->GetCompositorViewportPixelSize(); expected_bitmap.allocN32Pixels(view_size.width(), view_size.height()); expected_bitmap.eraseColor(SkColorSetRGB(0x12, 0x34, 0x56)); CaptureScreenshotAndCompareTo(expected_bitmap, ENCODING_JPEG, false); @@ -932,7 +932,7 @@ // integer precision. gfx::Size view_size = static_cast<RenderWidgetHostViewBase*>( shell()->web_contents()->GetRenderWidgetHostView()) - ->GetPhysicalBackingSize(); + ->GetCompositorViewportPixelSize(); expected_bitmap.allocN32Pixels(view_size.width(), view_size.height()); expected_bitmap.eraseColor(SkColorSetRGB(0x00, 0x00, 0xff)); CaptureScreenshotAndCompareTo(expected_bitmap, ENCODING_PNG, true); @@ -948,14 +948,7 @@ // Verifies that setDefaultBackgroundColor and captureScreenshot support a fully // and semi-transparent background, and that setDeviceMetricsOverride doesn't // affect it. -// TODO(bokan): Temporarily disabled while landing --root-layer-scrolls. -// https://crbug.com/811406. -#if defined(OS_ANDROID) -#define MAYBE_TransparentScreenshots DISABLED_TransparentScreenshots -#else -#define MAYBE_TransparentScreenshots TransparentScreenshots -#endif -IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, MAYBE_TransparentScreenshots) { +IN_PROC_BROWSER_TEST_F(CaptureScreenshotTest, TransparentScreenshots) { if (base::SysInfo::IsLowEndDevice()) return; @@ -980,7 +973,7 @@ // integer precision. gfx::Size view_size = static_cast<RenderWidgetHostViewBase*>( shell()->web_contents()->GetRenderWidgetHostView()) - ->GetPhysicalBackingSize(); + ->GetCompositorViewportPixelSize(); expected_bitmap.allocN32Pixels(view_size.width(), view_size.height()); expected_bitmap.eraseColor(SK_ColorTRANSPARENT); CaptureScreenshotAndCompareTo(expected_bitmap, ENCODING_PNG, true); @@ -2412,11 +2405,12 @@ class CountingDownloadFile : public DownloadFileImpl { public: - CountingDownloadFile(std::unique_ptr<download::DownloadSaveInfo> save_info, - const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, - uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) + CountingDownloadFile( + std::unique_ptr<download::DownloadSaveInfo> save_info, + const base::FilePath& default_downloads_directory, + std::unique_ptr<download::InputStream> stream, + uint32_t download_id, + base::WeakPtr<download::DownloadDestinationObserver> observer) : DownloadFileImpl(std::move(save_info), default_downloads_directory, std::move(stream), @@ -2471,9 +2465,9 @@ DownloadFile* CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) override { + base::WeakPtr<download::DownloadDestinationObserver> observer) override { return new CountingDownloadFile(std::move(save_info), default_downloads_directory, std::move(stream), download_id, observer);
diff --git a/content/browser/devtools/protocol/page_handler.cc b/content/browser/devtools/protocol/page_handler.cc index 22373521..a76eb43b 100644 --- a/content/browser/devtools/protocol/page_handler.cc +++ b/content/browser/devtools/protocol/page_handler.cc
@@ -815,7 +815,7 @@ // Determine the snapshot size that best-fits the Surface's content to the // remote's requested image size. - const gfx::Size& surface_size = view->GetPhysicalBackingSize(); + const gfx::Size& surface_size = view->GetCompositorViewportPixelSize(); if (surface_size.IsEmpty()) return; // Nothing to copy (and avoid divide-by-zero below). double scale = 1;
diff --git a/content/browser/download/byte_stream_input_stream.cc b/content/browser/download/byte_stream_input_stream.cc new file mode 100644 index 0000000..3d53718 --- /dev/null +++ b/content/browser/download/byte_stream_input_stream.cc
@@ -0,0 +1,64 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/browser/download/byte_stream_input_stream.h" + +#include "content/browser/byte_stream.h" + +namespace content { + +ByteStreamInputStream::ByteStreamInputStream( + std::unique_ptr<ByteStreamReader> stream_reader) + : stream_reader_(std::move(stream_reader)), + completion_status_(download::DOWNLOAD_INTERRUPT_REASON_NONE) {} + +ByteStreamInputStream::~ByteStreamInputStream() = default; + +bool ByteStreamInputStream::IsEmpty() { + return !stream_reader_; +} + +void ByteStreamInputStream::RegisterDataReadyCallback( + const mojo::SimpleWatcher::ReadyCallback& callback) { + if (stream_reader_) { + stream_reader_->RegisterCallback( + base::BindRepeating(callback, MOJO_RESULT_OK)); + } +} + +void ByteStreamInputStream::ClearDataReadyCallback() { + if (stream_reader_) + stream_reader_->RegisterCallback(base::RepeatingClosure()); +} + +download::InputStream::StreamState ByteStreamInputStream::Read( + scoped_refptr<net::IOBuffer>* data, + size_t* length) { + if (!stream_reader_) + return download::InputStream::EMPTY; + + ByteStreamReader::StreamState state = stream_reader_->Read(data, length); + switch (state) { + case ByteStreamReader::STREAM_EMPTY: + return download::InputStream::EMPTY; + case ByteStreamReader::STREAM_HAS_DATA: + return download::InputStream::HAS_DATA; + case ByteStreamReader::STREAM_COMPLETE: + completion_status_ = static_cast<download::DownloadInterruptReason>( + stream_reader_->GetStatus()); + return download::InputStream::COMPLETE; + } + return download::InputStream::EMPTY; +} + +download::DownloadInterruptReason ByteStreamInputStream::GetCompletionStatus() { + return completion_status_; +} + +void ByteStreamInputStream::OnResponseCompleted( + download::DownloadInterruptReason status) { + completion_status_ = status; +} + +} // namespace content
diff --git a/content/browser/download/byte_stream_input_stream.h b/content/browser/download/byte_stream_input_stream.h new file mode 100644 index 0000000..469839c --- /dev/null +++ b/content/browser/download/byte_stream_input_stream.h
@@ -0,0 +1,44 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_BROWSER_DOWNLOAD_BYTE_STREAM_INPUT_STREAM_H_ +#define CONTENT_BROWSER_DOWNLOAD_BYTE_STREAM_INPUT_STREAM_H_ + +#include "components/download/public/common/input_stream.h" +#include "content/common/content_export.h" + +namespace content { + +class ByteStreamReader; + +// Download input stream backed by a ByteStreamReader. +class CONTENT_EXPORT ByteStreamInputStream : public download::InputStream { + public: + explicit ByteStreamInputStream( + std::unique_ptr<ByteStreamReader> stream_reader); + ~ByteStreamInputStream() override; + + // download::InputStream + bool IsEmpty() override; + void RegisterDataReadyCallback( + const mojo::SimpleWatcher::ReadyCallback& callback) override; + void ClearDataReadyCallback() override; + download::InputStream::StreamState Read(scoped_refptr<net::IOBuffer>* data, + size_t* length) override; + download::DownloadInterruptReason GetCompletionStatus() override; + void OnResponseCompleted(download::DownloadInterruptReason status) override; + + private: + // ByteStreamReader to read from. + std::unique_ptr<ByteStreamReader> stream_reader_; + + // Status when the response completes. + download::DownloadInterruptReason completion_status_; + + DISALLOW_COPY_AND_ASSIGN(ByteStreamInputStream); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_DOWNLOAD_BYTE_STREAM_INPUT_STREAM_H_
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc index 5ae140ab..4935952 100644 --- a/content/browser/download/download_browsertest.cc +++ b/content/browser/download/download_browsertest.cc
@@ -167,12 +167,13 @@ class DownloadFileWithDelay : public DownloadFileImpl { public: - DownloadFileWithDelay(std::unique_ptr<download::DownloadSaveInfo> save_info, - const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, - uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer, - base::WeakPtr<DownloadFileWithDelayFactory> owner); + DownloadFileWithDelay( + std::unique_ptr<download::DownloadSaveInfo> save_info, + const base::FilePath& default_download_directory, + std::unique_ptr<download::InputStream> stream, + uint32_t download_id, + base::WeakPtr<download::DownloadDestinationObserver> observer, + base::WeakPtr<DownloadFileWithDelayFactory> owner); ~DownloadFileWithDelay() override; @@ -214,9 +215,9 @@ DownloadFile* CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) override; + base::WeakPtr<download::DownloadDestinationObserver> observer) override; void AddRenameCallback(base::Closure callback); void GetAllRenameCallbacks(std::vector<base::Closure>* results); @@ -235,9 +236,9 @@ DownloadFileWithDelay::DownloadFileWithDelay( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer, + base::WeakPtr<download::DownloadDestinationObserver> observer, base::WeakPtr<DownloadFileWithDelayFactory> owner) : DownloadFileImpl(std::move(save_info), default_download_directory, @@ -294,9 +295,9 @@ DownloadFile* DownloadFileWithDelayFactory::CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) { + base::WeakPtr<download::DownloadDestinationObserver> observer) { return new DownloadFileWithDelay( std::move(save_info), default_download_directory, std::move(stream), download_id, observer, weak_ptr_factory_.GetWeakPtr()); @@ -327,11 +328,12 @@ class CountingDownloadFile : public DownloadFileImpl { public: - CountingDownloadFile(std::unique_ptr<download::DownloadSaveInfo> save_info, - const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, - uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) + CountingDownloadFile( + std::unique_ptr<download::DownloadSaveInfo> save_info, + const base::FilePath& default_downloads_directory, + std::unique_ptr<download::InputStream> stream, + uint32_t download_id, + base::WeakPtr<download::DownloadDestinationObserver> observer) : DownloadFileImpl(std::move(save_info), default_downloads_directory, std::move(stream), @@ -386,9 +388,9 @@ DownloadFile* CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) override { + base::WeakPtr<download::DownloadDestinationObserver> observer) override { return new CountingDownloadFile(std::move(save_info), default_downloads_directory, std::move(stream), download_id, observer); @@ -400,9 +402,9 @@ ErrorInjectionDownloadFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer, + base::WeakPtr<download::DownloadDestinationObserver> observer, int64_t error_stream_offset, int64_t error_stream_length) : DownloadFileImpl(std::move(save_info), @@ -447,9 +449,9 @@ DownloadFile* CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) override { + base::WeakPtr<download::DownloadDestinationObserver> observer) override { ErrorInjectionDownloadFile* download_file = new ErrorInjectionDownloadFile( std::move(save_info), default_download_directory, std::move(stream), download_id, observer, injected_error_offset_, injected_error_length_);
diff --git a/content/browser/download/download_file.h b/content/browser/download/download_file.h index af9a174..dde3bbb 100644 --- a/content/browser/download/download_file.h +++ b/content/browser/download/download_file.h
@@ -15,8 +15,8 @@ #include "components/download/public/common/base_file.h" #include "components/download/public/common/download_interrupt_reasons.h" #include "components/download/public/common/download_item.h" +#include "components/download/public/common/input_stream.h" #include "content/common/content_export.h" -#include "content/public/browser/download_manager.h" #include "mojo/public/cpp/system/data_pipe.h" class GURL; @@ -69,15 +69,9 @@ // Add an input stream to write into a slice of the file, used for // parallel download. - virtual void AddInputStream( - std::unique_ptr<DownloadManager::InputStream> stream, - int64_t offset, - int64_t length) = 0; - - // Called when the response for the stream starting at |offset| is completed, - virtual void OnResponseCompleted( - int64_t offset, - download::DownloadInterruptReason status) = 0; + virtual void AddInputStream(std::unique_ptr<download::InputStream> stream, + int64_t offset, + int64_t length) = 0; // Rename the download file to |full_path|. If that file exists // |full_path| will be uniquified by suffixing " (<number>)" to the
diff --git a/content/browser/download/download_file_factory.cc b/content/browser/download/download_file_factory.cc index 1b457ea..1fae4640 100644 --- a/content/browser/download/download_file_factory.cc +++ b/content/browser/download/download_file_factory.cc
@@ -15,9 +15,9 @@ DownloadFile* DownloadFileFactory::CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) { + base::WeakPtr<download::DownloadDestinationObserver> observer) { return new DownloadFileImpl(std::move(save_info), default_downloads_directory, std::move(stream), download_id, observer); }
diff --git a/content/browser/download/download_file_factory.h b/content/browser/download/download_file_factory.h index 6dcf3c5bc..fc071bf 100644 --- a/content/browser/download/download_file_factory.h +++ b/content/browser/download/download_file_factory.h
@@ -17,12 +17,12 @@ #include "url/gurl.h" namespace download { +class DownloadDestinationObserver; struct DownloadSaveInfo; } namespace content { -class DownloadDestinationObserver; class DownloadFile; class CONTENT_EXPORT DownloadFileFactory { @@ -32,9 +32,9 @@ virtual DownloadFile* CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer); + base::WeakPtr<download::DownloadDestinationObserver> observer); }; } // namespace content
diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc index fdf070cd..896cff2 100644 --- a/content/browser/download/download_file_impl.cc +++ b/content/browser/download/download_file_impl.cc
@@ -16,11 +16,9 @@ #include "base/time/time.h" #include "base/values.h" #include "components/download/public/common/download_create_info.h" +#include "components/download/public/common/download_destination_observer.h" #include "components/download/public/common/download_interrupt_reasons_utils.h" #include "components/download/public/common/download_stats.h" -#include "content/browser/byte_stream.h" -#include "content/browser/download/download_destination_observer.h" -#include "content/browser/download/download_utils.h" #include "content/browser/download/parallel_download_utils.h" #include "content/public/common/content_features.h" #include "crypto/secure_hash.h" @@ -51,56 +49,23 @@ // Default content length when the potential file size is not yet determined. const int kUnknownContentLength = -1; -// Data length to read from data pipe. -const int kBytesToRead = 4096; - } // namespace DownloadFileImpl::SourceStream::SourceStream( int64_t offset, int64_t length, - std::unique_ptr<DownloadManager::InputStream> stream) + std::unique_ptr<download::InputStream> stream) : offset_(offset), length_(length), bytes_written_(0), finished_(false), index_(0u), - stream_reader_(std::move(stream->stream_reader_)), - completion_status_(download::DOWNLOAD_INTERRUPT_REASON_NONE), - is_response_completed_(false), - stream_handle_(std::move(stream->stream_handle_)) {} + input_stream_(std::move(stream)) {} DownloadFileImpl::SourceStream::~SourceStream() = default; void DownloadFileImpl::SourceStream::Initialize() { - if (stream_handle_.is_null()) - return; - binding_ = - std::make_unique<mojo::Binding<download::mojom::DownloadStreamClient>>( - this, std::move(stream_handle_->client_request)); - binding_->set_connection_error_handler( - base::BindOnce(&DownloadFileImpl::SourceStream::OnStreamCompleted, - base::Unretained(this), - download::mojom::NetworkRequestStatus::USER_CANCELED)); - handle_watcher_ = std::make_unique<mojo::SimpleWatcher>( - FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::AUTOMATIC); -} - -void DownloadFileImpl::SourceStream::OnStreamCompleted( - download::mojom::NetworkRequestStatus status) { - // This can be called before or after data pipe is completely drained. So we - // need to pass the |completion_status_| to DownloadFileImpl if the data pipe - // is already drained. - OnResponseCompleted( - download::ConvertMojoNetworkRequestStatusToInterruptReason(status)); -} - -void DownloadFileImpl::SourceStream::OnResponseCompleted( - download::DownloadInterruptReason reason) { - is_response_completed_ = true; - completion_status_ = reason; - if (completion_callback_) - std::move(completion_callback_).Run(this); + input_stream_->Initialize(); } void DownloadFileImpl::SourceStream::OnWriteBytesToDisk(int64_t bytes_write) { @@ -130,81 +95,41 @@ void DownloadFileImpl::SourceStream::RegisterDataReadyCallback( const mojo::SimpleWatcher::ReadyCallback& callback) { - if (handle_watcher_) { - handle_watcher_->Watch(stream_handle_->stream.get(), - MOJO_HANDLE_SIGNAL_READABLE, callback); - } else if (stream_reader_) { - stream_reader_->RegisterCallback(base::Bind(callback, MOJO_RESULT_OK)); - } + input_stream_->RegisterDataReadyCallback(callback); } void DownloadFileImpl::SourceStream::ClearDataReadyCallback() { - if (handle_watcher_) - handle_watcher_->Cancel(); - else if (stream_reader_) - stream_reader_->RegisterCallback(base::Closure()); + input_stream_->ClearDataReadyCallback(); +} + +void DownloadFileImpl::SourceStream::OnResponseCompleted( + download::DownloadInterruptReason reason) { + input_stream_->OnResponseCompleted(reason); } download::DownloadInterruptReason DownloadFileImpl::SourceStream::GetCompletionStatus() const { - return completion_status_; + return input_stream_->GetCompletionStatus(); } void DownloadFileImpl::SourceStream::RegisterCompletionCallback( DownloadFileImpl::SourceStream::CompletionCallback callback) { - completion_callback_ = std::move(callback); + input_stream_->RegisterCompletionCallback( + base::BindOnce(std::move(callback), base::Unretained(this))); } -DownloadFileImpl::SourceStream::StreamState -DownloadFileImpl::SourceStream::Read(scoped_refptr<net::IOBuffer>* data, - size_t* length) { - if (handle_watcher_) { - *length = kBytesToRead; - *data = new net::IOBuffer(kBytesToRead); - MojoResult mojo_result = stream_handle_->stream->ReadData( - (*data)->data(), (uint32_t*)length, MOJO_READ_DATA_FLAG_NONE); - // TODO(qinmin): figure out when COMPLETE should be returned. - switch (mojo_result) { - case MOJO_RESULT_OK: - return HAS_DATA; - case MOJO_RESULT_SHOULD_WAIT: - return EMPTY; - case MOJO_RESULT_FAILED_PRECONDITION: - if (is_response_completed_) - return COMPLETE; - stream_handle_->stream.reset(); - ClearDataReadyCallback(); - return WAIT_FOR_COMPLETION; - case MOJO_RESULT_INVALID_ARGUMENT: - case MOJO_RESULT_OUT_OF_RANGE: - case MOJO_RESULT_BUSY: - NOTREACHED(); - return COMPLETE; - } - } else if (stream_reader_) { - ByteStreamReader::StreamState state = stream_reader_->Read(data, length); - switch (state) { - case ByteStreamReader::STREAM_EMPTY: - return EMPTY; - case ByteStreamReader::STREAM_HAS_DATA: - return HAS_DATA; - case ByteStreamReader::STREAM_COMPLETE: - download::DownloadInterruptReason reason = - static_cast<download::DownloadInterruptReason>( - stream_reader_->GetStatus()); - OnResponseCompleted(reason); - return COMPLETE; - } - } - return COMPLETE; +download::InputStream::StreamState DownloadFileImpl::SourceStream::Read( + scoped_refptr<net::IOBuffer>* data, + size_t* length) { + return input_stream_->Read(data, length); } DownloadFileImpl::DownloadFileImpl( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) + base::WeakPtr<download::DownloadDestinationObserver> observer) : DownloadFileImpl(std::move(save_info), default_download_directory, download_id, @@ -217,7 +142,7 @@ std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) + base::WeakPtr<download::DownloadDestinationObserver> observer) : file_(download_id), save_info_(std::move(save_info)), default_download_directory_(default_download_directory), @@ -302,7 +227,7 @@ } void DownloadFileImpl::AddInputStream( - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, int64_t offset, int64_t length) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -319,14 +244,6 @@ OnSourceStreamAdded(source_streams_[offset].get()); } -void DownloadFileImpl::OnResponseCompleted( - int64_t offset, - download::DownloadInterruptReason status) { - auto iter = source_streams_.find(offset); - if (iter != source_streams_.end()) - iter->second->OnResponseCompleted(status); -} - void DownloadFileImpl::OnSourceStreamAdded(SourceStream* source_stream) { // There are writers at different offsets now, create the received slices // vector if necessary. @@ -582,7 +499,7 @@ size_t num_buffers = 0; size_t bytes_to_write = 0; bool should_terminate = false; - SourceStream::StreamState state(SourceStream::EMPTY); + download::InputStream::StreamState state(download::InputStream::EMPTY); download::DownloadInterruptReason reason = download::DOWNLOAD_INTERRUPT_REASON_NONE; base::TimeDelta delta( @@ -592,10 +509,10 @@ do { state = source_stream->Read(&incoming_data, &incoming_data_size); switch (state) { - case SourceStream::EMPTY: + case download::InputStream::EMPTY: should_terminate = (source_stream->length() == kNoBytesToWrite); break; - case SourceStream::HAS_DATA: { + case download::InputStream::HAS_DATA: { ++num_buffers; base::TimeTicks write_start(base::TimeTicks::Now()); should_terminate = CalculateBytesToWrite( @@ -623,23 +540,23 @@ } } } break; - case SourceStream::WAIT_FOR_COMPLETION: + case download::InputStream::WAIT_FOR_COMPLETION: source_stream->RegisterCompletionCallback(base::BindOnce( &DownloadFileImpl::OnStreamCompleted, weak_factory_.GetWeakPtr())); break; - case SourceStream::COMPLETE: + case download::InputStream::COMPLETE: break; default: NOTREACHED(); break; } now = base::TimeTicks::Now(); - } while (state == SourceStream::HAS_DATA && + } while (state == download::InputStream::HAS_DATA && reason == download::DOWNLOAD_INTERRUPT_REASON_NONE && now - start <= delta && !should_terminate); // If we're stopping to yield the thread, post a task so we come back. - if (state == SourceStream::HAS_DATA && now - start > delta && + if (state == download::InputStream::HAS_DATA && now - start > delta && !should_terminate) { base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&DownloadFileImpl::StreamActive, @@ -652,7 +569,7 @@ download::RecordContiguousWriteTime(now - start); - if (state == SourceStream::COMPLETE) + if (state == download::InputStream::COMPLETE) OnStreamCompleted(source_stream); else NotifyObserver(source_stream, reason, state, should_terminate); @@ -668,16 +585,18 @@ SendUpdate(); - NotifyObserver(source_stream, reason, SourceStream::COMPLETE, false); + NotifyObserver(source_stream, reason, download::InputStream::COMPLETE, false); } -void DownloadFileImpl::NotifyObserver(SourceStream* source_stream, - download::DownloadInterruptReason reason, - SourceStream::StreamState stream_state, - bool should_terminate) { +void DownloadFileImpl::NotifyObserver( + SourceStream* source_stream, + download::DownloadInterruptReason reason, + download::InputStream::StreamState stream_state, + bool should_terminate) { if (reason != download::DOWNLOAD_INTERRUPT_REASON_NONE) { HandleStreamError(source_stream, reason); - } else if (stream_state == SourceStream::COMPLETE || should_terminate) { + } else if (stream_state == download::InputStream::COMPLETE || + should_terminate) { // Signal successful completion or termination of the current stream. source_stream->ClearDataReadyCallback(); source_stream->set_finished(true); @@ -717,9 +636,9 @@ update_timer_.reset(); main_task_runner_->PostTask( FROM_HERE, - base::BindOnce(&DownloadDestinationObserver::DestinationCompleted, - observer_, TotalBytesReceived(), - std::move(hash_state))); + base::BindOnce( + &download::DownloadDestinationObserver::DestinationCompleted, + observer_, TotalBytesReceived(), std::move(hash_state))); } } } @@ -749,9 +668,9 @@ // far along with received_slices_. main_task_runner_->PostTask( FROM_HERE, - base::BindOnce(&DownloadDestinationObserver::DestinationUpdate, observer_, - TotalBytesReceived(), rate_estimator_.GetCountPerSecond(), - received_slices_)); + base::BindOnce(&download::DownloadDestinationObserver::DestinationUpdate, + observer_, TotalBytesReceived(), + rate_estimator_.GetCountPerSecond(), received_slices_)); } void DownloadFileImpl::WillWriteToDisk(size_t data_len) { @@ -853,7 +772,7 @@ std::unique_ptr<crypto::SecureHash> hash_state = file_.Finish(); main_task_runner_->PostTask( FROM_HERE, - base::BindOnce(&DownloadDestinationObserver::DestinationError, + base::BindOnce(&download::DownloadDestinationObserver::DestinationError, observer_, reason, TotalBytesReceived(), std::move(hash_state))); }
diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h index a10d25bef..6b90a907 100644 --- a/content/browser/download/download_file_impl.h +++ b/content/browser/download/download_file_impl.h
@@ -26,15 +26,15 @@ #include "components/download/public/common/base_file.h" #include "components/download/public/common/download_item.h" #include "components/download/public/common/download_save_info.h" -#include "components/download/public/common/download_stream.mojom.h" #include "components/download/public/common/rate_estimator.h" -#include "content/browser/byte_stream.h" #include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/system/simple_watcher.h" -namespace content { -class ByteStreamReader; +namespace download { class DownloadDestinationObserver; +} + +namespace content { class CONTENT_EXPORT DownloadFileImpl : public DownloadFile { public: @@ -46,11 +46,12 @@ // Note that the DownloadFileImpl automatically reads from the passed in // |stream|, and sends updates and status of those reads to the // DownloadDestinationObserver. - DownloadFileImpl(std::unique_ptr<download::DownloadSaveInfo> save_info, - const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, - uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer); + DownloadFileImpl( + std::unique_ptr<download::DownloadSaveInfo> save_info, + const base::FilePath& default_downloads_directory, + std::unique_ptr<download::InputStream> stream, + uint32_t download_id, + base::WeakPtr<download::DownloadDestinationObserver> observer); ~DownloadFileImpl() override; @@ -59,11 +60,9 @@ const CancelRequestCallback& cancel_request_callback, const download::DownloadItem::ReceivedSlices& received_slices, bool is_parallelizable) override; - void AddInputStream(std::unique_ptr<DownloadManager::InputStream> stream, + void AddInputStream(std::unique_ptr<download::InputStream> stream, int64_t offset, int64_t length) override; - void OnResponseCompleted(int64_t offset, - download::DownloadInterruptReason status) override; void RenameAndUniquify(const base::FilePath& full_path, const RenameCompletionCallback& callback) override; void RenameAndAnnotate(const base::FilePath& full_path, @@ -87,20 +86,15 @@ // is handled. // // Multiple SourceStreams can concurrently write to the same file sink. - class CONTENT_EXPORT SourceStream - : public download::mojom::DownloadStreamClient { + class CONTENT_EXPORT SourceStream { public: SourceStream(int64_t offset, int64_t length, - std::unique_ptr<DownloadManager::InputStream> stream); - ~SourceStream() override; + std::unique_ptr<download::InputStream> stream); + ~SourceStream(); void Initialize(); - // download::mojom::DownloadStreamClient - void OnStreamCompleted( - download::mojom::NetworkRequestStatus status) override; - // Called when response is completed. void OnResponseCompleted(download::DownloadInterruptReason reason); @@ -133,14 +127,8 @@ // Register an callback to be called when download completes. void RegisterCompletionCallback(CompletionCallback callback); - // Results for reading the SourceStream. - enum StreamState { - EMPTY = 0, - HAS_DATA, - WAIT_FOR_COMPLETION, - COMPLETE, - }; - StreamState Read(scoped_refptr<net::IOBuffer>* data, size_t* length); + download::InputStream::StreamState Read(scoped_refptr<net::IOBuffer>* data, + size_t* length); int64_t offset() const { return offset_; } int64_t length() const { return length_; } @@ -171,21 +159,7 @@ size_t index_; // The stream through which data comes. - std::unique_ptr<ByteStreamReader> stream_reader_; - - // Status when the response completes, used by data pipe. - download::DownloadInterruptReason completion_status_; - - // Whether the producer has completed handling the response. - bool is_response_completed_; - - CompletionCallback completion_callback_; - - // Objects for consuming a mojo data pipe. - download::mojom::DownloadStreamHandlePtr stream_handle_; - std::unique_ptr<mojo::SimpleWatcher> handle_watcher_; - std::unique_ptr<mojo::Binding<download::mojom::DownloadStreamClient>> - binding_; + std::unique_ptr<download::InputStream> input_stream_; DISALLOW_COPY_AND_ASSIGN(SourceStream); }; @@ -209,10 +183,11 @@ private: friend class DownloadFileTest; - DownloadFileImpl(std::unique_ptr<download::DownloadSaveInfo> save_info, - const base::FilePath& default_downloads_directory, - uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer); + DownloadFileImpl( + std::unique_ptr<download::DownloadSaveInfo> save_info, + const base::FilePath& default_downloads_directory, + uint32_t download_id, + base::WeakPtr<download::DownloadDestinationObserver> observer); // Options for RenameWithRetryInternal. enum RenameOption { @@ -278,7 +253,7 @@ // Notify |observer_| about the download status. void NotifyObserver(SourceStream* source_stream, download::DownloadInterruptReason reason, - SourceStream::StreamState stream_state, + download::InputStream::StreamState stream_state, bool should_terminate); // Adds a new slice to |received_slices_| and update the existing entries in @@ -366,7 +341,7 @@ SEQUENCE_CHECKER(sequence_checker_); - base::WeakPtr<DownloadDestinationObserver> observer_; + base::WeakPtr<download::DownloadDestinationObserver> observer_; base::WeakPtrFactory<DownloadFileImpl> weak_factory_; DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl);
diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc index 9d5e084..8ae1ac9 100644 --- a/content/browser/download/download_file_unittest.cc +++ b/content/browser/download/download_file_unittest.cc
@@ -21,9 +21,10 @@ #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" #include "components/download/public/common/download_create_info.h" +#include "components/download/public/common/download_destination_observer.h" #include "components/download/public/common/download_interrupt_reasons.h" #include "content/browser/byte_stream.h" -#include "content/browser/download/download_destination_observer.h" +#include "content/browser/download/byte_stream_input_stream.h" #include "content/browser/download/download_file_impl.h" #include "content/public/browser/download_manager.h" #include "content/public/test/mock_download_manager.h" @@ -81,7 +82,8 @@ MOCK_METHOD1(RegisterCallback, void(const base::Closure&)); }; -class MockDownloadDestinationObserver : public DownloadDestinationObserver { +class MockDownloadDestinationObserver + : public download::DownloadDestinationObserver { public: MOCK_METHOD3(DestinationUpdate, void(int64_t, @@ -121,11 +123,12 @@ // retries renames failed due to ACCESS_DENIED. class TestDownloadFileImpl : public DownloadFileImpl { public: - TestDownloadFileImpl(std::unique_ptr<download::DownloadSaveInfo> save_info, - const base::FilePath& default_downloads_directory, - std::unique_ptr<DownloadManager::InputStream> stream, - uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) + TestDownloadFileImpl( + std::unique_ptr<download::DownloadSaveInfo> save_info, + const base::FilePath& default_downloads_directory, + std::unique_ptr<download::InputStream> stream, + uint32_t download_id, + base::WeakPtr<download::DownloadDestinationObserver> observer) : DownloadFileImpl(std::move(save_info), default_downloads_directory, std::move(stream), @@ -239,7 +242,7 @@ download_file_.reset(new TestDownloadFileImpl( std::move(save_info), download_dir_.GetPath(), - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::unique_ptr<ByteStreamReader>(input_stream_)), download::DownloadItem::kInvalidId, observer_factory_.GetWeakPtr())); @@ -473,7 +476,7 @@ } std::unique_ptr<StrictMock<MockDownloadDestinationObserver>> observer_; - base::WeakPtrFactory<DownloadDestinationObserver> observer_factory_; + base::WeakPtrFactory<download::DownloadDestinationObserver> observer_factory_; // DownloadFile instance we are testing. std::unique_ptr<DownloadFileImpl> download_file_; @@ -945,7 +948,7 @@ // Activate the streams. download_file_->AddInputStream( - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::unique_ptr<ByteStreamReader>(additional_streams_[0])), stream_0_length, download::DownloadSaveInfo::kLengthFullContent); sink_callback_.Run(); @@ -992,11 +995,11 @@ // Activate all the streams. download_file_->AddInputStream( - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::unique_ptr<ByteStreamReader>(additional_streams_[0])), stream_0_length, stream_1_length); download_file_->AddInputStream( - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::unique_ptr<ByteStreamReader>(additional_streams_[1])), stream_0_length + stream_1_length, download::DownloadSaveInfo::kLengthFullContent); @@ -1040,7 +1043,7 @@ additional_streams_[0] = new StrictMock<MockByteStreamReader>(); download_file_->AddInputStream( - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::unique_ptr<ByteStreamReader>(additional_streams_[0])), stream_0_length - 1, download::DownloadSaveInfo::kLengthFullContent); base::RunLoop().RunUntilIdle(); @@ -1080,7 +1083,7 @@ .RetiresOnSaturation(); download_file_->AddInputStream( - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::unique_ptr<ByteStreamReader>(additional_streams_[0])), 0, download::DownloadSaveInfo::kLengthFullContent);
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc index fedb1f2..aa6b434 100644 --- a/content/browser/download/download_item_impl.cc +++ b/content/browser/download/download_item_impl.cc
@@ -1243,7 +1243,7 @@ UpdateObservers(); } -base::WeakPtr<DownloadDestinationObserver> +base::WeakPtr<download::DownloadDestinationObserver> DownloadItemImpl::DestinationObserverAsWeakPtr() { return weak_ptr_factory_.GetWeakPtr(); }
diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h index 66a3f8c..0aa1793a 100644 --- a/content/browser/download/download_item_impl.h +++ b/content/browser/download/download_item_impl.h
@@ -18,11 +18,11 @@ #include "base/observer_list.h" #include "base/time/time.h" #include "components/download/public/common/download_create_info.h" +#include "components/download/public/common/download_destination_observer.h" #include "components/download/public/common/download_interrupt_reasons.h" #include "components/download/public/common/download_item.h" #include "components/download/public/common/download_request_handle_interface.h" #include "components/download/public/common/resume_mode.h" -#include "content/browser/download/download_destination_observer.h" #include "content/common/content_export.h" #include "url/gurl.h" @@ -34,8 +34,9 @@ class WebContents; // See download_item.h for usage. -class CONTENT_EXPORT DownloadItemImpl : public download::DownloadItem, - public DownloadDestinationObserver { +class CONTENT_EXPORT DownloadItemImpl + : public download::DownloadItem, + public download::DownloadDestinationObserver { public: // Information about the initial request that triggers the download. Most of // the fields are immutable after the download::DownloadItem is successfully @@ -305,8 +306,8 @@ // Provide a weak pointer reference to a DownloadDestinationObserver // for use by download destinations. - virtual base::WeakPtr<DownloadDestinationObserver> - DestinationObserverAsWeakPtr(); + virtual base::WeakPtr<download::DownloadDestinationObserver> + DestinationObserverAsWeakPtr(); // DownloadItemImpl routines only needed by SavePackage ---------------------- @@ -322,7 +323,7 @@ download::DownloadSource download_source() const { return download_source_; } - // DownloadDestinationObserver + // download::DownloadDestinationObserver void DestinationUpdate( int64_t bytes_so_far, int64_t bytes_per_sec,
diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc index 2892317..85bee53 100644 --- a/content/browser/download/download_item_impl_unittest.cc +++ b/content/browser/download/download_item_impl_unittest.cc
@@ -24,11 +24,11 @@ #include "base/test/scoped_task_environment.h" #include "base/threading/thread.h" #include "components/download/public/common/download_create_info.h" +#include "components/download/public/common/download_destination_observer.h" #include "components/download/public/common/download_interrupt_reasons.h" #include "components/download/public/common/download_request_handle_interface.h" #include "components/download/public/common/download_url_parameters.h" #include "content/browser/byte_stream.h" -#include "content/browser/download/download_destination_observer.h" #include "content/browser/download/download_file_factory.h" #include "content/browser/download/download_item_impl_delegate.h" #include "content/browser/download/mock_download_file.h" @@ -836,7 +836,7 @@ TEST_F(DownloadItemTest, AutomaticResumption_AttemptLimit) { base::HistogramTester histogram_tester; DownloadItemImpl* item = CreateDownloadItem(); - base::WeakPtr<DownloadDestinationObserver> as_observer( + base::WeakPtr<download::DownloadDestinationObserver> as_observer( item->DestinationObserverAsWeakPtr()); TestDownloadItemObserver observer(item); MockDownloadFile* mock_download_file_ref = nullptr; @@ -1554,7 +1554,7 @@ DownloadItemImpl* item = CreateDownloadItem(); MockDownloadFile* file = DoIntermediateRename(item, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); - base::WeakPtr<DownloadDestinationObserver> as_observer( + base::WeakPtr<download::DownloadDestinationObserver> as_observer( item->DestinationObserverAsWeakPtr()); TestDownloadItemObserver observer(item); @@ -1590,7 +1590,7 @@ DownloadItemImpl* item = CreateDownloadItem(); MockDownloadFile* download_file = DoIntermediateRename(item, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); - base::WeakPtr<DownloadDestinationObserver> as_observer( + base::WeakPtr<download::DownloadDestinationObserver> as_observer( item->DestinationObserverAsWeakPtr()); TestDownloadItemObserver observer(item); @@ -1625,7 +1625,7 @@ DownloadItemImpl* item = CreateDownloadItem(); MockDownloadFile* download_file = DoIntermediateRename(item, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); - base::WeakPtr<DownloadDestinationObserver> as_observer( + base::WeakPtr<download::DownloadDestinationObserver> as_observer( item->DestinationObserverAsWeakPtr()); TestDownloadItemObserver observer(item); @@ -1658,7 +1658,7 @@ DownloadItemImpl* item = CreateDownloadItem(); MockDownloadFile* download_file = DoIntermediateRename(item, download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS); - base::WeakPtr<DownloadDestinationObserver> as_observer( + base::WeakPtr<download::DownloadDestinationObserver> as_observer( item->DestinationObserverAsWeakPtr()); TestDownloadItemObserver observer(item); @@ -2104,7 +2104,7 @@ // various permutations of observer calls that will then be applied to a // download::DownloadItem in a state as yet undetermined. using CurriedObservation = - base::Callback<void(base::WeakPtr<DownloadDestinationObserver>)>; + base::Callback<void(base::WeakPtr<download::DownloadDestinationObserver>)>; // A list of observations that are to be made during some event in the // DownloadItemImpl control flow. Ordering of the observations is significant. @@ -2128,7 +2128,7 @@ void DestinationUpdateInvoker( int64_t bytes_so_far, int64_t bytes_per_sec, - base::WeakPtr<DownloadDestinationObserver> observer) { + base::WeakPtr<download::DownloadDestinationObserver> observer) { DVLOG(20) << "DestinationUpdate(bytes_so_far:" << bytes_so_far << ", bytes_per_sec:" << bytes_per_sec << ") observer:" << !!observer; @@ -2142,7 +2142,7 @@ void DestinationErrorInvoker( download::DownloadInterruptReason reason, int64_t bytes_so_far, - base::WeakPtr<DownloadDestinationObserver> observer) { + base::WeakPtr<download::DownloadDestinationObserver> observer) { DVLOG(20) << "DestinationError(reason:" << DownloadInterruptReasonToString(reason) << ", bytes_so_far:" << bytes_so_far << ") observer:" << !!observer; @@ -2153,7 +2153,7 @@ void DestinationCompletedInvoker( int64_t total_bytes, - base::WeakPtr<DownloadDestinationObserver> observer) { + base::WeakPtr<download::DownloadDestinationObserver> observer) { DVLOG(20) << "DestinationComplete(total_bytes:" << total_bytes << ") observer:" << !!observer; if (observer) @@ -2263,7 +2263,7 @@ // that are already scheduled. void ScheduleObservations( const ObservationList& observations, - base::WeakPtr<DownloadDestinationObserver> observer) { + base::WeakPtr<download::DownloadDestinationObserver> observer) { for (const auto action : observations) BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::BindOnce(action, observer)); @@ -2301,7 +2301,7 @@ item_->Start(std::move(file_), std::move(request_handle_), *create_info()); task_environment_.RunUntilIdle(); - base::WeakPtr<DownloadDestinationObserver> destination_observer = + base::WeakPtr<download::DownloadDestinationObserver> destination_observer = item_->DestinationObserverAsWeakPtr(); ScheduleObservations(PreInitializeFileObservations(), destination_observer); @@ -2348,7 +2348,7 @@ item_->Start(std::move(file_), std::move(request_handle_), *create_info()); task_environment_.RunUntilIdle(); - base::WeakPtr<DownloadDestinationObserver> destination_observer = + base::WeakPtr<download::DownloadDestinationObserver> destination_observer = item_->DestinationObserverAsWeakPtr(); ScheduleObservations(PreInitializeFileObservations(), destination_observer); @@ -2412,7 +2412,7 @@ item_->Start(std::move(file_), std::move(request_handle_), *create_info()); task_environment_.RunUntilIdle(); - base::WeakPtr<DownloadDestinationObserver> destination_observer = + base::WeakPtr<download::DownloadDestinationObserver> destination_observer = item_->DestinationObserverAsWeakPtr(); ScheduleObservations(PreInitializeFileObservations(), destination_observer);
diff --git a/content/browser/download/download_job.cc b/content/browser/download/download_job.cc index 6aa1355c..e39586b 100644 --- a/content/browser/download/download_job.cc +++ b/content/browser/download/download_job.cc
@@ -85,10 +85,9 @@ std::move(callback).Run(result, bytes_wasted); } -bool DownloadJob::AddInputStream( - std::unique_ptr<DownloadManager::InputStream> stream, - int64_t offset, - int64_t length) { +bool DownloadJob::AddInputStream(std::unique_ptr<download::InputStream> stream, + int64_t offset, + int64_t length) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DownloadFile* download_file = download_item_->download_file_.get(); if (!download_file) {
diff --git a/content/browser/download/download_job.h b/content/browser/download/download_job.h index aedb6e2..376a757 100644 --- a/content/browser/download/download_job.h +++ b/content/browser/download/download_job.h
@@ -62,7 +62,7 @@ // Add an input stream to the download sink. Return false if we start to // destroy download file. - bool AddInputStream(std::unique_ptr<DownloadManager::InputStream> stream, + bool AddInputStream(std::unique_ptr<download::InputStream> stream, int64_t offset, int64_t length);
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index 3776062c..33efd7d 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc
@@ -33,6 +33,7 @@ #include "components/download/public/common/download_url_parameters.h" #include "content/browser/byte_stream.h" #include "content/browser/child_process_security_policy_impl.h" +#include "content/browser/download/byte_stream_input_stream.h" #include "content/browser/download/download_file.h" #include "content/browser/download/download_file_factory.h" #include "content/browser/download/download_item_factory.h" @@ -120,11 +121,11 @@ std::unique_ptr<ByteStreamReader> empty_byte_stream; BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::BindOnce(&DownloadManager::StartDownload, download_manager, - std::move(failed_created_info), - std::make_unique<DownloadManager::InputStream>( - std::move(empty_byte_stream)), - params->callback())); + base::BindOnce( + &DownloadManager::StartDownload, download_manager, + std::move(failed_created_info), + std::make_unique<ByteStreamInputStream>(std::move(empty_byte_stream)), + params->callback())); } // Helper functions for DownloadItem -> DownloadEntry for InProgressCache. @@ -539,7 +540,7 @@ void DownloadManagerImpl::StartDownload( std::unique_ptr<download::DownloadCreateInfo> info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& on_started) { DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK(info); @@ -574,7 +575,7 @@ void DownloadManagerImpl::StartDownloadWithId( std::unique_ptr<download::DownloadCreateInfo> info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& on_started, bool new_download, uint32_t id) { @@ -1077,7 +1078,7 @@ void DownloadManagerImpl::OnUrlDownloadStarted( std::unique_ptr<download::DownloadCreateInfo> download_create_info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& callback) { StartDownload(std::move(download_create_info), std::move(stream), callback); }
diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h index f969895..66f48290 100644 --- a/content/browser/download/download_manager_impl.h +++ b/content/browser/download/download_manager_impl.h
@@ -76,7 +76,7 @@ void Shutdown() override; void GetAllDownloads(DownloadVector* result) override; void StartDownload(std::unique_ptr<download::DownloadCreateInfo> info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& on_started) override; @@ -130,7 +130,7 @@ // UrlDownloadHandler::Delegate implementation. void OnUrlDownloadStarted( std::unique_ptr<download::DownloadCreateInfo> download_create_info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& callback) override; void OnUrlDownloadStopped(UrlDownloadHandler* downloader) override; @@ -174,7 +174,7 @@ void StartDownloadWithId( std::unique_ptr<download::DownloadCreateInfo> info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& on_started, bool new_download, uint32_t id);
diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index 9e297fe..9bfc2f5 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc
@@ -29,6 +29,7 @@ #include "components/download/public/common/download_item.h" #include "components/download/public/common/download_request_handle_interface.h" #include "content/browser/byte_stream.h" +#include "content/browser/download/byte_stream_input_stream.h" #include "content/browser/download/download_file_factory.h" #include "content/browser/download/download_item_factory.h" #include "content/browser/download/download_item_impl.h" @@ -298,14 +299,14 @@ // Overridden method from DownloadFileFactory MOCK_METHOD2(MockCreateFile, MockDownloadFile*(const download::DownloadSaveInfo&, - DownloadManager::InputStream*)); + download::InputStream*)); DownloadFile* CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) override { + base::WeakPtr<download::DownloadDestinationObserver> observer) override { return MockCreateFile(*save_info, stream.get()); } }; @@ -571,7 +572,7 @@ .WillRepeatedly(Return("client-id")); MockDownloadFile* mock_file = new MockDownloadFile; auto input_stream = - std::make_unique<DownloadManager::InputStream>(std::move(stream)); + std::make_unique<ByteStreamInputStream>(std::move(stream)); EXPECT_CALL(*mock_download_file_factory_.get(), MockCreateFile(Ref(*info->save_info.get()), input_stream.get())) .WillOnce(Return(mock_file));
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc index 5ca1a5e..9bb5292 100644 --- a/content/browser/download/download_resource_handler.cc +++ b/content/browser/download/download_resource_handler.cc
@@ -17,6 +17,7 @@ #include "components/download/public/common/download_task_runner.h" #include "components/download/public/common/download_ukm_helper.h" #include "content/browser/byte_stream.h" +#include "content/browser/download/byte_stream_input_stream.h" #include "content/browser/download/download_manager_impl.h" #include "content/browser/download/download_request_handle.h" #include "content/browser/frame_host/frame_tree_node.h" @@ -92,8 +93,7 @@ download_manager->StartDownload( std::move(info), - std::make_unique<DownloadManager::InputStream>(std::move(stream)), - started_cb); + std::make_unique<ByteStreamInputStream>(std::move(stream)), started_cb); } void InitializeDownloadTabInfoOnUIThread(
diff --git a/content/browser/download/download_worker.cc b/content/browser/download/download_worker.cc index f9d4507..092910c 100644 --- a/content/browser/download/download_worker.cc +++ b/content/browser/download/download_worker.cc
@@ -6,7 +6,7 @@ #include "components/download/public/common/download_create_info.h" #include "components/download/public/common/download_interrupt_reasons.h" -#include "content/browser/byte_stream.h" +#include "components/download/public/common/input_stream.h" #include "content/browser/download/download_utils.h" #include "content/browser/download/resource_downloader.h" #include "content/public/browser/web_contents.h" @@ -19,21 +19,27 @@ const int kWorkerVerboseLevel = 1; -class CompletedByteStreamReader : public ByteStreamReader { +class CompletedInputStream : public download::InputStream { public: - CompletedByteStreamReader(int status) : status_(status) {}; - ~CompletedByteStreamReader() override = default; + CompletedInputStream(download::DownloadInterruptReason status) + : status_(status){}; + ~CompletedInputStream() override = default; - // ByteStreamReader implementations: - ByteStreamReader::StreamState Read(scoped_refptr<net::IOBuffer>* data, - size_t* length) override { - return ByteStreamReader::STREAM_COMPLETE; + // download::InputStream + bool IsEmpty() override { return false; } + download::InputStream::StreamState Read(scoped_refptr<net::IOBuffer>* data, + size_t* length) override { + *length = 0; + return InputStream::StreamState::COMPLETE; } - int GetStatus() const override { return status_; } - void RegisterCallback(const base::Closure& sink_callback) override {} + + download::DownloadInterruptReason GetCompletionStatus() override { + return status_; + } private: - int status_; + download::DownloadInterruptReason status_; + DISALLOW_COPY_AND_ASSIGN(CompletedInputStream); }; std::unique_ptr<UrlDownloadHandler, BrowserThread::DeleteOnIOThread> @@ -116,7 +122,7 @@ void DownloadWorker::OnUrlDownloadStarted( std::unique_ptr<download::DownloadCreateInfo> create_info, - std::unique_ptr<DownloadManager::InputStream> input_stream, + std::unique_ptr<download::InputStream> input_stream, const download::DownloadUrlParameters::OnStartedCallback& callback) { // |callback| is not used in subsequent requests. DCHECK(callback.is_null()); @@ -134,8 +140,7 @@ VLOG(kWorkerVerboseLevel) << "Parallel download sub-request failed. reason = " << create_info->result; - input_stream->stream_reader_.reset( - new CompletedByteStreamReader(create_info->result)); + input_stream.reset(new CompletedInputStream(create_info->result)); } request_handle_ = std::move(create_info->request_handle);
diff --git a/content/browser/download/download_worker.h b/content/browser/download/download_worker.h index 9a84008..c7ecb758 100644 --- a/content/browser/download/download_worker.h +++ b/content/browser/download/download_worker.h
@@ -31,7 +31,7 @@ // destination file. virtual void OnInputStreamReady( DownloadWorker* worker, - std::unique_ptr<DownloadManager::InputStream> input_stream) = 0; + std::unique_ptr<download::InputStream> input_stream) = 0; }; DownloadWorker(DownloadWorker::Delegate* delegate, @@ -56,7 +56,7 @@ // UrlDownloader::Delegate implementation. void OnUrlDownloadStarted( std::unique_ptr<download::DownloadCreateInfo> create_info, - std::unique_ptr<DownloadManager::InputStream> input_stream, + std::unique_ptr<download::InputStream> input_stream, const download::DownloadUrlParameters::OnStartedCallback& callback) override; void OnUrlDownloadStopped(UrlDownloadHandler* downloader) override;
diff --git a/content/browser/download/mock_download_file.cc b/content/browser/download/mock_download_file.cc index 4f88dde..7508d48 100644 --- a/content/browser/download/mock_download_file.cc +++ b/content/browser/download/mock_download_file.cc
@@ -38,7 +38,7 @@ } void MockDownloadFile::AddInputStream( - std::unique_ptr<DownloadManager::InputStream> input_stream, + std::unique_ptr<download::InputStream> input_stream, int64_t offset, int64_t length) { // Gmock currently can't mock method that takes move-only parameters,
diff --git a/content/browser/download/mock_download_file.h b/content/browser/download/mock_download_file.h index 9890b53..e8a0e14 100644 --- a/content/browser/download/mock_download_file.h +++ b/content/browser/download/mock_download_file.h
@@ -14,6 +14,7 @@ #include "base/files/file_path.h" #include "base/memory/ref_counted.h" +#include "components/download/public/common/input_stream.h" #include "content/browser/byte_stream.h" #include "content/browser/download/download_file.h" #include "content/public/browser/download_manager.h" @@ -35,12 +36,11 @@ const CancelRequestCallback& cancel_request_callback, const download::DownloadItem::ReceivedSlices& received_slices, bool is_parallelizable)); - void AddInputStream( - std::unique_ptr<DownloadManager::InputStream> input_stream, - int64_t offset, - int64_t length) override; + void AddInputStream(std::unique_ptr<download::InputStream> input_stream, + int64_t offset, + int64_t length) override; MOCK_METHOD3(DoAddInputStream, - void(DownloadManager::InputStream* input_stream, + void(download::InputStream* input_stream, int64_t offset, int64_t length)); MOCK_METHOD2(OnResponseCompleted,
diff --git a/content/browser/download/parallel_download_job.cc b/content/browser/download/parallel_download_job.cc index 9dfcc22..0f5b6578b 100644 --- a/content/browser/download/parallel_download_job.cc +++ b/content/browser/download/parallel_download_job.cc
@@ -125,7 +125,7 @@ void ParallelDownloadJob::OnInputStreamReady( DownloadWorker* worker, - std::unique_ptr<DownloadManager::InputStream> input_stream) { + std::unique_ptr<download::InputStream> input_stream) { bool success = DownloadJob::AddInputStream( std::move(input_stream), worker->offset(), worker->length()); download::RecordParallelDownloadAddStreamSuccess(success);
diff --git a/content/browser/download/parallel_download_job.h b/content/browser/download/parallel_download_job.h index 799f5df..0da38b6e 100644 --- a/content/browser/download/parallel_download_job.h +++ b/content/browser/download/parallel_download_job.h
@@ -59,7 +59,7 @@ // DownloadWorker::Delegate implementation. void OnInputStreamReady( DownloadWorker* worker, - std::unique_ptr<DownloadManager::InputStream> input_stream) override; + std::unique_ptr<download::InputStream> input_stream) override; // Build parallel requests after a delay, to effectively measure the single // stream bandwidth.
diff --git a/content/browser/download/parallel_download_job_unittest.cc b/content/browser/download/parallel_download_job_unittest.cc index d0164be..a52a5d1c 100644 --- a/content/browser/download/parallel_download_job_unittest.cc +++ b/content/browser/download/parallel_download_job_unittest.cc
@@ -11,8 +11,9 @@ #include "base/run_loop.h" #include "base/test/mock_callback.h" #include "base/test/scoped_task_environment.h" +#include "components/download/public/common/download_destination_observer.h" #include "components/download/public/common/download_task_runner.h" -#include "content/browser/download/download_destination_observer.h" +#include "content/browser/download/byte_stream_input_stream.h" #include "content/browser/download/download_file_impl.h" #include "content/browser/download/download_item_impl_delegate.h" #include "content/browser/download/mock_download_item_impl.h" @@ -39,7 +40,8 @@ MOCK_METHOD1(CancelRequest, void(bool)); }; -class MockDownloadDestinationObserver : public DownloadDestinationObserver { +class MockDownloadDestinationObserver + : public download::DownloadDestinationObserver { public: MOCK_METHOD3(DestinationUpdate, void(int64_t, @@ -106,7 +108,7 @@ void OnInputStreamReady( DownloadWorker* worker, - std::unique_ptr<DownloadManager::InputStream> input_stream) override { + std::unique_ptr<download::InputStream> input_stream) override { CountOnInputStreamReady(); } @@ -181,7 +183,7 @@ create_info->request_handle = std::move(request_handle); delegate->OnUrlDownloadStarted( std::move(create_info), - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::make_unique<MockByteStreamReader>()), download::DownloadUrlParameters::OnStartedCallback()); } @@ -488,11 +490,11 @@ new StrictMock<MockByteStreamReader>(); auto observer = std::make_unique<StrictMock<MockDownloadDestinationObserver>>(); - base::WeakPtrFactory<DownloadDestinationObserver> observer_factory( + base::WeakPtrFactory<download::DownloadDestinationObserver> observer_factory( observer.get()); auto download_file = std::make_unique<DownloadFileImpl>( std::move(save_info), base::FilePath(), - std::make_unique<DownloadManager::InputStream>( + std::make_unique<ByteStreamInputStream>( std::unique_ptr<ByteStreamReader>(input_stream)), download::DownloadItem::kInvalidId, observer_factory.GetWeakPtr()); CreateParallelJob(0, 100, download::DownloadItem::ReceivedSlices(), 2, 0, 0);
diff --git a/content/browser/download/parallel_download_utils_unittest.cc b/content/browser/download/parallel_download_utils_unittest.cc index 8344687..de977873 100644 --- a/content/browser/download/parallel_download_utils_unittest.cc +++ b/content/browser/download/parallel_download_utils_unittest.cc
@@ -11,6 +11,7 @@ #include "base/test/scoped_feature_list.h" #include "components/download/public/common/download_save_info.h" #include "content/browser/byte_stream.h" +#include "content/browser/download/byte_stream_input_stream.h" #include "content/public/browser/download_manager.h" #include "content/public/common/content_features.h" #include "testing/gmock/include/gmock/gmock.h" @@ -39,7 +40,7 @@ std::unique_ptr<DownloadFileImpl::SourceStream> CreateSourceStream( int64_t offset, int64_t length) { - auto input_stream = std::make_unique<DownloadManager::InputStream>( + auto input_stream = std::make_unique<ByteStreamInputStream>( std::make_unique<MockByteStreamReader>()); return std::make_unique<DownloadFileImpl::SourceStream>( offset, length, std::move(input_stream));
diff --git a/content/browser/download/resource_downloader.cc b/content/browser/download/resource_downloader.cc index b002708..91812870 100644 --- a/content/browser/download/resource_downloader.cc +++ b/content/browser/download/resource_downloader.cc
@@ -7,6 +7,7 @@ #include <memory> #include "base/strings/utf_string_conversions.h" +#include "components/download/public/common/stream_handle_input_stream.h" #include "content/browser/blob_storage/blob_url_loader_factory.h" #include "content/browser/download/download_utils.h" @@ -205,7 +206,7 @@ BrowserThread::UI, FROM_HERE, base::BindOnce(&UrlDownloadHandler::Delegate::OnUrlDownloadStarted, delegate_, std::move(download_create_info), - std::make_unique<DownloadManager::InputStream>( + std::make_unique<download::StreamHandleInputStream>( std::move(stream_handle)), callback_)); }
diff --git a/content/browser/download/url_download_handler.h b/content/browser/download/url_download_handler.h index c73d685..7986998 100644 --- a/content/browser/download/url_download_handler.h +++ b/content/browser/download/url_download_handler.h
@@ -6,10 +6,11 @@ #define CONTENT_BROWSER_DOWNLOAD_URL_DOWNLOAD_HANDLER #include "components/download/public/common/download_url_parameters.h" -#include "content/public/browser/download_manager.h" +#include "content/common/content_export.h" namespace download { struct DownloadCreateInfo; +class InputStream; } // namespace download namespace content { @@ -22,7 +23,7 @@ public: virtual void OnUrlDownloadStarted( std::unique_ptr<download::DownloadCreateInfo> download_create_info, - std::unique_ptr<DownloadManager::InputStream> input_stream, + std::unique_ptr<download::InputStream> input_stream, const download::DownloadUrlParameters::OnStartedCallback& callback) = 0; // Called after the connection is cancelled or finished. virtual void OnUrlDownloadStopped(UrlDownloadHandler* downloader) = 0;
diff --git a/content/browser/download/url_downloader.cc b/content/browser/download/url_downloader.cc index e6d93a0a..0943901 100644 --- a/content/browser/download/url_downloader.cc +++ b/content/browser/download/url_downloader.cc
@@ -14,6 +14,7 @@ #include "components/download/public/common/download_request_handle_interface.h" #include "components/download/public/common/download_url_parameters.h" #include "content/browser/byte_stream.h" +#include "content/browser/download/byte_stream_input_stream.h" #include "content/public/browser/browser_thread.h" #include "net/base/io_buffer.h" #include "net/base/load_flags.h" @@ -225,11 +226,11 @@ BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - base::BindOnce(&UrlDownloadHandler::Delegate::OnUrlDownloadStarted, - delegate_, std::move(create_info), - std::make_unique<DownloadManager::InputStream>( - std::move(stream_reader)), - callback)); + base::BindOnce( + &UrlDownloadHandler::Delegate::OnUrlDownloadStarted, delegate_, + std::move(create_info), + std::make_unique<ByteStreamInputStream>(std::move(stream_reader)), + callback)); } void UrlDownloader::OnReadyToRead() {
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 3f85398..39057c5 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1892,8 +1892,8 @@ // Execute any pending AX tree snapshot callbacks with an empty response, // since we're never going to get a response from this renderer. - for (const auto& iter : ax_tree_snapshot_callbacks_) - iter.second.Run(ui::AXTreeUpdate()); + for (auto& iter : ax_tree_snapshot_callbacks_) + std::move(iter.second).Run(ui::AXTreeUpdate()); #if defined(OS_ANDROID) // Execute any pending Samsung smart clip callbacks. @@ -2066,11 +2066,6 @@ // process input events. GetProcess()->SetIgnoreInputEvents(true); - // TODO(nasko): It is strange to accept the frame URL as a parameter from - // the renderer. Investigate and remove parameter, but for now let's - // double check. - DCHECK_EQ(frame_url, last_committed_url_); - delegate_->RunJavaScriptDialog(this, message, default_prompt, dialog_type, reply_msg); } @@ -2082,11 +2077,6 @@ TRACE_EVENT1("navigation", "RenderFrameHostImpl::OnRunBeforeUnloadConfirm", "frame_tree_node", frame_tree_node_->frame_tree_node_id()); - // TODO(nasko): It is strange to accept the frame URL as a parameter from - // the renderer. Investigate and remove parameter, but for now let's - // double check. - DCHECK_EQ(frame_url, last_committed_url_); - // While a JS beforeunload dialog is showing, tabs in the same process // shouldn't process input events. GetProcess()->SetIgnoreInputEvents(true); @@ -2629,7 +2619,7 @@ AXContentTreeDataToAXTreeData(&dst_snapshot.tree_data); dst_snapshot.has_tree_data = true; } - it->second.Run(dst_snapshot); + std::move(it->second).Run(dst_snapshot); ax_tree_snapshot_callbacks_.erase(it); } else { NOTREACHED() << "Received AX tree snapshot response for unknown id"; @@ -3952,7 +3942,8 @@ static int next_id = 1; int callback_id = next_id++; Send(new AccessibilityMsg_SnapshotTree(routing_id_, callback_id)); - ax_tree_snapshot_callbacks_.insert(std::make_pair(callback_id, callback)); + ax_tree_snapshot_callbacks_.insert( + std::make_pair(callback_id, std::move(callback))); } void RenderFrameHostImpl::SetAccessibilityCallbackForTesting(
diff --git a/content/browser/frame_host/render_frame_host_impl.h b/content/browser/frame_host/render_frame_host_impl.h index 2f94378..95fa30f 100644 --- a/content/browser/frame_host/render_frame_host_impl.h +++ b/content/browser/frame_host/render_frame_host_impl.h
@@ -158,8 +158,7 @@ public CSPContext { public: using AXTreeSnapshotCallback = - base::Callback<void( - const ui::AXTreeUpdate&)>; + base::OnceCallback<void(const ui::AXTreeUpdate&)>; // An accessibility reset is only allowed to prevent very rare corner cases // or race conditions where the browser and renderer get out of sync. If
diff --git a/content/browser/frame_host/render_widget_host_view_guest.cc b/content/browser/frame_host/render_widget_host_view_guest.cc index 475b8ba..fa89958 100644 --- a/content/browser/frame_host/render_widget_host_view_guest.cc +++ b/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -334,7 +334,7 @@ RenderWidgetHostViewChildFrame::Destroy(); } -gfx::Size RenderWidgetHostViewGuest::GetPhysicalBackingSize() const { +gfx::Size RenderWidgetHostViewGuest::GetCompositorViewportPixelSize() const { gfx::Size size; if (guest_) { size = gfx::ScaleToCeiledSize(guest_->frame_rect().size(),
diff --git a/content/browser/frame_host/render_widget_host_view_guest.h b/content/browser/frame_host/render_widget_host_view_guest.h index e15741e..a1c98cae 100644 --- a/content/browser/frame_host/render_widget_host_view_guest.h +++ b/content/browser/frame_host/render_widget_host_view_guest.h
@@ -75,7 +75,7 @@ gfx::NativeViewAccessible GetNativeViewAccessible() override; gfx::Rect GetViewBounds() const override; gfx::Rect GetBoundsInRootWindow() override; - gfx::Size GetPhysicalBackingSize() const override; + gfx::Size GetCompositorViewportPixelSize() const override; base::string16 GetSelectedText() override; void SetNeedsBeginFrames(bool needs_begin_frames) override; TouchSelectionControllerClientManager*
diff --git a/content/browser/loader/merkle_integrity_source_stream.cc b/content/browser/loader/merkle_integrity_source_stream.cc index 6844d77..5dc5b7f 100644 --- a/content/browser/loader/merkle_integrity_source_stream.cc +++ b/content/browser/loader/merkle_integrity_source_stream.cc
@@ -13,8 +13,9 @@ namespace { -// Limit the record size to 5MiB to prevent browser OOM. -constexpr uint64_t kMaxRecordSize = 5 * 1024 * 1024; +// Limit the record size to 16KiB to prevent browser OOM. This matches the +// maximum record size in TLS and the default maximum frame size in HTTP/2. +constexpr uint64_t kMaxRecordSize = 16 * 1024; constexpr char kMiSha256Header[] = "mi-sha256="; constexpr size_t kMiSha256HeaderLength = sizeof(kMiSha256Header) - 1;
diff --git a/content/browser/loader/merkle_integrity_source_stream_unittest.cc b/content/browser/loader/merkle_integrity_source_stream_unittest.cc index 6f9e514..cffe7cac 100644 --- a/content/browser/loader/merkle_integrity_source_stream_unittest.cc +++ b/content/browser/loader/merkle_integrity_source_stream_unittest.cc
@@ -199,8 +199,9 @@ EXPECT_EQ(net::ERR_CONTENT_DECODING_FAILED, result); } -TEST_P(MerkleIntegritySourceStreamTest, RecordSizeTooBig) { +TEST_P(MerkleIntegritySourceStreamTest, RecordSizeHuge) { Init(kMIEmptyBody); + // 2^64 - 1 is far too large. const uint8_t record_size[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; source()->AddReadResult(reinterpret_cast<const char*>(record_size), @@ -210,6 +211,18 @@ EXPECT_EQ(net::ERR_CONTENT_DECODING_FAILED, result); } +TEST_P(MerkleIntegritySourceStreamTest, RecordSizeTooBig) { + Init(kMIEmptyBody); + // 2^16 + 1 just exceeds the limit. + const uint8_t record_size[] = {0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x40, 0x01}; + source()->AddReadResult(reinterpret_cast<const char*>(record_size), + sizeof(record_size), net::OK, GetParam().mode); + std::string actual_output; + int result = ReadStream(&actual_output); + EXPECT_EQ(net::ERR_CONTENT_DECODING_FAILED, result); +} + // https://tools.ietf.org/html/draft-thomson-http-mice-02#section-4.1 TEST_P(MerkleIntegritySourceStreamTest, SingleRecord) { Init(kMISingleRecord);
diff --git a/content/browser/media/encrypted_media_browsertest.cc b/content/browser/media/encrypted_media_browsertest.cc index 74387d2..9b6b67df 100644 --- a/content/browser/media/encrypted_media_browsertest.cc +++ b/content/browser/media/encrypted_media_browsertest.cc
@@ -49,6 +49,9 @@ const char kWebMVP9VideoOnly[] = "video/webm; codecs=\"vp9\""; const char kWebMOpusAudioVP9Video[] = "video/webm; codecs=\"opus, vp9\""; const char kWebMVorbisAudioVP8Video[] = "video/webm; codecs=\"vorbis, vp8\""; +#if BUILDFLAG(USE_PROPRIETARY_CODECS) +const char kMP4VideoOnly[] = "video/mp4; codecs=\"avc1.64001E\""; +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) // EME-specific test results and errors. const char kEmeKeyError[] = "KEYERROR"; @@ -140,6 +143,19 @@ src_type, media::kEnded); } +#if BUILDFLAG(USE_PROPRIETARY_CODECS) + void TestMP4EncryptionPlayback(const std::string& media_file, + const std::string& expected_title) { + if (CurrentSourceType() != SrcType::MSE) { + DVLOG(0) << "Skipping test; Can only play MP4 encrypted streams by MSE."; + return; + } + + RunEncryptedMediaTest(kDefaultEmePlayer, media_file, kMP4VideoOnly, + CurrentKeySystem(), SrcType::MSE, expected_title); + } +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) + protected: // We want to fail quickly when a test fails because an error is encountered. void AddTitlesToAwait(content::TitleWatcher* title_watcher) override { @@ -270,6 +286,28 @@ TestFrameSizeChange(); } +#if BUILDFLAG(USE_PROPRIETARY_CODECS) +IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CENC) { + TestMP4EncryptionPlayback("bear-640x360-v_frag-cenc.mp4", media::kEnded); +} + +IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CBC1) { + TestMP4EncryptionPlayback("bear-640x360-v_frag-cbc1.mp4", media::kError); +} + +IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CENS) { + TestMP4EncryptionPlayback("bear-640x360-v_frag-cens.mp4", media::kError); +} + +IN_PROC_BROWSER_TEST_P(EncryptedMediaTest, Playback_Encryption_CBCS) { +#if BUILDFLAG(ENABLE_CBCS_ENCRYPTION_SCHEME) + TestMP4EncryptionPlayback("bear-640x360-v_frag-cbcs.mp4", media::kEnded); +#else + TestMP4EncryptionPlayback("bear-640x360-v_frag-cbcs.mp4", media::kError); +#endif +} +#endif // BUILDFLAG(USE_PROPRIETARY_CODECS) + IN_PROC_BROWSER_TEST_F(EncryptedMediaTest, UnknownKeySystemThrowsException) { RunEncryptedMediaTest(kDefaultEmePlayer, "bear-a_enc-a.webm", kWebMVorbisAudioOnly, "com.example.foo", SrcType::MSE,
diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc index 671f282..506227d 100644 --- a/content/browser/media/media_internals_unittest.cc +++ b/content/browser/media/media_internals_unittest.cc
@@ -126,6 +126,8 @@ std::map<VideoCaptureApi, std::string> api_to_string_map; api_to_string_map[VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE] = "V4L2 SPLANE"; api_to_string_map[VideoCaptureApi::WIN_MEDIA_FOUNDATION] = "Media Foundation"; + api_to_string_map[VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR] = + "Media Foundation Sensor Camera"; api_to_string_map[VideoCaptureApi::WIN_DIRECT_SHOW] = "Direct Show"; api_to_string_map[VideoCaptureApi::MACOSX_AVFOUNDATION] = "AV Foundation"; api_to_string_map[VideoCaptureApi::MACOSX_DECKLINK] = "DeckLink";
diff --git a/content/browser/memory/memory_coordinator_impl.cc b/content/browser/memory/memory_coordinator_impl.cc index 8c916774..bcae711d 100644 --- a/content/browser/memory/memory_coordinator_impl.cc +++ b/content/browser/memory/memory_coordinator_impl.cc
@@ -55,16 +55,6 @@ return "N/A"; } -void RecordBrowserPurge(size_t before) { - auto metrics = base::ProcessMetrics::CreateCurrentProcessMetrics(); - size_t after = metrics->GetWorkingSetSize(); - int64_t bytes = static_cast<int64_t>(before) - static_cast<int64_t>(after); - if (bytes < 0) - bytes = 0; - UMA_HISTOGRAM_MEMORY_LARGE_MB("Memory.Experimental.Browser.PurgedMemory", - bytes / 1024 / 1024); -} - } // namespace // The implementation of MemoryCoordinatorHandle. See memory_coordinator.mojom @@ -236,24 +226,6 @@ return true; } -bool MemoryCoordinatorImpl::TryToPurgeMemoryFromBrowser() { - base::TimeTicks now = tick_clock_->NowTicks(); - if (can_purge_after_ > now) - return false; - - auto metrics = base::ProcessMetrics::CreateCurrentProcessMetrics(); - size_t before = metrics->GetWorkingSetSize(); - task_runner_->PostDelayedTask(FROM_HERE, - base::BindOnce(&RecordBrowserPurge, before), - base::TimeDelta::FromSeconds(2)); - - // Suppress purging in the browser process until a certain period of time is - // passed. - can_purge_after_ = now + base::TimeDelta::FromMinutes(2); - base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory(); - return true; -} - bool MemoryCoordinatorImpl::TryToPurgeMemoryFromChild(int render_process_id) { auto iter = children().find(render_process_id); if (iter == children().end())
diff --git a/content/browser/memory/memory_coordinator_impl.h b/content/browser/memory/memory_coordinator_impl.h index 8f42d98d..48de5510 100644 --- a/content/browser/memory/memory_coordinator_impl.h +++ b/content/browser/memory/memory_coordinator_impl.h
@@ -105,9 +105,6 @@ // returns false otherwise. bool SetChildMemoryState(int render_process_id, MemoryState memory_state); - // Tries to purge memory from the browser process. - bool TryToPurgeMemoryFromBrowser(); - // Tries to purge memory from the provided child process. bool TryToPurgeMemoryFromChild(int render_process_id);
diff --git a/content/browser/payments/payment_app_provider_impl.cc b/content/browser/payments/payment_app_provider_impl.cc index 6c231e1..b1ef01e 100644 --- a/content/browser/payments/payment_app_provider_impl.cc +++ b/content/browser/payments/payment_app_provider_impl.cc
@@ -14,10 +14,13 @@ #include "content/browser/storage_partition_impl.h" #include "content/common/service_worker/service_worker_status_code.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/permission_manager.h" +#include "content/public/browser/permission_type.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" #include "mojo/common/time.mojom.h" #include "third_party/WebKit/public/mojom/service_worker/service_worker_provider_type.mojom.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/image/image.h" @@ -358,6 +361,37 @@ } } +void CheckPermissionForPaymentApps( + BrowserContext* browser_context, + PaymentAppProvider::GetAllPaymentAppsCallback callback, + PaymentAppProvider::PaymentApps apps) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + if (!browser_context) { + std::move(callback).Run(PaymentAppProvider::PaymentApps()); + return; + } + + PermissionManager* permission_manager = + browser_context->GetPermissionManager(); + if (!permission_manager) { + std::move(callback).Run(PaymentAppProvider::PaymentApps()); + return; + } + + PaymentAppProvider::PaymentApps permitted_apps; + for (auto& app : apps) { + GURL origin = app.second->scope.GetOrigin(); + if (permission_manager->GetPermissionStatus(PermissionType::PAYMENT_HANDLER, + origin, origin) == + blink::mojom::PermissionStatus::GRANTED) { + permitted_apps[app.first] = std::move(app.second); + } + } + + std::move(callback).Run(std::move(permitted_apps)); +} + } // namespace // static @@ -384,7 +418,8 @@ BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::BindOnce(&GetAllPaymentAppsOnIO, payment_app_context, - std::move(callback))); + base::BindOnce(&CheckPermissionForPaymentApps, + browser_context, std::move(callback)))); } void PaymentAppProviderImpl::InvokePaymentApp(
diff --git a/content/browser/payments/payment_app_provider_impl_unittest.cc b/content/browser/payments/payment_app_provider_impl_unittest.cc index aca22ef2..6cd52ccc 100644 --- a/content/browser/payments/payment_app_provider_impl_unittest.cc +++ b/content/browser/payments/payment_app_provider_impl_unittest.cc
@@ -10,8 +10,13 @@ #include "base/run_loop.h" #include "content/browser/payments/payment_app_content_unittest_base.h" #include "content/browser/payments/payment_app_provider_impl.h" +#include "content/public/browser/permission_type.h" +#include "content/public/test/mock_permission_manager.h" +#include "content/public/test/test_browser_context.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/platform/modules/payments/payment_app.mojom.h" +#include "third_party/WebKit/public/platform/modules/permissions/permission_status.mojom.h" #include "url/gurl.h" namespace content { @@ -51,7 +56,17 @@ class PaymentAppProviderTest : public PaymentAppContentUnitTestBase { public: - PaymentAppProviderTest() {} + PaymentAppProviderTest() { + std::unique_ptr<MockPermissionManager> mock_permission_manager( + new testing::NiceMock<MockPermissionManager>()); + ON_CALL(*mock_permission_manager, + GetPermissionStatus(PermissionType::PAYMENT_HANDLER, testing::_, + testing::_)) + .WillByDefault( + testing::Return(blink::mojom::PermissionStatus::GRANTED)); + static_cast<TestBrowserContext*>(browser_context()) + ->SetPermissionManager(std::move(mock_permission_manager)); + } ~PaymentAppProviderTest() override {} void SetPaymentInstrument(
diff --git a/content/browser/plugin_service_impl.h b/content/browser/plugin_service_impl.h index 8669885..08746e3 100644 --- a/content/browser/plugin_service_impl.h +++ b/content/browser/plugin_service_impl.h
@@ -88,6 +88,9 @@ void GetInternalPlugins(std::vector<WebPluginInfo>* plugins) override; bool PpapiDevChannelSupported(BrowserContext* browser_context, const GURL& document_url) override; + int CountPpapiPluginProcessesForProfile( + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory) override; // Returns the plugin process host corresponding to the plugin process that // has been started by this service. This will start a process to host the @@ -150,10 +153,6 @@ PpapiPluginProcessHost* FindPpapiBrokerProcess( const base::FilePath& broker_path); - int CountPpapiPluginProcessesForProfile( - const base::FilePath& plugin_path, - const base::FilePath& profile_data_directory); - void RegisterPepperPlugins(); // Loads the plugins synchronously in a thread pool.
diff --git a/content/browser/renderer_host/frame_connector_delegate.h b/content/browser/renderer_host/frame_connector_delegate.h index 2edb79e..af0b0ff 100644 --- a/content/browser/renderer_host/frame_connector_delegate.h +++ b/content/browser/renderer_host/frame_connector_delegate.h
@@ -245,7 +245,7 @@ const bool use_zoom_for_device_scale_factor_; FRIEND_TEST_ALL_PREFIXES(RenderWidgetHostViewChildFrameZoomForDSFTest, - PhysicalBackingSize); + CompositorViewportPixelSize); }; } // namespace content
diff --git a/content/browser/renderer_host/render_widget_host_browsertest.cc b/content/browser/renderer_host/render_widget_host_browsertest.cc index 492566c1..b55f1f1 100644 --- a/content/browser/renderer_host/render_widget_host_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_browsertest.cc
@@ -62,7 +62,8 @@ // Create a simulated-from-renderer CompositorFrame with a CopyOutputRequest. viz::CompositorFrame frame; std::unique_ptr<viz::RenderPass> pass = viz::RenderPass::Create(); - const gfx::Rect& output_rect = gfx::Rect(view->GetPhysicalBackingSize()); + const gfx::Rect output_rect = + gfx::Rect(view->GetCompositorViewportPixelSize()); pass->SetNew(1 /* render pass id */, output_rect, output_rect, gfx::Transform()); bool did_receive_aborted_copy_result = false;
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index a443c23..20e7e357 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -758,10 +758,8 @@ if (view_) { resize_params->new_size = view_->GetRequestedRendererSize(); - // TODO(wjmaclean): Can we just get rid of physical_backing_size and just - // deal with it on the renderer side? It seems to always be - // ScaleToCeiledSize(new_size, device_scale_factor) ?? - resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); + resize_params->compositor_viewport_pixel_size = + view_->GetCompositorViewportPixelSize(); resize_params->top_controls_height = view_->GetTopControlsHeight(); resize_params->bottom_controls_height = view_->GetBottomControlsHeight(); if (IsUseZoomForDSFEnabled()) { @@ -778,7 +776,7 @@ // a size. We should only propagate a LocalSurfaceId here if the // compositor's viewport has a non-empty size. viz::LocalSurfaceId local_surface_id = - resize_params->physical_backing_size.IsEmpty() + resize_params->compositor_viewport_pixel_size.IsEmpty() ? viz::LocalSurfaceId() : view_->GetLocalSurfaceId(); if (local_surface_id.is_valid()) @@ -800,14 +798,14 @@ const bool size_changed = !old_resize_params_ || old_resize_params_->new_size != resize_params->new_size || - (old_resize_params_->physical_backing_size.IsEmpty() && - !resize_params->physical_backing_size.IsEmpty()); + (old_resize_params_->compositor_viewport_pixel_size.IsEmpty() && + !resize_params->compositor_viewport_pixel_size.IsEmpty()); bool dirty = size_changed || old_resize_params_->screen_info != resize_params->screen_info || - old_resize_params_->physical_backing_size != - resize_params->physical_backing_size || + old_resize_params_->compositor_viewport_pixel_size != + resize_params->compositor_viewport_pixel_size || old_resize_params_->is_fullscreen_granted != resize_params->is_fullscreen_granted || old_resize_params_->display_mode != resize_params->display_mode || @@ -829,7 +827,7 @@ // backing size is empty, or when the main viewport size didn't change. resize_params->needs_resize_ack = g_check_for_pending_resize_ack && !resize_params->new_size.IsEmpty() && - !resize_params->physical_backing_size.IsEmpty() && + !resize_params->compositor_viewport_pixel_size.IsEmpty() && (size_changed || next_resize_needs_resize_ack_) && (!enable_surface_synchronization_ || (resize_params->local_surface_id.has_value() &&
diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 4ad77aef..430d49e 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc
@@ -327,7 +327,7 @@ unhandled_wheel_event_count_(0), acked_event_count_(0), gesture_event_type_(-1), - use_fake_physical_backing_size_(false), + use_fake_compositor_viewport_pixel_size_(false), ack_result_(INPUT_EVENT_ACK_STATE_UNKNOWN), top_controls_height_(0.f), bottom_controls_height_(0.f) {} @@ -372,12 +372,13 @@ int gesture_event_type() const { return gesture_event_type_; } InputEventAckState ack_result() const { return ack_result_; } - void SetMockPhysicalBackingSize(const gfx::Size& mock_physical_backing_size) { - use_fake_physical_backing_size_ = true; - mock_physical_backing_size_ = mock_physical_backing_size; + void SetMockCompositorViewportPixelSize( + const gfx::Size& mock_compositor_viewport_pixel_size) { + use_fake_compositor_viewport_pixel_size_ = true; + mock_compositor_viewport_pixel_size_ = mock_compositor_viewport_pixel_size; } - void ClearMockPhysicalBackingSize() { - use_fake_physical_backing_size_ = false; + void ClearMockCompositorViewportPixelSize() { + use_fake_compositor_viewport_pixel_size_ = false; } const viz::BeginFrameAck& last_did_not_produce_frame_ack() { @@ -411,10 +412,10 @@ gesture_event_type_ = event.GetType(); ack_result_ = ack_result; } - gfx::Size GetPhysicalBackingSize() const override { - if (use_fake_physical_backing_size_) - return mock_physical_backing_size_; - return TestRenderWidgetHostView::GetPhysicalBackingSize(); + gfx::Size GetCompositorViewportPixelSize() const override { + if (use_fake_compositor_viewport_pixel_size_) + return mock_compositor_viewport_pixel_size_; + return TestRenderWidgetHostView::GetCompositorViewportPixelSize(); } void OnDidNotProduceFrame(const viz::BeginFrameAck& ack) override { last_did_not_produce_frame_ack_ = ack; @@ -427,8 +428,8 @@ int acked_event_count_; int gesture_event_type_; gfx::Rect bounds_; - bool use_fake_physical_backing_size_; - gfx::Size mock_physical_backing_size_; + bool use_fake_compositor_viewport_pixel_size_; + gfx::Size mock_compositor_viewport_pixel_size_; InputEventAckState ack_result_; float top_controls_height_; float bottom_controls_height_; @@ -1009,7 +1010,7 @@ // No resize ack if the physical backing gets set, but the view bounds are // zero. - view_->SetMockPhysicalBackingSize(gfx::Size(200, 200)); + view_->SetMockCompositorViewportPixelSize(gfx::Size(200, 200)); host_->WasResized(); EXPECT_FALSE(host_->resize_ack_pending_); @@ -1018,7 +1019,7 @@ gfx::Rect original_size(0, 0, 100, 100); process_->sink().ClearMessages(); view_->SetBounds(original_size); - view_->SetMockPhysicalBackingSize(gfx::Size()); + view_->SetMockCompositorViewportPixelSize(gfx::Size()); host_->WasResized(); EXPECT_FALSE(host_->resize_ack_pending_); EXPECT_EQ(original_size.size(), host_->old_resize_params_->new_size); @@ -1027,7 +1028,7 @@ // Setting the bounds and physical backing size to nonzero should send out // the notification and expect an ack. process_->sink().ClearMessages(); - view_->ClearMockPhysicalBackingSize(); + view_->ClearMockCompositorViewportPixelSize(); host_->WasResized(); EXPECT_TRUE(host_->resize_ack_pending_); EXPECT_EQ(original_size.size(), host_->old_resize_params_->new_size); @@ -2707,14 +2708,15 @@ TEST_F(RenderWidgetHostTest, ResizeParams) { gfx::Rect bounds(0, 0, 100, 100); - gfx::Size physical_backing_size(40, 50); + gfx::Size compositor_viewport_pixel_size(40, 50); view_->SetBounds(bounds); - view_->SetMockPhysicalBackingSize(physical_backing_size); + view_->SetMockCompositorViewportPixelSize(compositor_viewport_pixel_size); ResizeParams resize_params; host_->GetResizeParams(&resize_params); EXPECT_EQ(bounds.size(), resize_params.new_size); - EXPECT_EQ(physical_backing_size, resize_params.physical_backing_size); + EXPECT_EQ(compositor_viewport_pixel_size, + resize_params.compositor_viewport_pixel_size); } TEST_F(RenderWidgetHostTest, ResizeParamsDeviceScale) {
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index bd0f339..8825203 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -418,7 +418,7 @@ return view_.GetSize(); } -gfx::Size RenderWidgetHostViewAndroid::GetPhysicalBackingSize() const { +gfx::Size RenderWidgetHostViewAndroid::GetCompositorViewportPixelSize() const { if (!content_view_core_) { if (default_bounds_.IsEmpty()) return gfx::Size();
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index 908ea65..e3e288f 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -117,7 +117,7 @@ bool IsShowing() override; gfx::Rect GetViewBounds() const override; gfx::Size GetVisibleViewportSize() const override; - gfx::Size GetPhysicalBackingSize() const override; + gfx::Size GetCompositorViewportPixelSize() const override; bool IsSurfaceAvailableForCopy() const override; void CopyFromSurface( const gfx::Rect& src_rect,
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index db0e5a9..c966e46 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -2212,7 +2212,7 @@ EXPECT_EQ(0U, pointer_state().GetPointerCount()); } -TEST_F(RenderWidgetHostViewAuraTest, PhysicalBackingSizeWithScale) { +TEST_F(RenderWidgetHostViewAuraTest, CompositorViewportPixelSizeWithScale) { view_->InitAsChild(nullptr); aura::client::ParentWindowWithContext( view_->GetNativeView(), @@ -2220,7 +2220,7 @@ gfx::Rect()); sink_->ClearMessages(); view_->SetSize(gfx::Size(100, 100)); - EXPECT_EQ("100x100", view_->GetPhysicalBackingSize().ToString()); + EXPECT_EQ("100x100", view_->GetCompositorViewportPixelSize().ToString()); EXPECT_EQ(1u, sink_->message_count()); EXPECT_EQ(static_cast<uint32_t>(ViewMsg_Resize::ID), sink_->GetMessageAt(0)->type()); @@ -2230,16 +2230,16 @@ ViewMsg_Resize::Param params; ViewMsg_Resize::Read(msg, ¶ms); EXPECT_EQ("100x100", std::get<0>(params).new_size.ToString()); // dip size - EXPECT_EQ( - "100x100", - std::get<0>(params).physical_backing_size.ToString()); // backing size + EXPECT_EQ("100x100", + std::get<0>(params) + .compositor_viewport_pixel_size.ToString()); // backing size } widget_host_->ResetSizeAndRepaintPendingFlags(); sink_->ClearMessages(); aura_test_helper_->test_screen()->SetDeviceScaleFactor(2.0f); - EXPECT_EQ("200x200", view_->GetPhysicalBackingSize().ToString()); + EXPECT_EQ("200x200", view_->GetCompositorViewportPixelSize().ToString()); // Extra ScreenInfoChanged message for |parent_view_|. // Changing the device scale factor triggers the // RenderWidgetHostViewAura::OnDisplayMetricsChanged() observer callback, @@ -2256,7 +2256,7 @@ EXPECT_EQ(1u, sink_->message_count()); EXPECT_EQ(static_cast<uint32_t>(ViewMsg_Resize::ID), sink_->GetMessageAt(0)->type()); - EXPECT_EQ("100x100", view_->GetPhysicalBackingSize().ToString()); + EXPECT_EQ("100x100", view_->GetCompositorViewportPixelSize().ToString()); } // This test verifies that in AutoResize mode a new
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index c6b83be..f7dfced4 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -95,7 +95,7 @@ SetBackgroundColor(SK_ColorWHITE); } -gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { +gfx::Size RenderWidgetHostViewBase::GetCompositorViewportPixelSize() const { return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), GetDeviceScaleFactor()); }
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index 9b8f8ad..e40361b6 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -183,7 +183,7 @@ virtual gfx::Size GetRequestedRendererSize() const; // The size of the view's backing surface in non-DPI-adjusted pixels. - virtual gfx::Size GetPhysicalBackingSize() const; + virtual gfx::Size GetCompositorViewportPixelSize() const; // Whether or not Blink's viewport size should be shrunk by the height of the // URL-bar.
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc index 4b89eee..68703a0 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -349,9 +349,8 @@ return background_color_; } -gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const { - // TODO(fsamuel): Consider renaming GetPhysicalBackingSize to - // GetCompositorViewportSize. +gfx::Size RenderWidgetHostViewChildFrame::GetCompositorViewportPixelSize() + const { if (frame_connector_) return frame_connector_->local_frame_size_in_pixels(); return gfx::Size();
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h index d92ad659..c9de265b 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.h +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h
@@ -107,7 +107,7 @@ gfx::NativeViewAccessible GetNativeViewAccessible() override; void SetBackgroundColor(SkColor color) override; SkColor background_color() const override; - gfx::Size GetPhysicalBackingSize() const override; + gfx::Size GetCompositorViewportPixelSize() const override; bool IsMouseLocked() override; void SetNeedsBeginFrames(bool needs_begin_frames) override; void SetWantsAnimateOnlyBeginFrames() override;
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc b/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc index 5b739f0..93cdd97 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc
@@ -310,19 +310,20 @@ } // Tests that moving the child around does not affect the physical backing size. -TEST_F(RenderWidgetHostViewChildFrameZoomForDSFTest, PhysicalBackingSize) { +TEST_F(RenderWidgetHostViewChildFrameZoomForDSFTest, + CompositorViewportPixelSize) { ScreenInfo screen_info; screen_info.device_scale_factor = 2.0f; test_frame_connector_->SetScreenInfoForTesting(screen_info); gfx::Size local_frame_size(1276, 410); test_frame_connector_->SetLocalFrameSize(local_frame_size); - EXPECT_EQ(local_frame_size, view_->GetPhysicalBackingSize()); + EXPECT_EQ(local_frame_size, view_->GetCompositorViewportPixelSize()); gfx::Rect screen_space_rect(local_frame_size); screen_space_rect.set_origin(gfx::Point(230, 263)); test_frame_connector_->SetScreenSpaceRect(screen_space_rect); - EXPECT_EQ(local_frame_size, view_->GetPhysicalBackingSize()); + EXPECT_EQ(local_frame_size, view_->GetCompositorViewportPixelSize()); EXPECT_EQ(gfx::Point(115, 131), view_->GetViewBounds().origin()); EXPECT_EQ(gfx::Point(230, 263), test_frame_connector_->screen_space_rect_in_pixels().origin()); @@ -337,8 +338,8 @@ widget_host_->Init(); - constexpr gfx::Size physical_backing_size(100, 100); - constexpr gfx::Rect screen_space_rect(physical_backing_size); + constexpr gfx::Size compositor_viewport_pixel_size(100, 100); + constexpr gfx::Rect screen_space_rect(compositor_viewport_pixel_size); viz::ParentLocalSurfaceIdAllocator allocator; viz::LocalSurfaceId local_surface_id = allocator.GenerateId(); constexpr viz::FrameSinkId frame_sink_id(1, 1); @@ -346,8 +347,9 @@ process->sink().ClearMessages(); - test_frame_connector_->UpdateResizeParams( - screen_space_rect, physical_backing_size, ScreenInfo(), 1u, surface_id); + test_frame_connector_->UpdateResizeParams(screen_space_rect, + compositor_viewport_pixel_size, + ScreenInfo(), 1u, surface_id); ASSERT_EQ(1u, process->sink().message_count()); @@ -356,7 +358,8 @@ ASSERT_NE(nullptr, resize_msg); ViewMsg_Resize::Param params; ViewMsg_Resize::Read(resize_msg, ¶ms); - EXPECT_EQ(physical_backing_size, std::get<0>(params).physical_backing_size); + EXPECT_EQ(compositor_viewport_pixel_size, + std::get<0>(params).compositor_viewport_pixel_size); EXPECT_EQ(screen_space_rect.size(), std::get<0>(params).new_size); EXPECT_EQ(local_surface_id, std::get<0>(params).local_surface_id); }
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 5084a18f..d7e37db 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -746,6 +746,9 @@ } void RenderWidgetHostViewMac::Hide() { + if (!browser_compositor_) + return; + ScopedCAActionDisabler disabler; [cocoa_view_ setHidden:YES]; @@ -754,11 +757,17 @@ } void RenderWidgetHostViewMac::WasUnOccluded() { + if (!browser_compositor_) + return; + browser_compositor_->SetRenderWidgetHostIsHidden(false); render_widget_host_->WasShown(ui::LatencyInfo()); } void RenderWidgetHostViewMac::WasOccluded() { + if (!browser_compositor_) + return; + render_widget_host_->WasHidden(); browser_compositor_->SetRenderWidgetHostIsHidden(true); }
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc index 848d834..e9f9bfd 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.cc +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
@@ -16,7 +16,6 @@ #include "content/browser/bad_message.h" #include "content/browser/service_worker/embedded_worker_registry.h" #include "content/browser/service_worker/embedded_worker_status.h" -#include "content/browser/service_worker/service_worker_client_utils.h" #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_context_wrapper.h" #include "content/browser/service_worker/service_worker_handle.h" @@ -124,21 +123,15 @@ bool ServiceWorkerDispatcherHost::OnMessageReceived( const IPC::Message& message) { - bool handled = true; - IPC_BEGIN_MESSAGE_MAP(ServiceWorkerDispatcherHost, message) - IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_PostMessageToWorker, - OnPostMessageToWorker) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - - if (!handled && GetContext()) { - handled = GetContext()->embedded_worker_registry()->OnMessageReceived( - message, render_process_id_); - if (!handled) - bad_message::ReceivedBadMessage(this, bad_message::SWDH_NOT_HANDLED); + ServiceWorkerContextCore* context = GetContext(); + if (!context) + return false; + if (!context->embedded_worker_registry()->OnMessageReceived( + message, render_process_id_)) { + bad_message::ReceivedBadMessage(this, bad_message::SWDH_NOT_HANDLED); + return false; } - - return handled; + return true; } bool ServiceWorkerDispatcherHost::Send(IPC::Message* message) { @@ -184,84 +177,6 @@ return weak_ptr_factory_.GetWeakPtr(); } -void ServiceWorkerDispatcherHost::OnPostMessageToWorker( - int handle_id, - int provider_id, - const scoped_refptr<base::RefCountedData<blink::TransferableMessage>>& - message, - const url::Origin& source_origin) { - TRACE_EVENT0("ServiceWorker", - "ServiceWorkerDispatcherHost::OnPostMessageToWorker"); - if (!GetContext()) - return; - - ServiceWorkerHandle* handle = handles_.Lookup(handle_id); - if (!handle) { - bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE); - return; - } - // TODO(leonhsl): Remove this unnecessary |provider_id| when mojofying - // ServiceWorkerHostMsg_PostMessageToWorker later. - DCHECK_EQ(provider_id, handle->provider_id()); - - // When this method is called the encoded_message inside message could just - // point to the IPC message's buffer. But that buffer can become invalid - // before the message is passed on to the service worker, so make sure - // message owns its data. - message->data.EnsureDataIsOwned(); - - DispatchExtendableMessageEvent(base::WrapRefCounted(handle->version()), - std::move(message->data), source_origin, - handle->provider_id(), base::DoNothing()); -} - -void ServiceWorkerDispatcherHost::DispatchExtendableMessageEvent( - scoped_refptr<ServiceWorkerVersion> worker, - blink::TransferableMessage message, - const url::Origin& source_origin, - int source_provider_id, - StatusCallback callback) { - ServiceWorkerProviderHost* source_provider_host = - GetContext()->GetProviderHost(render_process_id_, source_provider_id); - if (!source_provider_host) { - // This may occur when destruction of the source provider overtakes - // postMessage() because of thread hopping on WebServiceWorkerImpl. - return; - } - - switch (source_provider_host->provider_type()) { - case blink::mojom::ServiceWorkerProviderType::kForWindow: - case blink::mojom::ServiceWorkerProviderType::kForSharedWorker: - service_worker_client_utils::GetClient( - source_provider_host, - base::BindOnce(&ServiceWorkerDispatcherHost:: - DispatchExtendableMessageEventInternal, - this, worker, std::move(message), source_origin, - base::nullopt, std::move(callback), - kInvalidServiceWorkerProviderId)); - break; - case blink::mojom::ServiceWorkerProviderType::kForServiceWorker: { - // Clamp timeout to the sending worker's remaining timeout, to prevent - // postMessage from keeping workers alive forever. - base::TimeDelta timeout = - source_provider_host->running_hosted_version()->remaining_timeout(); - - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::BindOnce(&ServiceWorkerDispatcherHost:: - DispatchExtendableMessageEventInternal, - this, worker, std::move(message), source_origin, - base::make_optional(timeout), std::move(callback), - source_provider_id, nullptr /* source_client_info */)); - break; - } - case blink::mojom::ServiceWorkerProviderType::kUnknown: - default: - NOTREACHED() << source_provider_host->provider_type(); - break; - } -} - void ServiceWorkerDispatcherHost::OnProviderCreated( ServiceWorkerProviderHostInfo info) { TRACE_EVENT0("ServiceWorker", @@ -321,101 +236,6 @@ } } -void ServiceWorkerDispatcherHost::DispatchExtendableMessageEventInternal( - scoped_refptr<ServiceWorkerVersion> worker, - blink::TransferableMessage message, - const url::Origin& source_origin, - const base::Optional<base::TimeDelta>& timeout, - StatusCallback callback, - int source_service_worker_provider_id, - blink::mojom::ServiceWorkerClientInfoPtr source_client_info) { - if (source_service_worker_provider_id == kInvalidServiceWorkerProviderId && - !source_client_info) { - std::move(callback).Run(SERVICE_WORKER_ERROR_FAILED); - return; - } - - // If not enough time is left to actually process the event don't even - // bother starting the worker and sending the event. - if (timeout && *timeout < base::TimeDelta::FromMilliseconds(100)) { - std::move(callback).Run(SERVICE_WORKER_ERROR_TIMEOUT); - return; - } - - worker->RunAfterStartWorker( - ServiceWorkerMetrics::EventType::MESSAGE, - base::BindOnce(&ServiceWorkerDispatcherHost:: - DispatchExtendableMessageEventAfterStartWorker, - this, worker, std::move(message), source_origin, - source_service_worker_provider_id, - std::move(source_client_info), timeout, - std::move(callback))); -} - -void ServiceWorkerDispatcherHost:: - DispatchExtendableMessageEventAfterStartWorker( - scoped_refptr<ServiceWorkerVersion> worker, - blink::TransferableMessage message, - const url::Origin& source_origin, - int source_service_worker_provider_id, - blink::mojom::ServiceWorkerClientInfoPtr source_client_info, - const base::Optional<base::TimeDelta>& timeout, - StatusCallback callback, - ServiceWorkerStatusCode start_worker_status) { - if (start_worker_status != SERVICE_WORKER_OK) { - std::move(callback).Run(start_worker_status); - return; - } - if (!GetContext()) { - std::move(callback).Run(SERVICE_WORKER_ERROR_FAILED); - return; - } - - mojom::ExtendableMessageEventPtr event = mojom::ExtendableMessageEvent::New(); - event->message = std::move(message); - event->source_origin = source_origin; - if (source_service_worker_provider_id != kInvalidServiceWorkerProviderId) { - DCHECK(!source_client_info); - // The source is a service worker global scope. - ServiceWorkerProviderHost* source_service_worker_provider_host = - GetContext()->GetProviderHost(render_process_id_, - source_service_worker_provider_id); - if (!source_service_worker_provider_host) { - std::move(callback).Run(SERVICE_WORKER_ERROR_FAILED); - return; - } - DCHECK_EQ(blink::mojom::ServiceWorkerProviderType::kForServiceWorker, - source_service_worker_provider_host->provider_type()); - blink::mojom::ServiceWorkerObjectInfoPtr source_worker_info = - worker->provider_host()->GetOrCreateServiceWorkerHandle( - source_service_worker_provider_host->running_hosted_version()); - - event->source_info_for_service_worker = std::move(source_worker_info); - // Hide the service worker url if the service worker has a unique origin. - if (event->source_origin.unique()) - event->source_info_for_service_worker->url = GURL(); - } else { - // The source is a service worker client. - DCHECK(source_client_info && !source_client_info->client_uuid.empty()); - event->source_info_for_client = std::move(source_client_info); - // Hide the client url if the client has a unique origin. - if (event->source_origin.unique()) - event->source_info_for_client->url = GURL(); - } - - int request_id; - if (timeout) { - request_id = worker->StartRequestWithCustomTimeout( - ServiceWorkerMetrics::EventType::MESSAGE, std::move(callback), *timeout, - ServiceWorkerVersion::CONTINUE_ON_TIMEOUT); - } else { - request_id = worker->StartRequest(ServiceWorkerMetrics::EventType::MESSAGE, - std::move(callback)); - } - worker->event_dispatcher()->DispatchExtendableMessageEvent( - std::move(event), worker->CreateSimpleEventCallback(request_id)); -} - ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (!context_wrapper_.get())
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.h b/content/browser/service_worker/service_worker_dispatcher_host.h index 2de74af..78e1aa6e 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host.h +++ b/content/browser/service_worker/service_worker_dispatcher_host.h
@@ -24,18 +24,12 @@ #include "mojo/public/cpp/bindings/strong_associated_binding_set.h" #include "third_party/WebKit/public/mojom/service_worker/service_worker_registration.mojom.h" -namespace url { -class Origin; -} // namespace url - namespace content { class ResourceContext; class ServiceWorkerContextCore; class ServiceWorkerContextWrapper; class ServiceWorkerHandle; -class ServiceWorkerProviderHost; -class ServiceWorkerVersion; namespace service_worker_dispatcher_host_unittest { class ServiceWorkerDispatcherHostTest; @@ -126,8 +120,6 @@ service_worker_dispatcher_host_unittest::BackgroundSyncManagerTest, RegisterWithoutLiveSWRegistration); - using StatusCallback = - base::OnceCallback<void(ServiceWorkerStatusCode status)>; enum class ProviderStatus { OK, NO_CONTEXT, DEAD_HOST, NO_HOST, NO_URL }; // Debugging for https://crbug.com/750267 enum class Phase { kInitial, kAddedToContext, kRemovedFromContext }; @@ -135,40 +127,6 @@ // mojom::ServiceWorkerDispatcherHost implementation void OnProviderCreated(ServiceWorkerProviderHostInfo info) override; - // IPC Message handlers - void OnPostMessageToWorker( - int handle_id, - int provider_id, - const scoped_refptr<base::RefCountedData<blink::TransferableMessage>>& - message, - const url::Origin& source_origin); - - void DispatchExtendableMessageEvent( - scoped_refptr<ServiceWorkerVersion> worker, - blink::TransferableMessage message, - const url::Origin& source_origin, - int source_provider_id, - StatusCallback callback); - // A valid |source_service_worker_provider_id| is passed if the message source - // is a service worker, and otherwise |source_client_info| is passed. - void DispatchExtendableMessageEventInternal( - scoped_refptr<ServiceWorkerVersion> worker, - blink::TransferableMessage message, - const url::Origin& source_origin, - const base::Optional<base::TimeDelta>& timeout, - StatusCallback callback, - int source_service_worker_provider_id, - blink::mojom::ServiceWorkerClientInfoPtr source_client_info); - void DispatchExtendableMessageEventAfterStartWorker( - scoped_refptr<ServiceWorkerVersion> worker, - blink::TransferableMessage message, - const url::Origin& source_origin, - int source_service_worker_provider_id, - blink::mojom::ServiceWorkerClientInfoPtr source_client_info, - const base::Optional<base::TimeDelta>& timeout, - StatusCallback callback, - ServiceWorkerStatusCode status); - ServiceWorkerContextCore* GetContext(); const int render_process_id_;
diff --git a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc index eb62434..bb905fbc 100644 --- a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc +++ b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
@@ -12,7 +12,6 @@ #include "base/files/file_path.h" #include "base/memory/ptr_util.h" #include "base/run_loop.h" -#include "base/test/simple_test_tick_clock.h" #include "base/time/time.h" #include "content/browser/browser_thread_impl.h" #include "content/browser/service_worker/embedded_worker_instance.h" @@ -35,8 +34,6 @@ #include "third_party/WebKit/public/mojom/service_worker/service_worker_provider_type.mojom.h" #include "third_party/WebKit/public/mojom/service_worker/service_worker_registration.mojom.h" -using blink::MessagePortChannel; - namespace content { namespace service_worker_dispatcher_host_unittest { @@ -47,12 +44,6 @@ *out = status; } -void SetUpDummyMessagePort(std::vector<MessagePortChannel>* ports) { - // Let the other end of the pipe close. - mojo::MessagePipe pipe; - ports->push_back(MessagePortChannel(std::move(pipe.handle0))); -} - struct RemoteProviderInfo { mojom::ServiceWorkerContainerHostAssociatedPtr host_ptr; mojom::ServiceWorkerContainerAssociatedRequest client_request; @@ -117,50 +108,6 @@ ~TestingServiceWorkerDispatcherHost() override {} }; -class FailToStartWorkerTestHelper : public EmbeddedWorkerTestHelper { - public: - FailToStartWorkerTestHelper() : EmbeddedWorkerTestHelper(base::FilePath()) {} - - void OnStartWorker( - int embedded_worker_id, - int64_t service_worker_version_id, - const GURL& scope, - const GURL& script_url, - bool pause_after_download, - mojom::ServiceWorkerEventDispatcherRequest dispatcher_request, - mojom::ControllerServiceWorkerRequest controller_request, - blink::mojom::ServiceWorkerHostAssociatedPtrInfo service_worker_host, - mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo instance_host, - mojom::ServiceWorkerProviderInfoForStartWorkerPtr provider_info, - blink::mojom::ServiceWorkerInstalledScriptsInfoPtr installed_scripts_info) - override { - mojom::EmbeddedWorkerInstanceHostAssociatedPtr instance_host_ptr; - instance_host_ptr.Bind(std::move(instance_host)); - instance_host_ptr->OnStopped(); - base::RunLoop().RunUntilIdle(); - } -}; - -// A helper that holds on to ExtendableMessageEventPtr so it doesn't get -// destroyed after the message event handler runs. -class ExtendableMessageEventTestHelper : public EmbeddedWorkerTestHelper { - public: - ExtendableMessageEventTestHelper() - : EmbeddedWorkerTestHelper(base::FilePath()) {} - - void OnExtendableMessageEvent( - mojom::ExtendableMessageEventPtr event, - mojom::ServiceWorkerEventDispatcher:: - DispatchExtendableMessageEventCallback callback) override { - event_ = std::move(event); - std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::COMPLETED, - base::Time::Now()); - } - - private: - mojom::ExtendableMessageEventPtr event_; -}; - class ServiceWorkerDispatcherHostTest : public testing::Test { protected: ServiceWorkerDispatcherHostTest() @@ -233,19 +180,7 @@ helper_->mock_render_process_id(), kProviderId); } - void DispatchExtendableMessageEvent( - scoped_refptr<ServiceWorkerVersion> worker, - blink::TransferableMessage message, - const url::Origin& source_origin, - ServiceWorkerProviderHost* sender_provider_host, - ServiceWorkerDispatcherHost::StatusCallback callback) { - dispatcher_host_->DispatchExtendableMessageEvent( - std::move(worker), std::move(message), source_origin, - sender_provider_host->provider_id(), std::move(callback)); - } - TestBrowserThreadBundle browser_thread_bundle_; - base::SimpleTestTickClock tick_clock_; content::MockResourceContext resource_context_; std::unique_ptr<EmbeddedWorkerTestHelper> helper_; scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_; @@ -371,86 +306,5 @@ EXPECT_EQ(0, new_dispatcher_host->bad_messages_received_count_); } -TEST_F(ServiceWorkerDispatcherHostTest, DispatchExtendableMessageEvent) { - GURL pattern = GURL("http://www.example.com/"); - GURL script_url = GURL("http://www.example.com/service_worker.js"); - - Initialize(std::make_unique<ExtendableMessageEventTestHelper>()); - SetUpRegistration(pattern, script_url); - - // Set mock clock on version_ to check timeout behavior. - tick_clock_.SetNowTicks(base::TimeTicks::Now()); - version_->SetTickClockForTesting(&tick_clock_); - - // Make sure worker has a non-zero timeout. - bool called = false; - ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE; - version_->StartWorker(ServiceWorkerMetrics::EventType::UNKNOWN, - base::BindOnce(&SaveStatusCallback, &called, &status)); - base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(called); - EXPECT_EQ(SERVICE_WORKER_OK, status); - version_->StartRequestWithCustomTimeout( - ServiceWorkerMetrics::EventType::ACTIVATE, base::DoNothing(), - base::TimeDelta::FromSeconds(10), ServiceWorkerVersion::KILL_ON_TIMEOUT); - - // Advance clock by a couple seconds. - tick_clock_.Advance(base::TimeDelta::FromSeconds(4)); - base::TimeDelta remaining_time = version_->remaining_timeout(); - EXPECT_EQ(base::TimeDelta::FromSeconds(6), remaining_time); - - ServiceWorkerHandle* sender_worker_handle = - dispatcher_host_->FindServiceWorkerHandle( - version_->provider_host()->provider_id(), version_->version_id()); - EXPECT_FALSE(sender_worker_handle); - // Simulate dispatching an ExtendableMessageEvent which comes from - // |version_|'s own remote provider. - blink::TransferableMessage message; - SetUpDummyMessagePort(&message.ports); - called = false; - status = SERVICE_WORKER_ERROR_MAX_VALUE; - DispatchExtendableMessageEvent( - version_, std::move(message), - url::Origin::Create(version_->scope().GetOrigin()), - version_->provider_host(), - base::BindOnce(&SaveStatusCallback, &called, &status)); - base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(called); - EXPECT_EQ(SERVICE_WORKER_OK, status); - // A service worker object info of |version_| should be created as the source - // of the ExtendableMessageEvent dispatched above. - sender_worker_handle = dispatcher_host_->FindServiceWorkerHandle( - version_->provider_host()->provider_id(), version_->version_id()); - EXPECT_TRUE(sender_worker_handle); - EXPECT_EQ(1u, sender_worker_handle->bindings_.size()); - - // Timeout of message event should not have extended life of service worker. - EXPECT_EQ(remaining_time, version_->remaining_timeout()); -} - -TEST_F(ServiceWorkerDispatcherHostTest, DispatchExtendableMessageEvent_Fail) { - GURL pattern = GURL("http://www.example.com/"); - GURL script_url = GURL("http://www.example.com/service_worker.js"); - - Initialize(base::WrapUnique(new FailToStartWorkerTestHelper)); - SendProviderCreated(blink::mojom::ServiceWorkerProviderType::kForSharedWorker, - pattern); - SetUpRegistration(pattern, script_url); - - // Try to dispatch ExtendableMessageEvent. This should fail to start the - // worker and to dispatch the event. - blink::TransferableMessage message; - SetUpDummyMessagePort(&message.ports); - bool called = false; - ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE; - DispatchExtendableMessageEvent( - version_, std::move(message), - url::Origin::Create(version_->scope().GetOrigin()), provider_host_, - base::BindOnce(&SaveStatusCallback, &called, &status)); - base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(called); - EXPECT_EQ(SERVICE_WORKER_ERROR_START_WORKER_FAILED, status); -} - } // namespace service_worker_dispatcher_host_unittest } // namespace content
diff --git a/content/browser/service_worker/service_worker_handle.cc b/content/browser/service_worker/service_worker_handle.cc index 3a24575..8abb977 100644 --- a/content/browser/service_worker/service_worker_handle.cc +++ b/content/browser/service_worker/service_worker_handle.cc
@@ -5,17 +5,154 @@ #include "content/browser/service_worker/service_worker_handle.h" #include "base/memory/ptr_util.h" +#include "content/browser/service_worker/service_worker_client_utils.h" #include "content/browser/service_worker/service_worker_context_core.h" #include "content/browser/service_worker/service_worker_dispatcher_host.h" +#include "content/browser/service_worker/service_worker_provider_host.h" #include "content/browser/service_worker/service_worker_registration.h" #include "content/browser/service_worker/service_worker_type_converters.h" -#include "content/common/service_worker/service_worker_messages.h" #include "content/common/service_worker/service_worker_types.h" #include "content/common/service_worker/service_worker_utils.h" #include "content/public/common/browser_side_navigation_policy.h" namespace content { +namespace { + +using StatusCallback = base::OnceCallback<void(ServiceWorkerStatusCode)>; +using SetExtendableMessageEventSourceCallback = + base::OnceCallback<bool(mojom::ExtendableMessageEventPtr*)>; + +void DispatchExtendableMessageEventAfterStartWorker( + scoped_refptr<ServiceWorkerVersion> worker, + blink::TransferableMessage message, + const url::Origin& source_origin, + const base::Optional<base::TimeDelta>& timeout, + StatusCallback callback, + SetExtendableMessageEventSourceCallback set_source_callback, + ServiceWorkerStatusCode start_worker_status) { + if (start_worker_status != SERVICE_WORKER_OK) { + std::move(callback).Run(start_worker_status); + return; + } + + mojom::ExtendableMessageEventPtr event = mojom::ExtendableMessageEvent::New(); + event->message = std::move(message); + event->source_origin = source_origin; + if (!std::move(set_source_callback).Run(&event)) { + std::move(callback).Run(SERVICE_WORKER_ERROR_FAILED); + return; + } + + int request_id; + if (timeout) { + request_id = worker->StartRequestWithCustomTimeout( + ServiceWorkerMetrics::EventType::MESSAGE, std::move(callback), *timeout, + ServiceWorkerVersion::CONTINUE_ON_TIMEOUT); + } else { + request_id = worker->StartRequest(ServiceWorkerMetrics::EventType::MESSAGE, + std::move(callback)); + } + worker->event_dispatcher()->DispatchExtendableMessageEvent( + std::move(event), worker->CreateSimpleEventCallback(request_id)); +} + +void StartWorkerToDispatchExtendableMessageEvent( + scoped_refptr<ServiceWorkerVersion> worker, + blink::TransferableMessage message, + const url::Origin& source_origin, + const base::Optional<base::TimeDelta>& timeout, + StatusCallback callback, + SetExtendableMessageEventSourceCallback set_source_callback) { + // If not enough time is left to actually process the event don't even + // bother starting the worker and sending the event. + if (timeout && *timeout < base::TimeDelta::FromMilliseconds(100)) { + std::move(callback).Run(SERVICE_WORKER_ERROR_TIMEOUT); + return; + } + + worker->RunAfterStartWorker( + ServiceWorkerMetrics::EventType::MESSAGE, + base::BindOnce(&DispatchExtendableMessageEventAfterStartWorker, worker, + std::move(message), source_origin, timeout, + std::move(callback), std::move(set_source_callback))); +} + +bool SetSourceClientInfo( + blink::mojom::ServiceWorkerClientInfoPtr source_client_info, + mojom::ExtendableMessageEventPtr* event) { + DCHECK(source_client_info && !source_client_info->client_uuid.empty()); + (*event)->source_info_for_client = std::move(source_client_info); + // Hide the client url if the client has a unique origin. + if ((*event)->source_origin.unique()) + (*event)->source_info_for_client->url = GURL(); + return true; +} + +bool SetSourceServiceWorkerInfo(scoped_refptr<ServiceWorkerVersion> worker, + base::WeakPtr<ServiceWorkerProviderHost> + source_service_worker_provider_host, + mojom::ExtendableMessageEventPtr* event) { + // The service worker execution context may have been destroyed by the time we + // get here. + if (!source_service_worker_provider_host) + return false; + + DCHECK_EQ(blink::mojom::ServiceWorkerProviderType::kForServiceWorker, + source_service_worker_provider_host->provider_type()); + blink::mojom::ServiceWorkerObjectInfoPtr source_worker_info = + worker->provider_host()->GetOrCreateServiceWorkerHandle( + source_service_worker_provider_host->running_hosted_version()); + + (*event)->source_info_for_service_worker = std::move(source_worker_info); + // Hide the service worker url if the service worker has a unique origin. + if ((*event)->source_origin.unique()) + (*event)->source_info_for_service_worker->url = GURL(); + return true; +} + +void DispatchExtendableMessageEventFromClient( + scoped_refptr<ServiceWorkerVersion> worker, + blink::TransferableMessage message, + const url::Origin& source_origin, + StatusCallback callback, + blink::mojom::ServiceWorkerClientInfoPtr source_client_info) { + // |source_client_info| may be null if a client sent the message but its + // info could not be retrieved. + if (!source_client_info) { + std::move(callback).Run(SERVICE_WORKER_ERROR_FAILED); + return; + } + + StartWorkerToDispatchExtendableMessageEvent( + worker, std::move(message), source_origin, base::nullopt /* timeout */, + std::move(callback), + base::BindOnce(&SetSourceClientInfo, std::move(source_client_info))); +} + +void DispatchExtendableMessageEventFromServiceWorker( + scoped_refptr<ServiceWorkerVersion> worker, + blink::TransferableMessage message, + const url::Origin& source_origin, + const base::Optional<base::TimeDelta>& timeout, + StatusCallback callback, + base::WeakPtr<ServiceWorkerProviderHost> + source_service_worker_provider_host) { + if (!source_service_worker_provider_host) { + std::move(callback).Run(SERVICE_WORKER_ERROR_FAILED); + return; + } + + DCHECK_EQ(blink::mojom::ServiceWorkerProviderType::kForServiceWorker, + source_service_worker_provider_host->provider_type()); + StartWorkerToDispatchExtendableMessageEvent( + worker, std::move(message), source_origin, timeout, std::move(callback), + base::BindOnce(&SetSourceServiceWorkerInfo, worker, + source_service_worker_provider_host)); +} + +} // namespace + // static base::WeakPtr<ServiceWorkerHandle> ServiceWorkerHandle::Create( ServiceWorkerDispatcherHost* dispatcher_host, @@ -85,11 +222,62 @@ dispatcher_host_->RegisterServiceWorkerHandle(base::WrapUnique(this)); } +void ServiceWorkerHandle::PostMessage(::blink::TransferableMessage message, + const url::Origin& source_origin) { + // When this method is called the encoded_message inside message could just + // point to the IPC message's buffer. But that buffer can become invalid + // before the message is passed on to the service worker, so make sure + // message owns its data. + message.EnsureDataIsOwned(); + + DispatchExtendableMessageEvent(std::move(message), source_origin, + base::DoNothing()); +} + void ServiceWorkerHandle::TerminateForTesting( TerminateForTestingCallback callback) { version_->StopWorker(std::move(callback)); } +void ServiceWorkerHandle::DispatchExtendableMessageEvent( + ::blink::TransferableMessage message, + const url::Origin& source_origin, + StatusCallback callback) { + if (!context_ || !provider_host_) { + std::move(callback).Run(SERVICE_WORKER_ERROR_FAILED); + return; + } + switch (provider_host_->provider_type()) { + case blink::mojom::ServiceWorkerProviderType::kForWindow: + // TODO(leonhsl): Move kForSharedWorker to the kUnknown block to clarify + // that currently a shared worker can not postMessage to a service worker. + case blink::mojom::ServiceWorkerProviderType::kForSharedWorker: + service_worker_client_utils::GetClient( + provider_host_.get(), + base::BindOnce(&DispatchExtendableMessageEventFromClient, version_, + std::move(message), source_origin, + std::move(callback))); + return; + case blink::mojom::ServiceWorkerProviderType::kForServiceWorker: { + // Clamp timeout to the sending worker's remaining timeout, to prevent + // postMessage from keeping workers alive forever. + base::TimeDelta timeout = + provider_host_->running_hosted_version()->remaining_timeout(); + + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(&DispatchExtendableMessageEventFromServiceWorker, + version_, std::move(message), source_origin, + base::make_optional(timeout), std::move(callback), + provider_host_)); + return; + } + case blink::mojom::ServiceWorkerProviderType::kUnknown: + break; + } + NOTREACHED() << provider_host_->provider_type(); +} + base::WeakPtr<ServiceWorkerHandle> ServiceWorkerHandle::AsWeakPtr() { return weak_ptr_factory_.GetWeakPtr(); }
diff --git a/content/browser/service_worker/service_worker_handle.h b/content/browser/service_worker/service_worker_handle.h index 1f3baa49..abf0971 100644 --- a/content/browser/service_worker/service_worker_handle.h +++ b/content/browser/service_worker/service_worker_handle.h
@@ -16,15 +16,19 @@ #include "mojo/public/cpp/bindings/associated_binding_set.h" #include "third_party/WebKit/public/mojom/service_worker/service_worker_object.mojom.h" +namespace url { +class Origin; +} // namespace url + namespace content { class ServiceWorkerContextCore; class ServiceWorkerDispatcherHost; +class ServiceWorkerProviderHost; -namespace service_worker_dispatcher_host_unittest { -FORWARD_DECLARE_TEST(ServiceWorkerDispatcherHostTest, - DispatchExtendableMessageEvent); -} // namespace service_worker_dispatcher_host_unittest +namespace service_worker_handle_unittest { +class ServiceWorkerHandleTest; +} // namespace service_worker_handle_unittest // Roughly corresponds to one WebServiceWorker object in the renderer process. // @@ -71,9 +75,7 @@ ServiceWorkerVersion* version() { return version_.get(); } private: - FRIEND_TEST_ALL_PREFIXES( - service_worker_dispatcher_host_unittest::ServiceWorkerDispatcherHostTest, - DispatchExtendableMessageEvent); + friend class service_worker_handle_unittest::ServiceWorkerHandleTest; ServiceWorkerHandle(ServiceWorkerDispatcherHost* dispatcher_host, base::WeakPtr<ServiceWorkerContextCore> context, @@ -81,8 +83,15 @@ ServiceWorkerVersion* version); // Implements blink::mojom::ServiceWorkerObjectHost. + void PostMessage(::blink::TransferableMessage message, + const url::Origin& source_origin) override; void TerminateForTesting(TerminateForTestingCallback callback) override; + void DispatchExtendableMessageEvent( + ::blink::TransferableMessage message, + const url::Origin& source_origin, + base::OnceCallback<void(ServiceWorkerStatusCode)> callback); + base::WeakPtr<ServiceWorkerHandle> AsWeakPtr(); void OnConnectionError();
diff --git a/content/browser/service_worker/service_worker_handle_unittest.cc b/content/browser/service_worker/service_worker_handle_unittest.cc index 9a21638f..e90991b 100644 --- a/content/browser/service_worker/service_worker_handle_unittest.cc +++ b/content/browser/service_worker/service_worker_handle_unittest.cc
@@ -7,6 +7,7 @@ #include "base/macros.h" #include "base/run_loop.h" +#include "base/test/simple_test_tick_clock.h" #include "content/browser/service_worker/embedded_worker_registry.h" #include "content/browser/service_worker/embedded_worker_test_helper.h" #include "content/browser/service_worker/service_worker_context_core.h" @@ -17,8 +18,12 @@ #include "content/browser/service_worker/service_worker_version.h" #include "content/common/service_worker/service_worker_messages.h" #include "content/common/service_worker/service_worker_types.h" +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/render_process_host.h" #include "content/public/test/mock_resource_context.h" +#include "content/public/test/test_browser_context.h" #include "content/public/test/test_browser_thread_bundle.h" +#include "content/public/test/web_contents_tester.h" #include "ipc/ipc_message.h" #include "ipc/ipc_test_sink.h" #include "testing/gtest/include/gtest/gtest.h" @@ -28,8 +33,6 @@ namespace content { namespace service_worker_handle_unittest { -const int kRenderFrameId = 44; // A dummy ID for testing. - void VerifyStateChangedMessage(int expected_handle_id, blink::mojom::ServiceWorkerState expected_state, const IPC::Message* message) { @@ -41,6 +44,67 @@ EXPECT_EQ(expected_state, std::get<2>(param)); } +static void SaveStatusCallback(bool* called, + ServiceWorkerStatusCode* out, + ServiceWorkerStatusCode status) { + *called = true; + *out = status; +} + +void SetUpDummyMessagePort(std::vector<blink::MessagePortChannel>* ports) { + // Let the other end of the pipe close. + mojo::MessagePipe pipe; + ports->push_back(blink::MessagePortChannel(std::move(pipe.handle0))); +} + +// A helper that holds on to ExtendableMessageEventPtr so it doesn't get +// destroyed after the message event handler runs. +class ExtendableMessageEventTestHelper : public EmbeddedWorkerTestHelper { + public: + ExtendableMessageEventTestHelper() + : EmbeddedWorkerTestHelper(base::FilePath()) {} + + void OnExtendableMessageEvent( + mojom::ExtendableMessageEventPtr event, + mojom::ServiceWorkerEventDispatcher:: + DispatchExtendableMessageEventCallback callback) override { + events_.push_back(std::move(event)); + std::move(callback).Run(blink::mojom::ServiceWorkerEventStatus::COMPLETED, + base::Time::Now()); + } + + const std::vector<mojom::ExtendableMessageEventPtr>& events() { + return events_; + } + + private: + std::vector<mojom::ExtendableMessageEventPtr> events_; +}; + +class FailToStartWorkerTestHelper : public ExtendableMessageEventTestHelper { + public: + FailToStartWorkerTestHelper() : ExtendableMessageEventTestHelper() {} + + void OnStartWorker( + int embedded_worker_id, + int64_t service_worker_version_id, + const GURL& scope, + const GURL& script_url, + bool pause_after_download, + mojom::ServiceWorkerEventDispatcherRequest dispatcher_request, + mojom::ControllerServiceWorkerRequest controller_request, + blink::mojom::ServiceWorkerHostAssociatedPtrInfo service_worker_host, + mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo instance_host, + mojom::ServiceWorkerProviderInfoForStartWorkerPtr provider_info, + blink::mojom::ServiceWorkerInstalledScriptsInfoPtr installed_scripts_info) + override { + mojom::EmbeddedWorkerInstanceHostAssociatedPtr instance_host_ptr; + instance_host_ptr.Bind(std::move(instance_host)); + instance_host_ptr->OnStopped(); + base::RunLoop().RunUntilIdle(); + } +}; + class TestingServiceWorkerDispatcherHost : public ServiceWorkerDispatcherHost { public: TestingServiceWorkerDispatcherHost(int process_id, @@ -66,25 +130,29 @@ ServiceWorkerHandleTest() : browser_thread_bundle_(TestBrowserThreadBundle::IO_MAINLOOP) {} - void SetUp() override { - helper_.reset(new EmbeddedWorkerTestHelper(base::FilePath())); + void Initialize(std::unique_ptr<EmbeddedWorkerTestHelper> helper) { + helper_ = std::move(helper); dispatcher_host_ = new TestingServiceWorkerDispatcherHost( helper_->mock_render_process_id(), &resource_context_, helper_.get()); helper_->RegisterDispatcherHost(helper_->mock_render_process_id(), dispatcher_host_); dispatcher_host_->Init(helper_->context_wrapper()); + } - const GURL pattern("http://www.example.com/"); + void SetUpRegistration(const GURL& scope, const GURL& script_url) { + helper_->context()->storage()->LazyInitializeForTest(base::DoNothing()); + base::RunLoop().RunUntilIdle(); + blink::mojom::ServiceWorkerRegistrationOptions options; - options.scope = pattern; + options.scope = scope; registration_ = new ServiceWorkerRegistration( - options, 1L, helper_->context()->AsWeakPtr()); - version_ = new ServiceWorkerVersion( - registration_.get(), - GURL("http://www.example.com/service_worker.js"), - 1L, + options, helper_->context()->storage()->NewRegistrationId(), helper_->context()->AsWeakPtr()); + version_ = + new ServiceWorkerVersion(registration_.get(), script_url, + helper_->context()->storage()->NewVersionId(), + helper_->context()->AsWeakPtr()); std::vector<ServiceWorkerDatabase::ResourceRecord> records; records.push_back( ServiceWorkerDatabase::ResourceRecord(10, version_->script_url(), 100)); @@ -95,8 +163,6 @@ version_->SetStatus(ServiceWorkerVersion::INSTALLING); // Make the registration findable via storage functions. - helper_->context()->storage()->LazyInitializeForTest(base::DoNothing()); - base::RunLoop().RunUntilIdle(); ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; helper_->context()->storage()->StoreRegistration( registration_.get(), @@ -104,44 +170,63 @@ CreateReceiverOnCurrentThread(&status)); base::RunLoop().RunUntilIdle(); ASSERT_EQ(SERVICE_WORKER_OK, status); - - provider_host_ = CreateProviderHostWithDispatcherHost( - helper_->mock_render_process_id(), 1 /* provider_id */, - helper_->context()->AsWeakPtr(), kRenderFrameId, dispatcher_host_.get(), - &remote_endpoint_); } void TearDown() override { dispatcher_host_ = nullptr; registration_ = nullptr; version_ = nullptr; - provider_host_.reset(); helper_.reset(); } + void CallDispatchExtendableMessageEvent( + ServiceWorkerHandle* handle, + ::blink::TransferableMessage message, + const url::Origin& source_origin, + base::OnceCallback<void(ServiceWorkerStatusCode)> callback) { + handle->DispatchExtendableMessageEvent(std::move(message), source_origin, + std::move(callback)); + } + + size_t GetBindingsCount(ServiceWorkerHandle* handle) { + return handle->bindings_.size(); + } + IPC::TestSink* ipc_sink() { return helper_->ipc_sink(); } TestBrowserThreadBundle browser_thread_bundle_; MockResourceContext resource_context_; + base::SimpleTestTickClock tick_clock_; std::unique_ptr<EmbeddedWorkerTestHelper> helper_; - std::unique_ptr<ServiceWorkerProviderHost> provider_host_; scoped_refptr<ServiceWorkerRegistration> registration_; scoped_refptr<ServiceWorkerVersion> version_; scoped_refptr<TestingServiceWorkerDispatcherHost> dispatcher_host_; - ServiceWorkerRemoteProviderEndpoint remote_endpoint_; private: DISALLOW_COPY_AND_ASSIGN(ServiceWorkerHandleTest); }; TEST_F(ServiceWorkerHandleTest, OnVersionStateChanged) { + const int64_t kProviderId = 99; + const int kRenderFrameId = 44; + const GURL pattern("https://www.example.com/"); + const GURL script_url("https://www.example.com/service_worker.js"); + Initialize(std::make_unique<EmbeddedWorkerTestHelper>(base::FilePath())); + SetUpRegistration(pattern, script_url); + + ServiceWorkerRemoteProviderEndpoint remote_endpoint; + std::unique_ptr<ServiceWorkerProviderHost> provider_host = + CreateProviderHostWithDispatcherHost( + helper_->mock_render_process_id(), kProviderId, + helper_->context()->AsWeakPtr(), kRenderFrameId, + dispatcher_host_.get(), &remote_endpoint); blink::mojom::ServiceWorkerObjectInfoPtr info; // ServiceWorkerHandle lifetime is controlled by |info| and is also owned by // |dispatcher_host_|. - auto handle = ServiceWorkerHandle::Create( + base::WeakPtr<ServiceWorkerHandle> handle = ServiceWorkerHandle::Create( dispatcher_host_.get(), helper_->context()->AsWeakPtr(), - provider_host_->AsWeakPtr(), version_.get(), &info); + provider_host->AsWeakPtr(), version_.get(), &info); // Start the worker, and then... ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_FAILED; @@ -166,5 +251,184 @@ message); } +TEST_F(ServiceWorkerHandleTest, + DispatchExtendableMessageEvent_FromServiceWorker) { + const GURL pattern("https://www.example.com/"); + const GURL script_url("https://www.example.com/service_worker.js"); + Initialize(std::make_unique<ExtendableMessageEventTestHelper>()); + SetUpRegistration(pattern, script_url); + + // Set mock clock on version_ to check timeout behavior. + tick_clock_.SetNowTicks(base::TimeTicks::Now()); + version_->SetTickClockForTesting(&tick_clock_); + + // Make sure worker has a non-zero timeout. + bool called = false; + ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE; + version_->StartWorker(ServiceWorkerMetrics::EventType::UNKNOWN, + base::BindOnce(&SaveStatusCallback, &called, &status)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(called); + EXPECT_EQ(SERVICE_WORKER_OK, status); + version_->StartRequestWithCustomTimeout( + ServiceWorkerMetrics::EventType::ACTIVATE, base::DoNothing(), + base::TimeDelta::FromSeconds(10), ServiceWorkerVersion::KILL_ON_TIMEOUT); + + // Advance clock by a couple seconds. + tick_clock_.Advance(base::TimeDelta::FromSeconds(4)); + base::TimeDelta remaining_time = version_->remaining_timeout(); + EXPECT_EQ(base::TimeDelta::FromSeconds(6), remaining_time); + + // Prepare a ServiceWorkerHandle corresponding to a JavaScript ServiceWorker + // object in the service worker execution context for |version_|. + EXPECT_FALSE(dispatcher_host_->FindServiceWorkerHandle( + version_->provider_host()->provider_id(), version_->version_id())); + blink::mojom::ServiceWorkerObjectInfoPtr info; + // ServiceWorkerHandle lifetime is controlled by |info| and is also owned by + // |dispatcher_host_|. + base::WeakPtr<ServiceWorkerHandle> sender_worker_handle = + ServiceWorkerHandle::Create( + dispatcher_host_.get(), helper_->context()->AsWeakPtr(), + version_->provider_host()->AsWeakPtr(), version_.get(), &info); + EXPECT_EQ(1u, GetBindingsCount(sender_worker_handle.get())); + + // Dispatch an ExtendableMessageEvent simulating calling + // ServiceWorker#postMessage() on the ServiceWorker object corresponding to + // |service_worker_handle|. + blink::TransferableMessage message; + SetUpDummyMessagePort(&message.ports); + called = false; + status = SERVICE_WORKER_ERROR_MAX_VALUE; + CallDispatchExtendableMessageEvent( + sender_worker_handle.get(), std::move(message), + url::Origin::Create(version_->scope().GetOrigin()), + base::BindOnce(&SaveStatusCallback, &called, &status)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(called); + EXPECT_EQ(SERVICE_WORKER_OK, status); + // The dispatched ExtendableMessageEvent should be kept in + // ExtendableMessageEventTestHelper, and the source service worker object info + // should correspond to the pair (|version_->provider_host()|, |version_|), + // means it should correspond to |sender_worker_handle|. + EXPECT_EQ(2u, GetBindingsCount(sender_worker_handle.get())); + const std::vector<mojom::ExtendableMessageEventPtr>& events = + static_cast<ExtendableMessageEventTestHelper*>(helper_.get())->events(); + EXPECT_EQ(1u, events.size()); + EXPECT_FALSE(events[0]->source_info_for_client); + EXPECT_TRUE(events[0]->source_info_for_service_worker); + EXPECT_EQ(sender_worker_handle->handle_id(), + events[0]->source_info_for_service_worker->handle_id); + EXPECT_EQ(version_->version_id(), + events[0]->source_info_for_service_worker->version_id); + + // Timeout of message event should not have extended life of service worker. + EXPECT_EQ(remaining_time, version_->remaining_timeout()); +} + +TEST_F(ServiceWorkerHandleTest, DispatchExtendableMessageEvent_FromClient) { + const int64_t kProviderId = 99; + const GURL pattern("https://www.example.com/"); + const GURL script_url("https://www.example.com/service_worker.js"); + Initialize(std::make_unique<ExtendableMessageEventTestHelper>()); + SetUpRegistration(pattern, script_url); + + // Prepare a ServiceWorkerProviderHost for a window client. Use a real + // RenderFrameHost because it's needed to populate + // ExtendableMessageEvent#source. + std::unique_ptr<WebContents> web_contents( + WebContentsTester::CreateTestWebContents(helper_->browser_context(), + nullptr)); + RenderFrameHost* frame_host = web_contents->GetMainFrame(); + ServiceWorkerProviderHostInfo provider_host_info( + kProviderId, frame_host->GetRoutingID(), + blink::mojom::ServiceWorkerProviderType::kForWindow, + true /* is_parent_frame_secure */); + std::unique_ptr<ServiceWorkerProviderHost> provider_host = + ServiceWorkerProviderHost::Create( + frame_host->GetProcess()->GetID(), std::move(provider_host_info), + helper_->context()->AsWeakPtr(), dispatcher_host_->AsWeakPtr()); + // Prepare a ServiceWorkerHandle for the above |provider_host|. + blink::mojom::ServiceWorkerObjectInfoPtr info; + // ServiceWorkerHandle lifetime is controlled by |info| and is also owned by + // |dispatcher_host_|. + base::WeakPtr<ServiceWorkerHandle> handle = ServiceWorkerHandle::Create( + dispatcher_host_.get(), helper_->context()->AsWeakPtr(), + provider_host->AsWeakPtr(), version_.get(), &info); + + // Simulate dispatching an ExtendableMessageEvent. + blink::TransferableMessage message; + SetUpDummyMessagePort(&message.ports); + bool called = false; + ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE; + CallDispatchExtendableMessageEvent( + handle.get(), std::move(message), + url::Origin::Create(version_->scope().GetOrigin()), + base::BindOnce(&SaveStatusCallback, &called, &status)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(called); + EXPECT_EQ(SERVICE_WORKER_OK, status); + // The dispatched ExtendableMessageEvent should be kept in + // ExtendableMessageEventTestHelper, and its source client info should + // correspond to |provider_host|. + const std::vector<mojom::ExtendableMessageEventPtr>& events = + static_cast<ExtendableMessageEventTestHelper*>(helper_.get())->events(); + EXPECT_EQ(1u, events.size()); + EXPECT_FALSE(events[0]->source_info_for_service_worker); + EXPECT_TRUE(events[0]->source_info_for_client); + EXPECT_EQ(provider_host->client_uuid(), + events[0]->source_info_for_client->client_uuid); + EXPECT_EQ(provider_host->client_type(), + events[0]->source_info_for_client->client_type); +} + +TEST_F(ServiceWorkerHandleTest, DispatchExtendableMessageEvent_Fail) { + const int64_t kProviderId = 99; + const GURL pattern("https://www.example.com/"); + const GURL script_url("https://www.example.com/service_worker.js"); + Initialize(std::make_unique<FailToStartWorkerTestHelper>()); + SetUpRegistration(pattern, script_url); + + // Prepare a ServiceWorkerProviderHost for a window client. Use a real + // RenderFrameHost because it's needed to populate + // ExtendableMessageEvent#source. + std::unique_ptr<WebContents> web_contents( + WebContentsTester::CreateTestWebContents(helper_->browser_context(), + nullptr)); + RenderFrameHost* frame_host = web_contents->GetMainFrame(); + ServiceWorkerProviderHostInfo provider_host_info( + kProviderId, frame_host->GetRoutingID(), + blink::mojom::ServiceWorkerProviderType::kForWindow, + true /* is_parent_frame_secure */); + std::unique_ptr<ServiceWorkerProviderHost> provider_host = + ServiceWorkerProviderHost::Create( + frame_host->GetProcess()->GetID(), std::move(provider_host_info), + helper_->context()->AsWeakPtr(), dispatcher_host_->AsWeakPtr()); + // Prepare a ServiceWorkerHandle for the above |provider_host|. + blink::mojom::ServiceWorkerObjectInfoPtr info; + // ServiceWorkerHandle lifetime is controlled by |info| and is also owned by + // |dispatcher_host_|. + base::WeakPtr<ServiceWorkerHandle> handle = ServiceWorkerHandle::Create( + dispatcher_host_.get(), helper_->context()->AsWeakPtr(), + provider_host->AsWeakPtr(), version_.get(), &info); + + // Try to dispatch ExtendableMessageEvent. This should fail to start the + // worker and to dispatch the event. + blink::TransferableMessage message; + SetUpDummyMessagePort(&message.ports); + bool called = false; + ServiceWorkerStatusCode status = SERVICE_WORKER_ERROR_MAX_VALUE; + CallDispatchExtendableMessageEvent( + handle.get(), std::move(message), + url::Origin::Create(version_->scope().GetOrigin()), + base::BindOnce(&SaveStatusCallback, &called, &status)); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(called); + EXPECT_EQ(SERVICE_WORKER_ERROR_START_WORKER_FAILED, status); + // No ExtendableMessageEvent has been dispatched. + const std::vector<mojom::ExtendableMessageEventPtr>& events = + static_cast<ExtendableMessageEventTestHelper*>(helper_.get())->events(); + EXPECT_EQ(0u, events.size()); +} + } // namespace service_worker_handle_unittest } // namespace content
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc index 4f2fd4ea..d8dea178 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc
@@ -434,10 +434,12 @@ if (!origin.unique()) { // Prefer to use the scheme of |origin| rather than |url|, to correctly // cover blob: and filesystem: URIs (see also https://crbug.com/697111). - DCHECK(origin.GetURL().has_scheme()) << origin; - return GURL(origin.GetURL().scheme() + ":"); - } else if (url.has_scheme()) + DCHECK(!origin.scheme().empty()); + return GURL(origin.scheme() + ":"); + } else if (url.has_scheme()) { + DCHECK(!url.scheme().empty()); return GURL(url.scheme() + ":"); + } // Otherwise the URL should be invalid; return an empty site. DCHECK(!url.is_valid()) << url;
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 2c210d2..8f7c4c6 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -956,7 +956,8 @@ // Test that the physical backing size and view bounds for a scaled out-of- // process iframe are set and updated correctly. -IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, PhysicalBackingSizeTest) { +IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, + CompositorViewportPixelSizeTest) { GURL main_url(embedded_test_server()->GetURL( "a.com", "/frame_tree/page_with_scaled_frame.html")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -996,7 +997,7 @@ EXPECT_EQ(gfx::Size(100, 100), rwhv_nested->GetViewBounds().size()); EXPECT_EQ(gfx::Size(100, 100), connector->local_frame_size_in_dip()); EXPECT_EQ(connector->local_frame_size_in_pixels(), - rwhv_nested->GetPhysicalBackingSize()); + rwhv_nested->GetCompositorViewportPixelSize()); } // Test that the view bounds for an out-of-process iframe are set and updated
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc index f51fe3061..dba83c73 100644 --- a/content/browser/web_contents/web_contents_android.cc +++ b/content/browser/web_contents/web_contents_android.cc
@@ -561,10 +561,9 @@ ScopedJavaGlobalRef<jobject> j_callback; j_callback.Reset(env, callback); - WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = - base::Bind(&AXTreeSnapshotCallback, j_callback); - static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( - snapshot_callback); + static_cast<WebContentsImpl*>(web_contents_) + ->RequestAXTreeSnapshot( + base::BindOnce(&AXTreeSnapshotCallback, j_callback)); } ScopedJavaLocalRef<jstring> WebContentsAndroid::GetEncoding(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 3d9de22..b1b10828 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -219,8 +219,7 @@ static_cast<RenderFrameHostImpl*>(rfh)->AccessibilityReset(); } -using AXTreeSnapshotCallback = - base::Callback<void(const ui::AXTreeUpdate&)>; +using AXTreeSnapshotCallback = WebContents::AXTreeSnapshotCallback; // Helper class used by WebContentsImpl::RequestAXTreeSnapshot. // Handles the callbacks from parallel snapshot requests to each frame, @@ -229,14 +228,12 @@ class AXTreeSnapshotCombiner : public base::RefCounted<AXTreeSnapshotCombiner> { public: explicit AXTreeSnapshotCombiner(AXTreeSnapshotCallback callback) - : callback_(callback) { - } + : callback_(std::move(callback)) {} AXTreeSnapshotCallback AddFrame(bool is_root) { // Adds a reference to |this|. - return base::Bind(&AXTreeSnapshotCombiner::ReceiveSnapshot, - this, - is_root); + return base::BindOnce(&AXTreeSnapshotCombiner::ReceiveSnapshot, this, + is_root); } void ReceiveSnapshot(bool is_root, const ui::AXTreeUpdate& snapshot) { @@ -250,7 +247,7 @@ // when there are no more references to this object. ~AXTreeSnapshotCombiner() { combiner_.Combine(); - callback_.Run(combiner_.combined()); + std::move(callback_).Run(combiner_.combined()); } ui::AXTreeCombiner combiner_; @@ -1072,13 +1069,13 @@ SetAccessibilityMode(new_mode); } -void WebContentsImpl::RequestAXTreeSnapshot( - const AXTreeSnapshotCallback& callback) { +void WebContentsImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback) { // Send a request to each of the frames in parallel. Each one will return // an accessibility tree snapshot, and AXTreeSnapshotCombiner will combine // them into a single tree and call |callback| with that result, then // delete |combiner|. - AXTreeSnapshotCombiner* combiner = new AXTreeSnapshotCombiner(callback); + AXTreeSnapshotCombiner* combiner = + new AXTreeSnapshotCombiner(std::move(callback)); for (FrameTreeNode* frame_tree_node : frame_tree_.Nodes()) { bool is_root = frame_tree_node->parent() == nullptr; frame_tree_node->current_frame_host()->RequestAXTreeSnapshot(
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index ead9ccc..4cb3b5df 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -341,7 +341,7 @@ bool IsWaitingForResponse() const override; const net::LoadStateWithParam& GetLoadState() const override; const base::string16& GetLoadStateHost() const override; - void RequestAXTreeSnapshot(const AXTreeSnapshotCallback& callback) override; + void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback) override; uint64_t GetUploadSize() const override; uint64_t GetUploadPosition() const override; const std::string& GetEncoding() const override;
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc index 5835127cd..da45e08a 100644 --- a/content/child/runtime_features.cc +++ b/content/child/runtime_features.cc
@@ -338,6 +338,9 @@ false); } + if (base::FeatureList::IsEnabled(features::kRasterInducingScroll)) + WebRuntimeFeatures::EnableRasterInducingScroll(true); + WebRuntimeFeatures::EnableFeatureFromString( "AllowContentInitiatedDataUrlNavigations", base::FeatureList::IsEnabled(
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index cbed6c2..79ca13f7 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -528,6 +528,11 @@ # indexed_db.mojom uses a native typemap that is not available in Java. cpp_only = true + # imports vs deps check is disabled for this target to work around + # windows multiple definitions linker error caused by having + # both a direct and an indirect dependency on the same target + skip_deps_check = true + sources = [ "appcache.mojom", "associated_interfaces.mojom", @@ -590,20 +595,27 @@ public_deps = [ "//components/leveldb/public/interfaces", "//content/public/common:interfaces", + "//content/public/common:resource_type_bindings", "//ipc:mojom_constants", "//media/mojo/interfaces", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//services/network/public/mojom", "//services/service_manager/public/mojom", "//services/ui/public/interfaces", + "//services/ui/public/interfaces/ime", "//services/video_capture/public/mojom", "//services/viz/public/interfaces", "//skia/public/interfaces", "//third_party/WebKit/public:mojo_bindings", + "//third_party/WebKit/public:web_feature_mojo_bindings", "//third_party/WebKit/public/mojom:mojom_core", "//ui/base/mojo:mojo_bindings", + "//ui/events/mojo:interfaces", "//ui/gfx/geometry/mojo", "//ui/gfx/mojo", + "//ui/gfx/range/mojo", + "//ui/latency/mojo:interfaces", "//url/mojom:url_mojom_gurl", "//url/mojom:url_mojom_origin", ]
diff --git a/content/common/resize_params.h b/content/common/resize_params.h index 3f190c3..2bea476 100644 --- a/content/common/resize_params.h +++ b/content/common/resize_params.h
@@ -22,11 +22,13 @@ // Information about the screen (dpi, depth, etc..). ScreenInfo screen_info; - // The size of the renderer. + // The size for the widget in DIPs. gfx::Size new_size; - // The size of the view's backing surface in non-DPI-adjusted pixels. - gfx::Size physical_backing_size; + // The size of compositor's viewport in pixels. Note that this may differ + // from a ScaleToCeiledSize of |new_size| due to Android's keyboard or due + // to rounding particulars. + gfx::Size compositor_viewport_pixel_size; // Whether or not Blink's viewport size should be shrunk by the height of the // URL-bar (always false on platforms where URL-bar hiding isn't supported).
diff --git a/content/common/service_worker/service_worker_messages.h b/content/common/service_worker/service_worker_messages.h index a5b84405..aceea65 100644 --- a/content/common/service_worker/service_worker_messages.h +++ b/content/common/service_worker/service_worker_messages.h
@@ -22,8 +22,6 @@ #include "third_party/WebKit/public/common/message_port/message_port_channel.h" #include "third_party/WebKit/public/common/message_port/transferable_message.h" #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorkerError.h" -#include "url/gurl.h" -#include "url/origin.h" #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT CONTENT_EXPORT @@ -83,15 +81,6 @@ //--------------------------------------------------------------------------- // Messages sent from the child process to the browser. -// Sends ExtendableMessageEvent to a service worker (renderer->browser). -IPC_MESSAGE_CONTROL4( - ServiceWorkerHostMsg_PostMessageToWorker, - int /* handle_id */, - int /* provider_id */, - scoped_refptr< - base::RefCountedData<blink::TransferableMessage>> /* message */, - url::Origin /* source_origin */) - // Sends MessageEvent to a client (renderer->browser). IPC_MESSAGE_ROUTED2( ServiceWorkerHostMsg_PostMessageToClient,
diff --git a/content/common/view_messages.h b/content/common/view_messages.h index 4d4d304a..7e83d178 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h
@@ -163,7 +163,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::ResizeParams) IPC_STRUCT_TRAITS_MEMBER(screen_info) IPC_STRUCT_TRAITS_MEMBER(new_size) - IPC_STRUCT_TRAITS_MEMBER(physical_backing_size) + IPC_STRUCT_TRAITS_MEMBER(compositor_viewport_pixel_size) IPC_STRUCT_TRAITS_MEMBER(browser_controls_shrink_blink_size) IPC_STRUCT_TRAITS_MEMBER(scroll_focused_node_into_view) IPC_STRUCT_TRAITS_MEMBER(top_controls_height)
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn index 60d0b3f1..a6442c5 100644 --- a/content/public/android/BUILD.gn +++ b/content/public/android/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/android/config.gni") import("//build/config/android/rules.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") android_aidl("common_aidl") { interface_file = "java/src/org/chromium/content/common/common.aidl"
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentClassFactory.java b/content/public/android/java/src/org/chromium/content/browser/ContentClassFactory.java index 3566df7..32945c7 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentClassFactory.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentClassFactory.java
@@ -8,6 +8,7 @@ import org.chromium.base.ThreadUtils; import org.chromium.content.browser.selection.SelectionInsertionHandleObserver; +import org.chromium.content.browser.selection.SelectionPopupControllerImpl; /** * A class factory for downstream injecting code to content layer. @@ -42,6 +43,16 @@ /** * Creates HandleObserver object. */ + public SelectionInsertionHandleObserver createHandleObserver( + SelectionPopupControllerImpl.ReadbackViewCallback callback) { + // Implemented by a subclass. + return null; + } + + /** + * Creates HandleObserver object. + */ + // TODO(ctzsm): Remove this overload after we removed all usage of it. public SelectionInsertionHandleObserver createHandleObserver(View view) { // Implemented by a subclass. return null;
diff --git a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java index d7275dc1..fbb7d74 100644 --- a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java +++ b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
@@ -90,6 +90,11 @@ // does not require ordering information. private static final int MENU_ITEM_ORDER_TEXT_PROCESS_START = 100; + // A flag to determine if we should get readback view from WindowAndroid. + // The readback view could be the ContainerView, which WindowAndroid has no control on that. + // Embedders should set this properly to use the correct view for readback. + private static boolean sShouldGetReadbackViewFromWindowAndroid = false; + private static final class UserDataFactoryLazyHolder { private static final UserDataFactory<SelectionPopupControllerImpl> INSTANCE = SelectionPopupControllerImpl::new; @@ -164,6 +169,23 @@ private SelectionInsertionHandleObserver mHandleObserver; /** + * An interface for getting {@link View} for readback. + */ + public interface ReadbackViewCallback { + /** + * Gets the {@link View} for readback. + */ + View getReadbackView(); + } + + /** + * Sets to use the readback view from {@link WindowAndroid}. + */ + public static void setShouldGetReadbackViewFromWindowAndroid() { + sShouldGetReadbackViewFromWindowAndroid = true; + } + + /** * Create {@link SelectionPopupController} instance. * @param context Context for action mode. * @param window WindowAndroid instance. @@ -241,7 +263,7 @@ mLastSelectedText = ""; - mHandleObserver = ContentClassFactory.get().createHandleObserver(view); + initHandleObserver(); if (initializeNative) nativeInit(mWebContents); @@ -270,6 +292,7 @@ destroyPastePopup(); mView = view; + initHandleObserver(); } // ImeEventObserver @@ -537,6 +560,7 @@ @Override public void onWindowAndroidChanged(WindowAndroid newWindowAndroid) { mWindowAndroid = newWindowAndroid; + initHandleObserver(); } // WindowEventObserver @@ -1292,6 +1316,16 @@ mHandleObserver = handleObserver; } + private void initHandleObserver() { + mHandleObserver = ContentClassFactory.get().createHandleObserver(() -> { + if (sShouldGetReadbackViewFromWindowAndroid) { + return mWindowAndroid == null ? null : mWindowAndroid.getReadbackView(); + } else { + return mView; + } + }); + } + @CalledByNative private void onShowUnhandledTapUIIfNeeded(int x, int y) { if (x < 0 || y < 0 || mView.getWidth() < x || mView.getHeight() < y) return;
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/SelectionPopupController.java b/content/public/android/java/src/org/chromium/content_public/browser/SelectionPopupController.java index 4b96393..326637a 100644 --- a/content/public/android/java/src/org/chromium/content_public/browser/SelectionPopupController.java +++ b/content/public/android/java/src/org/chromium/content_public/browser/SelectionPopupController.java
@@ -33,6 +33,13 @@ } /** + * Makes {@link SelectionPopupcontroller} to use the readback view from {@link WindowAndroid} + */ + static void setShouldGetReadbackViewFromWindowAndroid() { + SelectionPopupControllerImpl.setShouldGetReadbackViewFromWindowAndroid(); + } + + /** * Set {@link ActionMode.Callback} used by {@link SelectionPopupController}. * @param callback ActionMode.Callback instance. */
diff --git a/content/public/browser/download_manager.cc b/content/public/browser/download_manager.cc index be1dab6..9f596178 100644 --- a/content/public/browser/download_manager.cc +++ b/content/public/browser/download_manager.cc
@@ -5,7 +5,6 @@ #include "content/public/browser/download_manager.h" #include "components/download/public/common/download_task_runner.h" -#include "content/browser/byte_stream.h" namespace content { @@ -14,18 +13,4 @@ return download::GetDownloadTaskRunner(); } -DownloadManager::InputStream::InputStream( - std::unique_ptr<ByteStreamReader> stream_reader) - : stream_reader_(std::move(stream_reader)) {} - -DownloadManager::InputStream::InputStream( - download::mojom::DownloadStreamHandlePtr stream_handle) - : stream_handle_(std::move(stream_handle)) {} - -DownloadManager::InputStream::~InputStream() = default; - -bool DownloadManager::InputStream::IsEmpty() const { - return !stream_reader_.get() && stream_handle_.is_null(); -} - } // namespace content
diff --git a/content/public/browser/download_manager.h b/content/public/browser/download_manager.h index 82b861f..0e3f4f4 100644 --- a/content/public/browser/download_manager.h +++ b/content/public/browser/download_manager.h
@@ -40,6 +40,7 @@ #include "components/download/public/common/download_item.h" #include "components/download/public/common/download_stream.mojom.h" #include "components/download/public/common/download_url_parameters.h" +#include "components/download/public/common/input_stream.h" #include "content/common/content_export.h" #include "net/base/net_errors.h" #include "storage/browser/blob/blob_data_handle.h" @@ -53,7 +54,6 @@ namespace content { class BrowserContext; -class ByteStreamReader; class DownloadManagerDelegate; // Browser's download manager: manages all downloads and destination view. @@ -108,27 +108,13 @@ // clearing |downloads| first. virtual void GetAllDownloads(DownloadVector* downloads) = 0; - // InputStream to read after the download starts. Only one of them could be - // available at the same time. - struct CONTENT_EXPORT InputStream { - explicit InputStream(std::unique_ptr<ByteStreamReader> stream_reader); - explicit InputStream( - download::mojom::DownloadStreamHandlePtr stream_handle); - ~InputStream(); - - bool IsEmpty() const; - - std::unique_ptr<ByteStreamReader> stream_reader_; - download::mojom::DownloadStreamHandlePtr stream_handle_; - }; - // Called by a download source (Currently DownloadResourceHandler) // to initiate the non-source portions of a download. // Returns the id assigned to the download. If the DownloadCreateInfo // specifies an id, that id will be used. virtual void StartDownload( std::unique_ptr<download::DownloadCreateInfo> info, - std::unique_ptr<InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& on_started) = 0; // Remove downloads whose URLs match the |url_filter| and are within
diff --git a/content/public/browser/plugin_service.h b/content/public/browser/plugin_service.h index ac05c13..27021d6 100644 --- a/content/public/browser/plugin_service.h +++ b/content/public/browser/plugin_service.h
@@ -35,22 +35,21 @@ // thread. This is an asynchronous wrapper around the PluginList interface for // querying plugin information. This must be used instead of that to avoid // doing expensive disk operations on the IO/UI threads. -class PluginService { +class CONTENT_EXPORT PluginService { public: using GetPluginsCallback = base::OnceCallback<void(const std::vector<WebPluginInfo>&)>; // Returns the PluginService singleton. - CONTENT_EXPORT static PluginService* GetInstance(); + static PluginService* GetInstance(); // Tells all the renderer processes associated with the given browser context // to throw away their cache of the plugin list, and optionally also reload // all the pages with plugins. If |browser_context| is nullptr, purges the // cache in all renderers. // NOTE: can only be called on the UI thread. - CONTENT_EXPORT static void PurgePluginListCache( - BrowserContext* browser_context, - bool reload_pages); + static void PurgePluginListCache(BrowserContext* browser_context, + bool reload_pages); virtual ~PluginService() {} @@ -132,6 +131,12 @@ // Returns true iff PPAPI "dev channel" methods are supported. virtual bool PpapiDevChannelSupported(BrowserContext* browser_context, const GURL& document_url) = 0; + + // Determine the number of PPAPI processes currently tracked by the service. + // Exposed primarily for testing purposes. + virtual int CountPpapiPluginProcessesForProfile( + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory) = 0; }; } // namespace content
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h index 7d2ec76..9c6643a 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h
@@ -300,9 +300,9 @@ // Request a one-time snapshot of the accessibility tree without changing // the accessibility mode. - using AXTreeSnapshotCallback = base::Callback<void(const ui::AXTreeUpdate&)>; - virtual void RequestAXTreeSnapshot( - const AXTreeSnapshotCallback& callback) = 0; + using AXTreeSnapshotCallback = + base::OnceCallback<void(const ui::AXTreeUpdate&)>; + virtual void RequestAXTreeSnapshot(AXTreeSnapshotCallback callback) = 0; // Causes the current page to be closed, including running its onunload event // handler.
diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn index f2f3d55..753c514 100644 --- a/content/public/common/BUILD.gn +++ b/content/public/common/BUILD.gn
@@ -365,6 +365,11 @@ "//extensions/common:mojo_blink", ] + # imports vs deps check is disabled for this target to work around + # windows multiple definitions linker error caused by having + # both a direct and an indirect dependency on the same target + skip_deps_check = true + sources = [ "appcache_info.mojom", "fullscreen_video_element.mojom",
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 1dbc2df..a1b368c 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -286,6 +286,10 @@ const base::Feature kPWAFullCodeCache{"PWAFullCodeCache", base::FEATURE_DISABLED_BY_DEFAULT}; +// Enable raster-inducing scroll. +const base::Feature kRasterInducingScroll{"RasterInducingScroll", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Throttle Blink's rendering pipeline based on frame visibility. const base::Feature kRenderingPipelineThrottling{ "RenderingPipelineThrottling", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h index a6fddc81..4915ec9 100644 --- a/content/public/common/content_features.h +++ b/content/public/common/content_features.h
@@ -70,6 +70,7 @@ CONTENT_EXPORT extern const base::Feature kPepper3DImageChromium; CONTENT_EXPORT extern const base::Feature kPurgeAndSuspend; CONTENT_EXPORT extern const base::Feature kPWAFullCodeCache; +CONTENT_EXPORT extern const base::Feature kRasterInducingScroll; CONTENT_EXPORT extern const base::Feature kRenderingPipelineThrottling; CONTENT_EXPORT extern const base::Feature kReportRendererPeakMemoryStats; CONTENT_EXPORT extern const base::Feature kRequireCSSExtensionForFile;
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index e46385b3..30188c1 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -772,12 +772,6 @@ // process consolidation, not isolation). You probably want this one. const char kSitePerProcess[] = "site-per-process"; -// Skips reencoding bitmaps as PNGs when the encoded data is unavailable -// during SKP capture. This allows for obtaining an accurate sample of -// the types of images on the web, rather than being weighted towards PNGs -// that we have encoded ourselves. -const char kSkipReencodingOnSKPCapture[] = "skip-reencoding-on-skp-capture"; - // Specifies if the browser should start in fullscreen mode, like if the user // had pressed F11 right after startup. const char kStartFullscreen[] = "start-fullscreen";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 66f9491..855329f 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -214,7 +214,6 @@ extern const char kShowPaintRects[]; CONTENT_EXPORT extern const char kSingleProcess[]; CONTENT_EXPORT extern const char kSitePerProcess[]; -extern const char kSkipReencodingOnSKPCapture[]; CONTENT_EXPORT extern const char kStartFullscreen[]; CONTENT_EXPORT extern const char kStatsCollectionController[]; CONTENT_EXPORT extern const char kTestType[];
diff --git a/content/public/test/mock_download_manager.cc b/content/public/test/mock_download_manager.cc index 7210f74..3fd2358 100644 --- a/content/public/test/mock_download_manager.cc +++ b/content/public/test/mock_download_manager.cc
@@ -110,7 +110,7 @@ void MockDownloadManager::StartDownload( std::unique_ptr<download::DownloadCreateInfo> info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& callback) { MockStartDownload(info.get(), stream.get()); }
diff --git a/content/public/test/mock_download_manager.h b/content/public/test/mock_download_manager.h index 2006f33..c60b5ad 100644 --- a/content/public/test/mock_download_manager.h +++ b/content/public/test/mock_download_manager.h
@@ -11,6 +11,7 @@ #include <vector> #include "components/download/public/common/download_url_parameters.h" +#include "components/download/public/common/input_stream.h" #include "content/public/browser/download_manager.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -101,13 +102,12 @@ // Gasket for handling scoped_ptr arguments. void StartDownload(std::unique_ptr<download::DownloadCreateInfo> info, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, const download::DownloadUrlParameters::OnStartedCallback& callback) override; MOCK_METHOD2(MockStartDownload, - void(download::DownloadCreateInfo*, - DownloadManager::InputStream*)); + void(download::DownloadCreateInfo*, download::InputStream*)); MOCK_METHOD3(RemoveDownloadsByURLAndTime, int(const base::Callback<bool(const GURL&)>& url_filter, base::Time remove_begin,
diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc index 4bf2f02..178c5f1 100644 --- a/content/public/test/render_view_test.cc +++ b/content/public/test/render_view_test.cc
@@ -569,7 +569,7 @@ ResizeParams params; params.screen_info = ScreenInfo(); params.new_size = new_size; - params.physical_backing_size = new_size; + params.compositor_viewport_pixel_size = new_size; params.top_controls_height = 0.f; params.browser_controls_shrink_blink_size = false; params.is_fullscreen_granted = is_fullscreen_granted;
diff --git a/content/public/test/test_file_error_injector.cc b/content/public/test/test_file_error_injector.cc index f665d7b..14227021 100644 --- a/content/public/test/test_file_error_injector.cc +++ b/content/public/test/test_file_error_injector.cc
@@ -31,14 +31,15 @@ // A class that performs file operations and injects errors. class DownloadFileWithError: public DownloadFileImpl { public: - DownloadFileWithError(std::unique_ptr<download::DownloadSaveInfo> save_info, - const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, - uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer, - const TestFileErrorInjector::FileErrorInfo& error_info, - const base::Closure& ctor_callback, - const base::Closure& dtor_callback); + DownloadFileWithError( + std::unique_ptr<download::DownloadSaveInfo> save_info, + const base::FilePath& default_download_directory, + std::unique_ptr<download::InputStream> stream, + uint32_t download_id, + base::WeakPtr<download::DownloadDestinationObserver> observer, + const TestFileErrorInjector::FileErrorInfo& error_info, + const base::Closure& ctor_callback, + const base::Closure& dtor_callback); ~DownloadFileWithError() override; @@ -111,9 +112,9 @@ DownloadFileWithError::DownloadFileWithError( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer, + base::WeakPtr<download::DownloadDestinationObserver> observer, const TestFileErrorInjector::FileErrorInfo& error_info, const base::Closure& ctor_callback, const base::Closure& dtor_callback) @@ -291,9 +292,9 @@ DownloadFile* CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) override; + base::WeakPtr<download::DownloadDestinationObserver> observer) override; bool SetError(TestFileErrorInjector::FileErrorInfo error); @@ -317,9 +318,9 @@ DownloadFile* DownloadFileWithErrorFactory::CreateFile( std::unique_ptr<download::DownloadSaveInfo> save_info, const base::FilePath& default_download_directory, - std::unique_ptr<DownloadManager::InputStream> stream, + std::unique_ptr<download::InputStream> stream, uint32_t download_id, - base::WeakPtr<DownloadDestinationObserver> observer) { + base::WeakPtr<download::DownloadDestinationObserver> observer) { return new DownloadFileWithError( std::move(save_info), default_download_directory, std::move(stream), download_id, observer, injected_error_, construction_callback_,
diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn index 2f79320a..6bbb6b32 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn
@@ -764,6 +764,8 @@ "media/webrtc/rtc_peer_connection_handler.h", "media/webrtc/rtc_rtp_contributing_source.cc", "media/webrtc/rtc_rtp_contributing_source.h", + "media/webrtc/rtc_rtp_parameters.cc", + "media/webrtc/rtc_rtp_parameters.h", "media/webrtc/rtc_rtp_receiver.cc", "media/webrtc/rtc_rtp_receiver.h", "media/webrtc/rtc_rtp_sender.cc",
diff --git a/content/renderer/gpu/frame_swap_message_queue.cc b/content/renderer/gpu/frame_swap_message_queue.cc index ba0f87b4..51a0cde 100644 --- a/content/renderer/gpu/frame_swap_message_queue.cc +++ b/content/renderer/gpu/frame_swap_message_queue.cc
@@ -208,10 +208,6 @@ source->clear(); } -uint32_t FrameSwapMessageQueue::AllocateFrameToken() { - return ++last_used_frame_token_; -} - void FrameSwapMessageQueue::NotifyFramesAreDiscarded( bool frames_are_discarded) { DCHECK_CALLED_ON_VALID_THREAD(impl_thread_checker_);
diff --git a/content/renderer/gpu/frame_swap_message_queue.h b/content/renderer/gpu/frame_swap_message_queue.h index 1a1dd74..54ad846 100644 --- a/content/renderer/gpu/frame_swap_message_queue.h +++ b/content/renderer/gpu/frame_swap_message_queue.h
@@ -97,8 +97,6 @@ std::vector<std::unique_ptr<IPC::Message>>* source, std::vector<IPC::Message>* dest); - uint32_t AllocateFrameToken(); - int32_t routing_id() const { return routing_id_; } void NotifyFramesAreDiscarded(bool frames_are_discarded); @@ -115,7 +113,6 @@ std::unique_ptr<FrameSwapMessageSubQueue> visual_state_queue_; std::unique_ptr<FrameSwapMessageSubQueue> swap_queue_; std::vector<std::unique_ptr<IPC::Message>> next_drain_messages_; - uint32_t last_used_frame_token_ = 0; int32_t routing_id_ = 0; bool frames_are_discarded_ = false; THREAD_CHECKER(impl_thread_checker_);
diff --git a/content/renderer/gpu/gpu_benchmarking_extension.cc b/content/renderer/gpu/gpu_benchmarking_extension.cc index 07dd309..29d9b3e 100644 --- a/content/renderer/gpu/gpu_benchmarking_extension.cc +++ b/content/renderer/gpu/gpu_benchmarking_extension.cc
@@ -54,8 +54,6 @@ #include "third_party/skia/include/core/SkGraphics.h" #include "third_party/skia/include/core/SkPicture.h" #include "third_party/skia/include/core/SkPictureRecorder.h" -#include "third_party/skia/include/core/SkSerialProcs.h" -#include "third_party/skia/include/core/SkStream.h" // Note that headers in third_party/skia/src are fragile. This is // an experimental, fragile, and diagnostic-only document type. #include "third_party/skia/src/utils/SkMultiPictureDocument.h" @@ -108,20 +106,7 @@ SkFILEWStream file(filepath.c_str()); DCHECK(file.isValid()); - SkSerialProcs procs; - procs.fImageProc = [](SkImage* image, void*) { - auto data = image->refEncodedData(); - if (!data) { - const base::CommandLine& commandLine = - *base::CommandLine::ForCurrentProcess(); - if (commandLine.HasSwitch(switches::kSkipReencodingOnSKPCapture)) { - data = SkData::MakeEmpty(); - } - // else data is null, which triggers skia's default PNG encode - } - return data; - }; - auto data = picture->serialize(&procs); + auto data = picture->serialize(); file.write(data->data(), data->size()); file.fsync(); }
diff --git a/content/renderer/gpu/queue_message_swap_promise.cc b/content/renderer/gpu/queue_message_swap_promise.cc index b045b83..199ddfa4 100644 --- a/content/renderer/gpu/queue_message_swap_promise.cc +++ b/content/renderer/gpu/queue_message_swap_promise.cc
@@ -7,6 +7,7 @@ #include <memory> #include "base/command_line.h" +#include "cc/trees/frame_token_allocator.h" #include "content/common/view_messages.h" #include "content/public/common/content_switches.h" #include "content/public/renderer/render_thread.h" @@ -46,7 +47,9 @@ // The OutputSurface will take care of the Drain+Send. } -void QueueMessageSwapPromise::WillSwap(viz::CompositorFrameMetadata* metadata) { +void QueueMessageSwapPromise::WillSwap( + viz::CompositorFrameMetadata* metadata, + cc::FrameTokenAllocator* frame_token_allocator) { #if DCHECK_IS_ON() DCHECK(!completed_); #endif @@ -61,7 +64,7 @@ std::vector<IPC::Message> messages_to_send; FrameSwapMessageQueue::TransferMessages(&messages, &messages_to_send); if (!messages_to_send.empty()) { - metadata->frame_token = message_queue_->AllocateFrameToken(); + metadata->frame_token = frame_token_allocator->GetOrAllocateFrameToken(); message_sender_->Send(new ViewHostMsg_FrameSwapMessages( message_queue_->routing_id(), metadata->frame_token, messages_to_send));
diff --git a/content/renderer/gpu/queue_message_swap_promise.h b/content/renderer/gpu/queue_message_swap_promise.h index f888f2f..392ac6d 100644 --- a/content/renderer/gpu/queue_message_swap_promise.h +++ b/content/renderer/gpu/queue_message_swap_promise.h
@@ -27,7 +27,8 @@ ~QueueMessageSwapPromise() override; void DidActivate() override; - void WillSwap(viz::CompositorFrameMetadata* metadata) override; + void WillSwap(viz::CompositorFrameMetadata* metadata, + cc::FrameTokenAllocator* frame_token_allocator) override; void DidSwap() override; DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override;
diff --git a/content/renderer/gpu/queue_message_swap_promise_unittest.cc b/content/renderer/gpu/queue_message_swap_promise_unittest.cc index eb1b54cc..8281480 100644 --- a/content/renderer/gpu/queue_message_swap_promise_unittest.cc +++ b/content/renderer/gpu/queue_message_swap_promise_unittest.cc
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/test/scoped_task_environment.h" +#include "cc/trees/frame_token_allocator.h" #include "cc/trees/swap_promise.h" #include "content/common/view_messages.h" #include "content/renderer/gpu/frame_swap_message_queue.h" @@ -145,7 +146,7 @@ for (const auto& promise : promises_) { if (promise.get()) { promise->DidActivate(); - promise->WillSwap(&dummy_metadata_); + promise->WillSwap(&dummy_metadata_, &dummy_frame_token_allocator_); promise->DidSwap(); } } @@ -161,6 +162,7 @@ std::vector<IPC::Message> messages_; std::vector<std::unique_ptr<cc::SwapPromise>> promises_; viz::CompositorFrameMetadata dummy_metadata_; + cc::FrameTokenAllocator dummy_frame_token_allocator_; cc::RenderFrameMetadata dummy_render_frame_metadata_; private: @@ -178,7 +180,7 @@ ASSERT_TRUE(promises_[0].get()); promises_[0]->DidActivate(); - promises_[0]->WillSwap(&dummy_metadata_); + promises_[0]->WillSwap(&dummy_metadata_, &dummy_frame_token_allocator_); promises_[0]->DidSwap(); EXPECT_TRUE(DirectSendMessages().empty()); @@ -283,7 +285,7 @@ QueueMessages(data, arraysize(data)); promises_[0]->DidActivate(); - promises_[0]->WillSwap(&dummy_metadata_); + promises_[0]->WillSwap(&dummy_metadata_, &dummy_frame_token_allocator_); promises_[0]->DidSwap(); ASSERT_FALSE(promises_[1].get()); std::vector<std::unique_ptr<IPC::Message>> messages;
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index 631948d..fd3475b 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -117,7 +117,8 @@ ~ReportTimeSwapPromise() override; void DidActivate() override {} - void WillSwap(viz::CompositorFrameMetadata* metadata) override {} + void WillSwap(viz::CompositorFrameMetadata* metadata, + cc::FrameTokenAllocator* frame_token_allocator) override {} void DidSwap() override; DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override;
diff --git a/content/renderer/media/webrtc/rtc_rtp_parameters.cc b/content/renderer/media/webrtc/rtc_rtp_parameters.cc new file mode 100644 index 0000000..f3938c6 --- /dev/null +++ b/content/renderer/media/webrtc/rtc_rtp_parameters.cc
@@ -0,0 +1,158 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/renderer/media/webrtc/rtc_rtp_parameters.h" + +#include <utility> + +namespace { + +// Relative weights for each priority as defined in RTCWEB-DATA +// https://tools.ietf.org/html/draft-ietf-rtcweb-data-channel +const double kPriorityWeightVeryLow = 0.5; +const double kPriorityWeightLow = 1; +const double kPriorityWeightMedium = 2; +const double kPriorityWeightHigh = 4; + +template <typename T, typename F> +base::Optional<T> ToBaseOptional(const rtc::Optional<F>& from) { + if (from) + return from.value(); + return base::nullopt; +} + +blink::WebRTCPriorityType PriorityFromDouble(double priority) { + // Find the middle point between 2 priority weights to match them to a + // WebRTC priority + const double very_low_upper_bound = + (kPriorityWeightVeryLow + kPriorityWeightLow) / 2; + const double low_upper_bound = + (kPriorityWeightLow + kPriorityWeightMedium) / 2; + const double medium_upper_bound = + (kPriorityWeightMedium + kPriorityWeightHigh) / 2; + + if (priority < webrtc::kDefaultBitratePriority * very_low_upper_bound) { + return blink::WebRTCPriorityType::VeryLow; + } + if (priority < webrtc::kDefaultBitratePriority * low_upper_bound) { + return blink::WebRTCPriorityType::Low; + } + if (priority < webrtc::kDefaultBitratePriority * medium_upper_bound) { + return blink::WebRTCPriorityType::Medium; + } + return blink::WebRTCPriorityType::High; +} + +base::Optional<blink::WebRTCDtxStatus> FromRTCDtxStatus( + rtc::Optional<webrtc::DtxStatus> status) { + if (!status) + return base::nullopt; + + blink::WebRTCDtxStatus result; + switch (status.value()) { + case webrtc::DtxStatus::DISABLED: + result = blink::WebRTCDtxStatus::Disabled; + break; + case webrtc::DtxStatus::ENABLED: + result = blink::WebRTCDtxStatus::Enabled; + break; + default: + NOTREACHED(); + } + return result; +} + +base::Optional<blink::WebRTCDegradationPreference> FromRTCDegradationPreference( + rtc::Optional<webrtc::DegradationPreference> degradation_preference) { + if (!degradation_preference) + return base::nullopt; + + blink::WebRTCDegradationPreference result; + switch (degradation_preference.value()) { + case webrtc::DegradationPreference::MAINTAIN_FRAMERATE: + result = blink::WebRTCDegradationPreference::MaintainFramerate; + break; + case webrtc::DegradationPreference::MAINTAIN_RESOLUTION: + result = blink::WebRTCDegradationPreference::MaintainResolution; + break; + case webrtc::DegradationPreference::BALANCED: + result = blink::WebRTCDegradationPreference::Balanced; + break; + default: + NOTREACHED(); + } + return result; +} + +} // namespace + +namespace content { + +blink::WebRTCRtpParameters GetWebRTCRtpParameters( + const webrtc::RtpParameters& parameters) { + blink::WebVector<blink::WebRTCRtpEncodingParameters> encodings; + encodings.reserve(parameters.encodings.size()); + for (const auto& encoding_parameter : parameters.encodings) { + encodings.emplace_back(GetWebRTCRtpEncodingParameters(encoding_parameter)); + } + + blink::WebVector<blink::WebRTCRtpHeaderExtensionParameters> header_extensions; + header_extensions.reserve(parameters.header_extensions.size()); + for (const auto& extension_parameter : parameters.header_extensions) { + header_extensions.emplace_back( + GetWebRTCRtpHeaderExtensionParameters(extension_parameter)); + } + + blink::WebVector<blink::WebRTCRtpCodecParameters> codec_parameters; + codec_parameters.reserve(parameters.codecs.size()); + for (const auto& codec_parameter : parameters.codecs) { + codec_parameters.emplace_back(GetWebRTCRtpCodecParameters(codec_parameter)); + } + + return blink::WebRTCRtpParameters( + blink::WebString::FromASCII(parameters.transaction_id), + blink::WebRTCRtcpParameters(), std::move(encodings), header_extensions, + codec_parameters, + FromRTCDegradationPreference(parameters.degradation_preference)); +} + +blink::WebRTCRtpEncodingParameters GetWebRTCRtpEncodingParameters( + const webrtc::RtpEncodingParameters& encoding_parameters) { + return blink::WebRTCRtpEncodingParameters( + ToBaseOptional<uint8_t>(encoding_parameters.codec_payload_type), + FromRTCDtxStatus(encoding_parameters.dtx), encoding_parameters.active, + PriorityFromDouble(encoding_parameters.bitrate_priority), + ToBaseOptional<uint32_t>(encoding_parameters.ptime), + ToBaseOptional<uint32_t>(encoding_parameters.max_bitrate_bps), + ToBaseOptional<uint32_t>(encoding_parameters.max_framerate), + encoding_parameters.scale_framerate_down_by, + blink::WebString::FromASCII(encoding_parameters.rid)); +} + +blink::WebRTCRtpHeaderExtensionParameters GetWebRTCRtpHeaderExtensionParameters( + const webrtc::RtpHeaderExtensionParameters& extension_parameters) { + return blink::WebRTCRtpHeaderExtensionParameters( + blink::WebString::FromASCII(extension_parameters.uri), + extension_parameters.id, extension_parameters.encrypt); +} + +// TODO(orphis): Copy the RTCP information +// https://crbug.com/webrtc/7580 +blink::WebRTCRtcpParameters GetWebRTCRtcpParameters() { + return blink::WebRTCRtcpParameters(); +} + +blink::WebRTCRtpCodecParameters GetWebRTCRtpCodecParameters( + const webrtc::RtpCodecParameters& codec_parameters) { + return blink::WebRTCRtpCodecParameters( + codec_parameters.payload_type, + blink::WebString::FromASCII(codec_parameters.mime_type()), + ToBaseOptional<uint32_t>(codec_parameters.clock_rate), + ToBaseOptional<uint16_t>(codec_parameters.num_channels), + // TODO(orphis): Convert the parameters field to sdpFmtpLine + // https://crbug.com/webrtc/7580 + blink::WebString()); +} + +} // namespace content
diff --git a/content/renderer/media/webrtc/rtc_rtp_parameters.h b/content/renderer/media/webrtc/rtc_rtp_parameters.h new file mode 100644 index 0000000..f9719e73 --- /dev/null +++ b/content/renderer/media/webrtc/rtc_rtp_parameters.h
@@ -0,0 +1,33 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_PARAMETERS_H_ +#define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_PARAMETERS_H_ + +#include "base/memory/ref_counted.h" +#include "content/common/content_export.h" +#include "third_party/WebKit/public/platform/WebRTCRtpParameters.h" +#include "third_party/webrtc/api/rtpparameters.h" + +namespace content { + +CONTENT_EXPORT blink::WebRTCRtpEncodingParameters +GetWebRTCRtpEncodingParameters( + const webrtc::RtpEncodingParameters& encoding_parameters); + +CONTENT_EXPORT blink::WebRTCRtpHeaderExtensionParameters +GetWebRTCRtpHeaderExtensionParameters( + const webrtc::RtpHeaderExtensionParameters& extension_parameters); + +CONTENT_EXPORT blink::WebRTCRtcpParameters GetWebRTCRtcpParameters(); + +CONTENT_EXPORT blink::WebRTCRtpCodecParameters GetWebRTCRtpCodecParameters( + const webrtc::RtpCodecParameters& codec_parameters); + +CONTENT_EXPORT blink::WebRTCRtpParameters GetWebRTCRtpParameters( + const webrtc::RtpParameters& parameters); + +} // namespace content + +#endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_PARAMETERS_H_
diff --git a/content/renderer/media/webrtc/rtc_rtp_parameters_unittest.cc b/content/renderer/media/webrtc/rtc_rtp_parameters_unittest.cc new file mode 100644 index 0000000..b1d1629 --- /dev/null +++ b/content/renderer/media/webrtc/rtc_rtp_parameters_unittest.cc
@@ -0,0 +1,165 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/renderer/media/webrtc/rtc_rtp_parameters.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace content { + +TEST(RTCRtpParametersTest, Read) { + webrtc::RtpParameters webrtc_parameters; + webrtc_parameters.transaction_id = "transaction_id"; + webrtc_parameters.degradation_preference = + webrtc::DegradationPreference::BALANCED; + + webrtc_parameters.encodings.emplace_back(); + webrtc::RtpEncodingParameters& webrtc_encoding = + webrtc_parameters.encodings.front(); + webrtc_encoding.codec_payload_type = 42; + webrtc_encoding.dtx = webrtc::DtxStatus::ENABLED; + webrtc_encoding.active = true; + webrtc_encoding.bitrate_priority = webrtc::kDefaultBitratePriority; + webrtc_encoding.ptime = 1337; + webrtc_encoding.max_bitrate_bps = 1337000; + webrtc_encoding.max_framerate = 60; + webrtc_encoding.scale_resolution_down_by = 1.; + webrtc_encoding.rid = "rid"; + + webrtc_parameters.header_extensions.emplace_back(); + webrtc::RtpHeaderExtensionParameters& webrtc_header_extension = + webrtc_parameters.header_extensions.front(); + webrtc_header_extension.uri = "uri"; + webrtc_header_extension.id = 33; + webrtc_header_extension.encrypt = true; + + webrtc_parameters.codecs.emplace_back(); + webrtc::RtpCodecParameters& webrtc_codec_parameter = + webrtc_parameters.codecs.front(); + webrtc_codec_parameter.payload_type = 42; + webrtc_codec_parameter.clock_rate = 1234; + webrtc_codec_parameter.num_channels = 2; + + blink::WebRTCRtpParameters parameters = + GetWebRTCRtpParameters(webrtc_parameters); + EXPECT_EQ(parameters.TransactionId(), "transaction_id"); + EXPECT_EQ(parameters.DegradationPreference(), + blink::WebRTCDegradationPreference::Balanced); + + ASSERT_EQ(parameters.Encodings().size(), 1u); + for (const auto& encoding : parameters.Encodings()) { + EXPECT_EQ(encoding.CodecPayloadType(), 42); + EXPECT_EQ(encoding.Dtx(), blink::WebRTCDtxStatus::Enabled); + EXPECT_EQ(encoding.Active(), true); + EXPECT_EQ(encoding.Priority(), blink::WebRTCPriorityType::Low); + EXPECT_EQ(encoding.Ptime(), 1337u); + EXPECT_EQ(encoding.MaxBitrate(), 1337000u); + EXPECT_EQ(encoding.MaxFramerate(), 60u); + EXPECT_EQ(encoding.ScaleResolutionDownBy(), 1.); + EXPECT_EQ(encoding.Rid(), "rid"); + } + + ASSERT_EQ(parameters.HeaderExtensions().size(), 1u); + for (const auto& header_extension : parameters.HeaderExtensions()) { + EXPECT_EQ(header_extension.URI(), "uri"); + EXPECT_EQ(header_extension.Id(), 33); + EXPECT_EQ(header_extension.Encrypted(), true); + } + + ASSERT_EQ(parameters.Codecs().size(), 1u); + for (const auto& codec : parameters.Codecs()) { + EXPECT_EQ(codec.PayloadType(), 42); + EXPECT_EQ(codec.ClockRate(), 1234u); + EXPECT_EQ(codec.Channels(), 2u); + } +} + +TEST(RTCRtpParametersTest, CheckDtxStatusEnum) { + webrtc::RtpEncodingParameters webrtc_encoding_parameters; + + { + webrtc_encoding_parameters.dtx = webrtc::DtxStatus::DISABLED; + blink::WebRTCRtpEncodingParameters encoding_parameters = + GetWebRTCRtpEncodingParameters(webrtc_encoding_parameters); + EXPECT_EQ(encoding_parameters.Dtx(), blink::WebRTCDtxStatus::Disabled); + } + + { + webrtc_encoding_parameters.dtx = webrtc::DtxStatus::ENABLED; + blink::WebRTCRtpEncodingParameters encoding_parameters = + GetWebRTCRtpEncodingParameters(webrtc_encoding_parameters); + EXPECT_EQ(encoding_parameters.Dtx(), blink::WebRTCDtxStatus::Enabled); + } +} + +TEST(RTCRtpParametersTest, CheckDegradationPreferenceEnum) { + webrtc::RtpParameters webrtc_parameters; + + { + webrtc_parameters.degradation_preference = + webrtc::DegradationPreference::MAINTAIN_FRAMERATE; + blink::WebRTCRtpParameters parameters = + GetWebRTCRtpParameters(webrtc_parameters); + EXPECT_EQ(parameters.DegradationPreference(), + blink::WebRTCDegradationPreference::MaintainFramerate); + } + + { + webrtc_parameters.degradation_preference = + webrtc::DegradationPreference::MAINTAIN_RESOLUTION; + blink::WebRTCRtpParameters parameters = + GetWebRTCRtpParameters(webrtc_parameters); + EXPECT_EQ(parameters.DegradationPreference(), + blink::WebRTCDegradationPreference::MaintainResolution); + } + + { + webrtc_parameters.degradation_preference = + webrtc::DegradationPreference::BALANCED; + blink::WebRTCRtpParameters parameters = + GetWebRTCRtpParameters(webrtc_parameters); + EXPECT_EQ(parameters.DegradationPreference(), + blink::WebRTCDegradationPreference::Balanced); + } +} + +TEST(RTCRtpParametersTest, CheckPriorityEnum) { + webrtc::RtpEncodingParameters webrtc_encoding_parameters; + + { + webrtc_encoding_parameters.bitrate_priority = + webrtc::kDefaultBitratePriority / 2; + blink::WebRTCRtpEncodingParameters encoding_parameters = + GetWebRTCRtpEncodingParameters(webrtc_encoding_parameters); + EXPECT_EQ(encoding_parameters.Priority(), + blink::WebRTCPriorityType::VeryLow); + } + + { + webrtc_encoding_parameters.bitrate_priority = + webrtc::kDefaultBitratePriority; + blink::WebRTCRtpEncodingParameters encoding_parameters = + GetWebRTCRtpEncodingParameters(webrtc_encoding_parameters); + EXPECT_EQ(encoding_parameters.Priority(), blink::WebRTCPriorityType::Low); + } + + { + webrtc_encoding_parameters.bitrate_priority = + webrtc::kDefaultBitratePriority * 2; + blink::WebRTCRtpEncodingParameters encoding_parameters = + GetWebRTCRtpEncodingParameters(webrtc_encoding_parameters); + EXPECT_EQ(encoding_parameters.Priority(), + blink::WebRTCPriorityType::Medium); + } + + { + webrtc_encoding_parameters.bitrate_priority = + webrtc::kDefaultBitratePriority * 4; + blink::WebRTCRtpEncodingParameters encoding_parameters = + GetWebRTCRtpEncodingParameters(webrtc_encoding_parameters); + EXPECT_EQ(encoding_parameters.Priority(), blink::WebRTCPriorityType::High); + } +} + +} // namespace content
diff --git a/content/renderer/media/webrtc/rtc_rtp_sender.cc b/content/renderer/media/webrtc/rtc_rtp_sender.cc index 40391dc..fc6c140 100644 --- a/content/renderer/media/webrtc/rtc_rtp_sender.cc +++ b/content/renderer/media/webrtc/rtc_rtp_sender.cc
@@ -4,8 +4,11 @@ #include "content/renderer/media/webrtc/rtc_rtp_sender.h" +#include <utility> + #include "base/logging.h" #include "content/renderer/media/webrtc/rtc_dtmf_sender_handler.h" +#include "content/renderer/media/webrtc/rtc_rtp_parameters.h" namespace content { @@ -119,6 +122,12 @@ return std::make_unique<RtcDtmfSenderHandler>(dtmf_sender); } + std::unique_ptr<blink::WebRTCRtpParameters> GetParameters() const { + webrtc::RtpParameters parameters = webrtc_sender_->GetParameters(); + return std::make_unique<blink::WebRTCRtpParameters>( + GetWebRTCRtpParameters(parameters)); + } + bool RemoveFromPeerConnection(webrtc::PeerConnectionInterface* pc) { if (!pc->RemoveTrack(webrtc_sender_)) return false; @@ -256,6 +265,11 @@ return internal_->GetDtmfSender(); } +std::unique_ptr<blink::WebRTCRtpParameters> RTCRtpSender::GetParameters() + const { + return internal_->GetParameters(); +} + webrtc::RtpSenderInterface* RTCRtpSender::webrtc_sender() const { return internal_->webrtc_sender(); }
diff --git a/content/renderer/media/webrtc/rtc_rtp_sender.h b/content/renderer/media/webrtc/rtc_rtp_sender.h index a1f9f1c2..4bd9212 100644 --- a/content/renderer/media/webrtc/rtc_rtp_sender.h +++ b/content/renderer/media/webrtc/rtc_rtp_sender.h
@@ -67,6 +67,7 @@ blink::WebRTCVoidRequest request) override; std::unique_ptr<blink::WebRTCDTMFSenderHandler> GetDtmfSender() const override; + std::unique_ptr<blink::WebRTCRtpParameters> GetParameters() const override; webrtc::RtpSenderInterface* webrtc_sender() const; const webrtc::MediaStreamTrackInterface* webrtc_track() const;
diff --git a/content/renderer/pepper/video_decoder_shim.cc b/content/renderer/pepper/video_decoder_shim.cc index 62fc729..a20432f7 100644 --- a/content/renderer/pepper/video_decoder_shim.cc +++ b/content/renderer/pepper/video_decoder_shim.cc
@@ -713,7 +713,8 @@ base::Bind(&VideoDecoderShim::DecoderImpl::OnInitDone, weak_ptr_factory_.GetWeakPtr()), base::Bind(&VideoDecoderShim::DecoderImpl::OnOutputComplete, - weak_ptr_factory_.GetWeakPtr())); + weak_ptr_factory_.GetWeakPtr()), + media::VideoDecoder::WaitingForDecryptionKeyCB()); #else OnInitDone(false); #endif // BUILDFLAG(ENABLE_LIBVPX) || BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
diff --git a/content/renderer/render_frame_impl_browsertest.cc b/content/renderer/render_frame_impl_browsertest.cc index 9b113b4..af58c099 100644 --- a/content/renderer/render_frame_impl_browsertest.cc +++ b/content/renderer/render_frame_impl_browsertest.cc
@@ -177,7 +177,7 @@ gfx::Size size(200, 200); resize_params.screen_info = ScreenInfo(); resize_params.new_size = size; - resize_params.physical_backing_size = size; + resize_params.compositor_viewport_pixel_size = size; resize_params.visible_viewport_size = size; resize_params.top_controls_height = 0.f; resize_params.browser_controls_shrink_blink_size = false;
diff --git a/content/renderer/render_frame_metadata_observer_impl.cc b/content/renderer/render_frame_metadata_observer_impl.cc index de27550..10015f4 100644 --- a/content/renderer/render_frame_metadata_observer_impl.cc +++ b/content/renderer/render_frame_metadata_observer_impl.cc
@@ -4,6 +4,8 @@ #include "content/renderer/render_frame_metadata_observer_impl.h" +#include "cc/trees/frame_token_allocator.h" + namespace content { RenderFrameMetadataObserverImpl::RenderFrameMetadataObserverImpl( @@ -15,8 +17,10 @@ RenderFrameMetadataObserverImpl::~RenderFrameMetadataObserverImpl() {} -void RenderFrameMetadataObserverImpl::BindToCurrentThread() { +void RenderFrameMetadataObserverImpl::BindToCurrentThread( + cc::FrameTokenAllocator* frame_token_allocator) { DCHECK(request_.is_pending()); + frame_token_allocator_ = frame_token_allocator; render_frame_metadata_observer_binding_.Bind(std::move(request_)); render_frame_metadata_observer_client_.Bind(std::move(client_info_)); }
diff --git a/content/renderer/render_frame_metadata_observer_impl.h b/content/renderer/render_frame_metadata_observer_impl.h index 6c4c29d..b963608 100644 --- a/content/renderer/render_frame_metadata_observer_impl.h +++ b/content/renderer/render_frame_metadata_observer_impl.h
@@ -10,6 +10,10 @@ #include "content/common/render_frame_metadata.mojom.h" #include "mojo/public/cpp/bindings/binding.h" +namespace cc { +class FrameTokenAllocator; +} // namespace cc + namespace content { // Implementation of cc::RenderFrameMetadataObserver which exists in the @@ -31,7 +35,8 @@ ~RenderFrameMetadataObserverImpl() override; // cc::RenderFrameMetadataObserver: - void BindToCurrentThread() override; + void BindToCurrentThread( + cc::FrameTokenAllocator* frame_token_allocator) override; void OnRenderFrameSubmission(cc::RenderFrameMetadata metadata) override; // mojom::RenderFrameMetadataObserver: @@ -44,6 +49,9 @@ cc::RenderFrameMetadata last_render_frame_metadata_; + // Not owned. + cc::FrameTokenAllocator* frame_token_allocator_; + // These are destroyed when BindToCurrentThread() is called. mojom::RenderFrameMetadataObserverRequest request_; mojom::RenderFrameMetadataObserverClientPtrInfo client_info_;
diff --git a/content/renderer/render_view_browsertest.cc b/content/renderer/render_view_browsertest.cc index 7adf552..9d8d925 100644 --- a/content/renderer/render_view_browsertest.cc +++ b/content/renderer/render_view_browsertest.cc
@@ -444,7 +444,7 @@ ResizeParams params; params.screen_info.device_scale_factor = dsf; params.new_size = gfx::Size(100, 100); - params.physical_backing_size = gfx::Size(200, 200); + params.compositor_viewport_pixel_size = gfx::Size(200, 200); params.visible_viewport_size = params.new_size; params.needs_resize_ack = false; params.content_source_id = view()->GetContentSourceId();
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index b148a96..6f1a1042 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc
@@ -427,7 +427,8 @@ void DidActivate() override {} - void WillSwap(viz::CompositorFrameMetadata* metadata) override { + void WillSwap(viz::CompositorFrameMetadata* metadata, + cc::FrameTokenAllocator* frame_token_allocator) override { DCHECK(!latency_info_.terminated()); metadata->latency_info.push_back(latency_info_); } @@ -1933,7 +1934,8 @@ ResizeParams resize_params; resize_params.screen_info = screen_info_; resize_params.new_size = new_size; - resize_params.physical_backing_size = physical_backing_size_; + resize_params.compositor_viewport_pixel_size = + compositor_viewport_pixel_size_; resize_params.browser_controls_shrink_blink_size = browser_controls_shrink_blink_size_; resize_params.top_controls_height = top_controls_height_; @@ -2090,7 +2092,7 @@ if (device_scale_factor_for_testing_) { ResizeParams p(params); p.screen_info.device_scale_factor = *device_scale_factor_for_testing_; - p.physical_backing_size = + p.compositor_viewport_pixel_size = gfx::ScaleToCeiledSize(p.new_size, p.screen_info.device_scale_factor); RenderWidget::OnResize(p); } else { @@ -2414,7 +2416,8 @@ params.screen_info.device_scale_factor = factor; params.new_size = size(); params.visible_viewport_size = visible_viewport_size_; - params.physical_backing_size = gfx::ScaleToCeiledSize(size(), factor); + params.compositor_viewport_pixel_size = + gfx::ScaleToCeiledSize(size(), factor); params.browser_controls_shrink_blink_size = false; params.top_controls_height = 0.f; params.is_fullscreen_granted = is_fullscreen_granted(); @@ -2430,7 +2433,7 @@ params.screen_info.color_space = color_space; params.new_size = size(); params.visible_viewport_size = visible_viewport_size_; - params.physical_backing_size = physical_backing_size_; + params.compositor_viewport_pixel_size = compositor_viewport_pixel_size_; params.browser_controls_shrink_blink_size = false; params.top_controls_height = 0.f; params.is_fullscreen_granted = is_fullscreen_granted();
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 60010bc9..a985c6e9 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -621,7 +621,7 @@ popup_view_origin_for_emulation_ = emulator->applied_widget_rect().origin(); popup_screen_origin_for_emulation_ = emulator->original_screen_rect().origin(); - UpdateSurfaceAndScreenInfo(local_surface_id_, physical_backing_size_, + UpdateSurfaceAndScreenInfo(local_surface_id_, compositor_viewport_pixel_size_, emulator->original_screen_info()); } @@ -652,15 +652,16 @@ content_source_id != current_content_source_id_ ? viz::LocalSurfaceId() : local_surface_id; // TODO(ccameron): If there is a meaningful distinction between |size_| and - // |physical_backing_size_| is it okay to ignore that distinction here, and - // assume that |physical_backing_size_| is just |size_| in pixels? Also note - // that the computation of |new_physical_backing_size| does not appear to - // take into account device emulation. + // |compositor_viewport_pixel_size_| is it okay to ignore that distinction + // here, and assume that |compositor_viewport_pixel_size_| is just |size_| in + // pixels? Also note that the computation of + // |new_compositor_viewport_pixel_size| does not appear to take into account + // device emulation. float new_device_scale_factor = screen_info.device_scale_factor; - gfx::Size new_physical_backing_size = + gfx::Size new_compositor_viewport_pixel_size = gfx::ScaleToCeiledSize(size_, new_device_scale_factor); - UpdateSurfaceAndScreenInfo(new_local_surface_id, new_physical_backing_size, - screen_info); + UpdateSurfaceAndScreenInfo(new_local_surface_id, + new_compositor_viewport_pixel_size, screen_info); } void RenderWidget::OnShowHostContextMenu(ContextMenuParams* params) { @@ -767,7 +768,7 @@ ResizeParams params; params.screen_info = screen_info_; params.new_size = new_window_rect.size(); - params.physical_backing_size = + params.compositor_viewport_pixel_size = gfx::ScaleToCeiledSize(new_window_rect.size(), GetWebDeviceScaleFactor()); params.visible_viewport_size = new_window_rect.size(); params.is_fullscreen_granted = is_fullscreen_granted_; @@ -857,7 +858,8 @@ ResizeParams resize_params; resize_params.screen_info = screen_info_; resize_params.new_size = size_; - resize_params.physical_backing_size = physical_backing_size_; + resize_params.compositor_viewport_pixel_size = + compositor_viewport_pixel_size_; resize_params.local_surface_id = local_surface_id_; resize_params.content_source_id = current_content_source_id_; resize_params.visible_viewport_size = visible_viewport_size_; @@ -1397,7 +1399,8 @@ params.content_source_id == current_content_source_id_) { new_local_surface_id = *params.local_surface_id; } - UpdateSurfaceAndScreenInfo(new_local_surface_id, params.physical_backing_size, + UpdateSurfaceAndScreenInfo(new_local_surface_id, + params.compositor_viewport_pixel_size, params.screen_info); if (compositor_) { // If surface synchronization is enabled, then this will use the provided @@ -1440,7 +1443,8 @@ // When resizing, we want to wait to paint before ACK'ing the resize. This // ensures that we only resize as fast as we can paint. We only need to // send an ACK if we are resized to a non-empty rect. - if (params.new_size.IsEmpty() || params.physical_backing_size.IsEmpty()) { + if (params.new_size.IsEmpty() || + params.compositor_viewport_pixel_size.IsEmpty()) { // In this case there is no paint/composite and therefore no // ViewHostMsg_ResizeOrRepaint_ACK to send the resize ack with. We'd need to // send the ack through a fake ViewHostMsg_ResizeOrRepaint_ACK or a @@ -1506,7 +1510,7 @@ reset_next_paint_is_resize_ack(); } - UpdateSurfaceAndScreenInfo(local_surface_id_, physical_backing_size_, + UpdateSurfaceAndScreenInfo(local_surface_id_, compositor_viewport_pixel_size_, screen_info_); compositor_->SetRasterColorSpace( screen_info_.color_space.GetRasterColorSpace()); @@ -1928,7 +1932,7 @@ void RenderWidget::UpdateSurfaceAndScreenInfo( viz::LocalSurfaceId new_local_surface_id, - const gfx::Size& new_physical_backing_size, + const gfx::Size& new_compositor_viewport_pixel_size, const ScreenInfo& new_screen_info) { bool screen_info_changed = screen_info_ != new_screen_info; bool orientation_changed = @@ -1938,13 +1942,13 @@ screen_info_.device_scale_factor != new_screen_info.device_scale_factor; local_surface_id_ = new_local_surface_id; - physical_backing_size_ = new_physical_backing_size; + compositor_viewport_pixel_size_ = new_compositor_viewport_pixel_size; screen_info_ = new_screen_info; if (compositor_) { // Note carefully that the DSF specified in |new_screen_info| is not the // DSF used by the compositor during device emulation! - compositor_->SetViewportSizeAndScale(physical_backing_size_, + compositor_->SetViewportSizeAndScale(compositor_viewport_pixel_size_, GetOriginalDeviceScaleFactor(), local_surface_id_); } @@ -2374,12 +2378,13 @@ } // TODO(ccameron): Note that this destroys any information differentiating - // |size_| from |physical_backing_size_|. Also note that the calculation of - // |new_physical_backing_size| does not appear to take into account device - // emulation. - gfx::Size new_physical_backing_size = + // |size_| from |compositor_viewport_pixel_size_|. Also note that the + // calculation of |new_compositor_viewport_pixel_size| does not appear to + // take into account device emulation. + gfx::Size new_compositor_viewport_pixel_size = gfx::ScaleToCeiledSize(size_, GetWebDeviceScaleFactor()); - UpdateSurfaceAndScreenInfo(viz::LocalSurfaceId(), new_physical_backing_size, + UpdateSurfaceAndScreenInfo(viz::LocalSurfaceId(), + new_compositor_viewport_pixel_size, screen_info_); if (!resizing_mode_selector_->is_synchronous_mode()) { @@ -2698,8 +2703,8 @@ return; compositor_->SetContentSourceId(++current_content_source_id_); - UpdateSurfaceAndScreenInfo(viz::LocalSurfaceId(), physical_backing_size_, - screen_info_); + UpdateSurfaceAndScreenInfo(viz::LocalSurfaceId(), + compositor_viewport_pixel_size_, screen_info_); // If surface synchronization is on, navigation implicitly acks any resize // that has happened so far so we can get the next ResizeParams containing the
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index c9a69914..0660e31 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h
@@ -190,6 +190,9 @@ blink::WebInputMethodController* GetInputMethodController() const; const gfx::Size& size() const { return size_; } + const gfx::Size& compositor_viewport_pixel_size() const { + return compositor_viewport_pixel_size_; + } bool is_fullscreen_granted() const { return is_fullscreen_granted_; } blink::WebDisplayMode display_mode() const { return display_mode_; } bool is_hidden() const { return is_hidden_; } @@ -710,13 +713,13 @@ WebCursor current_cursor_; // The size of the RenderWidget in DIPs. This may differ from - // |physical_backing_size_| in the following (and possibly other) cases: - // * On Android, for top and bottom controls - // * On OOPIF, due to rounding + // |compositor_viewport_pixel_size_| in the following (and possibly other) + // cases: * On Android, for top and bottom controls * On OOPIF, due to + // rounding gfx::Size size_; // The size of the compositor's surface in pixels. - gfx::Size physical_backing_size_; + gfx::Size compositor_viewport_pixel_size_; // The size of the visible viewport in pixels. gfx::Size visible_viewport_size_; @@ -886,9 +889,10 @@ blink::WebPopupType popup_type, int32_t* routing_id); - void UpdateSurfaceAndScreenInfo(viz::LocalSurfaceId new_local_surface_id, - const gfx::Size& new_physical_backing_size, - const ScreenInfo& new_screen_info); + void UpdateSurfaceAndScreenInfo( + viz::LocalSurfaceId new_local_surface_id, + const gfx::Size& new_compositor_viewport_pixel_size, + const ScreenInfo& new_screen_info); // A variant of Send but is fatal if it fails. The browser may // be waiting for this IPC Message and if the send fails the browser will
diff --git a/content/renderer/render_widget_browsertest.cc b/content/renderer/render_widget_browsertest.cc index e713e4b..ec774a6 100644 --- a/content/renderer/render_widget_browsertest.cc +++ b/content/renderer/render_widget_browsertest.cc
@@ -59,7 +59,7 @@ ResizeParams resize_params; resize_params.screen_info = ScreenInfo(); resize_params.new_size = gfx::Size(); - resize_params.physical_backing_size = gfx::Size(); + resize_params.compositor_viewport_pixel_size = gfx::Size(); resize_params.top_controls_height = 0.f; resize_params.browser_controls_shrink_blink_size = false; resize_params.is_fullscreen_granted = false; @@ -79,7 +79,7 @@ gfx::Size size(100, 100); resize_params.local_surface_id = local_surface_id_allocator.GenerateId(); resize_params.new_size = size; - resize_params.physical_backing_size = size; + resize_params.compositor_viewport_pixel_size = size; resize_params.content_source_id = 1u; resize_params.needs_resize_ack = true; OnResize(resize_params); @@ -96,7 +96,7 @@ // Resetting the rect to empty should not send the ack. resize_params.new_size = gfx::Size(); - resize_params.physical_backing_size = gfx::Size(); + resize_params.compositor_viewport_pixel_size = gfx::Size(); resize_params.local_surface_id = base::nullopt; OnResize(resize_params); EXPECT_EQ(resize_params.needs_resize_ack, next_paint_is_resize_ack()); @@ -122,7 +122,7 @@ std::unique_ptr<ResizeParams> InitialSizeParams() override { std::unique_ptr<ResizeParams> initial_size_params(new ResizeParams()); initial_size_params->new_size = initial_size_; - initial_size_params->physical_backing_size = initial_size_; + initial_size_params->compositor_viewport_pixel_size = initial_size_; initial_size_params->needs_resize_ack = true; initial_size_params->local_surface_id = local_surface_id_; return initial_size_params;
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc index fcca5ce..3ac71cc3 100644 --- a/content/renderer/render_widget_fullscreen_pepper.cc +++ b/content/renderer/render_widget_fullscreen_pepper.cc
@@ -337,7 +337,9 @@ } if (!compositor()) InitializeLayerTreeView(); - layer_->SetBounds(blink::WebSize(size())); + // Note that root cc::Layers' bounds are specified in pixels (in contrast with + // non-root cc::Layers' bounds, which are specified in DIPs). + layer_->SetBounds(blink::WebSize(compositor_viewport_pixel_size())); layer_->SetDrawsContent(true); compositor_->SetRootLayer(*layer_); } @@ -375,8 +377,10 @@ } void RenderWidgetFullscreenPepper::OnResize(const ResizeParams& params) { + // Note that root cc::Layers' bounds are specified in pixels (in contrast with + // non-root cc::Layers' bounds, which are specified in DIPs). if (layer_) - layer_->SetBounds(blink::WebSize(params.new_size)); + layer_->SetBounds(blink::WebSize(params.compositor_viewport_pixel_size)); RenderWidget::OnResize(params); }
diff --git a/content/renderer/render_widget_unittest.cc b/content/renderer/render_widget_unittest.cc index c1fbb0e..79d50a2 100644 --- a/content/renderer/render_widget_unittest.cc +++ b/content/renderer/render_widget_unittest.cc
@@ -392,7 +392,7 @@ ResizeParams resize_params; resize_params.screen_info = ScreenInfo(); resize_params.new_size = size; - resize_params.physical_backing_size = size; + resize_params.compositor_viewport_pixel_size = size; resize_params.visible_viewport_size = size; resize_params.content_source_id = widget()->GetContentSourceId(); resize_params.needs_resize_ack = true;
diff --git a/content/renderer/service_worker/service_worker_dispatcher_unittest.cc b/content/renderer/service_worker/service_worker_dispatcher_unittest.cc index f94a7140f..372f41f 100644 --- a/content/renderer/service_worker/service_worker_dispatcher_unittest.cc +++ b/content/renderer/service_worker/service_worker_dispatcher_unittest.cc
@@ -38,6 +38,10 @@ private: // Implements blink::mojom::ServiceWorkerObjectHost. + void PostMessage(::blink::TransferableMessage message, + const url::Origin& source_origin) override { + NOTREACHED(); + } void TerminateForTesting(TerminateForTestingCallback callback) override { NOTREACHED(); }
diff --git a/content/renderer/service_worker/service_worker_provider_context_unittest.cc b/content/renderer/service_worker/service_worker_provider_context_unittest.cc index 20df4c88..2b769d32 100644 --- a/content/renderer/service_worker/service_worker_provider_context_unittest.cc +++ b/content/renderer/service_worker/service_worker_provider_context_unittest.cc
@@ -61,6 +61,10 @@ private: // Implements blink::mojom::ServiceWorkerObjectHost. + void PostMessage(::blink::TransferableMessage message, + const url::Origin& source_origin) override { + NOTREACHED(); + } void TerminateForTesting(TerminateForTestingCallback callback) override { NOTREACHED(); }
diff --git a/content/renderer/service_worker/web_service_worker_impl.cc b/content/renderer/service_worker/web_service_worker_impl.cc index 1c600e4..94037ab 100644 --- a/content/renderer/service_worker/web_service_worker_impl.cc +++ b/content/renderer/service_worker/web_service_worker_impl.cc
@@ -97,15 +97,9 @@ return state_; } -void WebServiceWorkerImpl::PostMessageToWorker( - blink::WebServiceWorkerProvider* provider, - blink::TransferableMessage message, - const WebSecurityOrigin& source_origin) { - thread_safe_sender_->Send(new ServiceWorkerHostMsg_PostMessageToWorker( - info_->handle_id, - static_cast<WebServiceWorkerProviderImpl*>(provider)->provider_id(), - new base::RefCountedData<blink::TransferableMessage>(std::move(message)), - url::Origin(source_origin))); +void WebServiceWorkerImpl::PostMessage(blink::TransferableMessage message, + const WebSecurityOrigin& source_origin) { + GetObjectHost()->PostMessage(std::move(message), url::Origin(source_origin)); } void WebServiceWorkerImpl::TerminateForTesting(
diff --git a/content/renderer/service_worker/web_service_worker_impl.h b/content/renderer/service_worker/web_service_worker_impl.h index 3f209826..9368828 100644 --- a/content/renderer/service_worker/web_service_worker_impl.h +++ b/content/renderer/service_worker/web_service_worker_impl.h
@@ -59,10 +59,8 @@ blink::WebServiceWorkerProxy* Proxy() override; blink::WebURL Url() const override; blink::mojom::ServiceWorkerState GetState() const override; - void PostMessageToWorker( - blink::WebServiceWorkerProvider* provider, - blink::TransferableMessage message, - const blink::WebSecurityOrigin& source_origin) override; + void PostMessage(blink::TransferableMessage message, + const blink::WebSecurityOrigin& source_origin) override; void TerminateForTesting( std::unique_ptr<TerminateForTestingCallback> callback) override;
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index 416c9a0..80d181b3 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -1845,6 +1845,7 @@ "../renderer/media/webrtc/peer_connection_tracker_unittest.cc", "../renderer/media/webrtc/rtc_data_channel_handler_unittest.cc", "../renderer/media/webrtc/rtc_peer_connection_handler_unittest.cc", + "../renderer/media/webrtc/rtc_rtp_parameters_unittest.cc", "../renderer/media/webrtc/rtc_rtp_sender_unittest.cc", "../renderer/media/webrtc/rtc_stats_unittest.cc", "../renderer/media/webrtc/rtc_video_decoder_unittest.cc",
diff --git a/content/test/fake_plugin_service.cc b/content/test/fake_plugin_service.cc index 6746b9f..dfc1e111 100644 --- a/content/test/fake_plugin_service.cc +++ b/content/test/fake_plugin_service.cc
@@ -88,4 +88,10 @@ return false; } +int FakePluginService::CountPpapiPluginProcessesForProfile( + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory) { + return 0; +} + } // namespace content
diff --git a/content/test/fake_plugin_service.h b/content/test/fake_plugin_service.h index db23a83e..84bed378 100644 --- a/content/test/fake_plugin_service.h +++ b/content/test/fake_plugin_service.h
@@ -53,6 +53,9 @@ void GetInternalPlugins(std::vector<WebPluginInfo>* plugins) override; bool PpapiDevChannelSupported(BrowserContext* browser_context, const GURL& document_url) override; + int CountPpapiPluginProcessesForProfile( + const base::FilePath& plugin_path, + const base::FilePath& profile_data_directory) override; private: DISALLOW_COPY_AND_ASSIGN(FakePluginService);
diff --git a/content/test/gpu/gpu_tests/pixel_expectations.py b/content/test/gpu/gpu_tests/pixel_expectations.py index 44d6fe1..eb368b1 100644 --- a/content/test/gpu/gpu_tests/pixel_expectations.py +++ b/content/test/gpu/gpu_tests/pixel_expectations.py
@@ -56,6 +56,9 @@ self.Flaky('*', ['linux', 'intel', 'debug'], bug=648369) self.Flaky('Pixel_Video_MP4', ['android', 'nvidia'], bug=716564) + self.Fail('Pixel_Video_MP4', + ['android', ('qualcomm', 'Adreno (TM) 418')], bug=820240) + self.Flaky('Pixel_Video_MP4', ['linux', 'nvidia'], bug=819635) # TODO(junov); validate new test results self.Fail('Pixel_CanvasLowLatency2D', @@ -109,20 +112,6 @@ self.Fail('Pixel_DirectComposition_Video_VP9', ['win', 'intel'], bug=602688) - # Prepare for Skia's Delta Anti-Aliasing golden images rebaseline - self.Fail('Pixel_OffscreenCanvasAccelerated2D', - ['mac', 'linux', 'win', 'android', 'chromeos'], bug=817110) - self.Fail('Pixel_OffscreenCanvasAccelerated2DWorker', - ['mac', 'linux', 'win', 'android', 'chromeos'], bug=817110) - self.Fail('Pixel_OffscreenCanvasUnaccelerated2D', - ['mac', 'linux', 'win', 'android', 'chromeos'], bug=817110) - self.Fail('Pixel_OffscreenCanvasUnaccelerated2DGPUCompositing', - ['mac', 'linux', 'win', 'android', 'chromeos'], bug=817110) - self.Fail('Pixel_OffscreenCanvasUnaccelerated2DGPUCompositingWorker', - ['mac', 'linux', 'win', 'android', 'chromeos'], bug=817110) - self.Fail('Pixel_OffscreenCanvasUnaccelerated2DWorker', - ['mac', 'linux', 'win', 'android', 'chromeos'], bug=817110) - # TODO(zmo): temporarily suppress these two tests until new # reference images with new names are generated. self.Fail('Pixel_Canvas2DRedBox_NoGpuProcess',
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py index ea095b2..eec4730 100644 --- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py +++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -689,6 +689,8 @@ ['mac', 'no_passthrough', 'intel'], bug=679692) self.Fail('deqp/functional/gles3/fbomultisample*', ['mac', 'intel'], bug=641209) + self.Flaky('deqp/functional/gles3/shaderoperator/common_functions.html', + ['mac', 'intel'], bug=820225) self.Fail('deqp/functional/gles3/texturefiltering/2d_combinations_01.html', ['mac', 'intel'], bug=606074) self.Fail('deqp/functional/gles3/texturefiltering/' +
diff --git a/content/test/gpu/run_gpu_integration_test.py b/content/test/gpu/run_gpu_integration_test.py index 4845805..87e562b 100755 --- a/content/test/gpu/run_gpu_integration_test.py +++ b/content/test/gpu/run_gpu_integration_test.py
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # 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.
diff --git a/content/test/layouttest_support.cc b/content/test/layouttest_support.cc index bec8b1f..c10abdd9 100644 --- a/content/test/layouttest_support.cc +++ b/content/test/layouttest_support.cc
@@ -286,7 +286,8 @@ DCHECK(layer_tree_frame_sink_from_commit_); } void DidActivate() override {} - void WillSwap(viz::CompositorFrameMetadata*) override { + void WillSwap(viz::CompositorFrameMetadata*, + cc::FrameTokenAllocator*) override { layer_tree_frame_sink_from_commit_->RequestCopyOfOutput( std::move(copy_request_)); }
diff --git a/crypto/nss_util.cc b/crypto/nss_util.cc index ce0b62c..594507e 100644 --- a/crypto/nss_util.cc +++ b/crypto/nss_util.cc
@@ -176,11 +176,11 @@ } ScopedPK11Slot GetPrivateSlot( - const base::Callback<void(ScopedPK11Slot)>& callback) { + base::OnceCallback<void(ScopedPK11Slot)> callback) { if (private_slot_) return ScopedPK11Slot(PK11_ReferenceSlot(private_slot_.get())); if (!callback.is_null()) - tpm_ready_callback_list_.push_back(callback); + tpm_ready_callback_list_.push_back(std::move(callback)); return ScopedPK11Slot(); } @@ -193,7 +193,8 @@ for (SlotReadyCallbackList::iterator i = callback_list.begin(); i != callback_list.end(); ++i) { - (*i).Run(ScopedPK11Slot(PK11_ReferenceSlot(private_slot_.get()))); + std::move(*i).Run( + ScopedPK11Slot(PK11_ReferenceSlot(private_slot_.get()))); } } @@ -211,7 +212,7 @@ bool private_slot_initialization_started_; - typedef std::vector<base::Callback<void(ScopedPK11Slot)> > + typedef std::vector<base::OnceCallback<void(ScopedPK11Slot)>> SlotReadyCallbackList; SlotReadyCallbackList tpm_ready_callback_list_; }; @@ -292,7 +293,7 @@ void InitializeTPMTokenAndSystemSlot( int system_slot_id, - const base::Callback<void(bool)>& callback) { + base::OnceCallback<void(bool)> callback) { DCHECK(thread_checker_.CalledOnValidThread()); // Should not be called while there is already an initialization in // progress. @@ -300,7 +301,7 @@ // If EnableTPMTokenForNSS hasn't been called, return false. if (!tpm_token_enabled_for_nss_) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, false)); + FROM_HERE, base::BindOnce(std::move(callback), false)); return; } @@ -308,8 +309,8 @@ // Note that only |tpm_slot_| is checked, since |chaps_module_| could be // nullptr in tests while |tpm_slot_| has been set to the test DB. if (tpm_slot_) { - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, - base::Bind(callback, true)); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), true)); return; } @@ -325,7 +326,7 @@ system_slot_id, tpm_args_ptr), base::BindOnce(&NSSInitSingleton::OnInitializedTPMTokenAndSystemSlot, base::Unretained(this), // NSSInitSingleton is leaky - callback, std::move(tpm_args))); + std::move(callback), std::move(tpm_args))); initializing_tpm_token_ = true; } @@ -361,7 +362,7 @@ } void OnInitializedTPMTokenAndSystemSlot( - const base::Callback<void(bool)>& callback, + base::OnceCallback<void(bool)> callback, std::unique_ptr<TPMModuleAndSlot> tpm_args) { DCHECK(thread_checker_.CalledOnValidThread()); DVLOG(2) << "Loaded chaps: " << !!tpm_args->chaps_module @@ -379,7 +380,7 @@ if (tpm_slot_) RunAndClearTPMReadyCallbackList(); - callback.Run(!!tpm_slot_); + std::move(callback).Run(!!tpm_slot_); } void RunAndClearTPMReadyCallbackList() { @@ -388,11 +389,11 @@ for (TPMReadyCallbackList::iterator i = callback_list.begin(); i != callback_list.end(); ++i) { - i->Run(); + std::move(*i).Run(); } } - bool IsTPMTokenReady(const base::Closure& callback) { + bool IsTPMTokenReady(base::OnceClosure callback) { if (!callback.is_null()) { // Cannot DCHECK in the general case yet, but since the callback is // a new addition to the API, DCHECK to make sure at least the new uses @@ -408,7 +409,7 @@ return true; if (!callback.is_null()) - tpm_ready_callback_list_.push_back(callback); + tpm_ready_callback_list_.push_back(std::move(callback)); return false; } @@ -531,21 +532,22 @@ ScopedPK11Slot GetPrivateSlotForChromeOSUser( const std::string& username_hash, - const base::Callback<void(ScopedPK11Slot)>& callback) { + base::OnceCallback<void(ScopedPK11Slot)> callback) { DCHECK(thread_checker_.CalledOnValidThread()); if (username_hash.empty()) { DVLOG(2) << "empty username_hash"; if (!callback.is_null()) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(callback, ScopedPK11Slot())); + FROM_HERE, base::BindOnce(std::move(callback), ScopedPK11Slot())); } return ScopedPK11Slot(); } DCHECK(chromeos_user_map_.find(username_hash) != chromeos_user_map_.end()); - return chromeos_user_map_[username_hash]->GetPrivateSlot(callback); + return chromeos_user_map_[username_hash]->GetPrivateSlot( + std::move(callback)); } void CloseChromeOSUserForTesting(const std::string& username_hash) { @@ -583,26 +585,26 @@ #if defined(OS_CHROMEOS) void GetSystemNSSKeySlotCallback( - const base::Callback<void(ScopedPK11Slot)>& callback) { - callback.Run(ScopedPK11Slot(PK11_ReferenceSlot(tpm_slot_.get()))); + base::OnceCallback<void(ScopedPK11Slot)> callback) { + std::move(callback).Run( + ScopedPK11Slot(PK11_ReferenceSlot(tpm_slot_.get()))); } ScopedPK11Slot GetSystemNSSKeySlot( - const base::Callback<void(ScopedPK11Slot)>& callback) { + base::OnceCallback<void(ScopedPK11Slot)> callback) { DCHECK(thread_checker_.CalledOnValidThread()); // TODO(mattm): chromeos::TPMTokenloader always calls // InitializeTPMTokenAndSystemSlot with slot 0. If the system slot is // disabled, tpm_slot_ will be the first user's slot instead. Can that be // detected and return nullptr instead? - base::Closure wrapped_callback; + base::OnceClosure wrapped_callback; if (!callback.is_null()) { - wrapped_callback = - base::Bind(&NSSInitSingleton::GetSystemNSSKeySlotCallback, - base::Unretained(this) /* singleton is leaky */, - callback); + wrapped_callback = base::BindOnce( + &NSSInitSingleton::GetSystemNSSKeySlotCallback, + base::Unretained(this) /* singleton is leaky */, std::move(callback)); } - if (IsTPMTokenReady(wrapped_callback)) + if (IsTPMTokenReady(std::move(wrapped_callback))) return ScopedPK11Slot(PK11_ReferenceSlot(tpm_slot_.get())); return ScopedPK11Slot(); } @@ -731,7 +733,7 @@ bool tpm_token_enabled_for_nss_; bool initializing_tpm_token_; - typedef std::vector<base::Closure> TPMReadyCallbackList; + typedef std::vector<base::OnceClosure> TPMReadyCallbackList; TPMReadyCallbackList tpm_ready_callback_list_; SECMODModule* chaps_module_; crypto::ScopedPK11Slot tpm_slot_; @@ -792,8 +794,8 @@ #if defined(OS_CHROMEOS) ScopedPK11Slot GetSystemNSSKeySlot( - const base::Callback<void(ScopedPK11Slot)>& callback) { - return g_nss_singleton.Get().GetSystemNSSKeySlot(callback); + base::OnceCallback<void(ScopedPK11Slot)> callback) { + return g_nss_singleton.Get().GetSystemNSSKeySlot(std::move(callback)); } void SetSystemKeySlotForTesting(ScopedPK11Slot slot) { @@ -808,15 +810,14 @@ return g_nss_singleton.Get().IsTPMTokenEnabledForNSS(); } -bool IsTPMTokenReady(const base::Closure& callback) { - return g_nss_singleton.Get().IsTPMTokenReady(callback); +bool IsTPMTokenReady(base::OnceClosure callback) { + return g_nss_singleton.Get().IsTPMTokenReady(std::move(callback)); } -void InitializeTPMTokenAndSystemSlot( - int token_slot_id, - const base::Callback<void(bool)>& callback) { +void InitializeTPMTokenAndSystemSlot(int token_slot_id, + base::OnceCallback<void(bool)> callback) { g_nss_singleton.Get().InitializeTPMTokenAndSystemSlot(token_slot_id, - callback); + std::move(callback)); } bool InitializeNSSForChromeOSUser(const std::string& username_hash, @@ -852,9 +853,9 @@ ScopedPK11Slot GetPrivateSlotForChromeOSUser( const std::string& username_hash, - const base::Callback<void(ScopedPK11Slot)>& callback) { - return g_nss_singleton.Get().GetPrivateSlotForChromeOSUser(username_hash, - callback); + base::OnceCallback<void(ScopedPK11Slot)> callback) { + return g_nss_singleton.Get().GetPrivateSlotForChromeOSUser( + username_hash, std::move(callback)); } void CloseChromeOSUserForTesting(const std::string& username_hash) {
diff --git a/crypto/nss_util.h b/crypto/nss_util.h index a0f0b03..d069164 100644 --- a/crypto/nss_util.h +++ b/crypto/nss_util.h
@@ -51,7 +51,7 @@ // If |callback| is non-null and the function returns false, the |callback| will // be run once the TPM is ready. |callback| will never be run if the function // returns true. -CRYPTO_EXPORT bool IsTPMTokenReady(const base::Closure& callback) +CRYPTO_EXPORT bool IsTPMTokenReady(base::OnceClosure callback) WARN_UNUSED_RESULT; // Initialize the TPM token and system slot. The |callback| will run on the same @@ -61,7 +61,7 @@ // |callback| has been run. CRYPTO_EXPORT void InitializeTPMTokenAndSystemSlot( int system_slot_id, - const base::Callback<void(bool)>& callback); + base::OnceCallback<void(bool)> callback); #endif // Convert a NSS PRTime value into a base::Time object.
diff --git a/crypto/nss_util_internal.h b/crypto/nss_util_internal.h index 080ac10..5fd40811 100644 --- a/crypto/nss_util_internal.h +++ b/crypto/nss_util_internal.h
@@ -53,7 +53,7 @@ // loaded and |callback| is non-null, the |callback| will be run once the slot // is loaded. CRYPTO_EXPORT ScopedPK11Slot GetSystemNSSKeySlot( - const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; + base::OnceCallback<void(ScopedPK11Slot)> callback) WARN_UNUSED_RESULT; // Sets the test system slot to |slot|, which means that |slot| will be exposed // through |GetSystemNSSKeySlot| and |IsTPMTokenReady| will return true. @@ -102,7 +102,7 @@ // is loaded. CRYPTO_EXPORT ScopedPK11Slot GetPrivateSlotForChromeOSUser( const std::string& username_hash, - const base::Callback<void(ScopedPK11Slot)>& callback) WARN_UNUSED_RESULT; + base::OnceCallback<void(ScopedPK11Slot)> callback) WARN_UNUSED_RESULT; // Closes the NSS DB for |username_hash| that was previously opened by the // *Initialize*ForChromeOSUser functions.
diff --git a/device/BUILD.gn b/device/BUILD.gn index 12bb8643..e74dfc2 100644 --- a/device/BUILD.gn +++ b/device/BUILD.gn
@@ -2,8 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("vr/features/features.gni") import("//build/config/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//testing/test.gni") if (is_android) {
diff --git a/device/usb/public/mojom/BUILD.gn b/device/usb/public/mojom/BUILD.gn index d099d9d..56bb553 100644 --- a/device/usb/public/mojom/BUILD.gn +++ b/device/usb/public/mojom/BUILD.gn
@@ -13,6 +13,7 @@ deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", ] # USB Mojom interfaces are exposed publicly to layout tests which use
diff --git a/device/usb/public/mojom/chooser_service.mojom b/device/usb/public/mojom/chooser_service.mojom index d7fd2fe..0b08dae 100644 --- a/device/usb/public/mojom/chooser_service.mojom +++ b/device/usb/public/mojom/chooser_service.mojom
@@ -4,8 +4,8 @@ module device.mojom; -import "device.mojom"; -import "device_manager.mojom"; +import "device/usb/public/mojom/device.mojom"; +import "device/usb/public/mojom/device_manager.mojom"; interface UsbChooserService { // Get permission from user to use the device.
diff --git a/device/vr/BUILD.gn b/device/vr/BUILD.gn index f072b84..f624bbc 100644 --- a/device/vr/BUILD.gn +++ b/device/vr/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("features/features.gni") +import("//device/vr/buildflags/buildflags.gni") if (is_android) { import("//build/config/android/rules.gni") # For generate_jni(). @@ -17,7 +17,7 @@ ] defines = [ "DEVICE_VR_IMPLEMENTATION" ] deps = [ - "features", + "//device/vr/buildflags", "//device/vr/public/mojom", ] sources += [
diff --git a/device/vr/features/BUILD.gn b/device/vr/buildflags/BUILD.gn similarity index 82% rename from device/vr/features/BUILD.gn rename to device/vr/buildflags/BUILD.gn index 40b5a50..51c05d32 100644 --- a/device/vr/features/BUILD.gn +++ b/device/vr/buildflags/BUILD.gn
@@ -2,12 +2,12 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("features.gni") +import("buildflags.gni") import("//build/buildflag_header.gni") # Generate a buildflag header for compile-time checking of WebVR support. -buildflag_header("features") { - header = "features.h" +buildflag_header("buildflags") { + header = "buildflags.h" flags = [ "ENABLE_VR=$enable_vr", "ENABLE_OPENVR=$enable_openvr",
diff --git a/device/vr/features/features.gni b/device/vr/buildflags/buildflags.gni similarity index 100% rename from device/vr/features/features.gni rename to device/vr/buildflags/buildflags.gni
diff --git a/docs/accessibility/patts.md b/docs/accessibility/patts.md index 65416008..2270151b 100644 --- a/docs/accessibility/patts.md +++ b/docs/accessibility/patts.md
@@ -22,11 +22,11 @@ duplicated, and ChromeOS will crash if you try to load the unpacked extension while the built-in one is already loaded. -To test, use the [https://chrome.google.com/webstore/detail/tts-demo/chhkejkkcghanjclmhhpncachhgejoel](TTS Demo extension) +To test, use the [TTS Demo extension](https://chrome.google.com/webstore/detail/tts-demo/chhkejkkcghanjclmhhpncachhgejoel) in Chromeos. This should automatically recognize the unpacked TTS extension based on its manifest key. You can also use any site that uses a web speech API demo. In addition, the Chrome Accessibility team has a -[https://chrome.google.com/webstore/detail/idllbaaoaldabjncnbfokacibfehkemd](TTS Debug extension) +[TTS Debug extension](https://chrome.google.com/webstore/detail/idllbaaoaldabjncnbfokacibfehkemd) which can run several automated tests. ## Updating @@ -102,9 +102,9 @@ repo upload . ``` -After submitting, inform the [mailto:chrome-a11y-core@google.com](Chrome Accessibility team) +After submitting, inform the [Chrome Accessibility Team](mailto:chrome-a11y-core@google.com) so that they can update their local copies of TTS per the -[https://chromium.googlesource.com/chromium/src/+/lkgr/docs/accessibility/chromevox_on_desktop_linux.md](Chromevox instructions). +[Chromevox instructions](chromevox_on_desktop_linux.md). ## Ebuild
diff --git a/docs/sublime_ide.md b/docs/sublime_ide.md index 77db8b8a..6b39096 100644 --- a/docs/sublime_ide.md +++ b/docs/sublime_ide.md
@@ -427,27 +427,6 @@ %USERPROFILE%\.gitignore` Mac, Linux: `git config --global core.excludesfile ~/.gitignore` -### Build a single file -Copy the file `compile_current_file.py` to your Packages directory: - -```shell -cd /path/to/chromium/src -cp tools/sublime/compile_current_file.py ~/.config/sublime-text-3/Packages/User -``` - -This will give you access to a command `"compile_current_file"`, which you can -then add to your `Preferences > Keybindings - User` file: - -```json -[ - { "keys": ["ctrl+f7"], "command": "compile_current_file", "args": {"target_build": "Debug"} }, - { "keys": ["ctrl+shift+f7"], "command": "compile_current_file", "args": {"target_build": "Release"} }, -] -``` - -You can then press those key combinations to compile the current file in the -given target build. - ## Building inside Sublime To build inside Sublime Text, we first have to create a new build system. @@ -523,6 +502,10 @@ "name": "Browser Tests", "cmd": ["ninja", "-j", "1000", "-C", "out/Debug", "browser_tests"], }, + { + "name": "Current file", + "cmd": ["compile_single_file", "--build-dir", "out/Debug", "--file-path", "$file"], + }, ] ```
diff --git a/docs/vscode.md b/docs/vscode.md index cda5fcc..acdbbd2 100644 --- a/docs/vscode.md +++ b/docs/vscode.md
@@ -352,6 +352,28 @@ "file": 1, "severity": 3, "message": 4 } }] + }, + { + "taskName": "6-build_current_file", + "command": "compile_single_file --build-dir=out/Debug --file-path=${file}", + "isShellCommand": true, + "problemMatcher": [ + { + "owner": "cpp", + "fileLocation": ["relative", "${workspaceRoot}"], + "pattern": { + "regexp": "^../../(.*):(\\d+):(\\d+):\\s+(warning|\\w*\\s?error):\\s+(.*)$", + "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 + } + }, + { + "owner": "cpp", + "fileLocation": ["relative", "${workspaceRoot}"], + "pattern": { + "regexp": "^../../(.*?):(.*):\\s+(warning|\\w*\\s?error):\\s+(.*)$", + "file": 1, "severity": 3, "message": 4 + } + }] }] } ```
diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn index dc414725..3d37afb2 100644 --- a/extensions/BUILD.gn +++ b/extensions/BUILD.gn
@@ -2,7 +2,7 @@ # found in the LICENSE file. import("//build/config/jumbo.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//testing/test.gni") import("//tools/grit/grit_rule.gni") import("//tools/grit/repack.gni")
diff --git a/extensions/browser/BUILD.gn b/extensions/browser/BUILD.gn index baee0edd..28da43b 100644 --- a/extensions/browser/BUILD.gn +++ b/extensions/browser/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/features.gni") import("//build/config/jumbo.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions) @@ -380,9 +380,9 @@ "//crypto:platform", "//extensions:extensions_browser_resources", "//extensions/browser/guest_view/web_view/web_ui", + "//extensions/buildflags", "//extensions/common", "//extensions/common/api", - "//extensions/features", "//extensions/strings", "//google_apis", "//ppapi/features", @@ -623,9 +623,9 @@ "//device/bluetooth:mocks", "//extensions:extensions_browser_resources", "//extensions:test_support", + "//extensions/buildflags", "//extensions/common", "//extensions/common/api", - "//extensions/features", "//extensions/strings", "//ipc:test_support", "//net:test_support",
diff --git a/extensions/browser/api/BUILD.gn b/extensions/browser/api/BUILD.gn index 2b39dd80..691e452 100644 --- a/extensions/browser/api/BUILD.gn +++ b/extensions/browser/api/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//extensions/common/api/schema.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//tools/json_schema_compiler/json_schema_api.gni") assert(enable_extensions,
diff --git a/extensions/browser/api/activity_log/BUILD.gn b/extensions/browser/api/activity_log/BUILD.gn index 6636ef032..7f0db86a 100644 --- a/extensions/browser/api/activity_log/BUILD.gn +++ b/extensions/browser/api/activity_log/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/alarms/BUILD.gn b/extensions/browser/api/alarms/BUILD.gn index fd15ea6..002f8975 100644 --- a/extensions/browser/api/alarms/BUILD.gn +++ b/extensions/browser/api/alarms/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/app_current_window_internal/BUILD.gn b/extensions/browser/api/app_current_window_internal/BUILD.gn index 32e292f..7caa7ca 100644 --- a/extensions/browser/api/app_current_window_internal/BUILD.gn +++ b/extensions/browser/api/app_current_window_internal/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/app_runtime/BUILD.gn b/extensions/browser/api/app_runtime/BUILD.gn index 3ffa9588..041b5ff 100644 --- a/extensions/browser/api/app_runtime/BUILD.gn +++ b/extensions/browser/api/app_runtime/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/app_window/BUILD.gn b/extensions/browser/api/app_window/BUILD.gn index 9181383e..48ad602 100644 --- a/extensions/browser/api/app_window/BUILD.gn +++ b/extensions/browser/api/app_window/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/audio/BUILD.gn b/extensions/browser/api/audio/BUILD.gn index 3efa0001..4df4bd05 100644 --- a/extensions/browser/api/audio/BUILD.gn +++ b/extensions/browser/api/audio/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/bluetooth/BUILD.gn b/extensions/browser/api/bluetooth/BUILD.gn index bf9fcd5..24dc5a0 100644 --- a/extensions/browser/api/bluetooth/BUILD.gn +++ b/extensions/browser/api/bluetooth/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/bluetooth_low_energy/BUILD.gn b/extensions/browser/api/bluetooth_low_energy/BUILD.gn index 729f870..2370edaf 100644 --- a/extensions/browser/api/bluetooth_low_energy/BUILD.gn +++ b/extensions/browser/api/bluetooth_low_energy/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/bluetooth_socket/BUILD.gn b/extensions/browser/api/bluetooth_socket/BUILD.gn index 052da50..3b02b08 100644 --- a/extensions/browser/api/bluetooth_socket/BUILD.gn +++ b/extensions/browser/api/bluetooth_socket/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/cast_channel/BUILD.gn b/extensions/browser/api/cast_channel/BUILD.gn index eebc7796..99e08e3 100644 --- a/extensions/browser/api/cast_channel/BUILD.gn +++ b/extensions/browser/api/cast_channel/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/clipboard/BUILD.gn b/extensions/browser/api/clipboard/BUILD.gn index c79bb34..fe8b639e 100644 --- a/extensions/browser/api/clipboard/BUILD.gn +++ b/extensions/browser/api/clipboard/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/declarative/BUILD.gn b/extensions/browser/api/declarative/BUILD.gn index 3b1b5f01..7a9e5ac 100644 --- a/extensions/browser/api/declarative/BUILD.gn +++ b/extensions/browser/api/declarative/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/declarative_content/BUILD.gn b/extensions/browser/api/declarative_content/BUILD.gn index 0ffbfbd..ba1247af0 100644 --- a/extensions/browser/api/declarative_content/BUILD.gn +++ b/extensions/browser/api/declarative_content/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/declarative_webrequest/BUILD.gn b/extensions/browser/api/declarative_webrequest/BUILD.gn index 659c259..bb7dec5b 100644 --- a/extensions/browser/api/declarative_webrequest/BUILD.gn +++ b/extensions/browser/api/declarative_webrequest/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/diagnostics/BUILD.gn b/extensions/browser/api/diagnostics/BUILD.gn index a453db1..12b7beb7 100644 --- a/extensions/browser/api/diagnostics/BUILD.gn +++ b/extensions/browser/api/diagnostics/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/display_source/BUILD.gn b/extensions/browser/api/display_source/BUILD.gn index b162f19..e938d20 100644 --- a/extensions/browser/api/display_source/BUILD.gn +++ b/extensions/browser/api/display_source/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/dns/BUILD.gn b/extensions/browser/api/dns/BUILD.gn index 4e6be67..41d2295 100644 --- a/extensions/browser/api/dns/BUILD.gn +++ b/extensions/browser/api/dns/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/document_scan/BUILD.gn b/extensions/browser/api/document_scan/BUILD.gn index 5ae82b36..4be146a2 100644 --- a/extensions/browser/api/document_scan/BUILD.gn +++ b/extensions/browser/api/document_scan/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/feedback_private/BUILD.gn b/extensions/browser/api/feedback_private/BUILD.gn index dd980181..ceab8bee 100644 --- a/extensions/browser/api/feedback_private/BUILD.gn +++ b/extensions/browser/api/feedback_private/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/file_handlers/BUILD.gn b/extensions/browser/api/file_handlers/BUILD.gn index 5838bb3..826c0a9 100644 --- a/extensions/browser/api/file_handlers/BUILD.gn +++ b/extensions/browser/api/file_handlers/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/file_system/BUILD.gn b/extensions/browser/api/file_system/BUILD.gn index a352c48..3dccf829 100644 --- a/extensions/browser/api/file_system/BUILD.gn +++ b/extensions/browser/api/file_system/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/hid/BUILD.gn b/extensions/browser/api/hid/BUILD.gn index 9f07f4f7..9e9ef37 100644 --- a/extensions/browser/api/hid/BUILD.gn +++ b/extensions/browser/api/hid/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/idle/BUILD.gn b/extensions/browser/api/idle/BUILD.gn index 23a7e17e..edc5714 100644 --- a/extensions/browser/api/idle/BUILD.gn +++ b/extensions/browser/api/idle/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/management/BUILD.gn b/extensions/browser/api/management/BUILD.gn index a6dfb86a..0365561 100644 --- a/extensions/browser/api/management/BUILD.gn +++ b/extensions/browser/api/management/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/messaging/BUILD.gn b/extensions/browser/api/messaging/BUILD.gn index 2683c5a5f..4f47135 100644 --- a/extensions/browser/api/messaging/BUILD.gn +++ b/extensions/browser/api/messaging/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/metrics_private/BUILD.gn b/extensions/browser/api/metrics_private/BUILD.gn index 39a6063..08a3dfb 100644 --- a/extensions/browser/api/metrics_private/BUILD.gn +++ b/extensions/browser/api/metrics_private/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/mime_handler_private/BUILD.gn b/extensions/browser/api/mime_handler_private/BUILD.gn index 2613c6e..31c06b71 100644 --- a/extensions/browser/api/mime_handler_private/BUILD.gn +++ b/extensions/browser/api/mime_handler_private/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/networking_config/BUILD.gn b/extensions/browser/api/networking_config/BUILD.gn index 00cb31e..172052ac 100644 --- a/extensions/browser/api/networking_config/BUILD.gn +++ b/extensions/browser/api/networking_config/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/networking_private/BUILD.gn b/extensions/browser/api/networking_private/BUILD.gn index 3875d32..0f3eade 100644 --- a/extensions/browser/api/networking_private/BUILD.gn +++ b/extensions/browser/api/networking_private/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/power/BUILD.gn b/extensions/browser/api/power/BUILD.gn index ed964678..1b75846 100644 --- a/extensions/browser/api/power/BUILD.gn +++ b/extensions/browser/api/power/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/printer_provider/BUILD.gn b/extensions/browser/api/printer_provider/BUILD.gn index 82a38964..9efce9f3 100644 --- a/extensions/browser/api/printer_provider/BUILD.gn +++ b/extensions/browser/api/printer_provider/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/printer_provider_internal/BUILD.gn b/extensions/browser/api/printer_provider_internal/BUILD.gn index 6f37926..a054f06 100644 --- a/extensions/browser/api/printer_provider_internal/BUILD.gn +++ b/extensions/browser/api/printer_provider_internal/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/runtime/BUILD.gn b/extensions/browser/api/runtime/BUILD.gn index 97838c732..7220ebba 100644 --- a/extensions/browser/api/runtime/BUILD.gn +++ b/extensions/browser/api/runtime/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/serial/BUILD.gn b/extensions/browser/api/serial/BUILD.gn index 2c295ad..edef4685 100644 --- a/extensions/browser/api/serial/BUILD.gn +++ b/extensions/browser/api/serial/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/socket/BUILD.gn b/extensions/browser/api/socket/BUILD.gn index 489bc47c..a707906e 100644 --- a/extensions/browser/api/socket/BUILD.gn +++ b/extensions/browser/api/socket/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/sockets_tcp/BUILD.gn b/extensions/browser/api/sockets_tcp/BUILD.gn index a5575cf..d41c11f0 100644 --- a/extensions/browser/api/sockets_tcp/BUILD.gn +++ b/extensions/browser/api/sockets_tcp/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/sockets_tcp_server/BUILD.gn b/extensions/browser/api/sockets_tcp_server/BUILD.gn index a4f8278..44b3bb4 100644 --- a/extensions/browser/api/sockets_tcp_server/BUILD.gn +++ b/extensions/browser/api/sockets_tcp_server/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/sockets_udp/BUILD.gn b/extensions/browser/api/sockets_udp/BUILD.gn index 961429f..551b9e83 100644 --- a/extensions/browser/api/sockets_udp/BUILD.gn +++ b/extensions/browser/api/sockets_udp/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/storage/BUILD.gn b/extensions/browser/api/storage/BUILD.gn index 5970a8a..a5e4fa08 100644 --- a/extensions/browser/api/storage/BUILD.gn +++ b/extensions/browser/api/storage/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/system_cpu/BUILD.gn b/extensions/browser/api/system_cpu/BUILD.gn index 7617d68..06c0f74 100644 --- a/extensions/browser/api/system_cpu/BUILD.gn +++ b/extensions/browser/api/system_cpu/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/system_display/BUILD.gn b/extensions/browser/api/system_display/BUILD.gn index 2f5a5b61..a5aa07a 100644 --- a/extensions/browser/api/system_display/BUILD.gn +++ b/extensions/browser/api/system_display/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/system_info/BUILD.gn b/extensions/browser/api/system_info/BUILD.gn index 0cc1ea4..ba1a902 100644 --- a/extensions/browser/api/system_info/BUILD.gn +++ b/extensions/browser/api/system_info/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/system_memory/BUILD.gn b/extensions/browser/api/system_memory/BUILD.gn index 2c98c12..8b2c1341 100644 --- a/extensions/browser/api/system_memory/BUILD.gn +++ b/extensions/browser/api/system_memory/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/system_network/BUILD.gn b/extensions/browser/api/system_network/BUILD.gn index b7b1640..eba8f4a7 100644 --- a/extensions/browser/api/system_network/BUILD.gn +++ b/extensions/browser/api/system_network/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/system_storage/BUILD.gn b/extensions/browser/api/system_storage/BUILD.gn index 5711ffae..6b8889ba 100644 --- a/extensions/browser/api/system_storage/BUILD.gn +++ b/extensions/browser/api/system_storage/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/test/BUILD.gn b/extensions/browser/api/test/BUILD.gn index bc1eff4..c1242fb7 100644 --- a/extensions/browser/api/test/BUILD.gn +++ b/extensions/browser/api/test/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/usb/BUILD.gn b/extensions/browser/api/usb/BUILD.gn index 2c82a7e8a..8c94c2e3 100644 --- a/extensions/browser/api/usb/BUILD.gn +++ b/extensions/browser/api/usb/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/virtual_keyboard/BUILD.gn b/extensions/browser/api/virtual_keyboard/BUILD.gn index a495d9ba..51a58df1 100644 --- a/extensions/browser/api/virtual_keyboard/BUILD.gn +++ b/extensions/browser/api/virtual_keyboard/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/virtual_keyboard_private/BUILD.gn b/extensions/browser/api/virtual_keyboard_private/BUILD.gn index 3417cd1..2d50bf8a 100644 --- a/extensions/browser/api/virtual_keyboard_private/BUILD.gn +++ b/extensions/browser/api/virtual_keyboard_private/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/vpn_provider/BUILD.gn b/extensions/browser/api/vpn_provider/BUILD.gn index febd1e0..ce57f5d 100644 --- a/extensions/browser/api/vpn_provider/BUILD.gn +++ b/extensions/browser/api/vpn_provider/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/web_request/BUILD.gn b/extensions/browser/api/web_request/BUILD.gn index 94a7cfa..d41346d 100644 --- a/extensions/browser/api/web_request/BUILD.gn +++ b/extensions/browser/api/web_request/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/api/web_request/form_data_parser.cc b/extensions/browser/api/web_request/form_data_parser.cc index cfd82120..f006684 100644 --- a/extensions/browser/api/web_request/form_data_parser.cc +++ b/extensions/browser/api/web_request/form_data_parser.cc
@@ -14,7 +14,7 @@ #include "base/strings/string_util.h" #include "base/values.h" #include "net/base/escape.h" -#include "net/url_request/url_request.h" +#include "net/http/http_request_headers.h" #include "third_party/re2/src/re2/re2.h" using base::DictionaryValue; @@ -314,10 +314,10 @@ // static std::unique_ptr<FormDataParser> FormDataParser::Create( - const net::URLRequest& request) { + const net::HttpRequestHeaders& request_headers) { std::string value; - const bool found = request.extra_request_headers().GetHeader( - net::HttpRequestHeaders::kContentType, &value); + const bool found = + request_headers.GetHeader(net::HttpRequestHeaders::kContentType, &value); return CreateFromContentTypeHeader(found ? &value : NULL); }
diff --git a/extensions/browser/api/web_request/form_data_parser.h b/extensions/browser/api/web_request/form_data_parser.h index baef2aa..054a014 100644 --- a/extensions/browser/api/web_request/form_data_parser.h +++ b/extensions/browser/api/web_request/form_data_parser.h
@@ -15,7 +15,7 @@ #include "base/values.h" namespace net { -class URLRequest; +class HttpRequestHeaders; } namespace extensions { @@ -47,9 +47,10 @@ virtual ~FormDataParser(); - // Creates a correct parser instance based on the |request|. Returns NULL - // on failure. - static std::unique_ptr<FormDataParser> Create(const net::URLRequest& request); + // Creates a correct parser instance based on the |request_headers|. Returns + // null on failure. + static std::unique_ptr<FormDataParser> Create( + const net::HttpRequestHeaders& request_headers); // Creates a correct parser instance based on |content_type_header|, the // "Content-Type" request header value. If |content_type_header| is NULL, it
diff --git a/extensions/browser/api/web_request/upload_data_presenter.cc b/extensions/browser/api/web_request/upload_data_presenter.cc index 82efc18..022abc0 100644 --- a/extensions/browser/api/web_request/upload_data_presenter.cc +++ b/extensions/browser/api/web_request/upload_data_presenter.cc
@@ -12,9 +12,7 @@ #include "base/values.h" #include "extensions/browser/api/web_request/form_data_parser.h" #include "extensions/browser/api/web_request/web_request_api_constants.h" -#include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_file_element_reader.h" -#include "net/url_request/url_request.h" using base::DictionaryValue; using base::ListValue; @@ -58,20 +56,18 @@ } RawDataPresenter::~RawDataPresenter() {} -void RawDataPresenter::FeedNext(const net::UploadElementReader& reader) { +void RawDataPresenter::FeedBytes(base::StringPiece bytes) { if (!success_) return; - if (reader.AsBytesReader()) { - const net::UploadBytesElementReader* bytes_reader = reader.AsBytesReader(); - FeedNextBytes(bytes_reader->bytes(), bytes_reader->length()); - } else if (reader.AsFileReader()) { - // Insert the file path instead of the contents, which may be too large. - const net::UploadFileElementReader* file_reader = reader.AsFileReader(); - FeedNextFile(file_reader->path().AsUTF8Unsafe()); - } else { - NOTIMPLEMENTED(); - } + FeedNextBytes(bytes.data(), bytes.size()); +} + +void RawDataPresenter::FeedFile(const base::FilePath& path) { + if (!success_) + return; + + FeedNextFile(path.AsUTF8Unsafe()); } bool RawDataPresenter::Succeeded() { @@ -98,24 +94,19 @@ list_.get()); } -ParsedDataPresenter::ParsedDataPresenter(const net::URLRequest& request) - : parser_(FormDataParser::Create(request)), - success_(parser_.get() != NULL), - dictionary_(success_ ? new base::DictionaryValue() : NULL) { -} +ParsedDataPresenter::ParsedDataPresenter( + const net::HttpRequestHeaders& request_headers) + : parser_(FormDataParser::Create(request_headers)), + success_(parser_ != nullptr), + dictionary_(success_ ? new base::DictionaryValue() : nullptr) {} ParsedDataPresenter::~ParsedDataPresenter() {} -void ParsedDataPresenter::FeedNext(const net::UploadElementReader& reader) { +void ParsedDataPresenter::FeedBytes(base::StringPiece bytes) { if (!success_) return; - const net::UploadBytesElementReader* bytes_reader = reader.AsBytesReader(); - if (!bytes_reader) - return; - - if (!parser_->SetSource(base::StringPiece(bytes_reader->bytes(), - bytes_reader->length()))) { + if (!parser_->SetSource(bytes)) { Abort(); return; } @@ -127,6 +118,8 @@ } } +void ParsedDataPresenter::FeedFile(const base::FilePath& path) {} + bool ParsedDataPresenter::Succeeded() { if (success_ && !parser_->AllDataReadOK()) Abort();
diff --git a/extensions/browser/api/web_request/upload_data_presenter.h b/extensions/browser/api/web_request/upload_data_presenter.h index d632087..98c0765d 100644 --- a/extensions/browser/api/web_request/upload_data_presenter.h +++ b/extensions/browser/api/web_request/upload_data_presenter.h
@@ -13,9 +13,11 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/strings/string_piece.h" namespace base { class DictionaryValue; +class FilePath; class ListValue; class Value; } @@ -25,8 +27,7 @@ } namespace net { -class URLRequest; -class UploadElementReader; +class HttpRequestHeaders; } namespace extensions { @@ -54,7 +55,8 @@ class UploadDataPresenter { public: virtual ~UploadDataPresenter(); - virtual void FeedNext(const net::UploadElementReader& reader) = 0; + virtual void FeedBytes(base::StringPiece bytes) = 0; + virtual void FeedFile(const base::FilePath& path) = 0; virtual bool Succeeded() = 0; virtual std::unique_ptr<base::Value> Result() = 0; @@ -74,7 +76,8 @@ ~RawDataPresenter() override; // Implementation of UploadDataPresenter. - void FeedNext(const net::UploadElementReader& reader) override; + void FeedBytes(base::StringPiece bytes) override; + void FeedFile(const base::FilePath& path) override; bool Succeeded() override; std::unique_ptr<base::Value> Result() override; @@ -100,15 +103,16 @@ // DictionaryValue, not as a JSON string). class ParsedDataPresenter : public UploadDataPresenter { public: - explicit ParsedDataPresenter(const net::URLRequest& request); + explicit ParsedDataPresenter(const net::HttpRequestHeaders& request_headers); ~ParsedDataPresenter() override; // Implementation of UploadDataPresenter. - void FeedNext(const net::UploadElementReader& reader) override; + void FeedBytes(base::StringPiece bytes) override; + void FeedFile(const base::FilePath& path) override; bool Succeeded() override; std::unique_ptr<base::Value> Result() override; - // Allows to create ParsedDataPresenter without the URLRequest. Uses the + // Allows to create ParsedDataPresenter without request headers. Uses the // parser for "application/x-www-form-urlencoded" form encoding. Only use this // in tests. static std::unique_ptr<ParsedDataPresenter> CreateForTests();
diff --git a/extensions/browser/api/web_request/upload_data_presenter_unittest.cc b/extensions/browser/api/web_request/upload_data_presenter_unittest.cc index 4cbf5ce..92f7afc 100644 --- a/extensions/browser/api/web_request/upload_data_presenter_unittest.cc +++ b/extensions/browser/api/web_request/upload_data_presenter_unittest.cc
@@ -34,7 +34,8 @@ std::unique_ptr<ParsedDataPresenter> parsed_data_presenter( ParsedDataPresenter::CreateForTests()); ASSERT_TRUE(parsed_data_presenter.get() != NULL); - parsed_data_presenter->FeedNext(element); + parsed_data_presenter->FeedBytes( + base::StringPiece(element.bytes(), element.length())); EXPECT_TRUE(parsed_data_presenter->Succeeded()); std::unique_ptr<base::Value> result = parsed_data_presenter->Result(); ASSERT_TRUE(result.get() != NULL);
diff --git a/extensions/browser/api/web_request/web_request_info.cc b/extensions/browser/api/web_request/web_request_info.cc index e70dc949..3b9e224 100644 --- a/extensions/browser/api/web_request/web_request_info.cc +++ b/extensions/browser/api/web_request/web_request_info.cc
@@ -7,6 +7,7 @@ #include <memory> #include <string> +#include "base/files/file_path.h" #include "base/values.h" #include "content/public/browser/resource_request_info.h" #include "content/public/browser/websocket_handshake_request_info.h" @@ -16,7 +17,9 @@ #include "extensions/browser/extension_navigation_ui_data.h" #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/guest_view/web_view/web_view_renderer_state.h" +#include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_data_stream.h" +#include "net/base/upload_file_element_reader.h" #include "net/log/net_log_with_source.h" #include "net/url_request/url_request.h" #include "services/network/public/cpp/resource_response.h" @@ -27,6 +30,49 @@ namespace { +// UploadDataSource abstracts an interface for feeding an arbitrary data element +// to an UploadDataPresenter. This is helpful because in the Network Service vs +// non-Network Service case, upload data comes from different types of source +// objects, but we'd like to share parsing code. +class UploadDataSource { + public: + virtual ~UploadDataSource() {} + + virtual void FeedToPresenter(UploadDataPresenter* presenter) = 0; +}; + +class BytesUploadDataSource : public UploadDataSource { + public: + BytesUploadDataSource(const base::StringPiece& bytes) : bytes_(bytes) {} + ~BytesUploadDataSource() override = default; + + // UploadDataSource: + void FeedToPresenter(UploadDataPresenter* presenter) override { + presenter->FeedBytes(bytes_); + } + + private: + base::StringPiece bytes_; + + DISALLOW_COPY_AND_ASSIGN(BytesUploadDataSource); +}; + +class FileUploadDataSource : public UploadDataSource { + public: + FileUploadDataSource(const base::FilePath& path) : path_(path) {} + ~FileUploadDataSource() override = default; + + // UploadDataSource: + void FeedToPresenter(UploadDataPresenter* presenter) override { + presenter->FeedFile(path_); + } + + private: + base::FilePath path_; + + DISALLOW_COPY_AND_ASSIGN(FileUploadDataSource); +}; + std::unique_ptr<base::Value> NetLogExtensionIdCallback( const std::string& extension_id, net::NetLogCaptureMode capture_mode) { @@ -82,18 +128,72 @@ DISALLOW_COPY_AND_ASSIGN(NetworkServiceLogger); }; -std::unique_ptr<base::DictionaryValue> ExtractRequestBodyData( - net::URLRequest* url_request) { +bool CreateUploadDataSourcesFromURLRequest( + net::URLRequest* url_request, + std::vector<std::unique_ptr<UploadDataSource>>* data_sources) { const net::UploadDataStream* upload_data = url_request->get_upload(); - if (!upload_data || - (url_request->method() != "POST" && url_request->method() != "PUT")) { - return nullptr; + if (!upload_data) + return false; + + const std::vector<std::unique_ptr<net::UploadElementReader>>* readers = + upload_data->GetElementReaders(); + for (const auto& reader : *readers) { + if (const auto* bytes_reader = reader->AsBytesReader()) { + data_sources->push_back(std::make_unique<BytesUploadDataSource>( + base::StringPiece(bytes_reader->bytes(), bytes_reader->length()))); + } else if (const auto* file_reader = reader->AsFileReader()) { + data_sources->push_back( + std::make_unique<FileUploadDataSource>(file_reader->path())); + } else { + NOTIMPLEMENTED(); + } } + return true; +} + +bool CreateUploadDataSourcesFromResourceRequest( + const network::ResourceRequest& request, + std::vector<std::unique_ptr<UploadDataSource>>* data_sources) { + if (!request.request_body) + return false; + + for (auto& element : *request.request_body->elements()) { + switch (element.type()) { + case network::DataElement::TYPE_DATA_PIPE: + // TODO(https://crbug.com/721414): Support data pipe elements. + break; + + case network::DataElement::TYPE_BYTES: + data_sources->push_back(std::make_unique<BytesUploadDataSource>( + base::StringPiece(element.bytes(), element.length()))); + break; + + case network::DataElement::TYPE_FILE: + // Should not be hit in the Network Service case. + NOTREACHED(); + break; + + default: + NOTIMPLEMENTED(); + break; + } + } + + return true; +} + +std::unique_ptr<base::DictionaryValue> CreateRequestBodyData( + const std::string& method, + const net::HttpRequestHeaders& request_headers, + const std::vector<std::unique_ptr<UploadDataSource>>& data_sources) { + if (method != "POST" && method != "PUT") + return nullptr; + auto request_body_data = std::make_unique<base::DictionaryValue>(); // Get the data presenters, ordered by how specific they are. - ParsedDataPresenter parsed_data_presenter(*url_request); + ParsedDataPresenter parsed_data_presenter(request_headers); RawDataPresenter raw_data_presenter; UploadDataPresenter* const presenters[] = { &parsed_data_presenter, // 1: any parseable forms? (Specific to forms.) @@ -102,13 +202,11 @@ // Keys for the results of the corresponding presenters. static const char* const kKeys[] = {keys::kRequestBodyFormDataKey, keys::kRequestBodyRawKey}; - const std::vector<std::unique_ptr<net::UploadElementReader>>* readers = - upload_data->GetElementReaders(); bool some_succeeded = false; - if (readers) { + if (!data_sources.empty()) { for (size_t i = 0; i < arraysize(presenters); ++i) { - for (const auto& reader : *readers) - presenters[i]->FeedNext(*reader); + for (auto& source : data_sources) + source->FeedToPresenter(presenters[i]); if (presenters[i]->Succeeded()) { request_body_data->Set(kKeys[i], presenters[i]->Result()); some_succeeded = true; @@ -116,9 +214,9 @@ } } } - if (!some_succeeded) { + + if (!some_succeeded) request_body_data->SetString(keys::kRequestBodyErrorKey, "Unknown error."); - } return request_body_data; } @@ -135,7 +233,6 @@ initiator(url_request->initiator()), extra_request_headers(url_request->extra_request_headers()), is_pac_request(url_request->is_pac_request()), - request_body_data(ExtractRequestBodyData(url_request)), logger(std::make_unique<NetLogLogger>(url_request)) { if (url.SchemeIsWSOrWSS()) { web_request_type = WebRequestResourceType::WEB_SOCKET; @@ -172,6 +269,12 @@ is_browser_side_navigation = true; InitializeWebViewAndFrameData(navigation_ui_data); + + std::vector<std::unique_ptr<UploadDataSource>> data_sources; + if (CreateUploadDataSourcesFromURLRequest(url_request, &data_sources)) { + request_body_data = + CreateRequestBodyData(method, extra_request_headers, data_sources); + } } WebRequestInfo::WebRequestInfo( @@ -200,9 +303,15 @@ InitializeWebViewAndFrameData(navigation_ui_data.get()); + std::vector<std::unique_ptr<UploadDataSource>> data_sources; + if (CreateUploadDataSourcesFromResourceRequest(request, &data_sources)) { + request_body_data = + CreateRequestBodyData(method, extra_request_headers, data_sources); + } + // TODO(https://crbug.com/721414): For this constructor (i.e. the Network - // Service case), we are still missing information for |is_async|, - // |request_body_data|, and |is_pac_request|. + // Service case), we are still missing information for |is_async| and + // |is_pac_request|. } WebRequestInfo::~WebRequestInfo() = default;
diff --git a/extensions/browser/api/webcam_private/BUILD.gn b/extensions/browser/api/webcam_private/BUILD.gn index 762c105..2a1c04b 100644 --- a/extensions/browser/api/webcam_private/BUILD.gn +++ b/extensions/browser/api/webcam_private/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/extension_api_frame_id_map.cc b/extensions/browser/extension_api_frame_id_map.cc index 78c4a9d..aa044e3d 100644 --- a/extensions/browser/extension_api_frame_id_map.cc +++ b/extensions/browser/extension_api_frame_id_map.cc
@@ -162,6 +162,10 @@ const RenderFrameIdKey& key) const { content::RenderFrameHost* rfh = content::RenderFrameHost::FromID( key.render_process_id, key.frame_routing_id); + + if (!rfh || !rfh->IsRenderFrameLive()) + return FrameData(); + int tab_id = extension_misc::kUnknownTabId; int window_id = extension_misc::kUnknownWindowId; if (helper_) @@ -347,19 +351,18 @@ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK(rfh); const RenderFrameIdKey key(rfh->GetProcess()->GetID(), rfh->GetRoutingID()); + + // Only track FrameData for live render frames. + if (!rfh->IsRenderFrameLive()) { + return; + } + base::AutoLock lock(frame_data_map_lock_); FrameDataMap::iterator iter = frame_data_map_.find(key); - if (iter != frame_data_map_.end()) { - iter->second.tab_id = tab_id; - iter->second.window_id = window_id; - } else { - DCHECK(!rfh->IsRenderFrameLive()); - // TODO(crbug.com/817205): Remove this branch. We should only maintain frame - // data for tracked live render frames. Most probably this is causing a - // memory leak. - frame_data_map_[key] = - FrameData(GetFrameId(rfh), GetParentFrameId(rfh), tab_id, window_id); - } + // The FrameData for |rfh| should have already been initialized. + DCHECK(iter != frame_data_map_.end()); + iter->second.tab_id = tab_id; + iter->second.window_id = window_id; } bool ExtensionApiFrameIdMap::HasCachedFrameDataForTesting(
diff --git a/extensions/browser/extension_api_frame_id_map.h b/extensions/browser/extension_api_frame_id_map.h index a5081e58..6eed79a 100644 --- a/extensions/browser/extension_api_frame_id_map.h +++ b/extensions/browser/extension_api_frame_id_map.h
@@ -131,7 +131,7 @@ // the given render frame. void OnRenderFrameDeleted(content::RenderFrameHost* rfh); - // Updates the tab and window id for the given RenderFrameHost, if any exists. + // Updates the tab and window id for the given RenderFrameHost if necessary. void UpdateTabAndWindowId(int tab_id, int window_id, content::RenderFrameHost* rfh); @@ -179,8 +179,9 @@ virtual ~ExtensionApiFrameIdMap(); // Determines the value to be stored in |frame_data_map_| for a given key. - // This method is only called when |key| is not in |frame_data_map_|. - // virtual for testing. + // Returns empty FrameData when the corresponding RenderFrameHost is not + // alive. This method is only called when |key| is not in |frame_data_map_|. + // Virtual for testing. virtual FrameData KeyToValue(const RenderFrameIdKey& key) const; // Looks up the data for the given |key| and adds it to the |frame_data_map_|.
diff --git a/extensions/browser/extension_registry.h b/extensions/browser/extension_registry.h index 293b2cd6..8610c0a 100644 --- a/extensions/browser/extension_registry.h +++ b/extensions/browser/extension_registry.h
@@ -14,9 +14,9 @@ #include "base/version.h" #include "components/keyed_service/core/keyed_service.h" #include "extensions/browser/uninstall_reason.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension_id.h" #include "extensions/common/extension_set.h" -#include "extensions/features/features.h" #if !BUILDFLAG(ENABLE_EXTENSIONS) #error "Extensions must be enabled"
diff --git a/extensions/browser/extension_system.h b/extensions/browser/extension_system.h index ff0f4ee9..21ea3b6d 100644 --- a/extensions/browser/extension_system.h +++ b/extensions/browser/extension_system.h
@@ -11,8 +11,8 @@ #include "base/memory/ref_counted.h" #include "build/build_config.h" #include "components/keyed_service/core/keyed_service.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension.h" -#include "extensions/features/features.h" #if !BUILDFLAG(ENABLE_EXTENSIONS) #error "Extensions must be enabled"
diff --git a/extensions/browser/extension_web_contents_observer.cc b/extensions/browser/extension_web_contents_observer.cc index 52be0b4..f6191b1d 100644 --- a/extensions/browser/extension_web_contents_observer.cc +++ b/extensions/browser/extension_web_contents_observer.cc
@@ -114,6 +114,8 @@ // looked up again on the IO thread for the webRequest API. ExtensionApiFrameIdMap::Get()->InitializeRenderFrameData(render_frame_host); + InitializeRenderFrame(render_frame_host); + const Extension* extension = GetExtensionFromFrame(render_frame_host, false); if (!extension) return; @@ -146,8 +148,6 @@ // isolation is turned on. RendererStartupHelperFactory::GetForBrowserContext(browser_context_) ->ActivateExtensionInProcess(*extension, render_frame_host->GetProcess()); - - InitializeRenderFrame(render_frame_host); } void ExtensionWebContentsObserver::RenderFrameDeleted(
diff --git a/extensions/browser/extension_web_contents_observer.h b/extensions/browser/extension_web_contents_observer.h index 685e4154..9a412ac 100644 --- a/extensions/browser/extension_web_contents_observer.h +++ b/extensions/browser/extension_web_contents_observer.h
@@ -78,7 +78,8 @@ content::BrowserContext* browser_context() { return browser_context_; } // Initializes a new render frame. Subclasses should invoke this - // implementation if extending. + // implementation if extending. Note: this should be called for both extension + // and non-extension frames. virtual void InitializeRenderFrame( content::RenderFrameHost* render_frame_host);
diff --git a/extensions/browser/guest_view/web_view/web_ui/BUILD.gn b/extensions/browser/guest_view/web_view/web_ui/BUILD.gn index 28823f1..dd31920 100644 --- a/extensions/browser/guest_view/web_view/web_ui/BUILD.gn +++ b/extensions/browser/guest_view/web_view/web_ui/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/image_sanitizer.cc b/extensions/browser/image_sanitizer.cc index fcad629e..7aa1f34 100644 --- a/extensions/browser/image_sanitizer.cc +++ b/extensions/browser/image_sanitizer.cc
@@ -90,6 +90,9 @@ } connector->BindInterface(identity, &image_decoder_ptr_); + image_decoder_ptr_.set_connection_error_handler( + base::BindOnce(&ImageSanitizer::ReportError, weak_factory_.GetWeakPtr(), + Status::kServiceError, base::FilePath())); std::set<base::FilePath> normalized_image_paths; for (const base::FilePath& path : image_paths_) {
diff --git a/extensions/browser/image_sanitizer.h b/extensions/browser/image_sanitizer.h index ac1938b..1aa67f2 100644 --- a/extensions/browser/image_sanitizer.h +++ b/extensions/browser/image_sanitizer.h
@@ -39,6 +39,7 @@ kDecodingError, kEncodingError, kFileWriteError, + kServiceError, // The data-decoder service crashed. }; // Callback invoked when the image sanitization is is done. If status is an
diff --git a/extensions/browser/image_sanitizer_unittest.cc b/extensions/browser/image_sanitizer_unittest.cc index 742db94..7b0282f 100644 --- a/extensions/browser/image_sanitizer_unittest.cc +++ b/extensions/browser/image_sanitizer_unittest.cc
@@ -65,9 +65,21 @@ class ImageSanitizerTest : public testing::Test { public: ImageSanitizerTest() - : thread_bundle_(content::TestBrowserThreadBundle::DEFAULT) {} + : thread_bundle_(content::TestBrowserThreadBundle::DEFAULT) { + InitTestDataDecoderService(/*service=*/nullptr); + } protected: + void InitTestDataDecoderService( + std::unique_ptr<service_manager::Service> service) { + if (!service) + service = data_decoder::DataDecoderService::Create(); + connector_factory_ = + service_manager::TestConnectorFactory::CreateForUniqueService( + std::move(service)); + connector_ = connector_factory_->CreateConnector(); + } + void CreateValidImage(const base::FilePath::StringPieceType& file_name) { ASSERT_TRUE(WriteBase64DataToFile(kBase64edValidPng, file_name)); } @@ -138,9 +150,9 @@ ImageSanitizer::ImageDecodedCallback image_decoded_callback, ImageSanitizer::SanitizationDoneCallback done_callback) { sanitizer_ = ImageSanitizer::CreateAndStart( - test_data_decoder_service_.connector(), service_manager::Identity(), - temp_dir_.GetPath(), image_relative_paths, - std::move(image_decoded_callback), std::move(done_callback)); + connector_.get(), service_manager::Identity(), temp_dir_.GetPath(), + image_relative_paths, std::move(image_decoded_callback), + std::move(done_callback)); } bool WriteBase64DataToFile(const std::string& base64_data, @@ -171,7 +183,8 @@ } content::TestBrowserThreadBundle thread_bundle_; - data_decoder::TestDataDecoderService test_data_decoder_service_; + std::unique_ptr<service_manager::TestConnectorFactory> connector_factory_; + std::unique_ptr<service_manager::Connector> connector_; ImageSanitizer::Status last_status_ = ImageSanitizer::Status::kSuccess; base::FilePath last_reported_path_; base::OnceClosure done_callback_; @@ -318,4 +331,18 @@ TestDontHoldOnToCallback(base::FilePath(kGoodPngName)); } +// Tests that the callback is invoked if the data decoder service crashes. +TEST_F(ImageSanitizerTest, DataDecoderServiceCrashes) { + InitTestDataDecoderService( + std::make_unique<data_decoder::CrashyDataDecoderService>( + /*crash_json=*/false, /*crash_image=*/true)); + constexpr base::FilePath::CharType kGoodPngName[] = + FILE_PATH_LITERAL("good.png"); + CreateValidImage(kGoodPngName); + base::FilePath good_png(kGoodPngName); + CreateAndStartSanitizer({good_png}); + WaitForSanitizationDone(); + EXPECT_EQ(last_reported_status(), ImageSanitizer::Status::kServiceError); +} + } // namespace extensions
diff --git a/extensions/browser/install/BUILD.gn b/extensions/browser/install/BUILD.gn index 7e5fb09..f050e039 100644 --- a/extensions/browser/install/BUILD.gn +++ b/extensions/browser/install/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/kiosk/BUILD.gn b/extensions/browser/kiosk/BUILD.gn index 893af38a..6d7d4d3 100644 --- a/extensions/browser/kiosk/BUILD.gn +++ b/extensions/browser/kiosk/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/mojo/interface_registration.cc b/extensions/browser/mojo/interface_registration.cc index be3645f6..4207264 100644 --- a/extensions/browser/mojo/interface_registration.cc +++ b/extensions/browser/mojo/interface_registration.cc
@@ -15,10 +15,10 @@ #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/mojo/keep_alive_impl.h" #include "extensions/browser/process_map.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/constants.h" #include "extensions/common/extension_api.h" #include "extensions/common/switches.h" -#include "extensions/features/features.h" #include "services/service_manager/public/cpp/binder_registry.h" #if BUILDFLAG(ENABLE_WIFI_DISPLAY)
diff --git a/extensions/browser/notification_types.h b/extensions/browser/notification_types.h index e830dca..fe72081 100644 --- a/extensions/browser/notification_types.h +++ b/extensions/browser/notification_types.h
@@ -8,7 +8,7 @@ #include <string> #include "content/public/browser/notification_types.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if !BUILDFLAG(ENABLE_EXTENSIONS) #error "Extensions must be enabled"
diff --git a/extensions/browser/updater/BUILD.gn b/extensions/browser/updater/BUILD.gn index ccd6359c..f1c10f9 100644 --- a/extensions/browser/updater/BUILD.gn +++ b/extensions/browser/updater/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/browser/value_store/BUILD.gn b/extensions/browser/value_store/BUILD.gn index 7dc35d50..3048a6ee 100644 --- a/extensions/browser/value_store/BUILD.gn +++ b/extensions/browser/value_store/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/features/BUILD.gn b/extensions/buildflags/BUILD.gn similarity index 85% rename from extensions/features/BUILD.gn rename to extensions/buildflags/BUILD.gn index 8c23ef1..6a36fa14 100644 --- a/extensions/features/BUILD.gn +++ b/extensions/buildflags/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/buildflag_header.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") # TODO(crbug.com/731689): Assert that extensions are enabled. @@ -12,8 +12,8 @@ # bringing in all of extensions. Other targets can depend on this target # regardless of whether extensions are enabled. -buildflag_header("features") { - header = "features.h" +buildflag_header("buildflags") { + header = "buildflags.h" flags = [ "ENABLE_EXTENSIONS=$enable_extensions", "ENABLE_WIFI_DISPLAY=$enable_wifi_display",
diff --git a/extensions/features/features.gni b/extensions/buildflags/buildflags.gni similarity index 100% rename from extensions/features/features.gni rename to extensions/buildflags/buildflags.gni
diff --git a/extensions/common/BUILD.gn b/extensions/common/BUILD.gn index e17d511..0450e04 100644 --- a/extensions/common/BUILD.gn +++ b/extensions/common/BUILD.gn
@@ -5,7 +5,7 @@ import("//build/config/features.gni") import("//build/config/jumbo.gni") import("//components/nacl/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//mojo/public/tools/bindings/mojom.gni") # TODO(crbug.com/731689): Assert that extensions are enabled.
diff --git a/extensions/common/api/BUILD.gn b/extensions/common/api/BUILD.gn index a04e789..9009562 100644 --- a/extensions/common/api/BUILD.gn +++ b/extensions/common/api/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/features.gni") import("//extensions/common/api/schema.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//mojo/public/tools/bindings/mojom.gni") import("//tools/json_schema_compiler/json_schema_api.gni") @@ -21,7 +21,7 @@ extensions_api_uncompiled_bundle_schema_sources deps = [ "//base", - "//extensions/features", + "//extensions/buildflags", ] } @@ -35,6 +35,6 @@ public_deps = [ ":generated_api", ":mojom", - "//extensions/features", + "//extensions/buildflags", ] }
diff --git a/extensions/common/extension.h b/extensions/common/extension.h index f964681..d61aa64 100644 --- a/extensions/common/extension.h +++ b/extensions/common/extension.h
@@ -16,13 +16,13 @@ #include "base/memory/ref_counted.h" #include "base/threading/thread_checker.h" #include "base/version.h" +#include "extensions/buildflags/buildflags.h" #include "extensions/common/extension_id.h" #include "extensions/common/extension_resource.h" #include "extensions/common/hashed_extension_id.h" #include "extensions/common/install_warning.h" #include "extensions/common/manifest.h" #include "extensions/common/url_pattern_set.h" -#include "extensions/features/features.h" #include "url/gurl.h" #if !BUILDFLAG(ENABLE_EXTENSIONS)
diff --git a/extensions/components/javascript_dialog_extensions_client/BUILD.gn b/extensions/components/javascript_dialog_extensions_client/BUILD.gn index c55ddfef..c6f7d52 100644 --- a/extensions/components/javascript_dialog_extensions_client/BUILD.gn +++ b/extensions/components/javascript_dialog_extensions_client/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/components/native_app_window/BUILD.gn b/extensions/components/native_app_window/BUILD.gn index f856c4f..1c17614e 100644 --- a/extensions/components/native_app_window/BUILD.gn +++ b/extensions/components/native_app_window/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/renderer/BUILD.gn b/extensions/renderer/BUILD.gn index 5c3222c..4dd7a6a 100644 --- a/extensions/renderer/BUILD.gn +++ b/extensions/renderer/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/features.gni") import("//build/config/jumbo.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions)
diff --git a/extensions/renderer/api/display_source/display_source_session.cc b/extensions/renderer/api/display_source/display_source_session.cc index 99b60bb..d14132b 100644 --- a/extensions/renderer/api/display_source/display_source_session.cc +++ b/extensions/renderer/api/display_source/display_source_session.cc
@@ -4,7 +4,7 @@ #include "extensions/renderer/api/display_source/display_source_session.h" -#include "extensions/features/features.h" +#include "extensions/buildflags/buildflags.h" #if BUILDFLAG(ENABLE_WIFI_DISPLAY) #include "extensions/renderer/api/display_source/wifi_display/wifi_display_session.h"
diff --git a/extensions/shell/BUILD.gn b/extensions/shell/BUILD.gn index 1d719c3..b5ddbfab 100644 --- a/extensions/shell/BUILD.gn +++ b/extensions/shell/BUILD.gn
@@ -6,7 +6,7 @@ import("//build/config/ui.gni") import("//build/util/process_version.gni") import("//components/nacl/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//testing/test.gni") import("//tools/grit/grit_rule.gni") import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
diff --git a/extensions/shell/browser/system_logs/BUILD.gn b/extensions/shell/browser/system_logs/BUILD.gn index 64af606..78a19345 100644 --- a/extensions/shell/browser/system_logs/BUILD.gn +++ b/extensions/shell/browser/system_logs/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions, "Cannot depend on extensions because enable_extensions=false.")
diff --git a/extensions/shell/common/api/BUILD.gn b/extensions/shell/common/api/BUILD.gn index b91d68f6..031a8e6 100644 --- a/extensions/shell/common/api/BUILD.gn +++ b/extensions/shell/common/api/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//tools/json_schema_compiler/json_features.gni") import("//tools/json_schema_compiler/json_schema_api.gni")
diff --git a/extensions/shell/installer/BUILD.gn b/extensions/shell/installer/BUILD.gn index ec48719b..a153ef7 100644 --- a/extensions/shell/installer/BUILD.gn +++ b/extensions/shell/installer/BUILD.gn
@@ -5,7 +5,7 @@ import("//build/config/sanitizers/sanitizers.gni") import("//build/config/ui.gni") import("//build/util/process_version.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions)
diff --git a/extensions/shell/installer/linux/BUILD.gn b/extensions/shell/installer/linux/BUILD.gn index ea9cd4de..1317430 100644 --- a/extensions/shell/installer/linux/BUILD.gn +++ b/extensions/shell/installer/linux/BUILD.gn
@@ -12,7 +12,7 @@ import("//build/util/version.gni") import("//chrome/process_version_rc_template.gni") # For branding_file_path. import("//components/nacl/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(is_desktop_linux) assert(current_cpu == "x64")
diff --git a/extensions/shell/installer/linux/common/installer.include b/extensions/shell/installer/linux/common/installer.include index bb206a7..57724f8 100644 --- a/extensions/shell/installer/linux/common/installer.include +++ b/extensions/shell/installer/linux/common/installer.include
@@ -1,4 +1,5 @@ -# TODO(michaelpg): Dedupe common functionality with the Chrome installer. +# TODO(michaelpg): Dedupe common functionality with the Chrome installer. See +# https://crbug.com/820270. # Recursively replace @@include@@ template variables with the referenced file, # and write the resulting text to stdout. @@ -53,6 +54,7 @@ TMPLINCL="$(process_template_includes "$TMPLIN")" sed \ -e "s#@@PACKAGE@@#${PACKAGE}#g" \ + -e "s#@@PACKAGE_ORIG@@#${PACKAGE_ORIG}#g" \ -e "s#@@PACKAGE_FILENAME@@#${PACKAGE_FILENAME}#g" \ -e "s#@@PROGNAME@@#${PROGNAME}#g" \ -e "s#@@CHANNEL@@#${CHANNEL}#g" \ @@ -68,15 +70,18 @@ -e "s#@@PRODUCTURL@@#${PRODUCTURL}#g" \ -e "s#@@PREDEPENDS@@#${PREDEPENDS}#g" \ -e "s#@@DEPENDS@@#${DEPENDS}#g" \ + -e "s#@@RECOMMENDS@@#${RECOMMENDS}#g" \ -e "s#@@PROVIDES@@#${PROVIDES}#g" \ - -e "s#@@REPLACES@@#${REPLACES}#g" \ - -e "s#@@CONFLICTS@@#${CONFLICTS}#g" \ -e "s#@@ARCHITECTURE@@#${ARCHITECTURE}#g" \ -e "s#@@MAINTNAME@@#${MAINTNAME}#g" \ -e "s#@@MAINTMAIL@@#${MAINTMAIL}#g" \ + -e "s#@@REPOCONFIG@@#${REPOCONFIG}#g" \ + -e "s#@@REPOCONFIGREGEX@@#${REPOCONFIGREGEX}#g" \ -e "s#@@SHORTDESC@@#${SHORTDESC}#g" \ -e "s#@@FULLDESC@@#${FULLDESC}#g" \ -e "s#@@USR_BIN_SYMLINK_NAME@@#${USR_BIN_SYMLINK_NAME:-}#g" \ + -e "s#@@LOGO_RESOURCES_PNG@@#${LOGO_RESOURCES_PNG}#g" \ + -e "s#@@LOGO_RESOURCE_XPM@@#${LOGO_RESOURCE_XPM}#g" \ > "$TMPLOUT" <<< "$TMPLINCL" )
diff --git a/extensions/shell/installer/linux/debian/build.sh b/extensions/shell/installer/linux/debian/build.sh index 97e67e79..1bacfda 100755 --- a/extensions/shell/installer/linux/debian/build.sh +++ b/extensions/shell/installer/linux/debian/build.sh
@@ -66,8 +66,6 @@ PREDEPENDS="$COMMON_PREDEPS" DEPENDS="${COMMON_DEPS}" RECOMMENDS="${COMMON_RECOMMENDS}" - REPLACES="" - CONFLICTS="" PROVIDES="" gen_changelog process_template "${SCRIPTDIR}/control.template" "${DEB_CONTROL}"
diff --git a/extensions/strings/BUILD.gn b/extensions/strings/BUILD.gn index b32b998..0591399 100644 --- a/extensions/strings/BUILD.gn +++ b/extensions/strings/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//tools/grit/grit_rule.gni") assert(enable_extensions)
diff --git a/extensions/test/BUILD.gn b/extensions/test/BUILD.gn index 96322ea..375f593f 100644 --- a/extensions/test/BUILD.gn +++ b/extensions/test/BUILD.gn
@@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//tools/json_schema_compiler/json_features.gni") assert(enable_extensions)
diff --git a/extensions/utility/BUILD.gn b/extensions/utility/BUILD.gn index 20e62b4..de71ac1 100644 --- a/extensions/utility/BUILD.gn +++ b/extensions/utility/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") assert(enable_extensions)
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn index ced1cef..0f966c6a 100644 --- a/google_apis/BUILD.gn +++ b/google_apis/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//testing/test.gni") declare_args() {
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h index e580227..3573fbf 100644 --- a/gpu/GLES2/gl2chromium_autogen.h +++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -332,7 +332,6 @@ #define glScheduleCALayerInUseQueryCHROMIUM \ GLES2_GET_FUN(ScheduleCALayerInUseQueryCHROMIUM) #define glCommitOverlayPlanesCHROMIUM GLES2_GET_FUN(CommitOverlayPlanesCHROMIUM) -#define glSwapInterval GLES2_GET_FUN(SwapInterval) #define glFlushDriverCachesCHROMIUM GLES2_GET_FUN(FlushDriverCachesCHROMIUM) #define glGetLastFlushIdCHROMIUM GLES2_GET_FUN(GetLastFlushIdCHROMIUM) #define glScheduleDCLayerSharedStateCHROMIUM \
diff --git a/gpu/command_buffer/build_cmd_buffer_lib.py b/gpu/command_buffer/build_cmd_buffer_lib.py index 3209864..7b507ab 100644 --- a/gpu/command_buffer/build_cmd_buffer_lib.py +++ b/gpu/command_buffer/build_cmd_buffer_lib.py
@@ -6929,6 +6929,6 @@ def Format(generated_files): formatter = "third_party/depot_tools/clang-format" if platform.system() == "Windows": - formatter += ".bat" + formatter = "third_party\\depot_tools\\clang-format.bat" for filename in generated_files: call([formatter, "-i", "-style=chromium", filename])
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index e9744ec..db6f5e8 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -3584,14 +3584,6 @@ 'unit_test': False, 'extension': True, }, - 'SwapInterval': { - 'impl_func': False, - 'decoder_func': 'DoSwapInterval', - 'client_test': False, - 'expectation': False, - 'extension': True, - 'trace_level': 1, - }, 'TexImage2D': { 'type': 'Custom', 'impl_func': False,
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index 32b5dea..562bf272 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -1500,9 +1500,6 @@ void GL_APIENTRY GLES2CommitOverlayPlanesCHROMIUM() { gles2::GetGLContext()->CommitOverlayPlanesCHROMIUM(); } -void GL_APIENTRY GLES2SwapInterval(GLint interval) { - gles2::GetGLContext()->SwapInterval(interval); -} void GL_APIENTRY GLES2FlushDriverCachesCHROMIUM() { gles2::GetGLContext()->FlushDriverCachesCHROMIUM(); } @@ -2954,10 +2951,6 @@ reinterpret_cast<GLES2FunctionPointer>(glCommitOverlayPlanesCHROMIUM), }, { - "glSwapInterval", - reinterpret_cast<GLES2FunctionPointer>(glSwapInterval), - }, - { "glFlushDriverCachesCHROMIUM", reinterpret_cast<GLES2FunctionPointer>(glFlushDriverCachesCHROMIUM), },
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h index a146fc0..853b7b0 100644 --- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h +++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -2799,13 +2799,6 @@ } } -void SwapInterval(GLint interval) { - gles2::cmds::SwapInterval* c = GetCmdSpace<gles2::cmds::SwapInterval>(); - if (c) { - c->Init(interval); - } -} - void FlushDriverCachesCHROMIUM() { gles2::cmds::FlushDriverCachesCHROMIUM* c = GetCmdSpace<gles2::cmds::FlushDriverCachesCHROMIUM>();
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index d180566..179c880a 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -1327,13 +1327,6 @@ } } -void GLES2Implementation::SwapInterval(int interval) { - GPU_CLIENT_SINGLE_THREAD_CHECK(); - GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSwapInterval(" - << interval << ")"); - helper_->SwapInterval(interval); -} - void GLES2Implementation::BindAttribLocation( GLuint program, GLuint index, const char* name) { GPU_CLIENT_SINGLE_THREAD_CHECK();
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index 1c762323..97089ca 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -1057,8 +1057,6 @@ void CommitOverlayPlanesCHROMIUM() override; -void SwapInterval(GLint interval) override; - void FlushDriverCachesCHROMIUM() override; GLuint GetLastFlushIdCHROMIUM() override;
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index aa47322..89d36c8 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -777,7 +777,6 @@ virtual void ScheduleCALayerInUseQueryCHROMIUM(GLsizei count, const GLuint* textures) = 0; virtual void CommitOverlayPlanesCHROMIUM() = 0; -virtual void SwapInterval(GLint interval) = 0; virtual void FlushDriverCachesCHROMIUM() = 0; virtual GLuint GetLastFlushIdCHROMIUM() = 0; virtual void ScheduleDCLayerSharedStateCHROMIUM(GLfloat opacity,
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index d19d0988..e838c03 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -755,7 +755,6 @@ void ScheduleCALayerInUseQueryCHROMIUM(GLsizei count, const GLuint* textures) override; void CommitOverlayPlanesCHROMIUM() override; -void SwapInterval(GLint interval) override; void FlushDriverCachesCHROMIUM() override; GLuint GetLastFlushIdCHROMIUM() override; void ScheduleDCLayerSharedStateCHROMIUM(GLfloat opacity,
diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index 0eab75fc..cc76b5c 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -1021,7 +1021,6 @@ GLsizei /* count */, const GLuint* /* textures */) {} void GLES2InterfaceStub::CommitOverlayPlanesCHROMIUM() {} -void GLES2InterfaceStub::SwapInterval(GLint /* interval */) {} void GLES2InterfaceStub::FlushDriverCachesCHROMIUM() {} GLuint GLES2InterfaceStub::GetLastFlushIdCHROMIUM() { return 0;
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index 0aa7f89..05d52db 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -755,7 +755,6 @@ void ScheduleCALayerInUseQueryCHROMIUM(GLsizei count, const GLuint* textures) override; void CommitOverlayPlanesCHROMIUM() override; -void SwapInterval(GLint interval) override; void FlushDriverCachesCHROMIUM() override; GLuint GetLastFlushIdCHROMIUM() override; void ScheduleDCLayerSharedStateCHROMIUM(GLfloat opacity,
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index f665626..be6855d 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -2187,11 +2187,6 @@ gl_->CommitOverlayPlanesCHROMIUM(); } -void GLES2TraceImplementation::SwapInterval(GLint interval) { - TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::SwapInterval"); - gl_->SwapInterval(interval); -} - void GLES2TraceImplementation::FlushDriverCachesCHROMIUM() { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::FlushDriverCachesCHROMIUM"); gl_->FlushDriverCachesCHROMIUM();
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 7997790a..536fafa 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -13785,38 +13785,6 @@ static_assert(offsetof(CommitOverlayPlanesCHROMIUM, header) == 0, "offset of CommitOverlayPlanesCHROMIUM header should be 0"); -struct SwapInterval { - typedef SwapInterval ValueType; - static const CommandId kCmdId = kSwapInterval; - static const cmd::ArgFlags kArgFlags = cmd::kFixed; - static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(1); - - static uint32_t ComputeSize() { - return static_cast<uint32_t>(sizeof(ValueType)); // NOLINT - } - - void SetHeader() { header.SetCmd<ValueType>(); } - - void Init(GLint _interval) { - SetHeader(); - interval = _interval; - } - - void* Set(void* cmd, GLint _interval) { - static_cast<ValueType*>(cmd)->Init(_interval); - return NextCmdAddress<ValueType>(cmd); - } - - gpu::CommandHeader header; - int32_t interval; -}; - -static_assert(sizeof(SwapInterval) == 8, "size of SwapInterval should be 8"); -static_assert(offsetof(SwapInterval, header) == 0, - "offset of SwapInterval header should be 0"); -static_assert(offsetof(SwapInterval, interval) == 4, - "offset of SwapInterval interval should be 4"); - struct FlushDriverCachesCHROMIUM { typedef FlushDriverCachesCHROMIUM ValueType; static const CommandId kCmdId = kFlushDriverCachesCHROMIUM;
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h index 5dd2ab1..2614e34 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -4616,16 +4616,6 @@ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); } -TEST_F(GLES2FormatTest, SwapInterval) { - cmds::SwapInterval& cmd = *GetBufferAs<cmds::SwapInterval>(); - void* next_cmd = cmd.Set(&cmd, static_cast<GLint>(11)); - EXPECT_EQ(static_cast<uint32_t>(cmds::SwapInterval::kCmdId), - cmd.header.command); - EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u); - EXPECT_EQ(static_cast<GLint>(11), cmd.interval); - CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd)); -} - TEST_F(GLES2FormatTest, FlushDriverCachesCHROMIUM) { cmds::FlushDriverCachesCHROMIUM& cmd = *GetBufferAs<cmds::FlushDriverCachesCHROMIUM>();
diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h index f843757..047ff08f 100644 --- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -295,60 +295,59 @@ OP(ScheduleCALayerCHROMIUM) /* 536 */ \ OP(ScheduleCALayerInUseQueryCHROMIUMImmediate) /* 537 */ \ OP(CommitOverlayPlanesCHROMIUM) /* 538 */ \ - OP(SwapInterval) /* 539 */ \ - OP(FlushDriverCachesCHROMIUM) /* 540 */ \ - OP(ScheduleDCLayerSharedStateCHROMIUM) /* 541 */ \ - OP(ScheduleDCLayerCHROMIUM) /* 542 */ \ - OP(MatrixLoadfCHROMIUMImmediate) /* 543 */ \ - OP(MatrixLoadIdentityCHROMIUM) /* 544 */ \ - OP(GenPathsCHROMIUM) /* 545 */ \ - OP(DeletePathsCHROMIUM) /* 546 */ \ - OP(IsPathCHROMIUM) /* 547 */ \ - OP(PathCommandsCHROMIUM) /* 548 */ \ - OP(PathParameterfCHROMIUM) /* 549 */ \ - OP(PathParameteriCHROMIUM) /* 550 */ \ - OP(PathStencilFuncCHROMIUM) /* 551 */ \ - OP(StencilFillPathCHROMIUM) /* 552 */ \ - OP(StencilStrokePathCHROMIUM) /* 553 */ \ - OP(CoverFillPathCHROMIUM) /* 554 */ \ - OP(CoverStrokePathCHROMIUM) /* 555 */ \ - OP(StencilThenCoverFillPathCHROMIUM) /* 556 */ \ - OP(StencilThenCoverStrokePathCHROMIUM) /* 557 */ \ - OP(StencilFillPathInstancedCHROMIUM) /* 558 */ \ - OP(StencilStrokePathInstancedCHROMIUM) /* 559 */ \ - OP(CoverFillPathInstancedCHROMIUM) /* 560 */ \ - OP(CoverStrokePathInstancedCHROMIUM) /* 561 */ \ - OP(StencilThenCoverFillPathInstancedCHROMIUM) /* 562 */ \ - OP(StencilThenCoverStrokePathInstancedCHROMIUM) /* 563 */ \ - OP(BindFragmentInputLocationCHROMIUMBucket) /* 564 */ \ - OP(ProgramPathFragmentInputGenCHROMIUM) /* 565 */ \ - OP(GetBufferSubDataAsyncCHROMIUM) /* 566 */ \ - OP(CoverageModulationCHROMIUM) /* 567 */ \ - OP(BlendBarrierKHR) /* 568 */ \ - OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 569 */ \ - OP(BindFragDataLocationIndexedEXTBucket) /* 570 */ \ - OP(BindFragDataLocationEXTBucket) /* 571 */ \ - OP(GetFragDataIndexEXT) /* 572 */ \ - OP(UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate) /* 573 */ \ - OP(OverlayPromotionHintCHROMIUM) /* 574 */ \ - OP(SwapBuffersWithBoundsCHROMIUMImmediate) /* 575 */ \ - OP(SetDrawRectangleCHROMIUM) /* 576 */ \ - OP(SetEnableDCLayersCHROMIUM) /* 577 */ \ - OP(InitializeDiscardableTextureCHROMIUM) /* 578 */ \ - OP(UnlockDiscardableTextureCHROMIUM) /* 579 */ \ - OP(LockDiscardableTextureCHROMIUM) /* 580 */ \ - OP(BeginRasterCHROMIUM) /* 581 */ \ - OP(RasterCHROMIUM) /* 582 */ \ - OP(EndRasterCHROMIUM) /* 583 */ \ - OP(CreateTransferCacheEntryINTERNAL) /* 584 */ \ - OP(DeleteTransferCacheEntryINTERNAL) /* 585 */ \ - OP(UnlockTransferCacheEntryINTERNAL) /* 586 */ \ - OP(TexStorage2DImageCHROMIUM) /* 587 */ \ - OP(SetColorSpaceMetadataCHROMIUM) /* 588 */ \ - OP(WindowRectanglesEXTImmediate) /* 589 */ \ - OP(CreateGpuFenceINTERNAL) /* 590 */ \ - OP(WaitGpuFenceCHROMIUM) /* 591 */ \ - OP(DestroyGpuFenceCHROMIUM) /* 592 */ + OP(FlushDriverCachesCHROMIUM) /* 539 */ \ + OP(ScheduleDCLayerSharedStateCHROMIUM) /* 540 */ \ + OP(ScheduleDCLayerCHROMIUM) /* 541 */ \ + OP(MatrixLoadfCHROMIUMImmediate) /* 542 */ \ + OP(MatrixLoadIdentityCHROMIUM) /* 543 */ \ + OP(GenPathsCHROMIUM) /* 544 */ \ + OP(DeletePathsCHROMIUM) /* 545 */ \ + OP(IsPathCHROMIUM) /* 546 */ \ + OP(PathCommandsCHROMIUM) /* 547 */ \ + OP(PathParameterfCHROMIUM) /* 548 */ \ + OP(PathParameteriCHROMIUM) /* 549 */ \ + OP(PathStencilFuncCHROMIUM) /* 550 */ \ + OP(StencilFillPathCHROMIUM) /* 551 */ \ + OP(StencilStrokePathCHROMIUM) /* 552 */ \ + OP(CoverFillPathCHROMIUM) /* 553 */ \ + OP(CoverStrokePathCHROMIUM) /* 554 */ \ + OP(StencilThenCoverFillPathCHROMIUM) /* 555 */ \ + OP(StencilThenCoverStrokePathCHROMIUM) /* 556 */ \ + OP(StencilFillPathInstancedCHROMIUM) /* 557 */ \ + OP(StencilStrokePathInstancedCHROMIUM) /* 558 */ \ + OP(CoverFillPathInstancedCHROMIUM) /* 559 */ \ + OP(CoverStrokePathInstancedCHROMIUM) /* 560 */ \ + OP(StencilThenCoverFillPathInstancedCHROMIUM) /* 561 */ \ + OP(StencilThenCoverStrokePathInstancedCHROMIUM) /* 562 */ \ + OP(BindFragmentInputLocationCHROMIUMBucket) /* 563 */ \ + OP(ProgramPathFragmentInputGenCHROMIUM) /* 564 */ \ + OP(GetBufferSubDataAsyncCHROMIUM) /* 565 */ \ + OP(CoverageModulationCHROMIUM) /* 566 */ \ + OP(BlendBarrierKHR) /* 567 */ \ + OP(ApplyScreenSpaceAntialiasingCHROMIUM) /* 568 */ \ + OP(BindFragDataLocationIndexedEXTBucket) /* 569 */ \ + OP(BindFragDataLocationEXTBucket) /* 570 */ \ + OP(GetFragDataIndexEXT) /* 571 */ \ + OP(UniformMatrix4fvStreamTextureMatrixCHROMIUMImmediate) /* 572 */ \ + OP(OverlayPromotionHintCHROMIUM) /* 573 */ \ + OP(SwapBuffersWithBoundsCHROMIUMImmediate) /* 574 */ \ + OP(SetDrawRectangleCHROMIUM) /* 575 */ \ + OP(SetEnableDCLayersCHROMIUM) /* 576 */ \ + OP(InitializeDiscardableTextureCHROMIUM) /* 577 */ \ + OP(UnlockDiscardableTextureCHROMIUM) /* 578 */ \ + OP(LockDiscardableTextureCHROMIUM) /* 579 */ \ + OP(BeginRasterCHROMIUM) /* 580 */ \ + OP(RasterCHROMIUM) /* 581 */ \ + OP(EndRasterCHROMIUM) /* 582 */ \ + OP(CreateTransferCacheEntryINTERNAL) /* 583 */ \ + OP(DeleteTransferCacheEntryINTERNAL) /* 584 */ \ + OP(UnlockTransferCacheEntryINTERNAL) /* 585 */ \ + OP(TexStorage2DImageCHROMIUM) /* 586 */ \ + OP(SetColorSpaceMetadataCHROMIUM) /* 587 */ \ + OP(WindowRectanglesEXTImmediate) /* 588 */ \ + OP(CreateGpuFenceINTERNAL) /* 589 */ \ + OP(WaitGpuFenceCHROMIUM) /* 590 */ \ + OP(DestroyGpuFenceCHROMIUM) /* 591 */ enum CommandId { kOneBeforeStartPoint =
diff --git a/gpu/command_buffer/gles2_cmd_buffer_functions.txt b/gpu/command_buffer/gles2_cmd_buffer_functions.txt index 6372acc..345eca7 100644 --- a/gpu/command_buffer/gles2_cmd_buffer_functions.txt +++ b/gpu/command_buffer/gles2_cmd_buffer_functions.txt
@@ -310,7 +310,6 @@ GL_APICALL void GL_APIENTRY glScheduleCALayerCHROMIUM (GLuint contents_texture_id, const GLfloat* contents_rect, GLuint background_color, GLuint edge_aa_mask, const GLfloat* bounds_rect, GLuint filter); GL_APICALL void GL_APIENTRY glScheduleCALayerInUseQueryCHROMIUM (GLsizei count, const GLuint* textures); GL_APICALL void GL_APIENTRY glCommitOverlayPlanesCHROMIUM (void); -GL_APICALL void GL_APIENTRY glSwapInterval (GLint interval); GL_APICALL void GL_APIENTRY glFlushDriverCachesCHROMIUM (void); GL_APICALL GLuint GL_APIENTRY glGetLastFlushIdCHROMIUM (void); GL_APICALL void GL_APIENTRY glScheduleDCLayerSharedStateCHROMIUM (GLfloat opacity, GLboolean is_clipped, const GLfloat* clip_rect, GLint z_order, const GLfloat* transform);
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 98cc319f..81b51b8 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -990,9 +990,6 @@ void DoCommitOverlayPlanes(); - // Wrapper for SwapInterval. - void DoSwapInterval(int interval); - // Wrapper for CopyTexSubImage2D. void DoCopyTexSubImage2D( GLenum target, @@ -16161,10 +16158,6 @@ } } -void GLES2DecoderImpl::DoSwapInterval(int interval) { - context_->SetSwapInterval(interval); -} - error::Error GLES2DecoderImpl::HandleEnableFeatureCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h index 0884f7b..821d21f 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_autogen.h
@@ -4907,16 +4907,6 @@ return error::kNoError; } -error::Error GLES2DecoderImpl::HandleSwapInterval( - uint32_t immediate_data_size, - const volatile void* cmd_data) { - const volatile gles2::cmds::SwapInterval& c = - *static_cast<const volatile gles2::cmds::SwapInterval*>(cmd_data); - GLint interval = static_cast<GLint>(c.interval); - DoSwapInterval(interval); - return error::kNoError; -} - error::Error GLES2DecoderImpl::HandleFlushDriverCachesCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h index 26c7dbf..31ed942 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doer_prototypes.h
@@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_DOER_PROTOTYPES_H_ +#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_DOER_PROTOTYPES_H_ + error::Error DoActiveTexture(GLenum texture); error::Error DoAttachShader(GLuint program, GLuint shader); error::Error DoBindAttribLocation(GLuint program, @@ -866,7 +869,6 @@ GLenum filter, const GLfloat* bounds_rect); error::Error DoCommitOverlayPlanesCHROMIUM(); -error::Error DoSwapInterval(GLint interval); error::Error DoFlushDriverCachesCHROMIUM(); error::Error DoMatrixLoadfCHROMIUM(GLenum matrixMode, const volatile GLfloat* m); @@ -1033,3 +1035,5 @@ GLint y, GLsizei width, GLsizei height); + +#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_PASSTHROUGH_DOER_PROTOTYPES_H_
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc index 6b96807..9acc3bc5 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
@@ -4282,11 +4282,6 @@ return error::kNoError; } -error::Error GLES2DecoderPassthroughImpl::DoSwapInterval(GLint interval) { - context_->SetSwapInterval(interval); - return error::kNoError; -} - error::Error GLES2DecoderPassthroughImpl::DoFlushDriverCachesCHROMIUM() { // On Adreno Android devices we need to use a workaround to force caches to // clear.
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc index 74fdfdbb..81b057e1 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_handlers_autogen.cc
@@ -4279,19 +4279,6 @@ return error::kNoError; } -error::Error GLES2DecoderPassthroughImpl::HandleSwapInterval( - uint32_t immediate_data_size, - const volatile void* cmd_data) { - const volatile gles2::cmds::SwapInterval& c = - *static_cast<const volatile gles2::cmds::SwapInterval*>(cmd_data); - GLint interval = static_cast<GLint>(c.interval); - error::Error error = DoSwapInterval(interval); - if (error != error::kNoError) { - return error; - } - return error::kNoError; -} - error::Error GLES2DecoderPassthroughImpl::HandleFlushDriverCachesCHROMIUM( uint32_t immediate_data_size, const volatile void* cmd_data) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h index 2138e2f..d481048 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
@@ -278,12 +278,4 @@ EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); EXPECT_EQ(GL_NO_ERROR, GetGLError()); } - -TEST_P(GLES2DecoderTest3, SwapIntervalValidArgs) { - SpecializedSetup<cmds::SwapInterval, 0>(true); - cmds::SwapInterval cmd; - cmd.Init(1); - EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); - EXPECT_EQ(GL_NO_ERROR, GetGLError()); -} #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
diff --git a/gpu/command_buffer/service/mailbox_manager_unittest.cc b/gpu/command_buffer/service/mailbox_manager_unittest.cc index cd7f6075e..6600d0f6 100644 --- a/gpu/command_buffer/service/mailbox_manager_unittest.cc +++ b/gpu/command_buffer/service/mailbox_manager_unittest.cc
@@ -727,6 +727,84 @@ DestroyTexture(new_texture); } +TEST_F(MailboxManagerSyncTest, ProduceTextureDefinedNotLevel0) { + const GLuint kNewTextureId = 1234; + InSequence sequence; + + Texture* texture = CreateTexture(); + const GLsizei levels_needed = TextureManager::ComputeMipMapCount( + GL_TEXTURE_2D, kMaxTextureWidth, kMaxTextureHeight, kMaxTextureDepth); + SetTarget(texture, GL_TEXTURE_2D, levels_needed); + SetLevelInfo(texture, GL_TEXTURE_2D, 1, GL_RGBA, 1, 1, 1, 0, GL_RGBA, + GL_UNSIGNED_BYTE, gfx::Rect(1, 1)); + SetParameter(texture, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + SetParameter(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + Mailbox name = Mailbox::Generate(); + + manager_->ProduceTexture(name, texture); + + // Share + manager_->PushTextureUpdates(g_sync_token); + EXPECT_CALL(*gl_, GenTextures(1, _)) + .WillOnce(SetArgPointee<1>(kNewTextureId)); + SetupUpdateTexParamExpectations(kNewTextureId, GL_LINEAR, GL_LINEAR, + GL_REPEAT, GL_REPEAT); + TextureBase* new_texture = manager2_->ConsumeTexture(name); + EXPECT_EQ(kNewTextureId, new_texture->service_id()); + + // Change something so that the push recreates the TextureDefinition. + SetParameter(static_cast<Texture*>(new_texture), GL_TEXTURE_MIN_FILTER, + GL_NEAREST); + + // Synchronize manager2 -> manager + manager2_->PushTextureUpdates(g_sync_token); + SetupUpdateTexParamExpectations(1, GL_NEAREST, GL_LINEAR, GL_REPEAT, + GL_REPEAT); + manager_->PullTextureUpdates(g_sync_token); + + DestroyTexture(texture); + DestroyTexture(new_texture); +} + +TEST_F(MailboxManagerSyncTest, ProduceTextureDefined0Size) { + const GLuint kNewTextureId = 1234; + InSequence sequence; + + Texture* texture = CreateTexture(); + const GLsizei levels_needed = TextureManager::ComputeMipMapCount( + GL_TEXTURE_2D, kMaxTextureWidth, kMaxTextureHeight, kMaxTextureDepth); + SetTarget(texture, GL_TEXTURE_2D, levels_needed); + SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 0, 0, GL_RGBA, + GL_UNSIGNED_BYTE, gfx::Rect(0, 0)); + SetParameter(texture, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + SetParameter(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + Mailbox name = Mailbox::Generate(); + + manager_->ProduceTexture(name, texture); + + // Share + manager_->PushTextureUpdates(g_sync_token); + EXPECT_CALL(*gl_, GenTextures(1, _)) + .WillOnce(SetArgPointee<1>(kNewTextureId)); + SetupUpdateTexParamExpectations(kNewTextureId, GL_LINEAR, GL_LINEAR, + GL_REPEAT, GL_REPEAT); + TextureBase* new_texture = manager2_->ConsumeTexture(name); + EXPECT_EQ(kNewTextureId, new_texture->service_id()); + + // Change something so that the push recreates the TextureDefinition. + SetParameter(static_cast<Texture*>(new_texture), GL_TEXTURE_MIN_FILTER, + GL_NEAREST); + + // Synchronize manager2 -> manager + manager2_->PushTextureUpdates(g_sync_token); + SetupUpdateTexParamExpectations(1, GL_NEAREST, GL_LINEAR, GL_REPEAT, + GL_REPEAT); + manager_->PullTextureUpdates(g_sync_token); + + DestroyTexture(texture); + DestroyTexture(new_texture); +} + TEST_F(MailboxManagerSyncTest, ProduceTextureNotBound) { InSequence sequence;
diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc index 231de63f..fdc6cfe0 100644 --- a/gpu/command_buffer/service/texture_definition.cc +++ b/gpu/command_buffer/service/texture_definition.cc
@@ -334,28 +334,26 @@ wrap_s_(texture->wrap_s()), wrap_t_(texture->wrap_t()), usage_(texture->usage()), - immutable_(texture->IsImmutable()), - defined_(texture->IsDefined()) { + immutable_(texture->IsImmutable()) { + const Texture::LevelInfo* level = texture->GetLevelInfo(target_, 0); + defined_ = !!level; DCHECK(!image_buffer_.get() || defined_); - if (!image_buffer_.get() && defined_) { + if (!defined_) + return; + if (!image_buffer_.get()) { image_buffer_ = NativeImageBuffer::Create(texture->service_id()); DCHECK(image_buffer_.get()); } - DCHECK(!texture->face_infos_.empty()); - const Texture::FaceInfo& first_face = texture->face_infos_[0]; if (image_buffer_.get()) { - scoped_refptr<gl::GLImage> gl_image(new GLImageSync( - image_buffer_, gfx::Size(first_face.level_infos[0].width, - first_face.level_infos[0].height))); + scoped_refptr<gl::GLImage> gl_image( + new GLImageSync(image_buffer_, gfx::Size(level->width, level->height))); texture->SetLevelImage(target_, 0, gl_image.get(), Texture::BOUND); } - DCHECK(!first_face.level_infos.empty()); - const Texture::LevelInfo& level = first_face.level_infos[0]; - level_info_ = LevelInfo(level.target, level.internal_format, level.width, - level.height, level.depth, level.border, level.format, - level.type, level.cleared_rect); + level_info_ = LevelInfo(level->target, level->internal_format, level->width, + level->height, level->depth, level->border, + level->format, level->type, level->cleared_rect); } TextureDefinition::TextureDefinition(const TextureDefinition& other) = default; @@ -398,7 +396,7 @@ level_info_.border, level_info_.format, level_info_.type, level_info_.cleared_rect); texture->face_infos_[0].level_infos.resize( - texture->face_infos_[0].num_mip_levels); + std::max(1, texture->face_infos_[0].num_mip_levels)); } if (image_buffer_.get()) {
diff --git a/headless/app/DEPS b/headless/app/DEPS new file mode 100644 index 0000000..a3c5a9c --- /dev/null +++ b/headless/app/DEPS
@@ -0,0 +1,5 @@ +include_rules = { + "+cc/base/switches.h", + "+components/viz/common/switches.h", +} +
diff --git a/headless/app/headless_shell.cc b/headless/app/headless_shell.cc index 757e432..9d028ee6 100644 --- a/headless/app/headless_shell.cc +++ b/headless/app/headless_shell.cc
@@ -25,6 +25,8 @@ #include "base/task_runner_util.h" #include "base/task_scheduler/post_task.h" #include "build/build_config.h" +#include "cc/base/switches.h" +#include "components/viz/common/switches.h" #include "content/public/app/content_main.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/content_switches.h" @@ -704,6 +706,21 @@ builder.SetCrashDumpsDir(dumps_path); #endif + if (command_line.HasSwitch(switches::kDeterministicMode)) { + command_line.AppendSwitch(switches::kEnableBeginFrameControl); + command_line.AppendSwitch(switches::kDeterministicFetch); + + // Compositor flags + command_line.AppendSwitch(::switches::kRunAllCompositorStagesBeforeDraw); + command_line.AppendSwitch(::switches::kDisableNewContentRenderingTimeout); + command_line.AppendSwitch(::switches::kEnableSurfaceSynchronization); + + // Renderer flags + command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation); + command_line.AppendSwitch(::switches::kDisableThreadedScrolling); + command_line.AppendSwitch(cc::switches::kDisableCheckerImaging); + } + if (command_line.HasSwitch(switches::kEnableBeginFrameControl)) builder.SetEnableBeginFrameControl(true);
diff --git a/headless/app/headless_shell_switches.cc b/headless/app/headless_shell_switches.cc index db35d2c..cc79986 100644 --- a/headless/app/headless_shell_switches.cc +++ b/headless/app/headless_shell_switches.cc
@@ -26,6 +26,11 @@ // The directory breakpad should store minidumps in. const char kCrashDumpsDir[] = "crash-dumps-dir"; +// A meta flag. This sets a number of flags which put the browser into +// deterministic mode where begin frames should be issued over DevToolsProtocol +// (experimental). +const char kDeterministicMode[] = "deterministic-mode"; + // Instructs headless_shell to cause network fetches to complete in order of // creation. This removes a significant source of network related // non-determinism at the cost of slower page loads.
diff --git a/headless/app/headless_shell_switches.h b/headless/app/headless_shell_switches.h index 9bec132a..bfe917d 100644 --- a/headless/app/headless_shell_switches.h +++ b/headless/app/headless_shell_switches.h
@@ -12,6 +12,7 @@ extern const char kCrashDumpsDir[]; extern const char kDefaultBackgroundColor[]; +extern const char kDeterministicMode[]; extern const char kDeterministicFetch[]; extern const char kDisableCrashReporter[]; extern const char kDumpDom[];
diff --git a/infra/config/global/cr-buildbucket.cfg b/infra/config/global/cr-buildbucket.cfg index 0401da4e..c7c27b3 100644 --- a/infra/config/global/cr-buildbucket.cfg +++ b/infra/config/global/cr-buildbucket.cfg
@@ -77,6 +77,17 @@ } } +# This is for tryservers becoming slow and critical path of patch landing. +builder_mixins { + name: "goma-j150" + recipe { + properties_j: <<END + $build/goma: { + "jobs": 150 + } + END + } +} builder_mixins { name: "android" @@ -104,6 +115,14 @@ } builder_mixins { + name: "angle-try" + service_account: "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + recipe { + properties: "mastername:tryserver.chromium.angle" + } +} + +builder_mixins { name: "fyi-ci" recipe { properties: "mastername:chromium.fyi" @@ -111,11 +130,39 @@ } builder_mixins { + name: "gpu-fyi-ci" + service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" + recipe { + properties: "mastername:chromium.gpu.fyi" + } +} + +builder_mixins { + name: "gpu-optional-try" + service_account: "chromium-try-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" +} + +builder_mixins { name: "linux" dimensions: "os:Ubuntu-14.04" } builder_mixins { + name: "linux-angle-try" + mixins: "linux" + mixins: "angle-try" +} + +builder_mixins { + name: "linux-optional-gpu-try" + mixins: "linux" + mixins: "gpu-optional-try" + recipe { + properties: "mastername:tryserver.chromium.linux" + } +} + +builder_mixins { name: "linux-try" mixins: "linux" recipe { @@ -142,13 +189,10 @@ builder_mixins { name: "linux-gpu-fyi-ci" - service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" dimensions: "cpu:x86-64" dimensions: "cores:8" mixins: "linux" - recipe { - properties: "mastername:chromium.gpu.fyi" - } + mixins: "gpu-fyi-ci" } builder_mixins { @@ -157,6 +201,21 @@ } builder_mixins { + name: "mac-angle-try" + mixins: "mac" + mixins: "angle-try" +} + +builder_mixins { + name: "mac-optional-gpu-try" + mixins: "mac" + mixins: "gpu-optional-try" + recipe { + properties: "mastername:tryserver.chromium.mac" + } +} + +builder_mixins { name: "mac-try" mixins: "mac" recipe { @@ -174,12 +233,9 @@ builder_mixins { name: "mac-gpu-fyi-ci" - service_account: "chromium-ci-gpu-builder@chops-service-accounts.iam.gserviceaccount.com" dimensions: "cpu:x86-64" mixins: "mac" - recipe { - properties: "mastername:chromium.gpu.fyi" - } + mixins: "gpu-fyi-ci" } builder_mixins { @@ -211,6 +267,13 @@ } builder_mixins { + name: "win-gpu-fyi-ci" + dimensions: "cpu:x86-64" + mixins: "win" + mixins: "gpu-fyi-ci" +} + +builder_mixins { name: "findit" # This category is meant for Findit to trigger tryjobs on. category: "Chromium Variable" @@ -256,6 +319,21 @@ } builders { + name: "Android x64 Builder (dbg)" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + dimensions: "cores:8" + execution_timeout_secs: 14400 # 4h + } + + builders { + name: "Android x86 Builder (dbg)" + mixins: "android-ci" + dimensions: "os:Ubuntu-14.04" + dimensions: "cores:8" + } + + builders { name: "Marshmallow 64 bit Tester" mixins: "android-ci" dimensions: "os:Ubuntu-14.04" @@ -503,6 +581,106 @@ dimensions: "cpu:x86-64" dimensions: "cores:8" } + builders { + name: "GPU FYI Win Builder" + mixins: "win-gpu-fyi-ci" + dimensions: "cores:32" + } + builders { + name: "GPU FYI Win Builder (dbg)" + mixins: "win-gpu-fyi-ci" + dimensions: "cores:32" + } + builders { + name: "GPU FYI Win Clang Builder (dbg)" + mixins: "win-gpu-fyi-ci" + dimensions: "cores:32" + } + builders { + name: "GPU FYI Win dEQP Builder" + mixins: "win-gpu-fyi-ci" + dimensions: "cores:32" + } + builders { + name: "GPU FYI Win x64 Builder" + mixins: "win-gpu-fyi-ci" + dimensions: "cores:32" + } + builders { + name: "GPU FYI Win x64 Builder (dbg)" + mixins: "win-gpu-fyi-ci" + dimensions: "cores:32" + } + builders { + name: "GPU FYI Win x64 dEQP Builder" + mixins: "win-gpu-fyi-ci" + dimensions: "cores:32" + } + builders { + name: "Win10 FYI Debug (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-10" + } + builders { + name: "Win10 FYI dEQP Release (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-10" + } + builders { + name: "Win10 FYI Exp Release (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-10" + } + builders { + name: "Win10 FYI Release (Intel HD 630)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-10" + } + builders { + name: "Win10 FYI Release (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-10" + } + builders { + name: "Win7 FYI Debug (AMD)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } + builders { + name: "Win7 FYI Debug (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } + builders { + name: "Win7 FYI dEQP Release (AMD)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } + builders { + name: "Win7 FYI Release (AMD)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } + builders { + name: "Win7 FYI Release (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } + builders { + name: "Win7 FYI x64 Debug (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } + builders { + name: "Win7 FYI x64 dEQP Release (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } + builders { + name: "Win7 FYI x64 Release (NVIDIA)" + mixins: "win-gpu-fyi-ci" + dimensions: "os:Windows-7" + } } } @@ -625,6 +803,11 @@ builders { mixins: "linux-try" name: "closure_compilation" } builders { mixins: "linux-try" name: "fuchsia" } builders { mixins: "linux-try" name: "linux_android_rel_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_compile_dbg_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_dbg_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_deqp_rel_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_ozone_rel_ng" } + builders { mixins: "linux-angle-try" name: "linux_angle_rel_ng" } builders { mixins: "linux-try" name: "linux_arm" } builders { mixins: "linux-try" name: "linux_chromium_analysis" } builders { mixins: "linux-try" name: "linux_chromium_archive_rel_ng" } @@ -658,7 +841,11 @@ builders { mixins: "linux-try" name: "linux_chromium_msan_rel_ng" } builders { mixins: "linux-try" name: "linux_chromium_msan_variable" } builders { mixins: "linux-try" name: "linux_chromium_ozone_compile_only_ng" } - builders { mixins: "linux-try" name: "linux_chromium_rel_ng" } + builders { + mixins: "linux-try" + mixins: "goma-j150" + name: "linux_chromium_rel_ng" + } builders { mixins: "linux-try" name: "linux_chromium_tsan_rel_ng" } builders { mixins: "linux-try" name: "linux_chromium_tsan_variable" } builders { mixins: "linux-try" name: "linux_chromium_ubsan_rel_ng" } @@ -684,7 +871,7 @@ builders { mixins: "linux-try" name: "linux_mojo_chromeos" } builders { mixins: "linux-try" name: "linux_nacl_sdk" } builders { mixins: "linux-try" name: "linux_nacl_sdk_build" } - builders { mixins: "linux-try" name: "linux_optional_gpu_tests_rel" } + builders { mixins: "linux-optional-gpu-try" name: "linux_optional_gpu_tests_rel" } builders { mixins: "linux-try" name: "linux_site_isolation" } builders { mixins: "linux-try" name: "linux_upload_clang" } @@ -694,6 +881,9 @@ builders { mixins: "mac-try" name: "ios-simulator-cronet" } builders { mixins: "mac-try" name: "ios-simulator-eg" } builders { mixins: "mac-try" name: "ios-simulator-xcode-clang" } + builders { mixins: "mac-angle-try" name: "mac_angle_compile_dbg_ng" } + builders { mixins: "mac-angle-try" name: "mac_angle_dbg_ng" } + builders { mixins: "mac-angle-try" name: "mac_angle_rel_ng" } builders { mixins: "mac-try" name: "mac_chromium_10.10_macviews" } builders { mixins: "mac-try" name: "mac_chromium_10.10_rel_ng" } builders { mixins: "mac-try" name: "mac_chromium_10.12_rel_ng" } @@ -717,7 +907,7 @@ builders { mixins: "mac-try" name: "mac_chromium_variable_layout" } builders { mixins: "mac-try" name: "mac_nacl_sdk" } builders { mixins: "mac-try" name: "mac_nacl_sdk_build" } - builders { mixins: "mac-try" name: "mac_optional_gpu_tests_rel" } + builders { mixins: "mac-optional-gpu-try" name: "mac_optional_gpu_tests_rel" } builders { mixins: "mac-try" name: "mac_upload_clang" } builders { mixins: "win-try" name: "win10_chromium_x64_rel_ng" }
diff --git a/infra/config/global/luci-milo-dev.cfg b/infra/config/global/luci-milo-dev.cfg index a322848..d3780217 100644 --- a/infra/config/global/luci-milo-dev.cfg +++ b/infra/config/global/luci-milo-dev.cfg
@@ -2781,39 +2781,49 @@ short_name: "tsn" } builders: { - name: "buildbot/chromium.gpu.fyi/Android FYI Release (NVIDIA Shield TV)" - category: "Android" - short_name: "nvi" - } - builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 5)" - category: "Android" + category: "Android|L32" short_name: "N5" } builders: { - name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 5X)" - category: "Android" - short_name: "N5X" - } - builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 6)" - category: "Android" + category: "Android|L32" short_name: "N6" } builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 5X)" + category: "Android|M64|QCOM" + short_name: "N5X" + } + builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 6P)" - category: "Android" + category: "Android|M64|QCOM" short_name: "N6P" } builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 9)" - category: "Android" + category: "Android|M64|NVDA" short_name: "N9" } builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI Release (NVIDIA Shield TV)" + category: "Android|N64|NVDA" + short_name: "STV" + } + builders: { name: "buildbot/chromium.gpu.fyi/Android FYI dEQP Release (Nexus 5X)" - category: "Android" - short_name: "dqp" + category: "Android|dqp|M64" + short_name: "N5X" + } + builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI 32 Vk Release (Nexus 5X)" + category: "Android|vk|O32" + short_name: "N5X" + } + builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI 64 Vk Release (Nexus 5X)" + category: "Android|vk|O64" + short_name: "N5X" } }
diff --git a/infra/config/global/luci-milo.cfg b/infra/config/global/luci-milo.cfg index 8f939c1..1b8a4b0 100644 --- a/infra/config/global/luci-milo.cfg +++ b/infra/config/global/luci-milo.cfg
@@ -1479,6 +1479,28 @@ } builders: { + name: "buildbucket/luci.chromium.ci/Android x64 Builder (dbg)" + category: "android|builder|debug|64" + short_name: "🐼" + } + builders: { + name: "buildbot/chromium.android/Android x64 Builder (dbg)" + category: "android|builder|debug|64" + short_name: "🐰" + } + + builders: { + name: "buildbucket/luci.chromium.ci/Android x86 Builder (dbg)" + category: "android|builder|debug|32" + short_name: "🐼" + } + builders: { + name: "buildbot/chromium.android/Android x86 Builder (dbg)" + category: "android|builder|debug|32" + short_name: "🐰" + } + + builders: { name: "buildbucket/luci.chromium.ci/Marshmallow 64 bit Tester" category: "android|tester|debug|phone|M" short_name: "🥪" @@ -1961,11 +1983,13 @@ } builders: { name: "buildbot/chromium.android/Android x86 Builder (dbg)" + name: "buildbucket/luci.chromium.ci/Android x86 Builder (dbg)" category: "builder|x86" short_name: "32" } builders: { name: "buildbot/chromium.android/Android x64 Builder (dbg)" + name: "buildbucket/luci.chromium.ci/Android x64 Builder (dbg)" category: "builder|x86" short_name: "64" } @@ -2668,7 +2692,7 @@ builders: { name: "buildbucket/luci.chromium.ci/linux-blink-heap-verification" category: "linux|blink" - short_name: "IM" + short_name: "VF" } builders: { name: "buildbot/chromium.fyi/Linux ARM" @@ -3169,39 +3193,49 @@ short_name: "tsn" } builders: { - name: "buildbot/chromium.gpu.fyi/Android FYI Release (NVIDIA Shield TV)" - category: "Android" - short_name: "nvi" - } - builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 5)" - category: "Android" + category: "Android|L32" short_name: "N5" } builders: { - name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 5X)" - category: "Android" - short_name: "N5X" - } - builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 6)" - category: "Android" + category: "Android|L32" short_name: "N6" } builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 5X)" + category: "Android|M64|QCOM" + short_name: "N5X" + } + builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 6P)" - category: "Android" + category: "Android|M64|QCOM" short_name: "N6P" } builders: { name: "buildbot/chromium.gpu.fyi/Android FYI Release (Nexus 9)" - category: "Android" + category: "Android|M64|NVDA" short_name: "N9" } builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI Release (NVIDIA Shield TV)" + category: "Android|N64|NVDA" + short_name: "STV" + } + builders: { name: "buildbot/chromium.gpu.fyi/Android FYI dEQP Release (Nexus 5X)" - category: "Android" - short_name: "dqp" + category: "Android|dqp|M64" + short_name: "N5X" + } + builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI 32 Vk Release (Nexus 5X)" + category: "Android|vk|O32" + short_name: "N5X" + } + builders: { + name: "buildbot/chromium.gpu.fyi/Android FYI 64 Vk Release (Nexus 5X)" + category: "Android|vk|O64" + short_name: "N5X" } } @@ -4572,6 +4606,73 @@ } consoles: { + id: "angle.try" + name: "angle.try" + repo_url: "https://chromium.googlesource.com/chromium/src" + ref: "refs/heads/master" + manifest_name: "REVISION" + header_id: "chromium" + + builders: { + name: "buildbucket/luci.chromium.try/android_angle_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/android_angle_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_compile_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_ozone_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/mac_angle_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/mac_angle_compile_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/mac_angle_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_compile_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_compile_x64_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_compile_x64_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_x64_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_x64_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_x64_rel_ng" + } +} + +consoles: { id: "luci.chromium.try" name: "luci.chromium.try" repo_url: "https://chromium.googlesource.com/chromium/src" @@ -4583,6 +4684,12 @@ name: "buildbucket/luci.chromium.try/android_arm64_dbg_recipe" } builders: { + name: "buildbucket/luci.chromium.try/android_angle_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/android_angle_rel_ng" + } + builders: { name: "buildbucket/luci.chromium.try/android_n5x_swarming_dbg" } builders: { @@ -4628,6 +4735,21 @@ name: "buildbucket/luci.chromium.try/linux_android_rel_ng" } builders: { + name: "buildbucket/luci.chromium.try/linux_angle_compile_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_ozone_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/linux_angle_rel_ng" + } + builders: { name: "buildbucket/luci.chromium.try/linux_arm" } builders: { @@ -4814,6 +4936,15 @@ name: "buildbucket/luci.chromium.try/ios-simulator-xcode-clang" } builders: { + name: "buildbucket/luci.chromium.try/mac_angle_compile_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/mac_angle_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/mac_angle_rel_ng" + } + builders: { name: "buildbucket/luci.chromium.try/mac_chromium_10.10_macviews" } builders: { @@ -4904,6 +5035,33 @@ name: "buildbucket/luci.chromium.try/win7_chromium_rel_loc_exp" } builders: { + name: "buildbucket/luci.chromium.try/win_angle_compile_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_compile_x64_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_compile_x64_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_x64_dbg_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_x64_deqp_rel_ng" + } + builders: { + name: "buildbucket/luci.chromium.try/win_angle_x64_rel_ng" + } + builders: { name: "buildbucket/luci.chromium.try/win_archive" } builders: {
diff --git a/infra/config/global/luci-scheduler.cfg b/infra/config/global/luci-scheduler.cfg index 20dbe4c..dd726f7 100644 --- a/infra/config/global/luci-scheduler.cfg +++ b/infra/config/global/luci-scheduler.cfg
@@ -53,6 +53,8 @@ # Android. Sorted alphabetically. triggers: "Android arm64 Builder (dbg)" + triggers: "Android x64 Builder (dbg)" + triggers: "Android x86 Builder (dbg)" # Linux. Sorted alphabetically. triggers: "Cast Linux" @@ -76,6 +78,13 @@ triggers: "WebKit Mac Builder (dbg)" # Windows. Sorted alphabetically. + triggers: "GPU FYI Win Builder" + triggers: "GPU FYI Win Builder (dbg)" + triggers: "GPU FYI Win Clang Builder (dbg)" + triggers: "GPU FYI Win dEQP Builder" + triggers: "GPU FYI Win x64 Builder" + triggers: "GPU FYI Win x64 Builder (dbg)" + triggers: "GPU FYI Win x64 dEQP Builder" triggers: "Win Builder" triggers: "Win Builder (dbg)" } @@ -110,6 +119,26 @@ } job { + id: "Android x64 Builder (dbg)" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Android x64 Builder (dbg)" + } +} + +job { + id: "Android x86 Builder (dbg)" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Android x86 Builder (dbg)" + } +} + +job { id: "Marshmallow 64 bit Tester" # triggered by "Android arm64 Builder (dbg)" acl_sets: "triggered-by-parent-builders" @@ -650,6 +679,219 @@ ################################################################################ job { + id: "GPU FYI Win Builder" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Win Builder" + } +} + +job { + id: "Win10 FYI Exp Release (NVIDIA)" + # Triggered by "GPU FYI Win Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win10 FYI Exp Release (NVIDIA)" + } +} + +job { + id: "Win10 FYI Release (Intel HD 630)" + # Triggered by "GPU FYI Win Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win10 FYI Release (Intel HD 630)" + } +} + +job { + id: "Win10 FYI Release (NVIDIA)" + # Triggered by "GPU FYI Win Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win10 FYI Release (NVIDIA)" + } +} + +job { + id: "Win7 FYI Release (AMD)" + # Triggered by "GPU FYI Win Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI Release (AMD)" + } +} + +job { + id: "Win7 FYI Release (NVIDIA)" + # Triggered by "GPU FYI Win Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI Release (NVIDIA)" + } +} + +job { + id: "GPU FYI Win Builder (dbg)" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Win Builder (dbg)" + } +} + +job { + id: "Win10 FYI Debug (NVIDIA)" + # Triggered by "GPU FYI Win Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win10 FYI Debug (NVIDIA)" + } +} + +job { + id: "Win7 FYI Debug (AMD)" + # Triggered by "GPU FYI Win Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI Debug (AMD)" + } +} + +job { + id: "Win7 FYI Debug (NVIDIA)" + # Triggered by "GPU FYI Win Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI Debug (NVIDIA)" + } +} + +job { + id: "GPU FYI Win Clang Builder (dbg)" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Win Clang Builder (dbg)" + } +} + +job { + id: "GPU FYI Win dEQP Builder" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Win dEQP Builder" + } +} + +job { + id: "Win10 FYI dEQP Release (NVIDIA)" + # Triggered by "GPU FYI Win dEQP Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win10 FYI dEQP Release (NVIDIA)" + } +} + +job { + id: "Win7 FYI dEQP Release (AMD)" + # Triggered by "GPU FYI Win dEQP Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI dEQP Release (AMD)" + } +} + +job { + id: "GPU FYI Win x64 Builder" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Win x64 Builder" + } +} + +job { + id: "Win7 FYI x64 Release (NVIDIA)" + # Triggered by "GPU FYI Win x64 Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI x64 Release (NVIDIA)" + } +} + +job { + id: "GPU FYI Win x64 Builder (dbg)" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Win x64 Builder (dbg)" + } +} + +job { + id: "Win7 FYI x64 Debug (NVIDIA)" + # Triggered by "GPU FYI Win x64 Builder (dbg)" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI x64 Debug (NVIDIA)" + } +} + +job { + id: "GPU FYI Win x64 dEQP Builder" + acl_sets: "default" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "GPU FYI Win x64 dEQP Builder" + } +} + +job { + id: "Win7 FYI x64 dEQP Release (NVIDIA)" + # Triggered by "GPU FYI Win x64 dEQP Builder" + acl_sets: "triggered-by-parent-builders" + buildbucket: { + server: "cr-buildbucket.appspot.com" + bucket: "luci.chromium.ci" + builder: "Win7 FYI x64 dEQP Release (NVIDIA)" + } +} + +job { id: "Win Builder (dbg)" acl_sets: "default" buildbucket: {
diff --git a/ios/chrome/browser/autofill/autofill_controller_js_unittest.mm b/ios/chrome/browser/autofill/autofill_controller_js_unittest.mm index f981dc9..5e00518 100644 --- a/ios/chrome/browser/autofill/autofill_controller_js_unittest.mm +++ b/ios/chrome/browser/autofill/autofill_controller_js_unittest.mm
@@ -788,8 +788,8 @@ size_t size_elements_with_true_expected); // Helper method that EXPECTs - // |__gCrWeb.autofill.webFormControlElementToFormField|. This method applies - // |__gCrWeb.autofill.webFormControlElementToFormField| on each element in + // |__gCrWeb.fill.webFormControlElementToFormField|. This method applies + // |__gCrWeb.fill.webFormControlElementToFormField| on each element in // |test_data| with all possible extract masks and verify the results. void TestWebFormControlElementToFormField(NSArray* test_data, NSString* tag_name); @@ -803,7 +803,7 @@ NSArray* test_data, NSString* tag_name); - // Helper method that EXPECTs |__gCrWeb.autofill.webFormElementToFormData| on + // Helper method that EXPECTs |__gCrWeb.fill.webFormElementToFormData| on // a form element obtained by |get_form_element_javascripts|. The results // are verified with |verifying_java_scripts|. void TestWebFormElementToFormDataForOneForm( @@ -812,7 +812,7 @@ NSString* expected_result, NSString* verifying_javascripts); - // EXPECTs |__gCrWeb.autofill.webFormElementToFormData| on all the test data. + // EXPECTs |__gCrWeb.fill.webFormElementToFormData| on all the test data. void TestWebFormElementToFormData(NSArray* test_items); // EXPECTs |__gCrWeb.autofill.extractNewForms| on |html|. @@ -887,7 +887,7 @@ }; TestExecutingBooleanJavaScriptOnElement( - @"__gCrWeb.autofill.hasTagName(%@, 'input')", elements_expecting_true, + @"__gCrWeb.fill.hasTagName(%@, 'input')", elements_expecting_true, arraysize(elements_expecting_true)); } @@ -895,30 +895,29 @@ LoadHtml(@"<html><body></body></html>"); EXPECT_NSEQ(@"foobar", ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace('" + @"__gCrWeb.fill.combineAndCollapseWhitespace('" @"foo', 'bar', false)")); EXPECT_NSEQ(@"foo bar", ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace(" + @"__gCrWeb.fill.combineAndCollapseWhitespace(" @"'foo', 'bar', true)")); EXPECT_NSEQ(@"foo bar", ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace(" + @"__gCrWeb.fill.combineAndCollapseWhitespace(" "'foo ', 'bar', false)")); EXPECT_NSEQ(@"foo bar", ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace(" + @"__gCrWeb.fill.combineAndCollapseWhitespace(" "'foo', ' bar', false)")); EXPECT_NSEQ(@"foo bar", ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace(" + @"__gCrWeb.fill.combineAndCollapseWhitespace(" "'foo', ' bar', true)")); EXPECT_NSEQ(@"foo bar", ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace(" + @"__gCrWeb.fill.combineAndCollapseWhitespace(" "'foo ', ' bar', false)")); EXPECT_NSEQ(@"foobar ", ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace(" + @"__gCrWeb.fill.combineAndCollapseWhitespace(" "'foo', 'bar ', false)")); - EXPECT_NSEQ(@" foo bar", - ExecuteJavaScriptWithFormat( - @"__gCrWeb.autofill.combineAndCollapseWhitespace(" - "' foo', 'bar', true)")); + EXPECT_NSEQ(@" foo bar", ExecuteJavaScriptWithFormat( + @"__gCrWeb.fill.combineAndCollapseWhitespace(" + "' foo', 'bar', true)")); } void AutofillControllerJsTest::TestInputElementDataEvaluation( @@ -943,86 +942,86 @@ TEST_F(AutofillControllerJsTest, InferLabelFromPrevious) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromPrevious", @"label", + @"__gCrWeb.fill.inferLabelFromPrevious", @"label", GetTestFormInputElementWithLabelFromPrevious(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromPreviousSpan) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromPrevious", @"label", + @"__gCrWeb.fill.inferLabelFromPrevious", @"label", GetTestFormInputElementWithLabelFromPreviousSpan(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromPreviousParagraph) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromPrevious", @"label", + @"__gCrWeb.fill.inferLabelFromPrevious", @"label", GetTestFormInputElementWithLabelFromPreviousParagraph(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromPreviousLabel) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromPrevious", @"label", + @"__gCrWeb.fill.inferLabelFromPrevious", @"label", GetTestFormInputElementWithLabelFromPreviousLabel(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromPreviousLabelOtherIgnored) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromPrevious", @"label", + @"__gCrWeb.fill.inferLabelFromPrevious", @"label", GetTestFormInputElementWithLabelFromPreviousLabelOtherIgnored(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromEnclosingLabelBefore) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromEnclosingLabel", @"label", + @"__gCrWeb.fill.inferLabelFromEnclosingLabel", @"label", GetTestFormInputElementWithLabelFromEnclosingLabelBefore(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromPreviousTextBrAndSpan) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromPrevious", @"label", + @"__gCrWeb.fill.inferLabelFromPrevious", @"label", GetTestFormInputElementWithLabelFromPreviousTextBrAndSpan(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromListItem) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromListItem", @"label", + @"__gCrWeb.fill.inferLabelFromListItem", @"label", GetTestFormInputElementWithLabelFromListItem(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromTableColumnTD) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromTableColumn", @"label", + @"__gCrWeb.fill.inferLabelFromTableColumn", @"label", GetTestFormInputElementWithLabelFromTableColumnTD(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromTableColumnTH) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromTableColumn", @"label", + @"__gCrWeb.fill.inferLabelFromTableColumn", @"label", GetTestFormInputElementWithLabelFromTableColumnTH(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromTableColumnNested) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromTableColumn", @"label", + @"__gCrWeb.fill.inferLabelFromTableColumn", @"label", GetTestFormInputElementWithLabelFromTableNested(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromTableRow) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromTableRow", @"label", + @"__gCrWeb.fill.inferLabelFromTableRow", @"label", GetTestFormInputElementWithLabelFromTableRow(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromDivTable) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromDivTable", @"label", + @"__gCrWeb.fill.inferLabelFromDivTable", @"label", GetTestFormInputElementWithLabelFromDivTable(), @"input"); } TEST_F(AutofillControllerJsTest, InferLabelFromDefinitionList) { TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelFromDefinitionList", @"label", + @"__gCrWeb.fill.inferLabelFromDefinitionList", @"label", GetTestFormInputElementWithLabelFromDefinitionList(), @"input"); } @@ -1046,16 +1045,16 @@ GetTestInputCheckbox() ]; for (NSArray* testingElement in testingElements) { - TestInputElementDataEvaluation(@"__gCrWeb.autofill.inferLabelForElement", + TestInputElementDataEvaluation(@"__gCrWeb.fill.inferLabelForElement", @"label", testingElement, @"input"); } - TestInputElementDataEvaluation(@"__gCrWeb.autofill.inferLabelForElement", + TestInputElementDataEvaluation(@"__gCrWeb.fill.inferLabelForElement", @"label", GetTestFormSelectElement(), @"select"); TestInputElementDataEvaluation( - @"__gCrWeb.autofill.inferLabelForElement", @"label", + @"__gCrWeb.fill.inferLabelForElement", @"label", GetTestFormSelectElementWithOptgroup(), @"select"); } @@ -1072,7 +1071,7 @@ }; TestExecutingBooleanJavaScriptOnElement( - @"__gCrWeb.autofill.isAutofillableElement(%@)", elements_expecting_true, + @"__gCrWeb.fill.isAutofillableElement(%@)", elements_expecting_true, arraysize(elements_expecting_true)); } @@ -1083,7 +1082,7 @@ LoadHtml(kHTMLForTestingElements); ExecuteJavaScriptOnElementsAndCheck( @"var field = {};" - "__gCrWeb.autofill.getOptionStringsFromElement(%@, field);" + "__gCrWeb.fill.getOptionStringsFromElement(%@, field);" "__gCrWeb.stringify(field);", GetElementsByNameJavaScripts(testing_elements, arraysize(testing_elements)), @@ -1177,7 +1176,7 @@ {"pwd", 0, -1}, }; - TestExecutingBooleanJavaScriptOnElement(@"__gCrWeb.autofill.isTextInput(%@)", + TestExecutingBooleanJavaScriptOnElement(@"__gCrWeb.fill.isTextInput(%@)", elements_expecting_true, arraysize(elements_expecting_true)); } @@ -1187,9 +1186,9 @@ {"state", 0, -1}, {"course", 0, -1}, }; - TestExecutingBooleanJavaScriptOnElement( - @"__gCrWeb.autofill.isSelectElement(%@)", elements_expecting_true, - arraysize(elements_expecting_true)); + TestExecutingBooleanJavaScriptOnElement(@"__gCrWeb.fill.isSelectElement(%@)", + elements_expecting_true, + arraysize(elements_expecting_true)); } TEST_F(AutofillControllerJsTest, IsCheckableElement) { @@ -1199,7 +1198,7 @@ }; TestExecutingBooleanJavaScriptOnElement( - @"__gCrWeb.autofill.isCheckableElement(%@)", elements_expecting_true, + @"__gCrWeb.fill.isCheckableElement(%@)", elements_expecting_true, arraysize(elements_expecting_true)); } @@ -1215,8 +1214,8 @@ }; TestExecutingBooleanJavaScriptOnElement( - @"__gCrWeb.autofill.isAutofillableInputElement(%@)", - elements_expecting_true, arraysize(elements_expecting_true)); + @"__gCrWeb.fill.isAutofillableInputElement(%@)", elements_expecting_true, + arraysize(elements_expecting_true)); } TEST_F(AutofillControllerJsTest, ExtractAutofillableElements) { @@ -1269,7 +1268,7 @@ EXPECT_NSEQ(@YES, ExecuteJavaScriptWithFormat( @"%@; var field = {};" - "__gCrWeb.autofill.webFormControlElementToFormField(" + "__gCrWeb.fill.webFormControlElementToFormField(" " element, %u, field);" "%@", get_element_to_test, extract_mask, verifying_javascripts)) @@ -1280,7 +1279,7 @@ "expected to be verified by %@", ExecuteJavaScriptWithFormat( @"%@; var field = {};" - "__gCrWeb.autofill.webFormControlElementToFormField(" + "__gCrWeb.fill.webFormControlElementToFormField(" " element, %u, field);__gCrWeb.stringify(field);", get_element_to_test, extract_mask), verifying_javascripts]); @@ -1323,7 +1322,7 @@ NSString* verifying_javascripts) { NSString* actual = ExecuteJavaScriptWithFormat( @"var form={}; var field={};" - "(__gCrWeb.autofill.webFormElementToFormData(" + "(__gCrWeb.fill.webFormElementToFormData(" "window, %@, null, %" PRIuNS ", form, field) === %@) && %@", get_form_element_javascripts, extract_mask, expected_result, verifying_javascripts); @@ -1332,7 +1331,7 @@ stringWithFormat:@"Actual:\n%@; expected to be verifyied by\n%@", ExecuteJavaScriptWithFormat( @"var form={};" - "__gCrWeb.autofill." + "__gCrWeb.fill." "webFormElementToFormData(window, %@, null," "%" PRIuNS ", form, null);" "__gCrWeb.stringify(form);", @@ -1404,7 +1403,7 @@ TEST_F(AutofillControllerJsTest, WebFormElementToFormDataTooManyFields) { NSString* html_fragment = @"<FORM name='Test' action='http://c.com'>"; // In autofill_controller.js, the maximum number of parsable element is 200 - // (__gCrWeb.autofill.MAX_PARSEABLE_FIELDS = 200). Here an HTML page with 201 + // (__gCrWeb.fill.MAX_PARSEABLE_FIELDS = 200). Here an HTML page with 201 // elements is generated for testing. for (NSUInteger index = 0; index < 201; ++index) { html_fragment =
diff --git a/ios/chrome/browser/ios_chrome_main_parts.h b/ios/chrome/browser/ios_chrome_main_parts.h index 9461ce8..d3bb1eef 100644 --- a/ios/chrome/browser/ios_chrome_main_parts.h +++ b/ios/chrome/browser/ios_chrome_main_parts.h
@@ -16,10 +16,6 @@ class ApplicationContextImpl; class PrefService; -namespace ios { -class FieldTrialSynchronizer; -} - class IOSChromeMainParts : public web::WebMainParts { public: explicit IOSChromeMainParts(const base::CommandLine& parsed_command_line); @@ -54,9 +50,6 @@ PrefService* local_state_; - // Initialized in SetupMetricsAndFieldTrials. - std::unique_ptr<ios::FieldTrialSynchronizer> field_trial_synchronizer_; - IOSChromeFieldTrials ios_field_trials_; DISALLOW_COPY_AND_ASSIGN(IOSChromeMainParts);
diff --git a/ios/chrome/browser/ios_chrome_main_parts.mm b/ios/chrome/browser/ios_chrome_main_parts.mm index c3634c7..7331d434 100644 --- a/ios/chrome/browser/ios_chrome_main_parts.mm +++ b/ios/chrome/browser/ios_chrome_main_parts.mm
@@ -27,6 +27,8 @@ #include "components/translate/core/browser/translate_download_manager.h" #include "components/variations/field_trial_config/field_trial_util.h" #include "components/variations/service/variations_service.h" +#include "components/variations/synthetic_trials_active_group_id_provider.h" +#include "components/variations/variations_crash_keys.h" #include "components/variations/variations_http_header_provider.h" #include "ios/chrome/browser/about_flags.h" #include "ios/chrome/browser/application_context_impl.h" @@ -36,7 +38,6 @@ #include "ios/chrome/browser/chrome_paths.h" #import "ios/chrome/browser/first_run/first_run.h" #include "ios/chrome/browser/install_time_util.h" -#include "ios/chrome/browser/metrics/field_trial_synchronizer.h" #include "ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.h" #include "ios/chrome/browser/pref_names.h" #include "ios/chrome/browser/translate/translate_service_ios.h" @@ -126,8 +127,7 @@ // initialization is handled in PreMainMessageLoopRun since it posts tasks. SetupFieldTrials(); - // Initialize FieldTrialSynchronizer system. - field_trial_synchronizer_.reset(new ios::FieldTrialSynchronizer); + variations::InitCrashKeys(); application_context_->PreCreateThreads(); } @@ -236,6 +236,8 @@ metrics::MetricsService* metrics = application_context_->GetMetricsService(); metrics->synthetic_trial_registry()->AddSyntheticTrialObserver( variations::VariationsHttpHeaderProvider::GetInstance()); + metrics->synthetic_trial_registry()->AddSyntheticTrialObserver( + variations::SyntheticTrialsActiveGroupIdProvider::GetInstance()); // Now that field trials have been created, initializes metrics recording. metrics->InitializeMetricsRecordingState(); }
diff --git a/ios/chrome/browser/mailto/features.mm b/ios/chrome/browser/mailto/features.mm index c1c403e..06ab1d1 100644 --- a/ios/chrome/browser/mailto/features.mm +++ b/ios/chrome/browser/mailto/features.mm
@@ -9,4 +9,4 @@ #endif const base::Feature kMailtoHandledWithGoogleUI{ - "kMailtoHandledWithGoogleUI", base::FEATURE_DISABLED_BY_DEFAULT}; + "kMailtoHandledWithGoogleUI", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/ios/chrome/browser/memory/memory_metrics.cc b/ios/chrome/browser/memory/memory_metrics.cc index 43bf6874..229b4162 100644 --- a/ios/chrome/browser/memory/memory_metrics.cc +++ b/ios/chrome/browser/memory/memory_metrics.cc
@@ -5,6 +5,7 @@ #include "ios/chrome/browser/memory/memory_metrics.h" #include <mach/mach.h> +#include <mach/task.h> #include <stddef.h> #include <stdint.h> @@ -47,10 +48,15 @@ } uint64_t GetRealMemoryUsedInBytes() { - base::ProcessHandle process_handle = base::GetCurrentProcessHandle(); - std::unique_ptr<base::ProcessMetrics> process_metrics( - base::ProcessMetrics::CreateProcessMetrics(process_handle)); - return static_cast<uint64_t>(process_metrics->GetWorkingSetSize()); + task_vm_info task_info_data; + mach_msg_type_number_t count = sizeof(task_vm_info) / sizeof(natural_t); + kern_return_t kr = + task_info(mach_task_self(), TASK_VM_INFO, + reinterpret_cast<task_info_t>(&task_info_data), &count); + if (kr != KERN_SUCCESS) + return 0; + + return task_info_data.resident_size - task_info_data.reusable; } uint64_t GetDirtyVMBytes() {
diff --git a/ios/chrome/browser/metrics/BUILD.gn b/ios/chrome/browser/metrics/BUILD.gn index ce718dd..bf6f7f2 100644 --- a/ios/chrome/browser/metrics/BUILD.gn +++ b/ios/chrome/browser/metrics/BUILD.gn
@@ -5,8 +5,6 @@ source_set("metrics") { configs += [ "//build/config/compiler:enable_arc" ] sources = [ - "field_trial_synchronizer.cc", - "field_trial_synchronizer.h", "incognito_web_state_observer.h", "incognito_web_state_observer.mm", "ios_chrome_metrics_service_accessor.cc",
diff --git a/ios/chrome/browser/metrics/field_trial_synchronizer.cc b/ios/chrome/browser/metrics/field_trial_synchronizer.cc deleted file mode 100644 index f1e1904..0000000 --- a/ios/chrome/browser/metrics/field_trial_synchronizer.cc +++ /dev/null
@@ -1,34 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ios/chrome/browser/metrics/field_trial_synchronizer.h" - -#include <vector> - -#include "base/logging.h" -#include "components/variations/variations_util.h" - -namespace ios { - -FieldTrialSynchronizer::FieldTrialSynchronizer() { - base::FieldTrialList::AddObserver(this); - SynchronizeCrashKeyExperimentList(); -} - -FieldTrialSynchronizer::~FieldTrialSynchronizer() { - base::FieldTrialList::RemoveObserver(this); -} - -void FieldTrialSynchronizer::OnFieldTrialGroupFinalized( - const std::string& field_trial_name, - const std::string& group_name) { - CHECK(!field_trial_name.empty() && !group_name.empty()); - SynchronizeCrashKeyExperimentList(); -} - -void FieldTrialSynchronizer::SynchronizeCrashKeyExperimentList() { - variations::SetVariationListCrashKeys(); -} - -} // namespace ios
diff --git a/ios/chrome/browser/metrics/field_trial_synchronizer.h b/ios/chrome/browser/metrics/field_trial_synchronizer.h deleted file mode 100644 index 8e47326..0000000 --- a/ios/chrome/browser/metrics/field_trial_synchronizer.h +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ -#define IOS_CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_ - -#include <string> - -#include "base/macros.h" -#include "base/metrics/field_trial.h" - -namespace ios { - -// FieldTrialSynchronizer registers itself as an observer of FieldTrialList -// and update the list of experiment reported to in the crashes by setting -// the corresponding crash key. -class FieldTrialSynchronizer : public base::FieldTrialList::Observer { - public: - FieldTrialSynchronizer(); - ~FieldTrialSynchronizer() override; - - private: - // base::FieldTrialList::Observer implementation. - void OnFieldTrialGroupFinalized(const std::string& field_trial_name, - const std::string& group_name) override; - - // Synchronizes the list of experiments into the crash keys. Called on - // creation and when the list of field trial changes. - void SynchronizeCrashKeyExperimentList(); - - DISALLOW_COPY_AND_ASSIGN(FieldTrialSynchronizer); -}; - -} // namespace ios - -#endif // IOS_CHROME_BROWSER_METRICS_FIELD_TRIAL_SYNCHRONIZER_H_
diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm index 9907b85..92227cb 100644 --- a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm +++ b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.mm
@@ -231,11 +231,17 @@ // shared between the iOS port's usage and // ChromeMetricsServiceClient::CollectFinalHistograms()'s usage of // MetricsMemoryDetails. - std::unique_ptr<base::ProcessMetrics> process_metrics( - base::ProcessMetrics::CreateProcessMetrics( - base::GetCurrentProcessHandle())); - UMA_HISTOGRAM_MEMORY_KB("Memory.Browser", - process_metrics->GetWorkingSetSize() / 1024); + task_vm_info task_info_data; + mach_msg_type_number_t count = sizeof(task_vm_info) / sizeof(natural_t); + kern_return_t kr = + task_info(mach_task_self(), TASK_VM_INFO, + reinterpret_cast<task_info_t>(&task_info_data), &count); + if (kr == KERN_SUCCESS) { + UMA_HISTOGRAM_MEMORY_KB( + "Memory.Browser", + (task_info_data.resident_size - task_info_data.reusable) / 1024); + } + collect_final_metrics_done_callback_.Run(); }
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm index 4c681905..65724be 100644 --- a/ios/chrome/browser/passwords/password_controller.mm +++ b/ios/chrome/browser/passwords/password_controller.mm
@@ -667,6 +667,8 @@ // on the loaded page. passwordManager_->OnPasswordFormsParsed(passwordManagerDriver_.get(), forms); + } else { + [self onNoSavedCredentials]; } // Invoke the password manager callback to check if password was // accepted or rejected. If accepted, infobar is presented. If
diff --git a/ios/chrome/browser/passwords/password_controller_unittest.mm b/ios/chrome/browser/passwords/password_controller_unittest.mm index 9e2e4a6..8e7dc81 100644 --- a/ios/chrome/browser/passwords/password_controller_unittest.mm +++ b/ios/chrome/browser/passwords/password_controller_unittest.mm
@@ -1712,3 +1712,31 @@ EXPECT_FALSE(completion_handler_success); } + +// Tests that when there are no password forms on a page and the user clicks on +// a text field the completion callback is called with no suggestions result. +TEST_F(PasswordControllerTest, CheckNoAsyncSuggestionsOnNoPasswordForms) { + LoadHtml(kHtmlWithoutPasswordForm); + + __block BOOL completion_handler_success = NO; + __block BOOL completion_handler_called = NO; + + EXPECT_CALL(*store_, GetLogins(_, _)).Times(0); + [passwordController_ checkIfSuggestionsAvailableForForm:@"form" + field:@"address" + fieldType:@"text" + type:@"focus" + typedValue:@"" + isMainFrame:YES + webState:web_state() + completionHandler:^(BOOL success) { + completion_handler_success = success; + completion_handler_called = YES; + }]; + // Wait until the expected handler is called. + EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForActionTimeout, ^bool() { + return completion_handler_called; + })); + + EXPECT_FALSE(completion_handler_success); +}
diff --git a/ios/chrome/browser/providers/images/chromium_branded_image_provider.h b/ios/chrome/browser/providers/images/chromium_branded_image_provider.h index 6f25ca9f..453c7c6 100644 --- a/ios/chrome/browser/providers/images/chromium_branded_image_provider.h +++ b/ios/chrome/browser/providers/images/chromium_branded_image_provider.h
@@ -18,7 +18,6 @@ UIImage* GetClearBrowsingDataSiteDataImage() override; UIImage* GetSigninConfirmationSyncSettingsImage() override; UIImage* GetSigninConfirmationPersonalizeServicesImage() override; - bool GetToolbarVoiceSearchButtonImageId(int* image_id) override; NSArray<UIImage*>* GetToolbarVoiceSearchButtonImages(bool incognito) override; UIImage* GetWhatsNewIconImage(WhatsNewIcon type) override; UIImage* GetToolbarSearchButtonImage(SearchEngineIcon type) override;
diff --git a/ios/chrome/browser/providers/images/chromium_branded_image_provider.mm b/ios/chrome/browser/providers/images/chromium_branded_image_provider.mm index 48d199e..cf48d751 100644 --- a/ios/chrome/browser/providers/images/chromium_branded_image_provider.mm +++ b/ios/chrome/browser/providers/images/chromium_branded_image_provider.mm
@@ -45,11 +45,6 @@ return rb.GetNativeImageNamed(IDR_IOS_SETTINGS_INFO_24).ToUIImage(); } -bool ChromiumBrandedImageProvider::GetToolbarVoiceSearchButtonImageId( - int* image_id) { - return false; -} - NSArray<UIImage*>* ChromiumBrandedImageProvider::GetToolbarVoiceSearchButtonImages( bool incognito) {
diff --git a/ios/chrome/browser/ui/fullscreen/BUILD.gn b/ios/chrome/browser/ui/fullscreen/BUILD.gn index a39a6212..ad2d5ba 100644 --- a/ios/chrome/browser/ui/fullscreen/BUILD.gn +++ b/ios/chrome/browser/ui/fullscreen/BUILD.gn
@@ -99,6 +99,7 @@ deps = [ "//base", + "//ios/chrome/browser/ui/util", "//ios/chrome/common:timing", "//ui/gfx/geometry", ]
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_animator.h b/ios/chrome/browser/ui/fullscreen/fullscreen_animator.h index 7172ef2..e18bfcf 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_animator.h +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_animator.h
@@ -5,12 +5,12 @@ #ifndef IOS_CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_ANIMATOR_H_ #define IOS_CHROME_BROWSER_UI_FULLSCREEN_FULLSCREEN_ANIMATOR_H_ -#import <UIKit/UIKit.h> +#import "ios/chrome/browser/ui/util/optional_property_animator.h" // Helper object for animating changes to fullscreen progress. Subclasses of // this object are provided to FullscreenControllerObservers to coordinate // animations across several different ojects. -@interface FullscreenAnimator : UIViewPropertyAnimator +@interface FullscreenAnimator : OptionalPropertyAnimator // The progress value at the start of the animation. @property(nonatomic, readonly) CGFloat startProgress;
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.h b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.h index 6961fe0..76ea02b 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.h +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.h
@@ -56,6 +56,11 @@ // completion block. void SetUpAnimator(__strong FullscreenAnimator** animator); + // Starts |animator| if it has animations to run. |animator| is expected to + // be a pointer to a data member of this object, and will be reset when + // attempting to start an animator without any animation blocks. + void StartAnimator(__strong FullscreenAnimator** animator); + // Stops the current scroll end animation if one is in progress. If // |update_model| is true, the FullscreenModel will be updated with the active // animator's current progress value. @@ -67,6 +72,10 @@ // animator before deallocation. void StopAnimator(__strong FullscreenAnimator** animator, bool update_model); + // Checks whether |animator| is a valid pointer to one of the three animator + // data members of this class. No-op for non-debug builds. + void VerifyAnimatorPointer(__strong FullscreenAnimator** animator) const; + // The controller. FullscreenController* controller_ = nullptr; // The model.
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm index e098a02..0da0e8c 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_mediator.mm
@@ -41,7 +41,7 @@ for (auto& observer : observers_) { observer.FullscreenWillScrollToTop(controller_, scroll_to_top_animator_); } - [scroll_to_top_animator_ startAnimation]; + StartAnimator(&scroll_to_top_animator_); } void FullscreenMediator::WillEnterForeground() { @@ -53,7 +53,7 @@ for (auto& observer : observers_) { observer.FullscreenWillEnterForeground(controller_, foreground_animator_); } - [foreground_animator_ startAnimation]; + StartAnimator(&foreground_animator_); } void FullscreenMediator::Disconnect() { @@ -103,7 +103,7 @@ for (auto& observer : observers_) { observer.FullscreenScrollEventEnded(controller_, scroll_end_animator_); } - [scroll_end_animator_ startAnimation]; + StartAnimator(&scroll_end_animator_); } void FullscreenMediator::FullscreenModelWasReset(FullscreenModel* model) { @@ -118,11 +118,7 @@ } void FullscreenMediator::SetUpAnimator(__strong FullscreenAnimator** animator) { - DCHECK(animator); - DCHECK(*animator); - DCHECK(*animator == scroll_end_animator_ || - *animator == scroll_to_top_animator_ || - *animator == foreground_animator_); + VerifyAnimatorPointer(animator); [*animator addCompletion:^(UIViewAnimatingPosition finalPosition) { DCHECK_EQ(finalPosition, UIViewAnimatingPositionEnd); model_->AnimationEndedWithProgress( @@ -131,6 +127,17 @@ }]; } +void FullscreenMediator::StartAnimator(__strong FullscreenAnimator** animator) { + // Start the animator if animations have been added to it, or reset the ivar + // otherwise. + VerifyAnimatorPointer(animator); + if ((*animator).hasAnimations) { + [*animator startAnimation]; + } else { + *animator = nil; + } +} + void FullscreenMediator::StopAnimating(bool update_model) { if (!scroll_end_animator_ && !scroll_to_top_animator_ && !foreground_animator_) { @@ -152,14 +159,19 @@ void FullscreenMediator::StopAnimator(__strong FullscreenAnimator** animator, bool update_model) { - DCHECK(animator); - DCHECK(*animator); - DCHECK(*animator == scroll_end_animator_ || - *animator == scroll_to_top_animator_ || - *animator == foreground_animator_); + VerifyAnimatorPointer(animator); DCHECK_EQ((*animator).state, UIViewAnimatingStateActive); if (update_model) model_->AnimationEndedWithProgress((*animator).currentProgress); [*animator stopAnimation:YES]; *animator = nil; } + +void FullscreenMediator::VerifyAnimatorPointer( + __strong FullscreenAnimator** animator) const { + DCHECK(animator); + DCHECK(*animator); + DCHECK(*animator == scroll_end_animator_ || + *animator == scroll_to_top_animator_ || + *animator == foreground_animator_); +}
diff --git a/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm b/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm index 0544824..34c379b 100644 --- a/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm +++ b/ios/chrome/browser/ui/side_swipe/card_side_swipe_view.mm
@@ -59,6 +59,7 @@ @implementation SwipeView { UIImageView* _image; + // TODO(crbug.com/800266): Remove the shadow. UIImageView* _shadowView; } @@ -83,9 +84,11 @@ _bottomToolbarSnapshot = [[UIImageView alloc] initWithFrame:CGRectZero]; [self addSubview:_bottomToolbarSnapshot]; - _shadowView = [[UIImageView alloc] initWithFrame:self.bounds]; - [_shadowView setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)]; - [self addSubview:_shadowView]; + if (!IsUIRefreshPhase1Enabled()) { + _shadowView = [[UIImageView alloc] initWithFrame:self.bounds]; + [_shadowView setImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)]; + [self addSubview:_shadowView]; + } // All subviews are as wide as the parent NSMutableArray* constraints = [NSMutableArray array]; @@ -106,15 +109,20 @@ constant:topMargin], [[_image bottomAnchor] constraintEqualToAnchor:self.bottomAnchor], _toolbarTopConstraint, - [[_shadowView topAnchor] constraintEqualToAnchor:self.topAnchor - constant:topMargin], - [[_shadowView heightAnchor] - constraintEqualToConstant:kNewTabPageShadowHeight], [_bottomToolbarSnapshot.bottomAnchor constraintEqualToAnchor:self.bottomAnchor], ]]; [NSLayoutConstraint activateConstraints:constraints]; + + if (!IsUIRefreshPhase1Enabled()) { + [NSLayoutConstraint activateConstraints:@[ + [[_shadowView topAnchor] constraintEqualToAnchor:self.topAnchor + constant:topMargin], + [[_shadowView heightAnchor] + constraintEqualToConstant:kNewTabPageShadowHeight], + ]]; + } } return self; }
diff --git a/ios/chrome/browser/ui/tab_grid/BUILD.gn b/ios/chrome/browser/ui/tab_grid/BUILD.gn index 01cf67c1..f6801046 100644 --- a/ios/chrome/browser/ui/tab_grid/BUILD.gn +++ b/ios/chrome/browser/ui/tab_grid/BUILD.gn
@@ -69,6 +69,7 @@ deps = [ "//base", "//ios/chrome/app/strings", + "//ios/chrome/browser", "//ios/chrome/browser/ui/tab_grid/transitions", "//ios/chrome/browser/ui/util:constraints_ui", "//ui/base",
diff --git a/ios/chrome/browser/ui/tab_grid/grid_cell.h b/ios/chrome/browser/ui/tab_grid/grid_cell.h index 73fa1b3a..0399e21 100644 --- a/ios/chrome/browser/ui/tab_grid/grid_cell.h +++ b/ios/chrome/browser/ui/tab_grid/grid_cell.h
@@ -11,9 +11,6 @@ @class GridCell; -// The accessibility label for the close button for use in test automation. -extern NSString* const kGridCellCloseButtonAccessibilityID; - // Informs the receiver of actions on the cell. @protocol GridCellDelegate - (void)closeButtonTappedForCell:(GridCell*)cell;
diff --git a/ios/chrome/browser/ui/tab_grid/grid_cell.mm b/ios/chrome/browser/ui/tab_grid/grid_cell.mm index 102a7ba..86db00e 100644 --- a/ios/chrome/browser/ui/tab_grid/grid_cell.mm +++ b/ios/chrome/browser/ui/tab_grid/grid_cell.mm
@@ -5,6 +5,7 @@ #import "ios/chrome/browser/ui/tab_grid/grid_cell.h" #import "base/logging.h" +#import "ios/chrome/browser/ui/tab_grid/grid_constants.h" #import "ios/chrome/browser/ui/tab_grid/top_aligned_image_view.h" #include "ios/chrome/grit/ios_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -13,9 +14,6 @@ #error "This file requires ARC support." #endif -NSString* const kGridCellCloseButtonAccessibilityID = - @"GridCellCloseButtonAccessibilityID"; - namespace { // Height of the top bar containing the icon, title, and close button. const CGFloat kTopBarHeight = 28.0f; @@ -205,7 +203,7 @@ [closeButton addTarget:self action:@selector(closeButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; - closeButton.accessibilityIdentifier = kGridCellCloseButtonAccessibilityID; + closeButton.accessibilityIdentifier = kGridCellCloseButtonIdentifier; [topBar addSubview:iconView]; [topBar addSubview:titleLabel];
diff --git a/ios/chrome/browser/ui/tab_grid/grid_constants.h b/ios/chrome/browser/ui/tab_grid/grid_constants.h index 10126be..2b692a8 100644 --- a/ios/chrome/browser/ui/tab_grid/grid_constants.h +++ b/ios/chrome/browser/ui/tab_grid/grid_constants.h
@@ -13,4 +13,7 @@ // index]. extern NSString* const kGridCellIdentifierPrefix; +// Accessibility identifier for the close button in a grid cell. +extern NSString* const kGridCellCloseButtonIdentifier; + #endif // IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/tab_grid/grid_constants.mm b/ios/chrome/browser/ui/tab_grid/grid_constants.mm index 99a9aece..4094fde 100644 --- a/ios/chrome/browser/ui/tab_grid/grid_constants.mm +++ b/ios/chrome/browser/ui/tab_grid/grid_constants.mm
@@ -10,3 +10,7 @@ // Accessibility identifier prefix of a grid cell. NSString* const kGridCellIdentifierPrefix = @"GridCellIdentifierPrefix"; + +// Accessibility identifier for the close button in a grid cell. +NSString* const kGridCellCloseButtonIdentifier = + @"GridCellCloseButtonIdentifier";
diff --git a/ios/chrome/browser/ui/tab_grid/grid_view_controller.h b/ios/chrome/browser/ui/tab_grid/grid_view_controller.h index dd20a27..f34e714 100644 --- a/ios/chrome/browser/ui/tab_grid/grid_view_controller.h +++ b/ios/chrome/browser/ui/tab_grid/grid_view_controller.h
@@ -23,12 +23,22 @@ // |gridViewController|. - (void)gridViewController:(GridViewController*)gridViewController didCloseItemAtIndex:(NSUInteger)index; +// Tells the receiver that the last item was closed in |gridViewController|. +- (void)lastItemWasClosedInGridViewController: + (GridViewController*)gridViewController; +// Tells the receiver that the first item was added in |gridViewController|. +- (void)firstItemWasAddedInGridViewController: + (GridViewController*)gridViewController; @end // A view controller that contains a grid of items. @interface GridViewController : UIViewController<GridConsumer> // The gridView is accessible to manage the content inset behavior. @property(nonatomic, readonly) UIScrollView* gridView; +// The view that is shown when there are no items. +@property(nonatomic, strong) UIView* emptyStateView; +// Returns YES if the grid has no items. +@property(nonatomic, readonly, getter=isGridEmpty) BOOL gridEmpty; // The visual look of the grid. @property(nonatomic, assign) GridTheme theme; // Delegate is informed of user interactions in the grid UI.
diff --git a/ios/chrome/browser/ui/tab_grid/grid_view_controller.mm b/ios/chrome/browser/ui/tab_grid/grid_view_controller.mm index b5e6f9a9..3f9a9e53 100644 --- a/ios/chrome/browser/ui/tab_grid/grid_view_controller.mm +++ b/ios/chrome/browser/ui/tab_grid/grid_view_controller.mm
@@ -7,6 +7,7 @@ #import "base/ios/block_types.h" #import "base/mac/foundation_util.h" #import "base/numerics/safe_conversions.h" +#include "ios/chrome/browser/procedural_block_types.h" #import "ios/chrome/browser/ui/tab_grid/grid_cell.h" #import "ios/chrome/browser/ui/tab_grid/grid_constants.h" #import "ios/chrome/browser/ui/tab_grid/grid_image_data_source.h" @@ -75,6 +76,7 @@ - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.collectionView reloadData]; + self.collectionView.backgroundView.hidden = (self.items.count > 0); // Selection is invalid if there are no items. if (self.items.count == 0) return; @@ -89,6 +91,21 @@ return self.collectionView; } +- (void)setEmptyStateView:(UIView*)emptyStateView { + self.collectionView.backgroundView = emptyStateView; + // The emptyStateView is hidden when there are items, and shown when the + // collectionView is empty. + self.collectionView.backgroundView.hidden = (self.items.count > 0); +} + +- (UIView*)emptyStateView { + return self.collectionView.backgroundView; +} + +- (BOOL)isGridEmpty { + return self.items.count == 0; +} + #pragma mark - UICollectionViewDataSource - (NSInteger)collectionView:(UICollectionView*)collectionView @@ -167,13 +184,20 @@ } ProceduralBlock performAllUpdates = ^{ performDataSourceUpdates(); + self.collectionView.backgroundView.hidden = YES; [self.collectionView insertItemsAtIndexPaths:@[ CreateIndexPath(index) ]]; [self.collectionView selectItemAtIndexPath:CreateIndexPath(selectedIndex) animated:YES scrollPosition:UICollectionViewScrollPositionNone]; }; - [self.collectionView performBatchUpdates:performAllUpdates completion:nil]; + ProceduralBlockWithBool completion = ^(BOOL finished) { + if (self.items.count == 1) { + [self.delegate firstItemWasAddedInGridViewController:self]; + } + }; + [self.collectionView performBatchUpdates:performAllUpdates + completion:completion]; } - (void)removeItemAtIndex:(NSUInteger)index @@ -196,7 +220,14 @@ scrollPosition:UICollectionViewScrollPositionNone]; } }; - [self.collectionView performBatchUpdates:performAllUpdates completion:nil]; + ProceduralBlockWithBool completion = ^(BOOL finished) { + if (self.items.count == 0) { + self.collectionView.backgroundView.hidden = NO; + [self.delegate lastItemWasClosedInGridViewController:self]; + } + }; + [self.collectionView performBatchUpdates:performAllUpdates + completion:completion]; } - (void)selectItemAtIndex:(NSUInteger)selectedIndex {
diff --git a/ios/chrome/browser/ui/tab_grid/tab_grid_egtest.mm b/ios/chrome/browser/ui/tab_grid/tab_grid_egtest.mm index 2f74f0a..9d8c75f 100644 --- a/ios/chrome/browser/ui/tab_grid/tab_grid_egtest.mm +++ b/ios/chrome/browser/ui/tab_grid/tab_grid_egtest.mm
@@ -15,15 +15,32 @@ #endif namespace { + +// Identifer for cell at given |index|. +NSString* IdentifierForCellAtIndex(unsigned int index) { + return [NSString stringWithFormat:@"%@%u", kGridCellIdentifierPrefix, index]; +} + +// Matcher for cell at |index|. +id<GREYMatcher> CellAtIndex(unsigned int index) { + return grey_allOf(grey_accessibilityID(IdentifierForCellAtIndex(index)), + grey_sufficientlyVisible(), nil); +} + +// Matcher for close button for cell at |index|. +id<GREYMatcher> CloseButtonForCellAtIndex(unsigned int index) { + return grey_allOf( + grey_ancestor(grey_accessibilityID(IdentifierForCellAtIndex(index))), + grey_accessibilityID(kGridCellCloseButtonIdentifier), + grey_sufficientlyVisible(), nil); +} + // Matcher for done button in tab grid. id<GREYMatcher> TabGridDoneButton() { return grey_allOf(grey_accessibilityID(kTabGridDoneButtonAccessibilityID), grey_sufficientlyVisible(), nil); } -// Identifer for cell at given |index|. -NSString* IdentifierForCellAtIndex(unsigned int index) { - return [NSString stringWithFormat:@"%@%u", kGridCellIdentifierPrefix, index]; -} + } // namespace @interface TabGridTestCase : ChromeTestCase @@ -43,11 +60,19 @@ - (void)testTappingOnFirstCell { [[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()] performAction:grey_tap()]; - [[EarlGrey selectElementWithMatcher:grey_accessibilityID( - IdentifierForCellAtIndex(0))] - performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:CellAtIndex(0)] performAction:grey_tap()]; [[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()] assertWithMatcher:grey_sufficientlyVisible()]; } +// Tests that closing the cell shows no tabs. +- (void)testClosingFirstCell { + [[EarlGrey selectElementWithMatcher:chrome_test_util::ShowTabsButton()] + performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:CloseButtonForCellAtIndex(0)] + performAction:grey_tap()]; + [[EarlGrey selectElementWithMatcher:CellAtIndex(0)] + assertWithMatcher:grey_nil()]; +} + @end
diff --git a/ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm b/ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm index b0b5af8..493cb697 100644 --- a/ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm +++ b/ios/chrome/browser/ui/tab_grid/tab_grid_view_controller.mm
@@ -98,11 +98,10 @@ // Call the current page setter to sync the scroll view offset to the current // page value. self.currentPage = _currentPage; - + [self updateDoneAndCloseAllButtons]; if (animated && self.transitionCoordinator) { [self animateToolbarsForAppearance]; } - [super viewWillAppear:animated]; } @@ -139,6 +138,7 @@ float fractionalPage = scrollView.contentOffset.x / pageWidth; NSUInteger page = lround(fractionalPage); _currentPage = static_cast<TabGridPage>(page); + [self updateDoneAndCloseAllButtons]; } #pragma mark - UIScrollViewAccessibilityDelegate @@ -257,6 +257,11 @@ [self addChildViewController:viewController]; [contentView addSubview:viewController.view]; [viewController didMoveToParentViewController:self]; + // TODO(crbug.com/818699) : Localize strings. + viewController.emptyStateView = [self + createEmptyStateViewWithTopText:@"No Incognito Tabs" + bottomText: + @"Open a tab to browse the web privately."]; viewController.theme = GridThemeDark; viewController.delegate = self; if (@available(iOS 11, *)) { @@ -287,6 +292,10 @@ [self addChildViewController:viewController]; [contentView addSubview:viewController.view]; [viewController didMoveToParentViewController:self]; + // TODO(crbug.com/818699) : Localize strings. + viewController.emptyStateView = + [self createEmptyStateViewWithTopText:@"No Open Tabs" + bottomText:@"Open a tab to browse the web."]; viewController.theme = GridThemeLight; viewController.delegate = self; if (@available(iOS 11, *)) { @@ -335,6 +344,34 @@ [NSLayoutConstraint activateConstraints:constraints]; } +// Creates an empty state view. +- (UIView*)createEmptyStateViewWithTopText:(NSString*)topText + bottomText:(NSString*)bottomText { + UIView* view = [[UIView alloc] init]; + UILabel* topLabel = [[UILabel alloc] init]; + topLabel.translatesAutoresizingMaskIntoConstraints = NO; + topLabel.text = topText; + topLabel.textColor = [UIColor whiteColor]; + topLabel.font = [UIFont boldSystemFontOfSize:20.0f]; + [view addSubview:topLabel]; + UILabel* bottomLabel = [[UILabel alloc] init]; + bottomLabel.translatesAutoresizingMaskIntoConstraints = NO; + bottomLabel.text = bottomText; + bottomLabel.textColor = [UIColor whiteColor]; + bottomLabel.font = [UIFont systemFontOfSize:18.0f]; + [view addSubview:bottomLabel]; + NSArray* constraints = @[ + [topLabel.centerXAnchor constraintEqualToAnchor:view.centerXAnchor], + [bottomLabel.centerXAnchor constraintEqualToAnchor:view.centerXAnchor], + [topLabel.centerYAnchor constraintEqualToAnchor:view.centerYAnchor + constant:-10.0f], + [bottomLabel.centerYAnchor constraintEqualToAnchor:view.centerYAnchor + constant:10.0f], + ]; + [NSLayoutConstraint activateConstraints:constraints]; + return view; +} + // Adds the top toolbar and sets constraints. - (void)setupTopToolbar { TabGridTopToolbar* topToolbar = [[TabGridTopToolbar alloc] init]; @@ -460,6 +497,24 @@ completion:nil]; } +// Update |enabled| property of the done and close all buttons. +- (void)updateDoneAndCloseAllButtons { + switch (self.currentPage) { + case TabGridPageIncognitoTabs: + self.doneButton.enabled = !self.incognitoTabsViewController.isGridEmpty; + self.closeAllButton.enabled = self.doneButton.enabled; + break; + case TabGridPageRegularTabs: + self.doneButton.enabled = !self.regularTabsViewController.isGridEmpty; + self.closeAllButton.enabled = self.doneButton.enabled; + break; + case TabGridPageRemoteTabs: + self.doneButton.enabled = YES; + self.closeAllButton.enabled = NO; + break; + } +} + #pragma mark - GridViewControllerDelegate - (void)gridViewController:(GridViewController*)gridViewController @@ -481,6 +536,16 @@ } } +- (void)lastItemWasClosedInGridViewController: + (GridViewController*)gridViewController { + [self updateDoneAndCloseAllButtons]; +} + +- (void)firstItemWasAddedInGridViewController: + (GridViewController*)gridViewController { + [self updateDoneAndCloseAllButtons]; +} + #pragma mark - Button actions - (void)doneButtonTapped:(id)sender {
diff --git a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button.mm b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button.mm index 03ed46c0..86b64d34 100644 --- a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button.mm +++ b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button.mm
@@ -113,23 +113,7 @@ if (!self.hidden && previouslyHidden != self.hidden && self.guideName) { // The button is appearing. At this point, if it has a layout guide // associated, it should constraint it to itself. - UILayoutGuide* guide = [NamedGuide guideWithName:self.guideName view:self]; - if (!guide) - return; - - // Removes the layout guide from its superview and re-add it to deactivate - // all constraints associated with this layout guide. As the layout guide is - // supposed to be associated only with this button and all components using - // those layout guide should close themselves when size class is changing, - // it should work. - UIView* guideOwner = guide.owningView; - [guideOwner removeLayoutGuide:guide]; - [guideOwner addLayoutGuide:guide]; - - AddSameConstraints(guide, self); - - // Make sure the constraints are taken into account. - [guideOwner layoutIfNeeded]; + [NamedGuide guideWithName:self.guideName view:self].constrainedView = self; } }
diff --git a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.h b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.h index a00cf6f..e816285d 100644 --- a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.h +++ b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.h
@@ -45,10 +45,8 @@ - (ToolbarButton*)forwardButton; // Tab Grid ToolbarButton. - (ToolbarTabGridButton*)tabGridButton; -// Tab Switcher Strip ToolbarButton. -- (ToolbarButton*)tabSwitcherStripButton; -// Tab Switcher Grid ToolbarButton. -- (ToolbarButton*)tabSwitcherGridButton; +// StackView ToolbarButton. +- (ToolbarButton*)stackViewButton; // Tools Menu ToolbarButton. - (ToolbarToolsMenuButton*)toolsMenuButton; // Share ToolbarButton.
diff --git a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.mm b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.mm index 2e22c8ce..bf24a2ea 100644 --- a/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.mm +++ b/ios/chrome/browser/ui/toolbar/buttons/toolbar_button_factory.mm
@@ -140,33 +140,10 @@ } - (ToolbarTabGridButton*)tabGridButton { - int tabGridButtonImages[styleCount][TOOLBAR_STATE_COUNT] = - TOOLBAR_IDR_THREE_STATE(OVERVIEW); - ToolbarTabGridButton* tabGridButton = nil; - if (IsUIRefreshPhase1Enabled()) { - tabGridButton = [ToolbarTabGridButton - toolbarButtonWithImage:[UIImage imageNamed:@"toolbar_switcher"]]; - [self configureButton:tabGridButton width:kAdaptiveToolbarButtonWidth]; - } else { - tabGridButton = [ToolbarTabGridButton - toolbarButtonWithImageForNormalState:NativeImage( - tabGridButtonImages[self.style] - [DEFAULT]) - imageForHighlightedState:NativeImage( - tabGridButtonImages[self.style] - [PRESSED]) - imageForDisabledState: - NativeImage( - tabGridButtonImages[self.style][DISABLED])]; - [self configureButton:tabGridButton width:kToolbarButtonWidth]; - [tabGridButton - setTitleColor:[self.toolbarConfiguration buttonTitleNormalColor] - forState:UIControlStateNormal]; - [tabGridButton - setTitleColor:[self.toolbarConfiguration buttonTitleHighlightedColor] - forState:UIControlStateHighlighted]; - } - DCHECK(tabGridButton); + DCHECK(IsUIRefreshPhase1Enabled()); + ToolbarTabGridButton* tabGridButton = [ToolbarTabGridButton + toolbarButtonWithImage:[UIImage imageNamed:@"toolbar_switcher"]]; + [self configureButton:tabGridButton width:kAdaptiveToolbarButtonWidth]; SetA11yLabelAndUiAutomationName(tabGridButton, IDS_IOS_TOOLBAR_SHOW_TABS, kToolbarStackButtonIdentifier); @@ -186,19 +163,44 @@ return tabGridButton; } -- (ToolbarButton*)tabSwitcherStripButton { - return [self tabGridButton]; -} +- (ToolbarButton*)stackViewButton { + DCHECK(!IsUIRefreshPhase1Enabled()); + int stackViewButtonImages[styleCount][TOOLBAR_STATE_COUNT] = + TOOLBAR_IDR_THREE_STATE(OVERVIEW); + ToolbarButton* stackViewButton = [ToolbarButton + toolbarButtonWithImageForNormalState:NativeImage( + stackViewButtonImages[self.style] + [DEFAULT]) + imageForHighlightedState:NativeImage( + stackViewButtonImages[self.style] + [PRESSED]) + imageForDisabledState: + NativeImage( + stackViewButtonImages[self.style][DISABLED])]; + [self configureButton:stackViewButton width:kToolbarButtonWidth]; + [stackViewButton + setTitleColor:[self.toolbarConfiguration buttonTitleNormalColor] + forState:UIControlStateNormal]; + [stackViewButton + setTitleColor:[self.toolbarConfiguration buttonTitleHighlightedColor] + forState:UIControlStateHighlighted]; + SetA11yLabelAndUiAutomationName(stackViewButton, IDS_IOS_TOOLBAR_SHOW_TABS, + kToolbarStackButtonIdentifier); -- (ToolbarButton*)tabSwitcherGridButton { - ToolbarButton* tabSwitcherGridButton = - [ToolbarButton toolbarButtonWithImageForNormalState: - [UIImage imageNamed:@"tabswitcher_tab_switcher_button"] - imageForHighlightedState:nil - imageForDisabledState:nil]; - tabSwitcherGridButton.accessibilityLabel = - l10n_util::GetNSString(IDS_IOS_TOOLBAR_SHOW_TAB_GRID); - return tabSwitcherGridButton; + // TODO(crbug.com/799601): Delete this once its not needed. + if (base::FeatureList::IsEnabled(kMemexTabSwitcher)) { + [stackViewButton addTarget:self.dispatcher + action:@selector(navigateToMemexTabSwitcher) + forControlEvents:UIControlEventTouchUpInside]; + } else { + [stackViewButton addTarget:self.dispatcher + action:@selector(displayTabSwitcher) + forControlEvents:UIControlEventTouchUpInside]; + } + + stackViewButton.visibilityMask = + self.visibilityConfiguration.tabGridButtonVisibility; + return stackViewButton; } - (ToolbarToolsMenuButton*)toolsMenuButton {
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm index 4e46f2cd6..38a4a1a0 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm
@@ -132,7 +132,7 @@ - (void)setUpToolbarButtons { self.backButton = [self.buttonFactory backButton]; self.forwardButton = [self.buttonFactory forwardButton]; - self.tabSwitchStripButton = [self.buttonFactory tabSwitcherStripButton]; + self.tabSwitchStripButton = [self.buttonFactory stackViewButton]; self.toolsMenuButton = [self.buttonFactory toolsMenuButton]; self.shareButton = [self.buttonFactory shareButton]; self.reloadButton = [self.buttonFactory reloadButton];
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm index 49da4a2..0401364c 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_model_delegate_ios.mm
@@ -44,7 +44,7 @@ const GURL& url, const base::string16& formatted_url) const { return AutocompleteInput::FormattedStringWithEquivalentMeaning( - url, formatted_url, AutocompleteSchemeClassifierImpl()); + url, formatted_url, AutocompleteSchemeClassifierImpl(), nullptr); } bool ToolbarModelDelegateIOS::GetURL(GURL* url) const {
diff --git a/ios/chrome/browser/ui/util/BUILD.gn b/ios/chrome/browser/ui/util/BUILD.gn index a97881a2..b356dd4 100644 --- a/ios/chrome/browser/ui/util/BUILD.gn +++ b/ios/chrome/browser/ui/util/BUILD.gn
@@ -25,6 +25,8 @@ "named_guide.mm", "named_guide_util.h", "named_guide_util.mm", + "optional_property_animator.h", + "optional_property_animator.mm", "pasteboard_util.h", "pasteboard_util.mm", "relaxed_bounds_constraints_hittest.h", @@ -63,6 +65,7 @@ "label_observer_unittest.mm", "manual_text_framer_unittest.mm", "named_guide_unittest.mm", + "optional_property_animator_unittest.mm", "text_region_mapper_unittest.mm", ] deps = [
diff --git a/ios/chrome/browser/ui/util/optional_property_animator.h b/ios/chrome/browser/ui/util/optional_property_animator.h new file mode 100644 index 0000000..b47942fc --- /dev/null +++ b/ios/chrome/browser/ui/util/optional_property_animator.h
@@ -0,0 +1,22 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_UTIL_OPTIONAL_PROPERTY_ANIMATOR_H_ +#define IOS_CHROME_BROWSER_UI_UTIL_OPTIONAL_PROPERTY_ANIMATOR_H_ + +#import <UIKit/UIKit.h> + +// UIViewPropertyAnimators throw exceptions if they're started before any +// animation blocks were added. OptionalPropertyAnimators can be used in +// scenarios when it is not guaranteed that animation blocks will be added (i.e. +// animation blocks provided by observers). +@interface OptionalPropertyAnimator : UIViewPropertyAnimator + +// Whether animations have been added to this animator. |-startAnimation| and +// |-startAnimationAfterDelay:| are no-ops if this property is NO. +@property(nonatomic, readonly) BOOL hasAnimations; + +@end + +#endif // IOS_CHROME_BROWSER_UI_UTIL_OPTIONAL_PROPERTY_ANIMATOR_H_
diff --git a/ios/chrome/browser/ui/util/optional_property_animator.mm b/ios/chrome/browser/ui/util/optional_property_animator.mm new file mode 100644 index 0000000..4860016 --- /dev/null +++ b/ios/chrome/browser/ui/util/optional_property_animator.mm
@@ -0,0 +1,86 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/util/optional_property_animator.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface OptionalPropertyAnimator () + +// Redefine property as readwrite. +@property(nonatomic, readwrite) BOOL hasAnimations; + +@end + +@implementation OptionalPropertyAnimator +@synthesize hasAnimations = _hasAnimations; + +#pragma mark - UIViewPropertyAnimator + +- (instancetype)initWithDuration:(NSTimeInterval)duration + curve:(UIViewAnimationCurve)curve + animations:(void (^__nullable)(void))animations { + if (self = + [super initWithDuration:duration curve:curve animations:animations]) { + _hasAnimations = !!animations; + } + return self; +} + +- (instancetype)initWithDuration:(NSTimeInterval)duration + controlPoint1:(CGPoint)point1 + controlPoint2:(CGPoint)point2 + animations:(void (^__nullable)(void))animations { + if (self = [super initWithDuration:duration + controlPoint1:point1 + controlPoint2:point2 + animations:animations]) { + _hasAnimations = !!animations; + } + return self; +} + +- (instancetype)initWithDuration:(NSTimeInterval)duration + dampingRatio:(CGFloat)ratio + animations:(void (^__nullable)(void))animations { + if (self = [super initWithDuration:duration + dampingRatio:ratio + animations:animations]) { + _hasAnimations = !!animations; + } + return self; +} + +#pragma mark - UIViewImplicitlyAnimating + +- (void)addAnimations:(void (^)(void))animation + delayFactor:(CGFloat)delayFactor { + if (animation) + self.hasAnimations = YES; + [super addAnimations:animation delayFactor:delayFactor]; +} + +- (void)addAnimations:(void (^)(void))animation { + if (animation) + self.hasAnimations = YES; + [super addAnimations:animation]; +} + +#pragma mark - UIViewAnimating + +- (void)startAnimation { + if (!self.hasAnimations) + return; + [super startAnimation]; +} + +- (void)startAnimationAfterDelay:(NSTimeInterval)delay { + if (!self.hasAnimations) + return; + [super startAnimationAfterDelay:delay]; +} + +@end
diff --git a/ios/chrome/browser/ui/util/optional_property_animator_unittest.mm b/ios/chrome/browser/ui/util/optional_property_animator_unittest.mm new file mode 100644 index 0000000..f4a9d8f --- /dev/null +++ b/ios/chrome/browser/ui/util/optional_property_animator_unittest.mm
@@ -0,0 +1,87 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/util/optional_property_animator.h" + +#import "base/ios/block_types.h" +#include "testing/platform_test.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace { +// Duration to use for test animators. +const NSTimeInterval kDuration = 0.1; +} + +// Test fixture for OptionalPropertyAnimator. +using OptionalPropertyAnimatorTest = PlatformTest; + +// Tests that the animator's |hasAnimations| property is NO before adding an +// animation. +TEST_F(OptionalPropertyAnimatorTest, NoAnimations) { + id<UITimingCurveProvider> curve = [[UICubicTimingParameters alloc] + initWithAnimationCurve:UIViewAnimationCurveEaseOut]; + OptionalPropertyAnimator* animator = + [[OptionalPropertyAnimator alloc] initWithDuration:kDuration + timingParameters:curve]; + EXPECT_FALSE(animator.hasAnimations); +} + +// Tests that animations added in initializers are correctly reflected in +// |hasAnimations| +TEST_F(OptionalPropertyAnimatorTest, InitializersWithAnimations) { + ProceduralBlock empty_animation = ^{ + }; + + OptionalPropertyAnimator* animator = [[OptionalPropertyAnimator alloc] + initWithDuration:kDuration + curve:UIViewAnimationCurveEaseOut + animations:empty_animation]; + EXPECT_TRUE(animator.hasAnimations); + + animator = + [[OptionalPropertyAnimator alloc] initWithDuration:kDuration + controlPoint1:CGPointZero + controlPoint2:CGPointZero + animations:empty_animation]; + EXPECT_TRUE(animator.hasAnimations); + + animator = + [[OptionalPropertyAnimator alloc] initWithDuration:kDuration + dampingRatio:0.0 + animations:empty_animation]; + EXPECT_TRUE(animator.hasAnimations); + + animator = [OptionalPropertyAnimator + runningPropertyAnimatorWithDuration:0.0 + delay:0.0 + options:0 + animations:empty_animation + completion:nil]; + EXPECT_TRUE(animator.hasAnimations); +} + +// Tests that starting an animator with no animations is a no-op. +TEST_F(OptionalPropertyAnimatorTest, NoOpStart) { + OptionalPropertyAnimator* animator = [[OptionalPropertyAnimator alloc] + initWithDuration:kDuration + curve:UIViewAnimationCurveEaseOut + animations:nil]; + ASSERT_FALSE(animator.hasAnimations); + ASSERT_EQ(animator.state, UIViewAnimatingStateInactive); + ASSERT_FALSE(animator.running); + + // Attempt to start the animator and verify that the state hasn't changed. + [animator startAnimation]; + EXPECT_EQ(animator.state, UIViewAnimatingStateInactive); + EXPECT_FALSE(animator.running); + + // Also attempt to start with a delay and ensure that state has still not + // changed. + [animator startAnimationAfterDelay:0.0]; + EXPECT_EQ(animator.state, UIViewAnimatingStateInactive); + EXPECT_FALSE(animator.running); +}
diff --git a/ios/public/provider/chrome/browser/images/branded_image_provider.h b/ios/public/provider/chrome/browser/images/branded_image_provider.h index a3c88406..93a8a504 100644 --- a/ios/public/provider/chrome/browser/images/branded_image_provider.h +++ b/ios/public/provider/chrome/browser/images/branded_image_provider.h
@@ -39,13 +39,6 @@ // the signin confirmation screen. virtual UIImage* GetSigninConfirmationPersonalizeServicesImage(); - // Sets |image_id| to contain the resource id corresponding to the 24pt x 24pt - // image for the toolbar voice search button. If this method returns false, - // |image_id| is invalid and callers should fall back to a default image. The - // returned image should be used for all toolbar styles and all button states. - // Deprecated, use GetToolbarVoiceSearchButtonImages(bool) instead. - virtual bool GetToolbarVoiceSearchButtonImageId(int* image_id); - // Returns two 24pt x 24pt images to use for toolbar voice search button. The // images corresponds to the normal and pressed state. virtual NSArray<UIImage*>* GetToolbarVoiceSearchButtonImages(bool incognito);
diff --git a/ios/public/provider/chrome/browser/images/branded_image_provider.mm b/ios/public/provider/chrome/browser/images/branded_image_provider.mm index 552f7d7..88c2c06 100644 --- a/ios/public/provider/chrome/browser/images/branded_image_provider.mm +++ b/ios/public/provider/chrome/browser/images/branded_image_provider.mm
@@ -34,10 +34,6 @@ return nil; } -bool BrandedImageProvider::GetToolbarVoiceSearchButtonImageId(int* image_id) { - return false; -} - NSArray<UIImage*>* BrandedImageProvider::GetToolbarVoiceSearchButtonImages( bool incognito) { return nil;
diff --git a/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.h b/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.h index fa1c1e3..07542e1 100644 --- a/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.h +++ b/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.h
@@ -9,9 +9,6 @@ #include "base/macros.h" @class ChromeIdentity; -namespace ios { -class ChromeIdentityService; -} // namespace ios typedef ChromeIdentity* (^SignedInIdentityBlock)(void); typedef NSArray<ChromeIdentity*>* (^SignedInIdentitiesBlock)(void); @@ -29,16 +26,6 @@ SignedInIdentityBlock signed_in_identity_block, SignedInIdentitiesBlock signed_in_identities_block); - // Set up mailto handling for the currently signed in users. - // The Signed-In Identity Block should return the primary signed in user. - // The Signed-In Identities Block should return all users signed in to Chrome. - // DEPRECATED: Use the above overloaded PrepareMailtoHandling() method - // without |identity_service| parameter instead. - virtual void PrepareMailtoHandling( - ios::ChromeIdentityService* identity_service, - SignedInIdentityBlock signed_in_identity_block, - SignedInIdentitiesBlock signed_in_identities_block); - // Returns a properly localized title for the menu item or button used to open // the settings for this handler. Returns nil if mailto handling is not // supported by the provider.
diff --git a/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.mm b/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.mm index d25d683..e6422c1c6 100644 --- a/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.mm +++ b/ios/public/provider/chrome/browser/mailto/mailto_handler_provider.mm
@@ -16,11 +16,6 @@ SignedInIdentityBlock signed_in_identity_block, SignedInIdentitiesBlock signed_in_identities_block) {} -void MailtoHandlerProvider::PrepareMailtoHandling( - ios::ChromeIdentityService* identity_service, - SignedInIdentityBlock signed_in_identity_block, - SignedInIdentitiesBlock signed_in_identities_block) {} - NSString* MailtoHandlerProvider::MailtoHandlerSettingsTitle() const { return nil; }
diff --git a/ios/web/net/cookies/wk_http_system_cookie_store.h b/ios/web/net/cookies/wk_http_system_cookie_store.h index 8ee81c8b..fb665c06 100644 --- a/ios/web/net/cookies/wk_http_system_cookie_store.h +++ b/ios/web/net/cookies/wk_http_system_cookie_store.h
@@ -50,7 +50,10 @@ net::SystemCookieStore::SystemCookieCallbackForCookies callback, NSArray<NSHTTPCookie*>* cookies); - WKHTTPCookieStore* cookie_store_; + // cookie_store_ must be deleted in the UI thread, So by making it weak + // WKHTTPSystemCookieStore will not retain the WKHTTPCookieStore instance, and + // it will be deleted with the owning WKWebSiteDataStore. + __weak WKHTTPCookieStore* cookie_store_; DISALLOW_COPY_AND_ASSIGN(WKHTTPSystemCookieStore); };
diff --git a/ios/web/net/cookies/wk_http_system_cookie_store.mm b/ios/web/net/cookies/wk_http_system_cookie_store.mm index 695b37df..a941445b 100644 --- a/ios/web/net/cookies/wk_http_system_cookie_store.mm +++ b/ios/web/net/cookies/wk_http_system_cookie_store.mm
@@ -63,6 +63,8 @@ void WKHTTPSystemCookieStore::GetCookiesForURLAsync( const GURL& url, SystemCookieCallbackForCookies callback) { + // This function shouldn't be called if cookie_store_ is deleted. + DCHECK(cookie_store_); __block SystemCookieCallbackForCookies shared_callback = std::move(callback); GURL block_url = url; web::WebThread::PostTask( @@ -81,6 +83,8 @@ void WKHTTPSystemCookieStore::GetAllCookiesAsync( SystemCookieCallbackForCookies callback) { + // This function shouldn't be called if cookie_store_ is deleted. + DCHECK(cookie_store_); __block SystemCookieCallbackForCookies shared_callback = std::move(callback); web::WebThread::PostTask( web::WebThread::UI, FROM_HERE, base::BindBlockArc(^{ @@ -93,6 +97,8 @@ void WKHTTPSystemCookieStore::DeleteCookieAsync(NSHTTPCookie* cookie, SystemCookieCallback callback) { + // This function shouldn't be called if cookie_store_ is deleted. + DCHECK(cookie_store_); __block SystemCookieCallback shared_callback = std::move(callback); NSHTTPCookie* block_cookie = cookie; web::WebThread::PostTask( @@ -111,6 +117,8 @@ NSHTTPCookie* cookie, const base::Time* optional_creation_time, SystemCookieCallback callback) { + // cookies can't be set if cookie_store_ is deleted. + DCHECK(cookie_store_); __block SystemCookieCallback shared_callback = std::move(callback); NSHTTPCookie* block_cookie = cookie; base::Time cookie_time = base::Time::Now();
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 693e405..71de0b90 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -813,7 +813,7 @@ - (void)URLDidChangeWithoutDocumentChange:(const GURL&)URL; // Returns context for pending navigation that has |URL|. null if there is no // matching pending navigation. -- (web::NavigationContextImpl*)contextForPendingNavigationWithURL: +- (web::NavigationContextImpl*)contextForPendingMainFrameNavigationWithURL: (const GURL&)URL; // Loads request for the URL of the current navigation item. Subclasses may // choose to build a new NSURLRequest and call |loadRequest| on the underlying @@ -4325,15 +4325,19 @@ } int64_t contentLength = navigationResponse.response.expectedContentLength; web::BrowserState* browserState = self.webState->GetBrowserState(); - web::NavigationContextImpl* context = - [self contextForPendingNavigationWithURL:responseURL]; - context->SetIsDownload(true); - _webStateImpl->OnNavigationFinished(context); + ui::PageTransition transition = ui::PAGE_TRANSITION_AUTO_SUBFRAME; + if (navigationResponse.forMainFrame) { + web::NavigationContextImpl* context = + [self contextForPendingMainFrameNavigationWithURL:responseURL]; + context->SetIsDownload(true); + // Navigation callbacks can only be called for the main frame. + _webStateImpl->OnNavigationFinished(context); + transition = context->GetPageTransition(); + } web::DownloadController::FromBrowserState(browserState) ->CreateDownloadTask(_webStateImpl, [NSUUID UUID].UUIDString, responseURL, contentDisposition, contentLength, - base::SysNSStringToUTF8(MIMEType), - context->GetPageTransition()); + base::SysNSStringToUTF8(MIMEType), transition); BOOL isPassKit = [MIMEType isEqualToString:@"application/vnd.apple.pkpass"]; if (!base::FeatureList::IsEnabled(web::features::kNewPassKitDownload) && isPassKit) { @@ -4986,7 +4990,7 @@ [self setDocumentURL:webViewURL]; web::NavigationContextImpl* existingContext = - [self contextForPendingNavigationWithURL:webViewURL]; + [self contextForPendingMainFrameNavigationWithURL:webViewURL]; if (!existingContext) { // This URL was not seen before, so register new load request. std::unique_ptr<web::NavigationContextImpl> newContext = @@ -5196,7 +5200,7 @@ // context object. std::unique_ptr<web::NavigationContextImpl> newNavigationContext; if (!_changingHistoryState) { - if ([self contextForPendingNavigationWithURL:newURL]) { + if ([self contextForPendingMainFrameNavigationWithURL:newURL]) { // NavigationManager::LoadURLWithParams() was called with URL that has // different fragment comparing to the previous URL. } else { @@ -5221,8 +5225,10 @@ // Pass either newly created context (if it exists) or context that already // existed before. web::NavigationContextImpl* navigationContext = newNavigationContext.get(); - if (!navigationContext) - navigationContext = [self contextForPendingNavigationWithURL:newURL]; + if (!navigationContext) { + navigationContext = + [self contextForPendingMainFrameNavigationWithURL:newURL]; + } DCHECK(navigationContext->IsSameDocument()); _webStateImpl->OnNavigationStarted(navigationContext); [self didStartLoading]; @@ -5234,7 +5240,7 @@ } } -- (web::NavigationContextImpl*)contextForPendingNavigationWithURL: +- (web::NavigationContextImpl*)contextForPendingMainFrameNavigationWithURL: (const GURL&)URL { // Here the enumeration variable |navigation| is __strong to allow setting it // to nil.
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm index ceba3cb20..523dfbb 100644 --- a/ios/web/web_state/ui/crw_web_controller_unittest.mm +++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -562,15 +562,20 @@ // and waits for decision handler call. Returns false if decision handler call // times out. bool CallDecidePolicyForNavigationResponseWithResponse( - NSURLResponse* response) WARN_UNUSED_RESULT { + NSURLResponse* response, + BOOL for_main_frame) WARN_UNUSED_RESULT { CRWFakeWKNavigationResponse* navigation_response = [[CRWFakeWKNavigationResponse alloc] init]; navigation_response.response = response; + navigation_response.forMainFrame = for_main_frame; // Wait for decidePolicyForNavigationResponse: callback. __block bool callback_called = false; - [navigation_delegate_ webView:mock_web_view_ - didStartProvisionalNavigation:nil]; + if (for_main_frame) { + // webView:didStartProvisionalNavigation: is not called for iframes. + [navigation_delegate_ webView:mock_web_view_ + didStartProvisionalNavigation:nil]; + } [navigation_delegate_ webView:mock_web_view_ decidePolicyForNavigationResponse:navigation_response decisionHandler:^(WKNavigationResponsePolicy policy) { @@ -598,7 +603,8 @@ MIMEType:@(kTestMimeType) expectedContentLength:content_length textEncodingName:nil]; - ASSERT_TRUE(CallDecidePolicyForNavigationResponseWithResponse(response)); + ASSERT_TRUE(CallDecidePolicyForNavigationResponseWithResponse( + response, /*for_main_frame=*/YES)); // Verify that download task was created. ASSERT_EQ(1U, delegate_.alive_download_tasks().size()); @@ -626,7 +632,8 @@ headerFields:@{ @"content-disposition" : @(kContentDisposition), }]; - ASSERT_TRUE(CallDecidePolicyForNavigationResponseWithResponse(response)); + ASSERT_TRUE(CallDecidePolicyForNavigationResponseWithResponse( + response, /*for_main_frame=*/YES)); // Verify that download task was created. ASSERT_EQ(1U, delegate_.alive_download_tasks().size()); @@ -642,6 +649,35 @@ ui::PageTransition::PAGE_TRANSITION_CLIENT_REDIRECT)); } +// Tests that webView:decidePolicyForNavigationResponse:decisionHandler: creates +// the DownloadTask for NSHTTPURLResponse and iframes. +TEST_F(CRWWebControllerDownloadTest, IFrameCreationWithNSHTTPURLResponse) { + // Simulate download response. + const char kContentDisposition[] = "attachment; filename=download.test"; + NSURLResponse* response = [[NSHTTPURLResponse alloc] + initWithURL:[NSURL URLWithString:@(kTestURLString)] + statusCode:200 + HTTPVersion:nil + headerFields:@{ + @"content-disposition" : @(kContentDisposition), + }]; + ASSERT_TRUE(CallDecidePolicyForNavigationResponseWithResponse( + response, /*for_main_frame=*/NO)); + + // Verify that download task was created. + ASSERT_EQ(1U, delegate_.alive_download_tasks().size()); + DownloadTask* task = delegate_.alive_download_tasks()[0].second.get(); + ASSERT_TRUE(task); + EXPECT_TRUE(task->GetIndentifier()); + EXPECT_EQ(kTestURLString, task->GetOriginalUrl()); + EXPECT_EQ(-1, task->GetTotalBytes()); + EXPECT_EQ(kContentDisposition, task->GetContentDisposition()); + EXPECT_EQ("", task->GetMimeType()); + EXPECT_TRUE(ui::PageTransitionTypeIncludingQualifiersIs( + task->GetTransitionType(), + ui::PageTransition::PAGE_TRANSITION_AUTO_SUBFRAME)); +} + // Tests |currentURLWithTrustLevel:| method. TEST_F(CRWWebControllerTest, CurrentUrlWithTrustLevel) { AddPendingItem(GURL("http://chromium.test"), ui::PAGE_TRANSITION_TYPED);
diff --git a/ipc/ipc_channel_mojo.cc b/ipc/ipc_channel_mojo.cc index d7ce34a..cb10b09 100644 --- a/ipc/ipc_channel_mojo.cc +++ b/ipc/ipc_channel_mojo.cc
@@ -217,6 +217,12 @@ } bool ChannelMojo::Send(Message* message) { + DVLOG(2) << "sending message @" << message << " on channel @" << this + << " with type " << message->type(); +#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) + Logging::GetInstance()->OnSendMessage(message); +#endif + std::unique_ptr<Message> scoped_message = base::WrapUnique(message); if (!message_reader_) return false;
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc index 2a862e8..8f54894 100644 --- a/media/audio/audio_output_device.cc +++ b/media/audio/audio_output_device.cc
@@ -217,7 +217,11 @@ case IPC_CLOSED: // We must make sure to not access |callback_| in case Stop() has already // been called. - NotifyRenderCallbackOfError(); + { + base::AutoLock auto_lock_(audio_thread_lock_); + if (!stopping_hack_) + callback_->OnRenderError(); + } break; case IDLE: @@ -326,7 +330,11 @@ // TODO(tommi): Add an explicit contract for clearing the callback // object. Possibly require calling Initialize again or provide // a callback object via Start() and clear it in Stop(). - NotifyRenderCallbackOfError(); + { + base::AutoLock auto_lock_(audio_thread_lock_); + if (audio_thread_) + callback_->OnRenderError(); + } } void AudioOutputDevice::OnDeviceAuthorized( @@ -399,8 +407,8 @@ // indefinitely after this method returns. ipc_->CloseStream(); OnIPCClosed(); - - NotifyRenderCallbackOfError(); + if (callback_) + callback_->OnRenderError(); } } @@ -465,19 +473,6 @@ did_receive_auth_.Signal(); } -void AudioOutputDevice::NotifyRenderCallbackOfError() { - TRACE_EVENT0("audio", "AudioOutputDevice::NotifyRenderCallbackOfError"); - DCHECK(task_runner()->BelongsToCurrentThread()); - - { - base::AutoLock auto_lock(audio_thread_lock_); - // Avoid signaling error if Initialize() hasn't been called yet, or if - // Stop() has already been called. - if (callback_ && !stopping_hack_) - callback_->OnRenderError(); - } -} - void AudioOutputDevice::WillDestroyCurrentMessageLoop() { LOG(ERROR) << "IO loop going away before the audio device has been stopped"; ShutDownOnIOThread();
diff --git a/media/audio/audio_output_device.h b/media/audio/audio_output_device.h index 679d7dc..edc6f320 100644 --- a/media/audio/audio_output_device.h +++ b/media/audio/audio_output_device.h
@@ -160,8 +160,6 @@ const std::string& matched_device_id, bool timed_out); - void NotifyRenderCallbackOfError(); - // base::MessageLoop::DestructionObserver implementation for the IO loop. // If the IO loop dies before we do, we shut down the audio thread from here. void WillDestroyCurrentMessageLoop() override;
diff --git a/media/audio/audio_output_device_unittest.cc b/media/audio/audio_output_device_unittest.cc index b03f236e..600a858b 100644 --- a/media/audio/audio_output_device_unittest.cc +++ b/media/audio/audio_output_device_unittest.cc
@@ -392,31 +392,6 @@ StopAudioDevice(); } -TEST_F(AudioOutputDeviceTest, AuthorizationFailsBeforeInitialize_NoError) { - // Clear audio device set by fixture. - StopAudioDevice(); - audio_output_ipc_ = new MockAudioOutputIPC(); - audio_device_ = new AudioOutputDevice( - base::WrapUnique(audio_output_ipc_), io_loop_.task_runner(), 0, - kDefaultDeviceId, url::Origin(), - base::TimeDelta::FromMilliseconds(kAuthTimeoutForTestingMs)); - EXPECT_CALL( - *audio_output_ipc_, - RequestDeviceAuthorization(audio_device_.get(), 0, kDefaultDeviceId, _)); - - audio_device_->RequestDeviceAuthorization(); - audio_device_->Initialize(default_audio_parameters_, &callback_); - base::RunLoop().RunUntilIdle(); - audio_device_->Stop(); - - // We've stopped, so accessing |callback_| isn't ok. - EXPECT_CALL(callback_, OnRenderError()).Times(0); - audio_device_->OnDeviceAuthorized(OUTPUT_DEVICE_STATUS_ERROR_NOT_AUTHORIZED, - default_audio_parameters_, - kDefaultDeviceId); - base::RunLoop().RunUntilIdle(); -} - TEST_F(AudioOutputDeviceTest, AuthorizationTimedOut) { base::Thread thread("DeviceInfo"); thread.Start();
diff --git a/media/base/audio_decoder.h b/media/base/audio_decoder.h index da47707..122dda54 100644 --- a/media/base/audio_decoder.h +++ b/media/base/audio_decoder.h
@@ -25,15 +25,19 @@ class MEDIA_EXPORT AudioDecoder { public: // Callback for VideoDecoder initialization. - typedef base::Callback<void(bool success)> InitCB; + using InitCB = base::Callback<void(bool success)>; // Callback for AudioDecoder to return a decoded frame whenever it becomes // available. Only non-EOS frames should be returned via this callback. - typedef base::Callback<void(const scoped_refptr<AudioBuffer>&)> OutputCB; + using OutputCB = base::Callback<void(const scoped_refptr<AudioBuffer>&)>; // Callback for Decode(). Called after the decoder has accepted corresponding // DecoderBuffer, indicating that the pipeline can send next buffer to decode. - typedef base::Callback<void(DecodeStatus)> DecodeCB; + using DecodeCB = base::Callback<void(DecodeStatus)>; + + // Callback for whenever the key needed to decrypt the stream is not + // available. May be called at any time after Initialize(). + using WaitingForDecryptionKeyCB = base::RepeatingClosure; AudioDecoder(); @@ -57,10 +61,14 @@ // stream is not encrypted. // |init_cb| is used to return initialization status. // |output_cb| is called for decoded audio buffers (see Decode()). - virtual void Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) = 0; + // |waiting_for_decryption_key_cb| is called whenever the key needed to + // decrypt the stream is not available. + virtual void Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) = 0; // Requests samples to be decoded. Only one decode may be in flight at any // given time. Once the buffer is decoded the decoder calls |decode_cb|.
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index b8e7136..6efb48a3 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -319,11 +319,6 @@ #endif #if defined(OS_WIN) -// Enables video decode acceleration using the D3D11 video decoder api. -// This is completely insecure - DO NOT USE except for testing. -const base::Feature kD3D11VideoDecoding{"D3D11VideoDecoding", - base::FEATURE_DISABLED_BY_DEFAULT}; - // Does NV12->NV12 video copy on the main thread right before the texture's // used by GL. const base::Feature kDelayCopyNV12Textures{"DelayCopyNV12Textures",
diff --git a/media/base/media_switches.h b/media/base/media_switches.h index cba9e8202..6fbfa27 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h
@@ -145,7 +145,6 @@ #endif // defined(OS_ANDROID) #if defined(OS_WIN) -MEDIA_EXPORT extern const base::Feature kD3D11VideoDecoding; MEDIA_EXPORT extern const base::Feature kDelayCopyNV12Textures; MEDIA_EXPORT extern const base::Feature kMediaFoundationH264Encoding; MEDIA_EXPORT extern const base::Feature kMediaFoundationVideoCapture;
diff --git a/media/base/mock_filters.h b/media/base/mock_filters.h index 5818b9e..3fa3e5e 100644 --- a/media/base/mock_filters.h +++ b/media/base/mock_filters.h
@@ -192,12 +192,14 @@ // VideoDecoder implementation. virtual std::string GetDisplayName() const; - MOCK_METHOD5(Initialize, - void(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb)); + MOCK_METHOD6( + Initialize, + void(const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb)); MOCK_METHOD2(Decode, void(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB&)); MOCK_METHOD1(Reset, void(const base::Closure&)); @@ -217,11 +219,13 @@ // AudioDecoder implementation. virtual std::string GetDisplayName() const; - MOCK_METHOD4(Initialize, - void(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb)); + MOCK_METHOD5( + Initialize, + void(const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb)); MOCK_METHOD2(Decode, void(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB&));
diff --git a/media/base/video_decoder.h b/media/base/video_decoder.h index 450f20e..e34275b 100644 --- a/media/base/video_decoder.h +++ b/media/base/video_decoder.h
@@ -36,6 +36,10 @@ // buffer to decode. using DecodeCB = base::Callback<void(DecodeStatus)>; + // Callback for whenever the key needed to decrypt the stream is not + // available. May be called at any time after Initialize(). + using WaitingForDecryptionKeyCB = base::RepeatingClosure; + VideoDecoder(); // Returns the name of the decoder for logging and decoder selection purposes. @@ -57,6 +61,9 @@ // |cdm_context| can be used to handle encrypted buffers. May be null if the // stream is not encrypted. // + // |waiting_for_decryption_key_cb| is called whenever the key needed to + // decrypt the stream is not available. + // // Note: // 1) The VideoDecoder will be reinitialized if it was initialized before. // Upon reinitialization, all internal buffered frames will be dropped. @@ -66,11 +73,13 @@ // is ready (i.e. w/o thread trampolining) since it can strongly affect frame // delivery times with high-frame-rate material. See Decode() for additional // notes. - virtual void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) = 0; + virtual void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) = 0; // Requests a |buffer| to be decoded. The status of the decoder and decoded // frame are returned via the provided callback. Some decoders may allow
diff --git a/media/capture/BUILD.gn b/media/capture/BUILD.gn index 940bad6d..c15e91a 100644 --- a/media/capture/BUILD.gn +++ b/media/capture/BUILD.gn
@@ -306,7 +306,10 @@ } if (is_win) { - sources += [ "video/win/video_capture_device_mf_win_unittest.cc" ] + sources += [ + "video/win/video_capture_device_factory_win_unittest.cc", + "video/win/video_capture_device_mf_win_unittest.cc", + ] libs = [ "mf.lib", "mfplat.lib",
diff --git a/media/capture/mojom/video_capture_types.mojom b/media/capture/mojom/video_capture_types.mojom index 68b4b19..4e30b745 100644 --- a/media/capture/mojom/video_capture_types.mojom +++ b/media/capture/mojom/video_capture_types.mojom
@@ -29,6 +29,7 @@ enum VideoCaptureApi { LINUX_V4L2_SINGLE_PLANE, WIN_MEDIA_FOUNDATION, + WIN_MEDIA_FOUNDATION_SENSOR, WIN_DIRECT_SHOW, MACOSX_AVFOUNDATION, MACOSX_DECKLINK,
diff --git a/media/capture/mojom/video_capture_types_mojom_traits.cc b/media/capture/mojom/video_capture_types_mojom_traits.cc index eceebb8..c6a40680 100644 --- a/media/capture/mojom/video_capture_types_mojom_traits.cc +++ b/media/capture/mojom/video_capture_types_mojom_traits.cc
@@ -108,6 +108,8 @@ return media::mojom::VideoCaptureApi::LINUX_V4L2_SINGLE_PLANE; case media::VideoCaptureApi::WIN_MEDIA_FOUNDATION: return media::mojom::VideoCaptureApi::WIN_MEDIA_FOUNDATION; + case media::VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR: + return media::mojom::VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR; case media::VideoCaptureApi::WIN_DIRECT_SHOW: return media::mojom::VideoCaptureApi::WIN_DIRECT_SHOW; case media::VideoCaptureApi::MACOSX_AVFOUNDATION: @@ -140,6 +142,9 @@ case media::mojom::VideoCaptureApi::WIN_MEDIA_FOUNDATION: *output = media::VideoCaptureApi::WIN_MEDIA_FOUNDATION; return true; + case media::mojom::VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR: + *output = media::VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR; + return true; case media::mojom::VideoCaptureApi::WIN_DIRECT_SHOW: *output = media::VideoCaptureApi::WIN_DIRECT_SHOW; return true;
diff --git a/media/capture/video/video_capture_device_descriptor.cc b/media/capture/video/video_capture_device_descriptor.cc index 8c320b0..89dd1b7a 100644 --- a/media/capture/video/video_capture_device_descriptor.cc +++ b/media/capture/video/video_capture_device_descriptor.cc
@@ -74,6 +74,8 @@ return "V4L2 SPLANE"; case VideoCaptureApi::WIN_MEDIA_FOUNDATION: return "Media Foundation"; + case VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR: + return "Media Foundation Sensor Camera"; case VideoCaptureApi::WIN_DIRECT_SHOW: return "Direct Show"; case VideoCaptureApi::MACOSX_AVFOUNDATION:
diff --git a/media/capture/video/video_capture_device_descriptor.h b/media/capture/video/video_capture_device_descriptor.h index 51cd5bb..48eed13 100644 --- a/media/capture/video/video_capture_device_descriptor.h +++ b/media/capture/video/video_capture_device_descriptor.h
@@ -19,6 +19,7 @@ enum class VideoCaptureApi { LINUX_V4L2_SINGLE_PLANE, WIN_MEDIA_FOUNDATION, + WIN_MEDIA_FOUNDATION_SENSOR, WIN_DIRECT_SHOW, MACOSX_AVFOUNDATION, MACOSX_DECKLINK,
diff --git a/media/capture/video/win/capability_list_win.cc b/media/capture/video/win/capability_list_win.cc index 7d728c2..c16708dc 100644 --- a/media/capture/video/win/capability_list_win.cc +++ b/media/capture/video/win/capability_list_win.cc
@@ -12,12 +12,24 @@ namespace media { -static bool CompareCapability(const VideoCaptureFormat& requested, - const CapabilityWin& capability_lhs, - const CapabilityWin& capability_rhs) { - const VideoCaptureFormat& lhs = capability_lhs.supported_format; - const VideoCaptureFormat& rhs = capability_rhs.supported_format; +namespace { +// Compares the priority of the capture formats. Returns true if |lhs| is the +// preferred capture format in comparison with |rhs|. Returns false otherwise. +bool CompareCapability(const VideoCaptureFormat& requested, + const VideoCaptureFormat& lhs, + const VideoCaptureFormat& rhs) { + // When 16-bit format is requested and available, avoid other formats. + // If both lhs and rhs are 16-bit, we still need to compare them based on + // height, width and frame rate. + const bool use_requested = + (requested.pixel_format == media::PIXEL_FORMAT_Y16); + if (use_requested && lhs.pixel_format != rhs.pixel_format) { + if (lhs.pixel_format == requested.pixel_format) + return true; + if (rhs.pixel_format == requested.pixel_format) + return false; + } const int diff_height_lhs = std::abs(lhs.frame_size.height() - requested.frame_size.height()); const int diff_height_rhs = @@ -41,14 +53,18 @@ rhs.pixel_format); } +} // namespace + const CapabilityWin& GetBestMatchedCapability( const VideoCaptureFormat& requested, const CapabilityList& capabilities) { DCHECK(!capabilities.empty()); const CapabilityWin* best_match = &(*capabilities.begin()); for (const CapabilityWin& capability : capabilities) { - if (CompareCapability(requested, capability, *best_match)) + if (CompareCapability(requested, capability.supported_format, + best_match->supported_format)) { best_match = &capability; + } } return *best_match; }
diff --git a/media/capture/video/win/video_capture_device_factory_win.cc b/media/capture/video/win/video_capture_device_factory_win.cc index ef3749d..ea65e95 100644 --- a/media/capture/video/win/video_capture_device_factory_win.cc +++ b/media/capture/video/win/video_capture_device_factory_win.cc
@@ -33,6 +33,8 @@ namespace media { +namespace { + // In Windows device identifiers, the USB VID and PID are preceded by the string // "vid_" or "pid_". The identifiers are each 4 bytes long. const char kVidPrefix[] = "vid_"; // Also contains '\0'. @@ -54,7 +56,7 @@ // Blacklisted devices are identified by a characteristic prefix of the name. // This prefix is used case-insensitively. This list must be kept in sync with // |BlacklistedCameraNames|. -static const char* const kBlacklistedCameraNames[] = { +const char* const kBlacklistedCameraNames[] = { // Name of a fake DirectShow filter on computers with GTalk installed. "Google Camera Adapter", // The following software WebCams cause crashes. @@ -64,12 +66,24 @@ "kBlacklistedCameraNames should be same size as " "BlacklistedCameraNames enum"); -static bool IsDeviceBlacklistedForQueryingDetailedFrameRates( +const std::pair<VideoCaptureApi, std::vector<std::pair<GUID, GUID>>> + kMfAttributes[] = {{VideoCaptureApi::WIN_MEDIA_FOUNDATION, + { + {MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, + MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID}, + }}, + {VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR, + {{MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, + MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID}, + {MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_CATEGORY, + KSCATEGORY_SENSOR_CAMERA}}}}; + +bool IsDeviceBlacklistedForQueryingDetailedFrameRates( const std::string& display_name) { return display_name.find("WebcamMax") != std::string::npos; } -static bool LoadMediaFoundationDlls() { +bool LoadMediaFoundationDlls() { static const wchar_t* const kMfDLLs[] = { L"%WINDIR%\\system32\\mf.dll", L"%WINDIR%\\system32\\mfplat.dll", L"%WINDIR%\\system32\\mfreadwrite.dll", @@ -84,9 +98,10 @@ return true; } -static bool PrepareVideoCaptureAttributesMediaFoundation( - IMFAttributes** attributes, - int count) { +bool PrepareVideoCaptureAttributesMediaFoundation( + const std::vector<std::pair<GUID, GUID>>& attributes_data, + int count, + IMFAttributes** attributes) { // Once https://bugs.chromium.org/p/chromium/issues/detail?id=791615 is fixed, // we must make sure that this method succeeds in capture_unittests context // when MediaFoundation is enabled. @@ -98,36 +113,53 @@ if (FAILED(MFCreateAttributes(attributes, count))) return false; - return SUCCEEDED( - (*attributes) - ->SetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, - MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID)); + for (const auto& value : attributes_data) { + if (!SUCCEEDED((*attributes)->SetGUID(value.first, value.second))) + return false; + } + return true; } -static bool CreateVideoCaptureDeviceMediaFoundation(const char* sym_link, - IMFMediaSource** source) { +bool CreateVideoCaptureDeviceMediaFoundation(const Descriptor& descriptor, + IMFMediaSource** source) { ComPtr<IMFAttributes> attributes; - if (!PrepareVideoCaptureAttributesMediaFoundation(attributes.GetAddressOf(), - 2)) + static_assert( + arraysize(kMfAttributes) == 2, + "Implementation here asumes that kMfAttributes has size of two."); + DCHECK_EQ(kMfAttributes[0].first, VideoCaptureApi::WIN_MEDIA_FOUNDATION); + const auto& attributes_data = + descriptor.capture_api == VideoCaptureApi::WIN_MEDIA_FOUNDATION + ? kMfAttributes[0].second + : kMfAttributes[1].second; + // We allocate attributes_data.size() + 1 (+1 is for sym_link below) elements + // in attributes store. + if (!PrepareVideoCaptureAttributesMediaFoundation( + attributes_data, attributes_data.size() + 1, + attributes.GetAddressOf())) { return false; + } attributes->SetString(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, - base::SysUTF8ToWide(sym_link).c_str()); - + base::SysUTF8ToWide(descriptor.device_id).c_str()); return SUCCEEDED(MFCreateDeviceSource(attributes.Get(), source)); } -static bool EnumerateVideoDevicesMediaFoundation(IMFActivate*** devices, - UINT32* count) { +bool EnumerateVideoDevicesMediaFoundation( + const std::vector<std::pair<GUID, GUID>>& attributes_data, + VideoCaptureDeviceFactoryWin::MFEnumDeviceSourcesFunc + mf_enum_device_sources_func, + IMFActivate*** devices, + UINT32* count) { ComPtr<IMFAttributes> attributes; - if (!PrepareVideoCaptureAttributesMediaFoundation(attributes.GetAddressOf(), - 1)) + if (!PrepareVideoCaptureAttributesMediaFoundation( + attributes_data, attributes_data.size(), attributes.GetAddressOf())) { return false; - - return SUCCEEDED(MFEnumDeviceSources(attributes.Get(), devices, count)); + } + return SUCCEEDED( + mf_enum_device_sources_func(attributes.Get(), devices, count)); } -static bool IsDeviceBlackListed(const std::string& name) { +bool IsDeviceBlackListed(const std::string& name) { DCHECK_EQ(BLACKLISTED_CAMERA_MAX + 1, static_cast<int>(arraysize(kBlacklistedCameraNames))); for (size_t i = 0; i < arraysize(kBlacklistedCameraNames); ++i) { @@ -142,7 +174,7 @@ return false; } -static std::string GetDeviceModelId(const std::string& device_id) { +std::string GetDeviceModelId(const std::string& device_id) { const size_t vid_prefix_size = sizeof(kVidPrefix) - 1; const size_t pid_prefix_size = sizeof(kPidPrefix) - 1; const size_t vid_location = device_id.find(kVidPrefix); @@ -162,7 +194,7 @@ return id_vendor + ":" + id_product; } -static void GetDeviceDescriptorsDirectShow(Descriptors* device_descriptors) { +void GetDeviceDescriptorsDirectShow(Descriptors* device_descriptors) { DCHECK(device_descriptors); DVLOG(1) << __func__; @@ -219,42 +251,66 @@ } } -static void GetDeviceDescriptorsMediaFoundation( +bool DescriptorsContainDeviceId(const Descriptors& descriptors, + const std::string& device_id) { + return std::find_if( + descriptors.begin(), descriptors.end(), + [device_id](const VideoCaptureDeviceDescriptor& descriptor) { + return device_id == descriptor.device_id; + }) != descriptors.end(); +} + +void GetDeviceDescriptorsMediaFoundation( + VideoCaptureDeviceFactoryWin::MFEnumDeviceSourcesFunc + mf_enum_device_sources_func, Descriptors* device_descriptors) { DVLOG(1) << " GetDeviceDescriptorsMediaFoundation"; - ScopedCoMem<IMFActivate*> devices; - UINT32 count; - if (!EnumerateVideoDevicesMediaFoundation(&devices, &count)) - return; - - for (UINT32 i = 0; i < count; ++i) { - ScopedCoMem<wchar_t> name; - UINT32 name_size; - HRESULT hr = devices[i]->GetAllocatedString( - MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME, &name, &name_size); - if (SUCCEEDED(hr)) { - ScopedCoMem<wchar_t> id; - UINT32 id_size; - hr = devices[i]->GetAllocatedString( - MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, &id, - &id_size); - if (SUCCEEDED(hr)) { - const std::string device_id = - base::SysWideToUTF8(std::wstring(id, id_size)); - const std::string model_id = GetDeviceModelId(device_id); - device_descriptors->emplace_back( - base::SysWideToUTF8(std::wstring(name, name_size)), device_id, - model_id, VideoCaptureApi::WIN_MEDIA_FOUNDATION); - } + // Recent non-RGB (depth, IR) cameras could be marked as sensor cameras in + // driver inf file and MFEnumDeviceSources enumerates them only if attribute + // KSCATEGORY_SENSOR_CAMERA is supplied. We enumerate twice. As it is possible + // that SENSOR_CAMERA is also in VIDEO_CAMERA category, we prevent duplicate + // entries. https://crbug.com/807293 + for (const auto& api_attributes : kMfAttributes) { + ScopedCoMem<IMFActivate*> devices; + UINT32 count; + if (!EnumerateVideoDevicesMediaFoundation(api_attributes.second, + mf_enum_device_sources_func, + &devices, &count)) { + return; } - DLOG_IF(ERROR, FAILED(hr)) << "GetAllocatedString failed: " - << logging::SystemErrorCodeToString(hr); - devices[i]->Release(); + const bool list_was_empty = !device_descriptors->size(); + for (UINT32 i = 0; i < count; ++i) { + ScopedCoMem<wchar_t> name; + UINT32 name_size; + HRESULT hr = devices[i]->GetAllocatedString( + MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME, &name, &name_size); + if (SUCCEEDED(hr)) { + ScopedCoMem<wchar_t> id; + UINT32 id_size; + hr = devices[i]->GetAllocatedString( + MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, &id, + &id_size); + if (SUCCEEDED(hr)) { + const std::string device_id = + base::SysWideToUTF8(std::wstring(id, id_size)); + const std::string model_id = GetDeviceModelId(device_id); + if (list_was_empty || + !DescriptorsContainDeviceId(*device_descriptors, device_id)) { + device_descriptors->emplace_back( + base::SysWideToUTF8(std::wstring(name, name_size)), device_id, + model_id, api_attributes.first); + } + } + } + DLOG_IF(ERROR, FAILED(hr)) << "GetAllocatedString failed: " + << logging::SystemErrorCodeToString(hr); + devices[i]->Release(); + } } } -static void GetDeviceSupportedFormatsDirectShow(const Descriptor& descriptor, - VideoCaptureFormats* formats) { +void GetDeviceSupportedFormatsDirectShow(const Descriptor& descriptor, + VideoCaptureFormats* formats) { DVLOG(1) << "GetDeviceSupportedFormatsDirectShow for " << descriptor.display_name(); bool query_detailed_frame_rates = @@ -270,13 +326,12 @@ } } -static void GetDeviceSupportedFormatsMediaFoundation( - const Descriptor& descriptor, - VideoCaptureFormats* formats) { +void GetDeviceSupportedFormatsMediaFoundation(const Descriptor& descriptor, + VideoCaptureFormats* formats) { DVLOG(1) << "GetDeviceSupportedFormatsMediaFoundation for " << descriptor.display_name(); ComPtr<IMFMediaSource> source; - if (!CreateVideoCaptureDeviceMediaFoundation(descriptor.device_id.c_str(), + if (!CreateVideoCaptureDeviceMediaFoundation(descriptor, source.GetAddressOf())) { return; } @@ -335,6 +390,8 @@ } } +} // namespace + // Returns true iff the current platform supports the Media Foundation API // and that the DLLs are available. On Vista this API is an optional download // but the API is advertised as a part of Windows 7 and onwards. However, @@ -349,6 +406,8 @@ VideoCaptureDeviceFactoryWin::VideoCaptureDeviceFactoryWin() : use_media_foundation_( base::FeatureList::IsEnabled(media::kMediaFoundationVideoCapture)) { + mf_enum_device_sources_func_ = + PlatformSupportsMediaFoundation() ? MFEnumDeviceSources : nullptr; if (!PlatformSupportsMediaFoundation()) { use_media_foundation_ = false; LogVideoCaptureWinBackendUsed( @@ -365,37 +424,48 @@ std::unique_ptr<VideoCaptureDevice> VideoCaptureDeviceFactoryWin::CreateDevice( const Descriptor& device_descriptor) { DCHECK(thread_checker_.CalledOnValidThread()); - std::unique_ptr<VideoCaptureDevice> device; - if (device_descriptor.capture_api == VideoCaptureApi::WIN_MEDIA_FOUNDATION) { - DCHECK(PlatformSupportsMediaFoundation()); - ComPtr<IMFMediaSource> source; - if (!CreateVideoCaptureDeviceMediaFoundation( - device_descriptor.device_id.c_str(), source.GetAddressOf())) { - return std::unique_ptr<VideoCaptureDevice>(); + switch (device_descriptor.capture_api) { + case VideoCaptureApi::WIN_MEDIA_FOUNDATION: + FALLTHROUGH; + case VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR: { + DCHECK(PlatformSupportsMediaFoundation()); + ComPtr<IMFMediaSource> source; + if (!CreateVideoCaptureDeviceMediaFoundation(device_descriptor, + source.GetAddressOf())) { + break; + } + std::unique_ptr<VideoCaptureDevice> device( + new VideoCaptureDeviceMFWin(source)); + DVLOG(1) << " MediaFoundation Device: " + << device_descriptor.display_name(); + if (static_cast<VideoCaptureDeviceMFWin*>(device.get())->Init()) + return device; + break; } - device.reset(new VideoCaptureDeviceMFWin(source)); - DVLOG(1) << " MediaFoundation Device: " << device_descriptor.display_name(); - if (!static_cast<VideoCaptureDeviceMFWin*>(device.get())->Init()) - device.reset(); - } else if (device_descriptor.capture_api == - VideoCaptureApi::WIN_DIRECT_SHOW) { - device.reset(new VideoCaptureDeviceWin(device_descriptor)); - DVLOG(1) << " DirectShow Device: " << device_descriptor.display_name(); - if (!static_cast<VideoCaptureDeviceWin*>(device.get())->Init()) - device.reset(); - } else { - NOTREACHED(); + case VideoCaptureApi::WIN_DIRECT_SHOW: { + DVLOG(1) << " DirectShow Device: " << device_descriptor.display_name(); + std::unique_ptr<VideoCaptureDevice> device( + new VideoCaptureDeviceWin(device_descriptor)); + if (static_cast<VideoCaptureDeviceWin*>(device.get())->Init()) + return device; + break; + } + default: + NOTREACHED(); + break; } - return device; + return nullptr; } void VideoCaptureDeviceFactoryWin::GetDeviceDescriptors( VideoCaptureDeviceDescriptors* device_descriptors) { DCHECK(thread_checker_.CalledOnValidThread()); - if (use_media_foundation_) - GetDeviceDescriptorsMediaFoundation(device_descriptors); - else + if (use_media_foundation_) { + GetDeviceDescriptorsMediaFoundation(mf_enum_device_sources_func_, + device_descriptors); + } else { GetDeviceDescriptorsDirectShow(device_descriptors); + } } void VideoCaptureDeviceFactoryWin::GetSupportedFormats(
diff --git a/media/capture/video/win/video_capture_device_factory_win.h b/media/capture/video/win/video_capture_device_factory_win.h index a7d36783..64cf2a5c 100644 --- a/media/capture/video/win/video_capture_device_factory_win.h +++ b/media/capture/video/win/video_capture_device_factory_win.h
@@ -7,6 +7,7 @@ #ifndef MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_FACTORY_WIN_H_ #define MEDIA_CAPTURE_VIDEO_WIN_VIDEO_CAPTURE_DEVICE_FACTORY_WIN_H_ +#include <mfidl.h> #include "base/macros.h" #include "media/capture/video/video_capture_device_factory.h" @@ -22,6 +23,8 @@ VideoCaptureDeviceFactoryWin(); ~VideoCaptureDeviceFactoryWin() override {} + using MFEnumDeviceSourcesFunc = decltype(&MFEnumDeviceSources); + std::unique_ptr<VideoCaptureDevice> CreateDevice( const VideoCaptureDeviceDescriptor& device_descriptor) override; void GetDeviceDescriptors( @@ -33,9 +36,17 @@ void set_use_media_foundation_for_testing(bool use) { use_media_foundation_ = use; } + void set_mf_enum_device_sources_func_for_testing( + MFEnumDeviceSourcesFunc func) { + mf_enum_device_sources_func_ = func; + } private: bool use_media_foundation_; + // In production code, when Media Foundation libraries are available, + // |mf_enum_device_sources_func_| points to MFEnumDeviceSources. It enables + // mock of Media Foundation API in unit tests. + MFEnumDeviceSourcesFunc mf_enum_device_sources_func_ = nullptr; DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceFactoryWin); };
diff --git a/media/capture/video/win/video_capture_device_factory_win_unittest.cc b/media/capture/video/win/video_capture_device_factory_win_unittest.cc new file mode 100644 index 0000000..b66d5565 --- /dev/null +++ b/media/capture/video/win/video_capture_device_factory_win_unittest.cc
@@ -0,0 +1,298 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <mfidl.h> + +#include <ks.h> +#include <mfapi.h> +#include <mferror.h> +#include <stddef.h> + +#include "base/strings/sys_string_conversions.h" +#include "media/capture/video/win/video_capture_device_factory_win.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using ::testing::Mock; + +namespace media { + +namespace { + +const wchar_t* kDeviceId0 = L"\\\\?\\usb#vid_0000&pid_0000&mi_00"; +const wchar_t* kDeviceId1 = L"\\\\?\\usb#vid_0001&pid_0001&mi_00"; +const wchar_t* kDeviceId2 = L"\\\\?\\usb#vid_0002&pid_0002&mi_00"; +const wchar_t* kDeviceName0 = L"Device 0"; +const wchar_t* kDeviceName1 = L"Device 1"; +const wchar_t* kDeviceName2 = L"Device 2"; + +using iterator = VideoCaptureDeviceDescriptors::const_iterator; +iterator FindDescriptorInRange(iterator begin, + iterator end, + const std::string& device_id) { + return std::find_if( + begin, end, [device_id](const VideoCaptureDeviceDescriptor& descriptor) { + return device_id == descriptor.device_id; + }); +} + +class MockMFActivate : public base::RefCountedThreadSafe<MockMFActivate>, + public IMFActivate { + public: + MockMFActivate(const std::wstring& symbolic_link, + const std::wstring& name, + bool kscategory_video_camera, + bool kscategory_sensor_camera) + : symbolic_link_(symbolic_link), + name_(name), + kscategory_video_camera_(kscategory_video_camera), + kscategory_sensor_camera_(kscategory_sensor_camera) {} + + bool MatchesQuery(IMFAttributes* query, HRESULT* status) { + UINT32 count; + *status = query->GetCount(&count); + if (FAILED(*status)) + return false; + GUID value; + *status = query->GetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, &value); + if (FAILED(*status)) + return false; + if (value != MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID) + return false; + *status = query->GetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_CATEGORY, + &value); + if (SUCCEEDED(*status)) { + if ((value == KSCATEGORY_SENSOR_CAMERA && kscategory_sensor_camera_) || + (value == KSCATEGORY_VIDEO_CAMERA && kscategory_video_camera_)) + return true; + } else if (*status == MF_E_ATTRIBUTENOTFOUND) { + // When no category attribute is specified, it should behave the same as + // if KSCATEGORY_VIDEO_CAMERA is specified. + *status = S_OK; + if (kscategory_video_camera_) + return true; + } + return false; + } + + STDMETHOD(QueryInterface)(REFIID riid, void** ppvObject) override { + return E_NOTIMPL; + } + STDMETHOD_(ULONG, AddRef)() override { + base::RefCountedThreadSafe<MockMFActivate>::AddRef(); + return 1U; + } + + STDMETHOD_(ULONG, Release)() override { + base::RefCountedThreadSafe<MockMFActivate>::Release(); + return 1U; + } + STDMETHOD(GetItem)(REFGUID key, PROPVARIANT* value) override { + return E_FAIL; + } + STDMETHOD(GetItemType)(REFGUID guidKey, MF_ATTRIBUTE_TYPE* pType) override { + return E_NOTIMPL; + } + STDMETHOD(CompareItem) + (REFGUID guidKey, REFPROPVARIANT Value, BOOL* pbResult) override { + return E_NOTIMPL; + } + STDMETHOD(Compare) + (IMFAttributes* pTheirs, + MF_ATTRIBUTES_MATCH_TYPE MatchType, + BOOL* pbResult) override { + return E_NOTIMPL; + } + STDMETHOD(GetUINT32)(REFGUID key, UINT32* value) override { + if (key == MF_MT_INTERLACE_MODE) { + *value = MFVideoInterlace_Progressive; + return S_OK; + } + return E_NOTIMPL; + } + STDMETHOD(GetUINT64)(REFGUID key, UINT64* value) override { return E_FAIL; } + STDMETHOD(GetDouble)(REFGUID guidKey, double* pfValue) override { + return E_NOTIMPL; + } + STDMETHOD(GetGUID)(REFGUID key, GUID* value) override { return E_FAIL; } + STDMETHOD(GetStringLength)(REFGUID guidKey, UINT32* pcchLength) override { + return E_NOTIMPL; + } + STDMETHOD(GetString) + (REFGUID guidKey, + LPWSTR pwszValue, + UINT32 cchBufSize, + UINT32* pcchLength) override { + return E_NOTIMPL; + } + STDMETHOD(GetAllocatedString) + (REFGUID guidKey, LPWSTR* ppwszValue, UINT32* pcchLength) override { + std::wstring value; + if (guidKey == MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK) { + value = symbolic_link_; + } else if (guidKey == MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME) { + value = name_; + } else { + return E_NOTIMPL; + } + *ppwszValue = static_cast<wchar_t*>( + CoTaskMemAlloc((value.size() + 1) * sizeof(wchar_t))); + wcscpy(*ppwszValue, value.c_str()); + *pcchLength = value.length(); + return S_OK; + } + STDMETHOD(GetBlobSize)(REFGUID guidKey, UINT32* pcbBlobSize) override { + return E_NOTIMPL; + } + STDMETHOD(GetBlob) + (REFGUID guidKey, + UINT8* pBuf, + UINT32 cbBufSize, + UINT32* pcbBlobSize) override { + return E_NOTIMPL; + } + STDMETHOD(GetAllocatedBlob) + (REFGUID guidKey, UINT8** ppBuf, UINT32* pcbSize) override { + return E_NOTIMPL; + } + STDMETHOD(GetUnknown)(REFGUID guidKey, REFIID riid, LPVOID* ppv) override { + return E_NOTIMPL; + } + STDMETHOD(SetItem)(REFGUID guidKey, REFPROPVARIANT Value) override { + return E_NOTIMPL; + } + STDMETHOD(DeleteItem)(REFGUID guidKey) override { return E_NOTIMPL; } + STDMETHOD(DeleteAllItems)(void) override { return E_NOTIMPL; } + STDMETHOD(SetUINT32)(REFGUID guidKey, UINT32 unValue) override { + return E_NOTIMPL; + } + STDMETHOD(SetUINT64)(REFGUID guidKey, UINT64 unValue) override { + return E_NOTIMPL; + } + STDMETHOD(SetDouble)(REFGUID guidKey, double fValue) override { + return E_NOTIMPL; + } + STDMETHOD(SetGUID)(REFGUID guidKey, REFGUID guidValue) override { + return E_NOTIMPL; + } + STDMETHOD(SetString)(REFGUID guidKey, LPCWSTR wszValue) override { + return E_NOTIMPL; + } + STDMETHOD(SetBlob) + (REFGUID guidKey, const UINT8* pBuf, UINT32 cbBufSize) override { + return E_NOTIMPL; + } + STDMETHOD(SetUnknown)(REFGUID guidKey, IUnknown* pUnknown) override { + return E_NOTIMPL; + } + STDMETHOD(LockStore)(void) override { return E_NOTIMPL; } + STDMETHOD(UnlockStore)(void) override { return E_NOTIMPL; } + STDMETHOD(GetCount)(UINT32* pcItems) override { return E_NOTIMPL; } + STDMETHOD(GetItemByIndex) + (UINT32 unIndex, GUID* pguidKey, PROPVARIANT* pValue) override { + return E_NOTIMPL; + } + STDMETHOD(CopyAllItems)(IMFAttributes* pDest) override { return E_NOTIMPL; } + STDMETHOD(ActivateObject)(REFIID riid, void** ppv) override { + return E_NOTIMPL; + } + STDMETHOD(DetachObject)(void) override { return E_NOTIMPL; } + STDMETHOD(ShutdownObject)(void) override { return E_NOTIMPL; } + + private: + friend class base::RefCountedThreadSafe<MockMFActivate>; + virtual ~MockMFActivate() = default; + + const std::wstring symbolic_link_; + const std::wstring name_; + const bool kscategory_video_camera_; + const bool kscategory_sensor_camera_; +}; + +HRESULT __stdcall MockMFEnumDeviceSources(IMFAttributes* attributes, + IMFActivate*** devices, + UINT32* count) { + MockMFActivate* mock_devices[] = { + new MockMFActivate(kDeviceId0, kDeviceName0, true, false), + new MockMFActivate(kDeviceId1, kDeviceName1, true, true), + new MockMFActivate(kDeviceId2, kDeviceName2, false, true)}; + // Iterate once to get the match count and check for errors. + *count = 0U; + HRESULT hr; + for (MockMFActivate* device : mock_devices) { + if (device->MatchesQuery(attributes, &hr)) + (*count)++; + if (FAILED(hr)) + return hr; + } + // Second iteration packs the returned devices and increments their + // reference count. + *devices = static_cast<IMFActivate**>( + CoTaskMemAlloc(sizeof(IMFActivate*) * (*count))); + int offset = 0; + for (MockMFActivate* device : mock_devices) { + if (!device->MatchesQuery(attributes, &hr)) + continue; + *(*devices + offset++) = device; + device->AddRef(); + } + return S_OK; +} + +} // namespace + +class VideoCaptureDeviceFactoryWinTest : public ::testing::Test { + protected: + VideoCaptureDeviceFactoryWinTest() + : media_foundation_supported_( + VideoCaptureDeviceFactoryWin::PlatformSupportsMediaFoundation()) {} + + bool ShouldSkipMFTest() { + if (media_foundation_supported_) + return false; + DVLOG(1) << "Media foundation is not supported by the current platform. " + "Skipping test."; + return true; + } + + VideoCaptureDeviceFactoryWin factory_; + const bool media_foundation_supported_; +}; + +class VideoCaptureDeviceFactoryMFWinTest + : public VideoCaptureDeviceFactoryWinTest { + void SetUp() override { factory_.set_use_media_foundation_for_testing(true); } +}; + +TEST_F(VideoCaptureDeviceFactoryMFWinTest, GetDeviceDescriptors) { + if (ShouldSkipMFTest()) + return; + factory_.set_mf_enum_device_sources_func_for_testing( + &MockMFEnumDeviceSources); + VideoCaptureDeviceDescriptors descriptors; + factory_.GetDeviceDescriptors(&descriptors); + EXPECT_EQ(descriptors.size(), 3U); + for (auto it = descriptors.begin(); it != descriptors.end(); it++) { + // Verify that there are no duplicates. + EXPECT_EQ(FindDescriptorInRange(descriptors.begin(), it, it->device_id), + it); + } + iterator it = FindDescriptorInRange(descriptors.begin(), descriptors.end(), + base::SysWideToUTF8(kDeviceId0)); + EXPECT_NE(it, descriptors.end()); + EXPECT_EQ(it->capture_api, VideoCaptureApi::WIN_MEDIA_FOUNDATION); + EXPECT_EQ(it->display_name(), base::SysWideToUTF8(kDeviceName0)); + it = FindDescriptorInRange(descriptors.begin(), descriptors.end(), + base::SysWideToUTF8(kDeviceId1)); + EXPECT_NE(it, descriptors.end()); + EXPECT_EQ(it->capture_api, VideoCaptureApi::WIN_MEDIA_FOUNDATION); + EXPECT_EQ(it->display_name(), base::SysWideToUTF8(kDeviceName1)); + it = FindDescriptorInRange(descriptors.begin(), descriptors.end(), + base::SysWideToUTF8(kDeviceId2)); + EXPECT_NE(it, descriptors.end()); + EXPECT_EQ(it->capture_api, VideoCaptureApi::WIN_MEDIA_FOUNDATION_SENSOR); + EXPECT_EQ(it->display_name(), base::SysWideToUTF8(kDeviceName2)); +} + +} // namespace media
diff --git a/media/capture/video/win/video_capture_device_mf_win.cc b/media/capture/video/win/video_capture_device_mf_win.cc index 59f6314..7230966 100644 --- a/media/capture/video/win/video_capture_device_mf_win.cc +++ b/media/capture/video/win/video_capture_device_mf_win.cc
@@ -119,15 +119,13 @@ return scoped_refptr<IMFCaptureEngineOnSampleCallback>( new MFPhotoCallback(std::move(callback), format)); } -} // namespace void LogError(const Location& from_here, HRESULT hr) { DPLOG(ERROR) << from_here.ToString() << " hr = " << logging::SystemErrorCodeToString(hr); } -static bool GetFrameSizeFromMediaType(IMFMediaType* type, - gfx::Size* frame_size) { +bool GetFrameSizeFromMediaType(IMFMediaType* type, gfx::Size* frame_size) { UINT32 width32, height32; if (FAILED(MFGetAttributeSize(type, MF_MT_FRAME_SIZE, &width32, &height32))) return false; @@ -135,7 +133,7 @@ return true; } -static bool GetFrameRateFromMediaType(IMFMediaType* type, float* frame_rate) { +bool GetFrameRateFromMediaType(IMFMediaType* type, float* frame_rate) { UINT32 numerator, denominator; if (FAILED(MFGetAttributeRatio(type, MF_MT_FRAME_RATE, &numerator, &denominator)) || @@ -146,9 +144,9 @@ return true; } -static bool GetFormatFromSourceMediaType(IMFMediaType* source_media_type, - bool photo, - VideoCaptureFormat* format) { +bool GetFormatFromSourceMediaType(IMFMediaType* source_media_type, + bool photo, + VideoCaptureFormat* format) { GUID major_type_guid; if (FAILED(source_media_type->GetGUID(MF_MT_MAJOR_TYPE, &major_type_guid)) || (major_type_guid != MFMediaType_Image && @@ -168,9 +166,9 @@ return true; } -static HRESULT CopyAttribute(IMFAttributes* source_attributes, - IMFAttributes* destination_attributes, - const GUID& key) { +HRESULT CopyAttribute(IMFAttributes* source_attributes, + IMFAttributes* destination_attributes, + const GUID& key) { PROPVARIANT var; PropVariantInit(&var); HRESULT hr = source_attributes->GetItem(key, &var); @@ -188,7 +186,7 @@ VideoPixelFormat pixel_format; }; -static bool GetMediaFormatConfigurationFromMFSourceMediaSubtype( +bool GetMediaFormatConfigurationFromMFSourceMediaSubtype( const GUID& mf_source_media_subtype, MediaFormatConfiguration* media_format_configuration) { static const MediaFormatConfiguration kMediaFormatConfigurationMap[] = { @@ -208,14 +206,13 @@ {MFVideoFormat_NV12, MFVideoFormat_I420, PIXEL_FORMAT_I420}, {MFVideoFormat_YV12, MFVideoFormat_I420, PIXEL_FORMAT_I420}, - // Depth cameras use specific uncompressed video formats unknown to - // IMFCaptureEngine. - // Therefore, IMFCaptureEngine cannot perform any transcoding on these. - // So we ask IMFCaptureEngine to let the frame pass through, without - // transcoding. + // Depth cameras use 16-bit uncompressed video formats. + // We ask IMFCaptureEngine to let the frame pass through, without + // transcoding, since transcoding would lead to precision loss. {kMediaSubTypeY16, kMediaSubTypeY16, PIXEL_FORMAT_Y16}, {kMediaSubTypeZ16, kMediaSubTypeZ16, PIXEL_FORMAT_Y16}, {kMediaSubTypeINVZ, kMediaSubTypeINVZ, PIXEL_FORMAT_Y16}, + {MFVideoFormat_D16, MFVideoFormat_D16, PIXEL_FORMAT_Y16}, // Photo type {GUID_ContainerFormatJpeg, GUID_ContainerFormatJpeg, PIXEL_FORMAT_MJPEG}}; @@ -231,8 +228,12 @@ return false; } -static HRESULT GetMFSinkMediaSubtype(IMFMediaType* source_media_type, - GUID* mf_sink_media_subtype) { +// Calculate sink subtype based on source subtype. |passthrough| is set when +// sink and source are the same and means that there should be no transcoding +// done by IMFCaptureEngine. +HRESULT GetMFSinkMediaSubtype(IMFMediaType* source_media_type, + GUID* mf_sink_media_subtype, + bool* passthrough) { GUID source_subtype; HRESULT hr = source_media_type->GetGUID(MF_MT_SUBTYPE, &source_subtype); if (FAILED(hr)) @@ -242,19 +243,22 @@ source_subtype, &media_format_configuration)) return E_FAIL; *mf_sink_media_subtype = media_format_configuration.mf_sink_media_subtype; + *passthrough = + (media_format_configuration.mf_sink_media_subtype == source_subtype); return S_OK; } -static HRESULT ConvertToPhotoSinkMediaType( - IMFMediaType* source_media_type, - IMFMediaType* destination_media_type) { +HRESULT ConvertToPhotoSinkMediaType(IMFMediaType* source_media_type, + IMFMediaType* destination_media_type) { HRESULT hr = destination_media_type->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Image); if (FAILED(hr)) return hr; + bool passthrough = false; GUID mf_sink_media_subtype; - hr = GetMFSinkMediaSubtype(source_media_type, &mf_sink_media_subtype); + hr = GetMFSinkMediaSubtype(source_media_type, &mf_sink_media_subtype, + &passthrough); if (FAILED(hr)) return hr; @@ -266,19 +270,23 @@ MF_MT_FRAME_SIZE); } -static HRESULT ConvertToVideoSinkMediaType(IMFMediaType* source_media_type, - IMFMediaType* sink_media_type) { +HRESULT ConvertToVideoSinkMediaType(IMFMediaType* source_media_type, + IMFMediaType* sink_media_type) { HRESULT hr = sink_media_type->SetGUID(MF_MT_MAJOR_TYPE, MFMediaType_Video); if (FAILED(hr)) return hr; + bool passthrough = false; GUID mf_sink_media_subtype; - hr = GetMFSinkMediaSubtype(source_media_type, &mf_sink_media_subtype); + hr = GetMFSinkMediaSubtype(source_media_type, &mf_sink_media_subtype, + &passthrough); if (FAILED(hr)) return hr; hr = sink_media_type->SetGUID(MF_MT_SUBTYPE, mf_sink_media_subtype); - if (FAILED(hr)) + // Copying attribute values for passthrough mode is redundant, since the + // format is kept unchanged, and causes AddStream error MF_E_INVALIDMEDIATYPE. + if (FAILED(hr) || passthrough) return hr; hr = CopyAttribute(source_media_type, sink_media_type, MF_MT_FRAME_SIZE); @@ -298,7 +306,7 @@ MF_MT_INTERLACE_MODE); } -static const CapabilityWin& GetBestMatchedPhotoCapability( +const CapabilityWin& GetBestMatchedPhotoCapability( ComPtr<IMFMediaType> current_media_type, gfx::Size requested_size, const CapabilityList& capabilities) { @@ -336,6 +344,7 @@ return capture_engine_class_factory->CreateInstance(CLSID_MFCaptureEngine, IID_PPV_ARGS(engine)); } +} // namespace class MFVideoCallback final : public base::RefCountedThreadSafe<MFVideoCallback>,
diff --git a/media/capture/video/win/video_capture_device_mf_win_unittest.cc b/media/capture/video/win/video_capture_device_mf_win_unittest.cc index 8b6b1e03..7ef9f343 100644 --- a/media/capture/video/win/video_capture_device_mf_win_unittest.cc +++ b/media/capture/video/win/video_capture_device_mf_win_unittest.cc
@@ -791,6 +791,13 @@ virtual ~MockMFMediaEvent() = default; }; +struct DepthDeviceParams { + GUID depth_video_stream_subtype; + // Depth stream could offer other (e.g. I420) formats, in addition to 16-bit. + bool additional_i420_formats_in_depth_stream; + // Depth device sometimes provides multiple video streams. + bool additional_i420_video_stream; +}; } // namespace const int kArbitraryValidVideoWidth = 1920; @@ -949,6 +956,72 @@ .WillRepeatedly(Invoke(get_device_media_type)); } + void PrepareMFDepthDeviceWithCombinedFormatsAndStreams( + DepthDeviceParams params) { + EXPECT_CALL(*capture_source_, DoGetDeviceStreamCount(_)) + .WillRepeatedly(Invoke([params](DWORD* stream_count) { + *stream_count = params.additional_i420_video_stream ? 2 : 1; + return S_OK; + })); + EXPECT_CALL(*capture_source_, DoGetDeviceStreamCategory(_, _)) + .WillRepeatedly(Invoke([](DWORD stream_index, + MF_CAPTURE_ENGINE_STREAM_CATEGORY* category) { + if (stream_index <= 1) { + *category = MF_CAPTURE_ENGINE_STREAM_CATEGORY_VIDEO_PREVIEW; + return S_OK; + } + return E_FAIL; + })); + + auto get_device_media_type = [params](DWORD stream_index, + IMFMediaType** media_type) { + if (stream_index == 0) { + *media_type = new StubMFMediaType( + MFMediaType_Video, params.depth_video_stream_subtype, + kArbitraryValidVideoWidth, kArbitraryValidVideoHeight, 30); + (*media_type)->AddRef(); + return S_OK; + } else if (stream_index == 1 && params.additional_i420_video_stream) { + *media_type = new StubMFMediaType(MFMediaType_Video, MFVideoFormat_I420, + kArbitraryValidVideoWidth, + kArbitraryValidVideoHeight, 30); + (*media_type)->AddRef(); + return S_OK; + } + return E_FAIL; + }; + + EXPECT_CALL(*capture_source_, DoGetAvailableDeviceMediaType(_, _, _)) + .WillRepeatedly(Invoke([params, get_device_media_type]( + DWORD stream_index, DWORD media_type_index, + IMFMediaType** media_type) { + if (stream_index == 0 && + params.additional_i420_formats_in_depth_stream && + media_type_index == 1) { + *media_type = new StubMFMediaType( + MFMediaType_Video, MFVideoFormat_I420, + kArbitraryValidVideoWidth, kArbitraryValidVideoHeight, 30); + (*media_type)->AddRef(); + return S_OK; + } + if (media_type_index != 0) + return MF_E_NO_MORE_TYPES; + return get_device_media_type(stream_index, media_type); + })); + + EXPECT_CALL(*(engine_.Get()), + DoGetSink(MF_CAPTURE_ENGINE_SINK_TYPE_PREVIEW, _)) + .WillRepeatedly(Invoke([this](MF_CAPTURE_ENGINE_SINK_TYPE sink_type, + IMFCaptureSink** sink) { + *sink = this->capture_preview_sink_.get(); + this->capture_preview_sink_->AddRef(); + return S_OK; + })); + + EXPECT_CALL(*capture_source_, DoGetCurrentDeviceMediaType(_, _)) + .WillRepeatedly(Invoke(get_device_media_type)); + } + Microsoft::WRL::ComPtr<MockMFMediaSource> media_source_; Microsoft::WRL::ComPtr<MockMFCaptureEngine> engine_; std::unique_ptr<MockClient> client_; @@ -1138,51 +1211,61 @@ device_->TakePhoto(std::move(take_photo_callback)); } -class DepthCameraDeviceMFWinTest : public VideoCaptureDeviceMFWinTest, - public testing::WithParamInterface<GUID> {}; +class DepthCameraDeviceMFWinTest + : public VideoCaptureDeviceMFWinTest, + public testing::WithParamInterface<DepthDeviceParams> {}; -const GUID kDepthCameraOfferedVideoMediaSubtype[] = { - kMediaSubTypeY16, kMediaSubTypeZ16, kMediaSubTypeINVZ}; +const DepthDeviceParams kDepthCamerasParams[] = { + {kMediaSubTypeY16, false, false}, + {kMediaSubTypeZ16, false, true}, + {kMediaSubTypeINVZ, true, false}, + {MFVideoFormat_D16, true, true}}; -INSTANTIATE_TEST_CASE_P( - DepthCameraDeviceMFWinTests, - DepthCameraDeviceMFWinTest, - testing::ValuesIn(kDepthCameraOfferedVideoMediaSubtype)); +INSTANTIATE_TEST_CASE_P(DepthCameraDeviceMFWinTests, + DepthCameraDeviceMFWinTest, + testing::ValuesIn(kDepthCamerasParams)); -// Given an |IMFCaptureSource| offering a video stream with subtype Y16, Z16 or -// INVZ , when allocating and starting |VideoCaptureDevice| then expect the MF -// source and the MF sink to be set to the same media subtype +// Given an |IMFCaptureSource| offering a video stream with subtype Y16, Z16, +// INVZ or D16, when allocating and starting |VideoCaptureDevice| expect the MF +// source and the MF sink to be set to the same media subtype. TEST_P(DepthCameraDeviceMFWinTest, AllocateAndStartDepthCamera) { if (ShouldSkipTest()) return; - GUID offered_video_media_subtype = GetParam(); - PrepareMFDeviceWithOneVideoStream(offered_video_media_subtype); + DepthDeviceParams params = GetParam(); + if (!params.additional_i420_video_stream && + !params.additional_i420_formats_in_depth_stream) { + PrepareMFDeviceWithOneVideoStream(params.depth_video_stream_subtype); + } else { + PrepareMFDepthDeviceWithCombinedFormatsAndStreams(params); + } EXPECT_CALL(*(engine_.Get()), OnStartPreview()); EXPECT_CALL(*client_, OnStarted()); EXPECT_CALL(*(capture_source_.get()), DoSetCurrentDeviceMediaType(0, _)) - .WillOnce(Invoke([offered_video_media_subtype](DWORD stream_index, - IMFMediaType* media_type) { + .WillOnce(Invoke([params](DWORD stream_index, IMFMediaType* media_type) { GUID source_video_media_subtype; media_type->GetGUID(MF_MT_SUBTYPE, &source_video_media_subtype); - EXPECT_EQ(source_video_media_subtype, offered_video_media_subtype); + EXPECT_EQ(source_video_media_subtype, + params.depth_video_stream_subtype); return S_OK; })); EXPECT_CALL(*(capture_preview_sink_.get()), DoAddStream(0, _, _, _)) - .WillOnce(Invoke([offered_video_media_subtype](DWORD stream_index, - IMFMediaType* media_type, - IMFAttributes* attributes, - DWORD* sink_stream_index) { + .WillOnce(Invoke([params](DWORD stream_index, IMFMediaType* media_type, + IMFAttributes* attributes, + DWORD* sink_stream_index) { GUID sink_video_media_subtype; media_type->GetGUID(MF_MT_SUBTYPE, &sink_video_media_subtype); - EXPECT_EQ(sink_video_media_subtype, offered_video_media_subtype); + EXPECT_EQ(sink_video_media_subtype, params.depth_video_stream_subtype); return S_OK; })); - device_->AllocateAndStart(VideoCaptureParams(), std::move(client_)); + VideoCaptureFormat format(gfx::Size(640, 480), 30, media::PIXEL_FORMAT_Y16); + VideoCaptureParams video_capture_params; + video_capture_params.requested_format = format; + device_->AllocateAndStart(video_capture_params, std::move(client_)); } } // namespace media \ No newline at end of file
diff --git a/media/cast/sender/h264_vt_encoder_unittest.cc b/media/cast/sender/h264_vt_encoder_unittest.cc index 29ee381..9bba4c2 100644 --- a/media/cast/sender/h264_vt_encoder_unittest.cc +++ b/media/cast/sender/h264_vt_encoder_unittest.cc
@@ -135,7 +135,8 @@ config, false, nullptr, base::Bind(&SaveDecoderInitResult, &decoder_init_result), base::Bind(&EndToEndFrameChecker::CompareFrameWithExpected, - base::Unretained(this))); + base::Unretained(this)), + VideoDecoder::WaitingForDecryptionKeyCB()); base::RunLoop().RunUntilIdle(); EXPECT_TRUE(decoder_init_result); }
diff --git a/media/filters/android/media_codec_audio_decoder.cc b/media/filters/android/media_codec_audio_decoder.cc index a987b612..9ce262db 100644 --- a/media/filters/android/media_codec_audio_decoder.cc +++ b/media/filters/android/media_codec_audio_decoder.cc
@@ -59,10 +59,12 @@ return "MediaCodecAudioDecoder"; } -void MediaCodecAudioDecoder::Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void MediaCodecAudioDecoder::Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DVLOG(1) << __func__ << ": " << config.AsHumanReadableString(); DCHECK_NE(state_, STATE_WAITING_FOR_MEDIA_CRYPTO);
diff --git a/media/filters/android/media_codec_audio_decoder.h b/media/filters/android/media_codec_audio_decoder.h index 0047a47..f748c18 100644 --- a/media/filters/android/media_codec_audio_decoder.h +++ b/media/filters/android/media_codec_audio_decoder.h
@@ -84,10 +84,12 @@ // AudioDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/filters/aom_video_decoder.cc b/media/filters/aom_video_decoder.cc index e06f4fd..09486b8 100644 --- a/media/filters/aom_video_decoder.cc +++ b/media/filters/aom_video_decoder.cc
@@ -216,11 +216,13 @@ return "AomVideoDecoder"; } -void AomVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool /* low_delay */, - CdmContext* /* cdm_context */, - const InitCB& init_cb, - const OutputCB& output_cb) { +void AomVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool /* low_delay */, + CdmContext* /* cdm_context */, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(config.IsValidConfig());
diff --git a/media/filters/aom_video_decoder.h b/media/filters/aom_video_decoder.h index 3cc807a1..1e78afe 100644 --- a/media/filters/aom_video_decoder.h +++ b/media/filters/aom_video_decoder.h
@@ -27,11 +27,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& reset_cb) override;
diff --git a/media/filters/aom_video_decoder_unittest.cc b/media/filters/aom_video_decoder_unittest.cc index 5f8cb97..e5749832 100644 --- a/media/filters/aom_video_decoder_unittest.cc +++ b/media/filters/aom_video_decoder_unittest.cc
@@ -44,7 +44,8 @@ bool success) { decoder_->Initialize( config, false, nullptr, NewExpectedBoolCB(success), - base::Bind(&AomVideoDecoderTest::FrameReady, base::Unretained(this))); + base::Bind(&AomVideoDecoderTest::FrameReady, base::Unretained(this)), + VideoDecoder::WaitingForDecryptionKeyCB()); base::RunLoop().RunUntilIdle(); }
diff --git a/media/filters/audio_decoder_selector_unittest.cc b/media/filters/audio_decoder_selector_unittest.cc index 5746df2..d52b106 100644 --- a/media/filters/audio_decoder_selector_unittest.cc +++ b/media/filters/audio_decoder_selector_unittest.cc
@@ -200,7 +200,7 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 1); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, IsNull())); @@ -211,7 +211,7 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 1); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)); + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)); SelectDecoderAndDestroy(); } @@ -220,9 +220,9 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -233,9 +233,9 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _)); + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)); SelectDecoderAndDestroy(); } @@ -245,7 +245,7 @@ InitializeDecoderSelector(kNoCdm, 2); // Decoder 1 is blacklisted and will not even be tried. - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -258,7 +258,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 1); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); EXPECT_CALL(*this, OnDecoderSelected(IsNull(), IsNull())); @@ -270,7 +270,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 1); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _)); + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)); SelectDecoderAndDestroy(); } @@ -279,9 +279,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 2); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -293,9 +293,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 2); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _)); + EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _)); SelectDecoderAndDestroy(); } @@ -313,7 +313,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kDecryptOnly, 1); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, NotNull())); @@ -325,7 +325,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kDecryptOnly, 1); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)); + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)); SelectDecoderAndDestroy(); } @@ -335,9 +335,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kDecryptOnly, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull())); @@ -349,9 +349,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kDecryptOnly, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _)); + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)); SelectDecoderAndDestroy(); } @@ -368,7 +368,7 @@ #else // A DecryptingDemuxerStream will be created. The clear decoder will be // initialized and returned. - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(NotNull(), NotNull())); #endif @@ -381,7 +381,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 2); - EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -394,9 +394,9 @@ InitializeDecoderSelector(kDecryptOnly, 2); // When DecryptingDemuxerStream is chosen, the blacklist is ignored. - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull())); @@ -410,9 +410,9 @@ // DecryptingAudioDecoder is blacklisted so we'll fall back to use // DecryptingDemuxerStream to do decrypt-only. - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) .WillOnce(RunCallback<2>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull()));
diff --git a/media/filters/audio_decoder_unittest.cc b/media/filters/audio_decoder_unittest.cc index 881265b..e141b58 100644 --- a/media/filters/audio_decoder_unittest.cc +++ b/media/filters/audio_decoder_unittest.cc
@@ -243,7 +243,8 @@ bool success) { decoder_->Initialize( config, nullptr, NewExpectedBoolCB(success), - base::Bind(&AudioDecoderTest::OnDecoderOutput, base::Unretained(this))); + base::Bind(&AudioDecoderTest::OnDecoderOutput, base::Unretained(this)), + AudioDecoder::WaitingForDecryptionKeyCB()); base::RunLoop().RunUntilIdle(); }
diff --git a/media/filters/decoder_selector.cc b/media/filters/decoder_selector.cc index 23e10e52..e005296 100644 --- a/media/filters/decoder_selector.cc +++ b/media/filters/decoder_selector.cc
@@ -120,8 +120,8 @@ void DecoderSelector<StreamType>::InitializeDecryptingDecoder() { DVLOG(2) << __func__; - decoder_.reset(new typename StreamTraits::DecryptingDecoderType( - task_runner_, media_log_, waiting_for_decryption_key_cb_)); + decoder_.reset(new typename StreamTraits::DecryptingDecoderType(task_runner_, + media_log_)); if (decoder_->GetDisplayName() == blacklisted_decoder_) { DVLOG(1) << __func__ << ": Decrypting decoder is blacklisted."; @@ -134,7 +134,7 @@ input_stream_->liveness() == DemuxerStream::LIVENESS_LIVE, cdm_context_, base::Bind(&DecoderSelector<StreamType>::DecryptingDecoderInitDone, weak_ptr_factory_.GetWeakPtr()), - output_cb_); + output_cb_, waiting_for_decryption_key_cb_); } template <DemuxerStream::Type StreamType> @@ -223,7 +223,7 @@ input_stream_->liveness() == DemuxerStream::LIVENESS_LIVE, cdm_context_, base::Bind(&DecoderSelector<StreamType>::DecoderInitDone, weak_ptr_factory_.GetWeakPtr()), - output_cb_); + output_cb_, waiting_for_decryption_key_cb_); } template <DemuxerStream::Type StreamType>
diff --git a/media/filters/decoder_stream.cc b/media/filters/decoder_stream.cc index 2921ca0e..837a690 100644 --- a/media/filters/decoder_stream.cc +++ b/media/filters/decoder_stream.cc
@@ -739,7 +739,8 @@ base::Bind(&DecoderStream<StreamType>::OnDecoderReinitialized, weak_factory_.GetWeakPtr()), base::Bind(&DecoderStream<StreamType>::OnDecodeOutputReady, - fallback_weak_factory_.GetWeakPtr())); + fallback_weak_factory_.GetWeakPtr()), + waiting_for_decryption_key_cb_); } template <DemuxerStream::Type StreamType>
diff --git a/media/filters/decoder_stream_traits.cc b/media/filters/decoder_stream_traits.cc index 66ca629..251465f6 100644 --- a/media/filters/decoder_stream_traits.cc +++ b/media/filters/decoder_stream_traits.cc
@@ -59,10 +59,13 @@ bool /* low_delay */, CdmContext* cdm_context, const InitCB& init_cb, - const OutputCB& output_cb) { + const OutputCB& output_cb, + const DecoderType::WaitingForDecryptionKeyCB& + waiting_for_decryption_key_cb) { DCHECK(config.IsValidConfig()); stats_.audio_decoder_name = decoder->GetDisplayName(); - decoder->Initialize(config, cdm_context, init_cb, output_cb); + decoder->Initialize(config, cdm_context, init_cb, output_cb, + waiting_for_decryption_key_cb); } void DecoderStreamTraits<DemuxerStream::AUDIO>::OnStreamReset( @@ -146,10 +149,13 @@ bool low_delay, CdmContext* cdm_context, const InitCB& init_cb, - const OutputCB& output_cb) { + const OutputCB& output_cb, + const DecoderType::WaitingForDecryptionKeyCB& + waiting_for_decryption_key_cb) { DCHECK(config.IsValidConfig()); stats_.video_decoder_name = decoder->GetDisplayName(); - decoder->Initialize(config, low_delay, cdm_context, init_cb, output_cb); + decoder->Initialize(config, low_delay, cdm_context, init_cb, output_cb, + waiting_for_decryption_key_cb); } void DecoderStreamTraits<DemuxerStream::VIDEO>::OnStreamReset(
diff --git a/media/filters/decoder_stream_traits.h b/media/filters/decoder_stream_traits.h index cd97229..6bb2d4d 100644 --- a/media/filters/decoder_stream_traits.h +++ b/media/filters/decoder_stream_traits.h
@@ -7,23 +7,23 @@ #include "base/containers/flat_set.h" #include "base/time/time.h" +#include "media/base/audio_decoder.h" #include "media/base/cdm_context.h" #include "media/base/demuxer_stream.h" #include "media/base/moving_average.h" #include "media/base/pipeline_status.h" +#include "media/base/video_decoder.h" #include "media/base/video_decoder_config.h" #include "media/filters/audio_timestamp_validator.h" namespace media { class AudioBuffer; -class AudioDecoder; class AudioDecoderConfig; class CdmContext; class DecryptingAudioDecoder; class DecryptingVideoDecoder; class DemuxerStream; -class VideoDecoder; class VideoDecoderConfig; class VideoFrame; @@ -35,12 +35,13 @@ template <> class MEDIA_EXPORT DecoderStreamTraits<DemuxerStream::AUDIO> { public: - typedef AudioBuffer OutputType; - typedef AudioDecoder DecoderType; - typedef AudioDecoderConfig DecoderConfigType; - typedef DecryptingAudioDecoder DecryptingDecoderType; - typedef base::Callback<void(bool success)> InitCB; - typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB; + using OutputType = AudioBuffer; + using DecoderType = AudioDecoder; + using DecoderConfigType = AudioDecoderConfig; + using DecryptingDecoderType = DecryptingAudioDecoder; + using InitCB = AudioDecoder::InitCB; + using OutputCB = AudioDecoder::OutputCB; + using WaitingForDecryptionKeyCB = AudioDecoder::WaitingForDecryptionKeyCB; static std::string ToString(); static bool NeedsBitstreamConversion(DecoderType* decoder); @@ -50,12 +51,14 @@ explicit DecoderStreamTraits(MediaLog* media_log); void ReportStatistics(const StatisticsCB& statistics_cb, int bytes_decoded); - void InitializeDecoder(DecoderType* decoder, - const DecoderConfigType& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb); + void InitializeDecoder( + DecoderType* decoder, + const DecoderConfigType& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb); void OnDecode(const scoped_refptr<DecoderBuffer>& buffer); PostDecodeAction OnDecodeDone(const scoped_refptr<OutputType>& buffer); void OnStreamReset(DemuxerStream* stream); @@ -73,12 +76,13 @@ template <> class MEDIA_EXPORT DecoderStreamTraits<DemuxerStream::VIDEO> { public: - typedef VideoFrame OutputType; - typedef VideoDecoder DecoderType; - typedef VideoDecoderConfig DecoderConfigType; - typedef DecryptingVideoDecoder DecryptingDecoderType; - typedef base::Callback<void(bool success)> InitCB; - typedef base::Callback<void(const scoped_refptr<OutputType>&)> OutputCB; + using OutputType = VideoFrame; + using DecoderType = VideoDecoder; + using DecoderConfigType = VideoDecoderConfig; + using DecryptingDecoderType = DecryptingVideoDecoder; + using InitCB = VideoDecoder::InitCB; + using OutputCB = VideoDecoder::OutputCB; + using WaitingForDecryptionKeyCB = VideoDecoder::WaitingForDecryptionKeyCB; static std::string ToString(); static bool NeedsBitstreamConversion(DecoderType* decoder); @@ -88,12 +92,14 @@ explicit DecoderStreamTraits(MediaLog* media_log); void ReportStatistics(const StatisticsCB& statistics_cb, int bytes_decoded); - void InitializeDecoder(DecoderType* decoder, - const DecoderConfigType& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb); + void InitializeDecoder( + DecoderType* decoder, + const DecoderConfigType& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb); void OnDecode(const scoped_refptr<DecoderBuffer>& buffer); PostDecodeAction OnDecodeDone(const scoped_refptr<OutputType>& buffer);
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc index 9d9eb376..a4412ca 100644 --- a/media/filters/decrypting_audio_decoder.cc +++ b/media/filters/decrypting_audio_decoder.cc
@@ -36,12 +36,10 @@ DecryptingAudioDecoder::DecryptingAudioDecoder( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - MediaLog* media_log, - const base::Closure& waiting_for_decryption_key_cb) + MediaLog* media_log) : task_runner_(task_runner), media_log_(media_log), state_(kUninitialized), - waiting_for_decryption_key_cb_(waiting_for_decryption_key_cb), decryptor_(NULL), key_added_while_decode_pending_(false), weak_factory_(this) {} @@ -50,10 +48,12 @@ return "DecryptingAudioDecoder"; } -void DecryptingAudioDecoder::Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void DecryptingAudioDecoder::Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) { DVLOG(2) << "Initialize()"; DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(decode_cb_.is_null()); @@ -64,6 +64,9 @@ init_cb_ = BindToCurrentLoop(init_cb); output_cb_ = BindToCurrentLoop(output_cb); + DCHECK(!waiting_for_decryption_key_cb.is_null()); + waiting_for_decryption_key_cb_ = waiting_for_decryption_key_cb; + // TODO(xhwang): We should be able to DCHECK config.IsValidConfig(). if (!config.IsValidConfig()) { DLOG(ERROR) << "Invalid audio stream config.";
diff --git a/media/filters/decrypting_audio_decoder.h b/media/filters/decrypting_audio_decoder.h index 5d807999..b9db45fb 100644 --- a/media/filters/decrypting_audio_decoder.h +++ b/media/filters/decrypting_audio_decoder.h
@@ -36,16 +36,17 @@ public: DecryptingAudioDecoder( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - MediaLog* media_log, - const base::Closure& waiting_for_decryption_key_cb); + MediaLog* media_log); ~DecryptingAudioDecoder() override; // AudioDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/filters/decrypting_audio_decoder_unittest.cc b/media/filters/decrypting_audio_decoder_unittest.cc index b8bca93b1b..93542a8 100644 --- a/media/filters/decrypting_audio_decoder_unittest.cc +++ b/media/filters/decrypting_audio_decoder_unittest.cc
@@ -55,11 +55,8 @@ class DecryptingAudioDecoderTest : public testing::Test { public: DecryptingAudioDecoderTest() - : decoder_(new DecryptingAudioDecoder( - message_loop_.task_runner(), - &media_log_, - base::Bind(&DecryptingAudioDecoderTest::OnWaitingForDecryptionKey, - base::Unretained(this)))), + : decoder_(new DecryptingAudioDecoder(message_loop_.task_runner(), + &media_log_)), cdm_context_(new StrictMock<MockCdmContext>()), decryptor_(new StrictMock<MockDecryptor>()), num_decrypt_and_decode_calls_(0), @@ -85,9 +82,12 @@ kNoTimestamp); decoded_frame_list_.push_back(decoded_frame_); - decoder_->Initialize(config, cdm_context_.get(), NewExpectedBoolCB(success), - base::Bind(&DecryptingAudioDecoderTest::FrameReady, - base::Unretained(this))); + decoder_->Initialize( + config, cdm_context_.get(), NewExpectedBoolCB(success), + base::Bind(&DecryptingAudioDecoderTest::FrameReady, + base::Unretained(this)), + base::Bind(&DecryptingAudioDecoderTest::OnWaitingForDecryptionKey, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); } @@ -123,10 +123,12 @@ .WillOnce(RunCallback<1>(true)); EXPECT_CALL(*decryptor_, RegisterNewKeyCB(Decryptor::kAudio, _)) .WillOnce(SaveArg<1>(&key_added_cb_)); - decoder_->Initialize(new_config, cdm_context_.get(), - NewExpectedBoolCB(true), - base::Bind(&DecryptingAudioDecoderTest::FrameReady, - base::Unretained(this))); + decoder_->Initialize( + new_config, cdm_context_.get(), NewExpectedBoolCB(true), + base::Bind(&DecryptingAudioDecoderTest::FrameReady, + base::Unretained(this)), + base::Bind(&DecryptingAudioDecoderTest::OnWaitingForDecryptionKey, + base::Unretained(this))); } // Decode |buffer| and expect DecodeDone to get called with |status|.
diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc index 5051d88..682f842 100644 --- a/media/filters/decrypting_video_decoder.cc +++ b/media/filters/decrypting_video_decoder.cc
@@ -23,12 +23,10 @@ DecryptingVideoDecoder::DecryptingVideoDecoder( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - MediaLog* media_log, - const base::Closure& waiting_for_decryption_key_cb) + MediaLog* media_log) : task_runner_(task_runner), media_log_(media_log), state_(kUninitialized), - waiting_for_decryption_key_cb_(waiting_for_decryption_key_cb), decryptor_(NULL), key_added_while_decode_pending_(false), trace_id_(0), @@ -38,11 +36,13 @@ return kDecoderName; } -void DecryptingVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool /* low_delay */, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void DecryptingVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool /* low_delay */, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) { DVLOG(2) << __func__ << ": " << config.AsHumanReadableString(); DCHECK(task_runner_->BelongsToCurrentThread()); @@ -59,6 +59,9 @@ weak_this_ = weak_factory_.GetWeakPtr(); config_ = config; + DCHECK(!waiting_for_decryption_key_cb.is_null()); + waiting_for_decryption_key_cb_ = waiting_for_decryption_key_cb; + if (state_ == kUninitialized) { if (!cdm_context->GetDecryptor()) { MEDIA_LOG(DEBUG, media_log_) << GetDisplayName() << ": no decryptor";
diff --git a/media/filters/decrypting_video_decoder.h b/media/filters/decrypting_video_decoder.h index 034ec943..35c2c37 100644 --- a/media/filters/decrypting_video_decoder.h +++ b/media/filters/decrypting_video_decoder.h
@@ -33,17 +33,18 @@ public: DecryptingVideoDecoder( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - MediaLog* media_log, - const base::Closure& waiting_for_decryption_key_cb); + MediaLog* media_log); ~DecryptingVideoDecoder() override; // VideoDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/filters/decrypting_video_decoder_unittest.cc b/media/filters/decrypting_video_decoder_unittest.cc index 16806f0..3d4ac1a 100644 --- a/media/filters/decrypting_video_decoder_unittest.cc +++ b/media/filters/decrypting_video_decoder_unittest.cc
@@ -48,11 +48,8 @@ class DecryptingVideoDecoderTest : public testing::Test { public: DecryptingVideoDecoderTest() - : decoder_(new DecryptingVideoDecoder( - message_loop_.task_runner(), - &media_log_, - base::Bind(&DecryptingVideoDecoderTest::OnWaitingForDecryptionKey, - base::Unretained(this)))), + : decoder_(new DecryptingVideoDecoder(message_loop_.task_runner(), + &media_log_)), cdm_context_(new StrictMock<MockCdmContext>()), decryptor_(new StrictMock<MockDecryptor>()), num_decrypt_and_decode_calls_(0), @@ -78,10 +75,12 @@ // can succeed or fail. void InitializeAndExpectResult(const VideoDecoderConfig& config, bool success) { - decoder_->Initialize(config, false, cdm_context_.get(), - NewExpectedBoolCB(success), - base::Bind(&DecryptingVideoDecoderTest::FrameReady, - base::Unretained(this))); + decoder_->Initialize( + config, false, cdm_context_.get(), NewExpectedBoolCB(success), + base::Bind(&DecryptingVideoDecoderTest::FrameReady, + base::Unretained(this)), + base::Bind(&DecryptingVideoDecoderTest::OnWaitingForDecryptionKey, + base::Unretained(this))); base::RunLoop().RunUntilIdle(); }
diff --git a/media/filters/fake_video_decoder.cc b/media/filters/fake_video_decoder.cc index bac7510..eab4bc8 100644 --- a/media/filters/fake_video_decoder.cc +++ b/media/filters/fake_video_decoder.cc
@@ -52,11 +52,13 @@ return decoder_name_; } -void FakeVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void FakeVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) { DVLOG(1) << decoder_name_ << ": " << __func__; DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(config.IsValidConfig());
diff --git a/media/filters/fake_video_decoder.h b/media/filters/fake_video_decoder.h index 4c5568f..4d9fa69 100644 --- a/media/filters/fake_video_decoder.h +++ b/media/filters/fake_video_decoder.h
@@ -45,11 +45,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/filters/fake_video_decoder_unittest.cc b/media/filters/fake_video_decoder_unittest.cc index 7ebcf5e..c46657d 100644 --- a/media/filters/fake_video_decoder_unittest.cc +++ b/media/filters/fake_video_decoder_unittest.cc
@@ -53,7 +53,8 @@ bool success) { decoder_->Initialize( config, false, nullptr, NewExpectedBoolCB(success), - base::Bind(&FakeVideoDecoderTest::FrameReady, base::Unretained(this))); + base::Bind(&FakeVideoDecoderTest::FrameReady, base::Unretained(this)), + VideoDecoder::WaitingForDecryptionKeyCB()); base::RunLoop().RunUntilIdle(); current_config_ = config; }
diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc index 520a42c..3be4495 100644 --- a/media/filters/ffmpeg_audio_decoder.cc +++ b/media/filters/ffmpeg_audio_decoder.cc
@@ -64,10 +64,12 @@ return "FFmpegAudioDecoder"; } -void FFmpegAudioDecoder::Initialize(const AudioDecoderConfig& config, - CdmContext* /* cdm_context */, - const InitCB& init_cb, - const OutputCB& output_cb) { +void FFmpegAudioDecoder::Initialize( + const AudioDecoderConfig& config, + CdmContext* /* cdm_context */, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DCHECK(task_runner_->BelongsToCurrentThread()); DCHECK(config.IsValidConfig());
diff --git a/media/filters/ffmpeg_audio_decoder.h b/media/filters/ffmpeg_audio_decoder.h index 93429db..be2e64de 100644 --- a/media/filters/ffmpeg_audio_decoder.h +++ b/media/filters/ffmpeg_audio_decoder.h
@@ -40,10 +40,12 @@ // AudioDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index a27dcee6..077ed78 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc
@@ -225,11 +225,13 @@ return "FFmpegVideoDecoder"; } -void FFmpegVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* /* cdm_context */, - const InitCB& init_cb, - const OutputCB& output_cb) { +void FFmpegVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* /* cdm_context */, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(config.IsValidConfig()); DCHECK(!output_cb.is_null());
diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h index 210b7d9..cb594ac 100644 --- a/media/filters/ffmpeg_video_decoder.h +++ b/media/filters/ffmpeg_video_decoder.h
@@ -39,11 +39,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc index bbdbb63..80c161c 100644 --- a/media/filters/ffmpeg_video_decoder_unittest.cc +++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -82,9 +82,10 @@ void InitializeWithConfigWithResult(const VideoDecoderConfig& config, bool success) { - decoder_->Initialize(config, false, nullptr, NewExpectedBoolCB(success), - base::Bind(&FFmpegVideoDecoderTest::FrameReady, - base::Unretained(this))); + decoder_->Initialize( + config, false, nullptr, NewExpectedBoolCB(success), + base::Bind(&FFmpegVideoDecoderTest::FrameReady, base::Unretained(this)), + VideoDecoder::WaitingForDecryptionKeyCB()); base::RunLoop().RunUntilIdle(); }
diff --git a/media/filters/gpu_memory_buffer_decoder_wrapper.cc b/media/filters/gpu_memory_buffer_decoder_wrapper.cc index 7aae06a4..33d4858 100644 --- a/media/filters/gpu_memory_buffer_decoder_wrapper.cc +++ b/media/filters/gpu_memory_buffer_decoder_wrapper.cc
@@ -32,11 +32,13 @@ return decoder_->GetDisplayName(); } -void GpuMemoryBufferDecoderWrapper::Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void GpuMemoryBufferDecoderWrapper::Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(eos_decode_cb_.is_null()); DCHECK_EQ(pending_copies_, 0u); @@ -46,7 +48,8 @@ decoder_->Initialize( config, low_delay, cdm_context, init_cb, base::BindRepeating(&GpuMemoryBufferDecoderWrapper::OnOutputReady, - weak_factory_.GetWeakPtr(), output_cb)); + weak_factory_.GetWeakPtr(), output_cb), + waiting_for_decryption_key_cb); } void GpuMemoryBufferDecoderWrapper::Decode(
diff --git a/media/filters/gpu_memory_buffer_decoder_wrapper.h b/media/filters/gpu_memory_buffer_decoder_wrapper.h index b22294b..25a4ec7c 100644 --- a/media/filters/gpu_memory_buffer_decoder_wrapper.h +++ b/media/filters/gpu_memory_buffer_decoder_wrapper.h
@@ -36,11 +36,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const override; // Returns |decoder_| name. - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& reset_cb) override;
diff --git a/media/filters/gpu_memory_buffer_decoder_wrapper_unittest.cc b/media/filters/gpu_memory_buffer_decoder_wrapper_unittest.cc index 27ed995d..310e799 100644 --- a/media/filters/gpu_memory_buffer_decoder_wrapper_unittest.cc +++ b/media/filters/gpu_memory_buffer_decoder_wrapper_unittest.cc
@@ -5,6 +5,7 @@ #include "media/filters/gpu_memory_buffer_decoder_wrapper.h" #include "base/bind.h" +#include "base/bind_helpers.h" #include "base/run_loop.h" #include "base/test/test_message_loop.h" #include "media/base/bind_to_current_loop.h" @@ -40,10 +41,12 @@ EXPECT_CALL(*this, OnInitDone(true)) .WillOnce(RunClosure(loop.QuitClosure())); + VideoDecoder::WaitingForDecryptionKeyCB unused_cb; VideoDecoderConfig actual_config; - EXPECT_CALL(*decoder_, Initialize(_, true, nullptr, _, _)) + EXPECT_CALL(*decoder_, Initialize(_, true, nullptr, _, _, _)) .WillOnce(DoAll(SaveArg<0>(&actual_config), - SaveArg<4>(replaced_output_cb), RunCallback<3>(true))); + SaveArg<4>(replaced_output_cb), RunCallback<3>(true), + SaveArg<5>(&unused_cb))); VideoDecoder::OutputCB output_cb = base::BindRepeating(&GpuMemoryBufferDecoderWrapperTest::OnOutputReady, @@ -52,7 +55,7 @@ config_, true, nullptr, base::BindRepeating(&GpuMemoryBufferDecoderWrapperTest::OnInitDone, base::Unretained(this)), - output_cb); + output_cb, base::DoNothing()); loop.Run(); // Verify the VideoDecoderConfig is passed correctly. @@ -60,6 +63,8 @@ // Verify the OutputCB has been replaced with a custom one. ASSERT_FALSE(replaced_output_cb->Equals(output_cb)); + + ASSERT_FALSE(unused_cb.is_null()); } // Verifies EOS waits for all pending copies and returns the correct final
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc index ba68d758..6ebcfe3b 100644 --- a/media/filters/gpu_video_decoder.cc +++ b/media/filters/gpu_video_decoder.cc
@@ -151,11 +151,13 @@ return kDecoderName; } -void GpuVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool /* low_delay */, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void GpuVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool /* low_delay */, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DVLOG(3) << "Initialize()"; DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); DCHECK(config.IsValidConfig());
diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h index 980dff54..e379c6bd 100644 --- a/media/filters/gpu_video_decoder.h +++ b/media/filters/gpu_video_decoder.h
@@ -56,11 +56,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/filters/offloading_video_decoder.cc b/media/filters/offloading_video_decoder.cc index 1fc9a67..29ae6cb 100644 --- a/media/filters/offloading_video_decoder.cc +++ b/media/filters/offloading_video_decoder.cc
@@ -40,11 +40,13 @@ return decoder_->GetDisplayName(); } -void OffloadingVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void OffloadingVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(config.IsValidConfig()); @@ -68,7 +70,8 @@ // possible for this class to be destroyed during Initialize(). base::BindOnce(&OffloadingVideoDecoder::Initialize, weak_factory_.GetWeakPtr(), config, low_delay, - cdm_context, init_cb, output_cb)); + cdm_context, init_cb, output_cb, + waiting_for_decryption_key_cb)); return; } @@ -90,7 +93,7 @@ if (disable_offloading) { offload_task_runner_ = nullptr; decoder_->Initialize(config, low_delay, cdm_context, bound_init_cb, - bound_output_cb); + bound_output_cb, waiting_for_decryption_key_cb); return; } @@ -103,7 +106,8 @@ FROM_HERE, base::BindOnce(&OffloadableVideoDecoder::Initialize, base::Unretained(decoder_.get()), config, low_delay, - cdm_context, bound_init_cb, bound_output_cb)); + cdm_context, bound_init_cb, bound_output_cb, + waiting_for_decryption_key_cb)); } void OffloadingVideoDecoder::Decode(const scoped_refptr<DecoderBuffer>& buffer,
diff --git a/media/filters/offloading_video_decoder.h b/media/filters/offloading_video_decoder.h index 556558e2..959d2d9 100644 --- a/media/filters/offloading_video_decoder.h +++ b/media/filters/offloading_video_decoder.h
@@ -51,11 +51,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& reset_cb) override;
diff --git a/media/filters/offloading_video_decoder_unittest.cc b/media/filters/offloading_video_decoder_unittest.cc index 902f8e5..81f660b 100644 --- a/media/filters/offloading_video_decoder_unittest.cc +++ b/media/filters/offloading_video_decoder_unittest.cc
@@ -35,12 +35,14 @@ std::string GetDisplayName() const override { return "MockOffloadableVideoDecoder"; } - MOCK_METHOD5(Initialize, - void(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb)); + MOCK_METHOD6( + Initialize, + void(const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb)); MOCK_METHOD2(Decode, void(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB&)); @@ -97,11 +99,12 @@ // Verify methods are called on the current thread since the offload codec // requirement is not satisfied. VideoDecoder::OutputCB output_cb; - EXPECT_CALL(*decoder_, Initialize(_, false, nullptr, _, _)) + EXPECT_CALL(*decoder_, Initialize(_, false, nullptr, _, _, _)) .WillOnce(DoAll(VerifyOn(task_env_.GetMainThreadTaskRunner()), RunCallback<3>(true), SaveArg<4>(&output_cb))); offloading_decoder_->Initialize(config, false, nullptr, ExpectInitCB(true), - ExpectOutputCB()); + ExpectOutputCB(), + VideoDecoder::WaitingForDecryptionKeyCB()); task_env_.RunUntilIdle(); // Verify decode works and is called on the right thread. @@ -134,8 +137,9 @@ .WillOnce(VerifyOn(task_env_.GetMainThreadTaskRunner())); } offloading_decoder_->Initialize(config, false, nullptr, ExpectInitCB(true), - ExpectOutputCB()); - EXPECT_CALL(*decoder_, Initialize(_, false, nullptr, _, _)) + ExpectOutputCB(), + VideoDecoder::WaitingForDecryptionKeyCB()); + EXPECT_CALL(*decoder_, Initialize(_, false, nullptr, _, _, _)) .WillOnce(DoAll(VerifyNotOn(task_env_.GetMainThreadTaskRunner()), RunCallback<3>(true), SaveArg<4>(&output_cb))); task_env_.RunUntilIdle(); @@ -212,10 +216,11 @@ offloading_decoder_->Initialize( TestVideoConfig::Normal(kCodecVP9), false, nullptr, ExpectInitCB(true), base::Bind(&OffloadingVideoDecoderTest::OutputDone, - base::Unretained(this))); + base::Unretained(this)), + VideoDecoder::WaitingForDecryptionKeyCB()); EXPECT_CALL(*decoder_, Detach()) .WillOnce(VerifyNotOn(task_env_.GetMainThreadTaskRunner())); - EXPECT_CALL(*decoder_, Initialize(_, false, nullptr, _, _)) + EXPECT_CALL(*decoder_, Initialize(_, false, nullptr, _, _, _)) .WillOnce(DoAll(VerifyOn(task_env_.GetMainThreadTaskRunner()), RunCallback<3>(true), SaveArg<4>(&output_cb))); task_env_.RunUntilIdle();
diff --git a/media/filters/video_decoder_selector_unittest.cc b/media/filters/video_decoder_selector_unittest.cc index 444be6a2..056a1eb 100644 --- a/media/filters/video_decoder_selector_unittest.cc +++ b/media/filters/video_decoder_selector_unittest.cc
@@ -195,7 +195,7 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 1); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, IsNull())); @@ -206,7 +206,7 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 1); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)); + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)); SelectDecoderAndDestroy(); } @@ -215,9 +215,9 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -228,9 +228,9 @@ UseClearStream(); InitializeDecoderSelector(kNoCdm, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)); + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _, _)); SelectDecoderAndDestroy(); } @@ -240,7 +240,7 @@ InitializeDecoderSelector(kNoCdm, 2); // Decoder 1 is blacklisted and will not even be tried. - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -253,7 +253,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 1); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); EXPECT_CALL(*this, OnDecoderSelected(IsNull(), IsNull())); @@ -265,7 +265,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 1); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)); + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _, _)); SelectDecoderAndDestroy(); } @@ -274,9 +274,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 2); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -288,9 +288,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 2); - EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(EncryptedConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _)); + EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _, _)); SelectDecoderAndDestroy(); } @@ -310,7 +310,7 @@ // Since we use DecryptingDemuxerStream, the decoder will be initialized with // a clear config. - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_1_, NotNull())); @@ -322,7 +322,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kDecryptOnly, 1); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)); + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)); SelectDecoderAndDestroy(); } @@ -332,9 +332,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kDecryptOnly, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull())); @@ -346,9 +346,9 @@ UseEncryptedStream(); InitializeDecoderSelector(kDecryptOnly, 2); - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)); + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _, _)); SelectDecoderAndDestroy(); } @@ -365,7 +365,7 @@ #else // A DecryptingDemuxerStream will be created. The clear decoder will be // initialized and returned. - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(NotNull(), NotNull())); #endif @@ -378,7 +378,7 @@ UseEncryptedStream(); InitializeDecoderSelector(kNoDecryptor, 2); - EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(EncryptedConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, IsNull())); @@ -391,9 +391,9 @@ InitializeDecoderSelector(kDecryptOnly, 2); // When DecryptingDemuxerStream is chosen, the blacklist is ignored. - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull())); @@ -407,9 +407,9 @@ // DecryptingAudioDecoder is blacklisted so we'll fallback to use // DecryptingDemuxerStream to do decrypt-only. - EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_1_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(false)); - EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _)) + EXPECT_CALL(*decoder_2_, Initialize(ClearConfig(), _, _, _, _, _)) .WillOnce(RunCallback<3>(true)); EXPECT_CALL(*this, OnDecoderSelected(decoder_2_, NotNull()));
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc index f080d8be..6a45a1c 100644 --- a/media/filters/vpx_video_decoder.cc +++ b/media/filters/vpx_video_decoder.cc
@@ -138,11 +138,13 @@ return "VpxVideoDecoder"; } -void VpxVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool /* low_delay */, - CdmContext* /* cdm_context */, - const InitCB& init_cb, - const OutputCB& output_cb) { +void VpxVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool /* low_delay */, + CdmContext* /* cdm_context */, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(config.IsValidConfig());
diff --git a/media/filters/vpx_video_decoder.h b/media/filters/vpx_video_decoder.h index 7a7142c2..2efc0213 100644 --- a/media/filters/vpx_video_decoder.h +++ b/media/filters/vpx_video_decoder.h
@@ -43,11 +43,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& reset_cb) override;
diff --git a/media/filters/vpx_video_decoder_fuzzertest.cc b/media/filters/vpx_video_decoder_fuzzertest.cc index fb8b8e73..3de0f22b 100644 --- a/media/filters/vpx_video_decoder_fuzzertest.cc +++ b/media/filters/vpx_video_decoder_fuzzertest.cc
@@ -107,7 +107,8 @@ decoder.Initialize( config, true /* low_delay */, nullptr /* cdm_context */, base::Bind(&OnInitDone, run_loop.QuitClosure(), &success), - base::Bind(&OnOutputComplete)); + base::Bind(&OnOutputComplete), + VideoDecoder::WaitingForDecryptionKeyCB()); run_loop.Run(); if (!success) return 0;
diff --git a/media/filters/vpx_video_decoder_unittest.cc b/media/filters/vpx_video_decoder_unittest.cc index 576735e..ce3fd555 100644 --- a/media/filters/vpx_video_decoder_unittest.cc +++ b/media/filters/vpx_video_decoder_unittest.cc
@@ -39,7 +39,8 @@ bool success) { decoder_->Initialize( config, false, nullptr, NewExpectedBoolCB(success), - base::Bind(&VpxVideoDecoderTest::FrameReady, base::Unretained(this))); + base::Bind(&VpxVideoDecoderTest::FrameReady, base::Unretained(this)), + VideoDecoder::WaitingForDecryptionKeyCB()); base::RunLoop().RunUntilIdle(); }
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn index 2f07f0c..6a8344fc 100644 --- a/media/gpu/BUILD.gn +++ b/media/gpu/BUILD.gn
@@ -66,6 +66,7 @@ # Only local test code, GPU-related IPC code in the media layer, and # media-related content code should access //media/gpu. visibility = [ + "//chrome/gpu", "//components/arc/common:media", "//components/arc/video_accelerator", "//components/viz/service/main", @@ -563,9 +564,9 @@ } if (is_win && enable_library_cdms) { sources += [ + "windows/d3d11_cdm_proxy_unittest.cc", "windows/d3d11_mocks.cc", "windows/d3d11_mocks.h", - "windows/d3d11_proxy_unittest.cc", ] libs = [ "dxguid.lib" ] }
diff --git a/media/gpu/OWNERS b/media/gpu/OWNERS index 8ea495b..2581cf75 100644 --- a/media/gpu/OWNERS +++ b/media/gpu/OWNERS
@@ -1,9 +1,10 @@ dalecurtis@chromium.org +dcastagna@chromium.org +jcliang@chromium.org kcwu@chromium.org posciak@chromium.org sandersd@chromium.org wuchengli@chromium.org -jcliang@chromium.org # For Android media gpu files. per-file *android*=liberato@chromium.org
diff --git a/media/gpu/android/media_codec_video_decoder.cc b/media/gpu/android/media_codec_video_decoder.cc index 251ef13c..b8729dc 100644 --- a/media/gpu/android/media_codec_video_decoder.cc +++ b/media/gpu/android/media_codec_video_decoder.cc
@@ -155,11 +155,13 @@ StartDrainingCodec(DrainType::kForDestroy); } -void MediaCodecVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void MediaCodecVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { const bool first_init = !decoder_config_.IsValidConfig(); DVLOG(2) << (first_init ? "Initializing" : "Reinitializing") << " MCVD with config: " << config.AsHumanReadableString();
diff --git a/media/gpu/android/media_codec_video_decoder.h b/media/gpu/android/media_codec_video_decoder.h index 1088814..14045c1 100644 --- a/media/gpu/android/media_codec_video_decoder.h +++ b/media/gpu/android/media_codec_video_decoder.h
@@ -63,11 +63,13 @@ // VideoDecoder implementation: std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/gpu/android/media_codec_video_decoder_unittest.cc b/media/gpu/android/media_codec_video_decoder_unittest.cc index 0397c32..8eeebf4 100644 --- a/media/gpu/android/media_codec_video_decoder_unittest.cc +++ b/media/gpu/android/media_codec_video_decoder_unittest.cc
@@ -169,7 +169,8 @@ bool result = false; auto init_cb = [](bool* result_out, bool result) { *result_out = result; }; mcvd_->Initialize(config, false, cdm_.get(), base::Bind(init_cb, &result), - base::Bind(&OutputCb)); + base::Bind(&OutputCb), + VideoDecoder::WaitingForDecryptionKeyCB()); base::RunLoop().RunUntilIdle(); if (config.is_encrypted() && cdm_) {
diff --git a/media/gpu/v4l2/v4l2_device.cc b/media/gpu/v4l2/v4l2_device.cc index 6b323b0..30dc1bd9 100644 --- a/media/gpu/v4l2/v4l2_device.cc +++ b/media/gpu/v4l2/v4l2_device.cc
@@ -145,8 +145,10 @@ case V4L2_PIX_FMT_VP9: case V4L2_PIX_FMT_VP9_FRAME: - min_profile = VP9PROFILE_MIN; - max_profile = VP9PROFILE_MAX; + // TODO(posciak): https://crbug.com/819930 Query supported profiles. + // Currently no devices support Profiles > 0 https://crbug.com/796297. + min_profile = VP9PROFILE_PROFILE0; + max_profile = VP9PROFILE_PROFILE0; break; default:
diff --git a/media/gpu/v4l2/v4l2_video_encode_accelerator.cc b/media/gpu/v4l2/v4l2_video_encode_accelerator.cc index c31374b..387ce352 100644 --- a/media/gpu/v4l2/v4l2_video_encode_accelerator.cc +++ b/media/gpu/v4l2/v4l2_video_encode_accelerator.cc
@@ -743,17 +743,6 @@ NOTIFY_ERROR(kPlatformFailureError); return; } - if ((encoder_state_ == kFlushing) && (dqbuf.flags & V4L2_BUF_FLAG_LAST)) { - DVLOGF(3) << "Flush completed. Start the encoder again."; - encoder_state_ = kEncoding; - // Notify client that flush has finished successfully. - std::move(flush_callback_).Run(true); - // Start the encoder again. - struct v4l2_encoder_cmd cmd; - memset(&cmd, 0, sizeof(cmd)); - cmd.cmd = V4L2_ENC_CMD_START; - IOCTL_OR_ERROR_RETURN(VIDIOC_ENCODER_CMD, &cmd); - } const bool key_frame = ((dqbuf.flags & V4L2_BUF_FLAG_KEYFRAME) != 0); OutputRecord& output_record = output_buffer_map_[dqbuf.index]; DCHECK(output_record.at_device); @@ -776,6 +765,19 @@ dqbuf.timestamp.tv_usec + dqbuf.timestamp.tv_sec * base::Time::kMicrosecondsPerSecond))); + if ((encoder_state_ == kFlushing) && (dqbuf.flags & V4L2_BUF_FLAG_LAST)) { + // Notify client that flush has finished successfully. The flush callback + // should be called after notifying the last buffer is ready. + DVLOGF(3) << "Flush completed. Start the encoder again."; + encoder_state_ = kEncoding; + child_task_runner_->PostTask( + FROM_HERE, base::BindOnce(std::move(flush_callback_), true)); + // Start the encoder again. + struct v4l2_encoder_cmd cmd; + memset(&cmd, 0, sizeof(cmd)); + cmd.cmd = V4L2_ENC_CMD_START; + IOCTL_OR_ERROR_RETURN(VIDIOC_ENCODER_CMD, &cmd); + } output_record.at_device = false; free_output_buffers_.push_back(dqbuf.index);
diff --git a/media/gpu/video_encode_accelerator_unittest.cc b/media/gpu/video_encode_accelerator_unittest.cc index 77e7ab9..f60fe22 100644 --- a/media/gpu/video_encode_accelerator_unittest.cc +++ b/media/gpu/video_encode_accelerator_unittest.cc
@@ -751,7 +751,8 @@ base::Bind(&VideoFrameQualityValidator::InitializeCB, base::Unretained(this)), base::Bind(&VideoFrameQualityValidator::VerifyOutputFrame, - base::Unretained(this))); + base::Unretained(this)), + VideoDecoder::WaitingForDecryptionKeyCB()); } void VideoFrameQualityValidator::InitializeCB(bool success) {
diff --git a/media/gpu/windows/d3d11_cdm_proxy.cc b/media/gpu/windows/d3d11_cdm_proxy.cc index cdae8a5..ab68be5c 100644 --- a/media/gpu/windows/d3d11_cdm_proxy.cc +++ b/media/gpu/windows/d3d11_cdm_proxy.cc
@@ -144,26 +144,19 @@ client_ = client; - D3D_FEATURE_LEVEL actual_feature_level = {}; - D3D_FEATURE_LEVEL feature_levels[] = {D3D_FEATURE_LEVEL_11_1, - D3D_FEATURE_LEVEL_11_0}; + const D3D_FEATURE_LEVEL feature_levels[] = {D3D_FEATURE_LEVEL_11_1}; + HRESULT hresult = create_device_func_.Run( nullptr, // No adapter. D3D_DRIVER_TYPE_HARDWARE, nullptr, // No software rasterizer. 0, // flags, none. feature_levels, arraysize(feature_levels), D3D11_SDK_VERSION, - device_.GetAddressOf(), &actual_feature_level, - device_context_.GetAddressOf()); + device_.GetAddressOf(), nullptr, device_context_.GetAddressOf()); if (FAILED(hresult)) { DLOG(ERROR) << "Failed to create the D3D11Device:" << hresult; failed(); return; } - if (actual_feature_level != D3D_FEATURE_LEVEL_11_1) { - DLOG(ERROR) << "D3D11 feature level too low: " << actual_feature_level; - failed(); - return; - } hresult = device_.CopyTo(video_device_.GetAddressOf()); if (FAILED(hresult)) {
diff --git a/media/gpu/windows/d3d11_proxy_unittest.cc b/media/gpu/windows/d3d11_cdm_proxy_unittest.cc similarity index 99% rename from media/gpu/windows/d3d11_proxy_unittest.cc rename to media/gpu/windows/d3d11_cdm_proxy_unittest.cc index 69bc19d83..4595e696 100644 --- a/media/gpu/windows/d3d11_proxy_unittest.cc +++ b/media/gpu/windows/d3d11_cdm_proxy_unittest.cc
@@ -93,7 +93,6 @@ EXPECT_CALL(create_device_mock_, Create(_, D3D_DRIVER_TYPE_HARDWARE, _, _, _, _, _, _, _, _)) .WillOnce(DoAll(SetArgPointee<7>(device_mock_.Get()), - SetArgPointee<8>(D3D_FEATURE_LEVEL_11_1), SetArgPointee<9>(device_context_mock_.Get()), Return(S_OK)));
diff --git a/media/gpu/windows/d3d11_video_decoder.cc b/media/gpu/windows/d3d11_video_decoder.cc index 5ab7d2d..7440598 100644 --- a/media/gpu/windows/d3d11_video_decoder.cc +++ b/media/gpu/windows/d3d11_video_decoder.cc
@@ -68,11 +68,13 @@ return "D3D11VideoDecoder"; } -void D3D11VideoDecoder::Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void D3D11VideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb const + WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { bool is_h264 = config.profile() >= H264PROFILE_MIN && config.profile() <= H264PROFILE_MAX; if (!is_h264) {
diff --git a/media/gpu/windows/d3d11_video_decoder.h b/media/gpu/windows/d3d11_video_decoder.h index 1b6cbdb..9a4af794cb 100644 --- a/media/gpu/windows/d3d11_video_decoder.h +++ b/media/gpu/windows/d3d11_video_decoder.h
@@ -34,11 +34,13 @@ // VideoDecoder implementation: std::string GetDisplayName() const override; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) override; void Reset(const base::Closure& closure) override;
diff --git a/media/mojo/clients/mojo_audio_decoder.cc b/media/mojo/clients/mojo_audio_decoder.cc index 3bfc626..de11396 100644 --- a/media/mojo/clients/mojo_audio_decoder.cc +++ b/media/mojo/clients/mojo_audio_decoder.cc
@@ -38,10 +38,12 @@ return "MojoAudioDecoder"; } -void MojoAudioDecoder::Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void MojoAudioDecoder::Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DVLOG(1) << __func__; DCHECK(task_runner_->BelongsToCurrentThread());
diff --git a/media/mojo/clients/mojo_audio_decoder.h b/media/mojo/clients/mojo_audio_decoder.h index 8b23e33..e8bbc43 100644 --- a/media/mojo/clients/mojo_audio_decoder.h +++ b/media/mojo/clients/mojo_audio_decoder.h
@@ -32,10 +32,12 @@ // AudioDecoder implementation. std::string GetDisplayName() const final; - void Initialize(const AudioDecoderConfig& config, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) final; + void Initialize( + const AudioDecoderConfig& config, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) final; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) final; void Reset(const base::Closure& closure) final;
diff --git a/media/mojo/clients/mojo_audio_decoder_unittest.cc b/media/mojo/clients/mojo_audio_decoder_unittest.cc index 146f21ae..2991646 100644 --- a/media/mojo/clients/mojo_audio_decoder_unittest.cc +++ b/media/mojo/clients/mojo_audio_decoder_unittest.cc
@@ -107,7 +107,7 @@ new StrictMock<MockAudioDecoder>()); mock_audio_decoder_ = mock_audio_decoder.get(); - EXPECT_CALL(*mock_audio_decoder_, Initialize(_, _, _, _)) + EXPECT_CALL(*mock_audio_decoder_, Initialize(_, _, _, _, _)) .WillRepeatedly(DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(true))); EXPECT_CALL(*mock_audio_decoder_, Decode(_, _)) .WillRepeatedly( @@ -136,9 +136,11 @@ Unencrypted()); mojo_audio_decoder_->Initialize( - audio_config, nullptr, base::Bind(&MojoAudioDecoderTest::OnInitialized, - base::Unretained(this)), - base::Bind(&MojoAudioDecoderTest::OnOutput, base::Unretained(this))); + audio_config, nullptr, + base::Bind(&MojoAudioDecoderTest::OnInitialized, + base::Unretained(this)), + base::Bind(&MojoAudioDecoderTest::OnOutput, base::Unretained(this)), + AudioDecoder::WaitingForDecryptionKeyCB()); RunLoop(); }
diff --git a/media/mojo/clients/mojo_cdm.cc b/media/mojo/clients/mojo_cdm.cc index 5d709d8..2e9cff45 100644 --- a/media/mojo/clients/mojo_cdm.cc +++ b/media/mojo/clients/mojo_cdm.cc
@@ -14,9 +14,11 @@ #include "base/metrics/histogram_macros.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" +#include "build/build_config.h" #include "media/base/cdm_context.h" #include "media/base/cdm_key_information.h" #include "media/base/cdm_promise.h" +#include "media/media_features.h" #include "media/mojo/clients/mojo_decryptor.h" #include "media/mojo/common/media_type_converters.h" #include "media/mojo/interfaces/decryptor.mojom.h" @@ -64,7 +66,8 @@ const SessionKeysChangeCB& session_keys_change_cb, const SessionExpirationUpdateCB& session_expiration_update_cb) : remote_cdm_(std::move(remote_cdm)), - binding_(this), + client_binding_(this), + task_runner_(base::ThreadTaskRunnerHandle::Get()), cdm_id_(CdmContext::kInvalidCdmId), session_message_cb_(session_message_cb), session_closed_cb_(session_closed_cb), @@ -78,13 +81,18 @@ DCHECK(!session_expiration_update_cb_.is_null()); mojom::ContentDecryptionModuleClientPtr client; - binding_.Bind(mojo::MakeRequest(&client)); + client_binding_.Bind(mojo::MakeRequest(&client)); remote_cdm_->SetClient(std::move(client)); } MojoCdm::~MojoCdm() { DVLOG(1) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + + // TODO(crbug.com/819269): It seems possible that |this| is destructed on the + // wrong thread. Add this check to help investigation. We cannot CHECK on the + // |thread_checker_| because it will not check anything in release builds. + CHECK(task_runner_->BelongsToCurrentThread()); base::AutoLock auto_lock(lock_); @@ -110,7 +118,7 @@ const CdmConfig& cdm_config, std::unique_ptr<CdmInitializedPromise> promise) { DVLOG(1) << __func__ << ": " << key_system; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); // If connection error has happened, fail immediately. if (remote_cdm_.encountered_error()) { @@ -138,7 +146,7 @@ const std::string& description) { LOG(ERROR) << "Remote CDM connection error: custom_reason=" << custom_reason << ", description=\"" << description << "\""; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); RecordConnectionError(true); @@ -163,7 +171,7 @@ void MojoCdm::SetServerCertificate(const std::vector<uint8_t>& certificate, std::unique_ptr<SimpleCdmPromise> promise) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!remote_cdm_) { promise->reject(media::CdmPromise::Exception::INVALID_STATE_ERROR, 0, @@ -180,7 +188,7 @@ void MojoCdm::GetStatusForPolicy(HdcpVersion min_hdcp_version, std::unique_ptr<KeyStatusCdmPromise> promise) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!remote_cdm_) { promise->reject(media::CdmPromise::Exception::INVALID_STATE_ERROR, 0, @@ -200,7 +208,7 @@ const std::vector<uint8_t>& init_data, std::unique_ptr<NewSessionCdmPromise> promise) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!remote_cdm_) { promise->reject(media::CdmPromise::Exception::INVALID_STATE_ERROR, 0, @@ -219,7 +227,7 @@ const std::string& session_id, std::unique_ptr<NewSessionCdmPromise> promise) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!remote_cdm_) { promise->reject(media::CdmPromise::Exception::INVALID_STATE_ERROR, 0, @@ -237,7 +245,7 @@ const std::vector<uint8_t>& response, std::unique_ptr<SimpleCdmPromise> promise) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!remote_cdm_) { promise->reject(media::CdmPromise::Exception::INVALID_STATE_ERROR, 0, @@ -254,7 +262,7 @@ void MojoCdm::CloseSession(const std::string& session_id, std::unique_ptr<SimpleCdmPromise> promise) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!remote_cdm_) { promise->reject(media::CdmPromise::Exception::INVALID_STATE_ERROR, 0, @@ -271,7 +279,7 @@ void MojoCdm::RemoveSession(const std::string& session_id, std::unique_ptr<SimpleCdmPromise> promise) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); if (!remote_cdm_) { promise->reject(media::CdmPromise::Exception::INVALID_STATE_ERROR, 0, @@ -311,6 +319,15 @@ int MojoCdm::GetCdmId() const { // Can be called on a different thread. base::AutoLock auto_lock(lock_); + +#if defined(OS_ANDROID) + // TODO(xhwang): On Android, we always assume the remote CDM is a + // MediaDrmBridge. If it supports a Decryptor here, then it's not a + // MediaDrmBridge, and we should not provide the CDM ID. + if (decryptor_ptr_info_.is_valid() || decryptor_) + return CdmContext::kInvalidCdmId; +#endif + DVLOG(2) << __func__ << ": cdm_id = " << cdm_id_; return cdm_id_; } @@ -319,14 +336,14 @@ MessageType message_type, const std::vector<uint8_t>& message) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); session_message_cb_.Run(session_id, message_type, message); } void MojoCdm::OnSessionClosed(const std::string& session_id) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); cdm_session_tracker_.RemoveSession(session_id); session_closed_cb_.Run(session_id); @@ -337,7 +354,7 @@ bool has_additional_usable_key, std::vector<mojom::CdmKeyInformationPtr> keys_info) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); // TODO(jrummell): Handling resume playback should be done in the media // player, not in the Decryptors. http://crbug.com/413413. @@ -363,7 +380,7 @@ void MojoCdm::OnSessionExpirationUpdate(const std::string& session_id, double new_expiry_time_sec) { DVLOG(2) << __func__; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); session_expiration_update_cb_.Run( session_id, base::Time::FromDoubleT(new_expiry_time_sec)); @@ -373,7 +390,7 @@ int cdm_id, mojom::DecryptorPtr decryptor) { DVLOG(2) << __func__ << " cdm_id: " << cdm_id; - DCHECK(thread_checker_.CalledOnValidThread()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(pending_init_promise_); if (!result->success) {
diff --git a/media/mojo/clients/mojo_cdm.h b/media/mojo/clients/mojo_cdm.h index d239c22..c883ec0 100644 --- a/media/mojo/clients/mojo_cdm.h +++ b/media/mojo/clients/mojo_cdm.h
@@ -129,10 +129,11 @@ mojom::CdmPromiseResultPtr result, const std::string& session_id); - base::ThreadChecker thread_checker_; + THREAD_CHECKER(thread_checker_); mojom::ContentDecryptionModulePtr remote_cdm_; - mojo::Binding<ContentDecryptionModuleClient> binding_; + mojo::Binding<ContentDecryptionModuleClient> client_binding_; + scoped_refptr<base::SingleThreadTaskRunner> task_runner_; // Protects |cdm_id_|, |decryptor_ptr_|, |decryptor_| and // |decryptor_task_runner_| which could be accessed from other threads.
diff --git a/media/mojo/clients/mojo_video_decoder.cc b/media/mojo/clients/mojo_video_decoder.cc index 5e4d06e0..e95f29d3 100644 --- a/media/mojo/clients/mojo_video_decoder.cc +++ b/media/mojo/clients/mojo_video_decoder.cc
@@ -100,11 +100,13 @@ return "MojoVideoDecoder"; } -void MojoVideoDecoder::Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) { +void MojoVideoDecoder::Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) { DVLOG(1) << __func__; DCHECK(task_runner_->BelongsToCurrentThread());
diff --git a/media/mojo/clients/mojo_video_decoder.h b/media/mojo/clients/mojo_video_decoder.h index 9a957a9..c62297d8 100644 --- a/media/mojo/clients/mojo_video_decoder.h +++ b/media/mojo/clients/mojo_video_decoder.h
@@ -42,11 +42,13 @@ // VideoDecoder implementation. std::string GetDisplayName() const final; - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) final; + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) final; void Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) final; void Reset(const base::Closure& closure) final;
diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc index dc9a33c..0f37f63 100644 --- a/media/mojo/services/gpu_mojo_media_client.cc +++ b/media/mojo/services/gpu_mojo_media_client.cc
@@ -77,7 +77,7 @@ return channel->LookupCommandBuffer(route_id); } -#endif // OS_ANDROID || BUILDFLAG(ENABLE_MEDIA_CODEC_VIDEO_D3D11) +#endif // OS_ANDROID || (OS_WIN && BUILDFLAG(ENABLE_D3D11_VIDEO_DECODER)) } // namespace @@ -131,7 +131,7 @@ command_buffer_id->route_id)); #else return nullptr; -#endif // BUILDFLAG(ENABLE_{MEDIA_CODEC | D3D11}_VIDEO_DECODER) +#endif // defined(OS_ANDROID) } std::unique_ptr<CdmFactory> GpuMojoMediaClient::CreateCdmFactory(
diff --git a/media/mojo/services/mojo_audio_decoder_service.cc b/media/mojo/services/mojo_audio_decoder_service.cc index da65bbd..5f50351 100644 --- a/media/mojo/services/mojo_audio_decoder_service.cc +++ b/media/mojo/services/mojo_audio_decoder_service.cc
@@ -56,7 +56,8 @@ config, cdm_context, base::Bind(&MojoAudioDecoderService::OnInitialized, weak_this_, base::Passed(&callback)), - base::Bind(&MojoAudioDecoderService::OnAudioBufferReady, weak_this_)); + base::Bind(&MojoAudioDecoderService::OnAudioBufferReady, weak_this_), + media::AudioDecoder::WaitingForDecryptionKeyCB()); } void MojoAudioDecoderService::SetDataSource(
diff --git a/media/mojo/services/mojo_cdm_service.cc b/media/mojo/services/mojo_cdm_service.cc index 26de295a..5c39b20 100644 --- a/media/mojo/services/mojo_cdm_service.cc +++ b/media/mojo/services/mojo_cdm_service.cc
@@ -38,11 +38,14 @@ context_(context), cdm_id_(CdmContext::kInvalidCdmId), weak_factory_(this) { + DVLOG(1) << __func__; DCHECK(cdm_factory_); // |context_| can be null. } MojoCdmService::~MojoCdmService() { + DVLOG(1) << __func__; + if (!context_ || cdm_id_ == CdmContext::kInvalidCdmId) return;
diff --git a/media/mojo/services/mojo_decryptor_service.cc b/media/mojo/services/mojo_decryptor_service.cc index 901fadff..cb41f498 100644 --- a/media/mojo/services/mojo_decryptor_service.cc +++ b/media/mojo/services/mojo_decryptor_service.cc
@@ -32,10 +32,10 @@ public: explicit FrameResourceReleaserImpl(scoped_refptr<VideoFrame> frame) : frame_(std::move(frame)) { - DVLOG(1) << __func__; + DVLOG(3) << __func__; DCHECK_EQ(VideoFrame::STORAGE_MOJO_SHARED_BUFFER, frame_->storage_type()); } - ~FrameResourceReleaserImpl() override { DVLOG(1) << __func__; } + ~FrameResourceReleaserImpl() override { DVLOG(3) << __func__; } private: scoped_refptr<VideoFrame> frame_; @@ -58,13 +58,17 @@ binding_.set_connection_error_handler(error_handler); } -MojoDecryptorService::~MojoDecryptorService() = default; +MojoDecryptorService::~MojoDecryptorService() { + DVLOG(1) << __func__; +} void MojoDecryptorService::Initialize( mojo::ScopedDataPipeConsumerHandle audio_pipe, mojo::ScopedDataPipeConsumerHandle video_pipe, mojo::ScopedDataPipeConsumerHandle decrypt_pipe, mojo::ScopedDataPipeProducerHandle decrypted_pipe) { + DVLOG(1) << __func__; + audio_buffer_reader_.reset( new MojoDecoderBufferReader(std::move(audio_pipe))); video_buffer_reader_.reset( @@ -86,7 +90,7 @@ } void MojoDecryptorService::CancelDecrypt(StreamType stream_type) { - DVLOG(1) << __func__; + DVLOG(2) << __func__; decryptor_->CancelDecrypt(stream_type); } @@ -102,7 +106,7 @@ void MojoDecryptorService::InitializeVideoDecoder( const VideoDecoderConfig& config, InitializeVideoDecoderCallback callback) { - DVLOG(1) << __func__; + DVLOG(2) << __func__; decryptor_->InitializeVideoDecoder( config, base::Bind(&MojoDecryptorService::OnVideoDecoderInitialized, weak_this_, base::Passed(&callback))); @@ -127,7 +131,7 @@ } void MojoDecryptorService::ResetDecoder(StreamType stream_type) { - DVLOG(1) << __func__ << ": stream_type = " << stream_type; + DVLOG(2) << __func__ << ": stream_type = " << stream_type; // Reset the reader so that pending decodes will be dispatched first. if (!GetBufferReader(stream_type)) @@ -139,7 +143,7 @@ } void MojoDecryptorService::DeinitializeDecoder(StreamType stream_type) { - DVLOG(1) << __func__; + DVLOG(2) << __func__; DCHECK(!GetBufferReader(stream_type)->HasPendingReads()) << "The decoder should be fully flushed before deinitialized."; @@ -185,14 +189,14 @@ void MojoDecryptorService::OnAudioDecoderInitialized( InitializeAudioDecoderCallback callback, bool success) { - DVLOG(1) << __func__ << "(" << success << ")"; + DVLOG(2) << __func__ << "(" << success << ")"; std::move(callback).Run(success); } void MojoDecryptorService::OnVideoDecoderInitialized( InitializeVideoDecoderCallback callback, bool success) { - DVLOG(1) << __func__ << "(" << success << ")"; + DVLOG(2) << __func__ << "(" << success << ")"; std::move(callback).Run(success); } @@ -222,7 +226,7 @@ } void MojoDecryptorService::OnReaderFlushDone(StreamType stream_type) { - DVLOG(1) << __func__ << ": stream_type = " << stream_type; + DVLOG(2) << __func__ << ": stream_type = " << stream_type; decryptor_->ResetDecoder(stream_type); }
diff --git a/media/mojo/services/mojo_video_decoder_service.cc b/media/mojo/services/mojo_video_decoder_service.cc index 6f1ddd54..a68e770 100644 --- a/media/mojo/services/mojo_video_decoder_service.cc +++ b/media/mojo/services/mojo_video_decoder_service.cc
@@ -172,7 +172,8 @@ base::Bind(&MojoVideoDecoderService::OnDecoderInitialized, weak_this_, base::Passed(&callback)), base::BindRepeating(&MojoVideoDecoderService::OnDecoderOutput, - weak_this_)); + weak_this_), + media::VideoDecoder::WaitingForDecryptionKeyCB()); } void MojoVideoDecoderService::Decode(mojom::DecoderBufferPtr buffer,
diff --git a/media/mojo/test/mojo_video_decoder_integration_test.cc b/media/mojo/test/mojo_video_decoder_integration_test.cc index 3af1c1ad..96d1f22 100644 --- a/media/mojo/test/mojo_video_decoder_integration_test.cc +++ b/media/mojo/test/mojo_video_decoder_integration_test.cc
@@ -78,11 +78,14 @@ MOCK_CONST_METHOD0(GetDisplayName, std::string()); // Initialize() records values before delegating to the mock method. - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override { + void Initialize( + const VideoDecoderConfig& config, + bool /* low_delay */, + CdmContext* /* cdm_context */, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& /* waiting_for_decryption_key_cb */) + override { config_ = config; output_cb_ = output_cb; DoInitialize(init_cb); @@ -205,7 +208,8 @@ EXPECT_CALL(init_cb, Run(_)).WillOnce(SaveArg<0>(&result)); client_->Initialize(TestVideoConfig::Normal(), false, nullptr, - init_cb.Get(), output_cb_.Get()); + init_cb.Get(), output_cb_.Get(), + VideoDecoder::WaitingForDecryptionKeyCB()); RunUntilIdle(); return result;
diff --git a/media/renderers/audio_renderer_impl_unittest.cc b/media/renderers/audio_renderer_impl_unittest.cc index 15ed036..76806201 100644 --- a/media/renderers/audio_renderer_impl_unittest.cc +++ b/media/renderers/audio_renderer_impl_unittest.cc
@@ -92,11 +92,11 @@ std::vector<std::unique_ptr<AudioDecoder>> CreateAudioDecoderForTest() { auto decoder = std::make_unique<MockAudioDecoder>(); if (!enter_pending_decoder_init_) { - EXPECT_CALL(*decoder, Initialize(_, _, _, _)) + EXPECT_CALL(*decoder, Initialize(_, _, _, _, _)) .WillOnce(DoAll(SaveArg<3>(&output_cb_), RunCallback<2>(expected_init_result_))); } else { - EXPECT_CALL(*decoder, Initialize(_, _, _, _)) + EXPECT_CALL(*decoder, Initialize(_, _, _, _, _)) .WillOnce(EnterPendingDecoderInitStateAction(this)); } EXPECT_CALL(*decoder, Decode(_, _))
diff --git a/media/renderers/video_renderer_impl_unittest.cc b/media/renderers/video_renderer_impl_unittest.cc index 9068c30..4514003 100644 --- a/media/renderers/video_renderer_impl_unittest.cc +++ b/media/renderers/video_renderer_impl_unittest.cc
@@ -62,7 +62,7 @@ decoder_ = new NiceMock<MockVideoDecoder>(); std::vector<std::unique_ptr<VideoDecoder>> decoders; decoders.push_back(base::WrapUnique(decoder_)); - ON_CALL(*decoder_, Initialize(_, _, _, _, _)) + ON_CALL(*decoder_, Initialize(_, _, _, _, _, _)) .WillByDefault(DoAll(SaveArg<4>(&output_cb_), RunCallback<3>(expect_init_success_))); // Monitor decodes from the decoder.
diff --git a/media/test/data/README b/media/test/data/README index dfcafef..12e4761d 100644 --- a/media/test/data/README +++ b/media/test/data/README
@@ -111,10 +111,32 @@ bear-320x240-opus-av_enc-v.webm - bear-vp9-opus.webm with video track encrypted using key ID [1] and key[2]. bear-640x360-a_frag-cenc.mp4 - A fragmented MP4 version of the audio track of bear-640x360.mp4 encrypted (ISO CENC) using key ID [1] and key [2]. bear-640x360-a_frag-cenc-key_rotation.mp4 - A fragmented MP4 version of the audio track of bear-640x360.mp4 encrypted (ISO CENC) using key ID [1] and key [2] with key rotation [3]. -bear-640x360-v_frag-cenc.mp4 - A fragmented MP4 version of the video track of bear-640x360.mp4 encrypted (ISO CENC) using key ID [1] and key [2] and with sample encryption auxiliary information in the beginning of mdat box. +bear-640x360-v_frag-cenc-mdat.mp4 - A fragmented MP4 version of the video track of bear-640x360.mp4 encrypted (ISO CENC) using key ID [1] and key [2] and with sample encryption auxiliary information in the beginning of mdat box. bear-640x360-v_frag-cenc-senc.mp4 - Same as above, but with sample encryption information stored in SampleEncryption ('senc') box. bear-640x360-v_frag-cenc-senc-no-saiz-saio.mp4 - Same as above, but without saiz and saio boxes. bear-640x360-v_frag-cenc-key_rotation.mp4 - A fragmented MP4 version of the video track of bear-640x360.mp4 encrypted (ISO CENC) using key ID [1] and key [2] with key rotation [3]. + +bear-640x360-v_frag-cenc.mp4 +bear-640x360-v_frag-cbc1.mp4 +bear-640x360-v_frag-cbcs.mp4 +bear-640x360-v_frag-cens.mp4 +- Encrypted versions of bear-640x360-v_frag.mp4, encrypted by Shaka Packager + using key ID [1] and key [2]. Sample encryption information stored in + SampleEncryption ('senc') box (in each encrypted fragment). + Shaka Packager: https://github.com/google/shaka-packager/releases/tag/v2.0.0 + Command: (replace both places of 'cenc' with desired scheme) + packager in=bear-640x360-v_frag.mp4,stream=video,output=bear-640x360-v-cenc.mp4 + --enable_raw_key_encryption + --protection_scheme cenc + --clear_lead 0.5 + --segment_duration 0.5 + --keys label=:key_id=30313233343536373839303132333435:key=ebdd62f16814d27b68ef122afce4ae3c + --pssh 000000327073736800000000EDEF8BA979D64ACEA3C827DCD51D21ED000000121210303132333435363738393031323334350000003470737368010000001077EFECC0B24D02ACE33C1E52E2FB4B000000013031323334353637383930313233343500000000 + 'pssh' data includes entries for both Widevine and Common SystemID [5]. + It was generated from concatenating the output of: + shaka/packager/tools/pssh/pssh-box.py --widevine-system-id --key-id 30313233343536373839303132333435 --hex + shaka/packager/tools/pssh/pssh-box.py --common-system-id --key-id 30313233343536373839303132333435 --hex + bear-a_enc-a.webm - bear-320x240-audio-only.webm encrypted using key ID [1] and key [2]. frame_size_change-av_enc-v.webm - third_party/WebKit/LayoutTests/media/resources/frame_size_change.webm encrypted using key ID [1] and key [2]. @@ -136,6 +158,7 @@ std::rotate for every new crypto period. This is only for testing. The actual key rotation algorithm is often much more complicated. [4] http://www.webmproject.org/docs/webm-encryption/#46-subsample-encrypted-block-format +[5] https://w3c.github.io/encrypted-media/format-registry/initdata/cenc.html#common-system // Container Tests (additional containers derived from bear.ogv) bear.ac3 -- created using "avconv -i bear.ogv -f ac3 -b 192k bear.ac3".
diff --git a/media/test/data/bear-640x360-v_frag-cbc1.mp4 b/media/test/data/bear-640x360-v_frag-cbc1.mp4 new file mode 100644 index 0000000..b146727 --- /dev/null +++ b/media/test/data/bear-640x360-v_frag-cbc1.mp4 Binary files differ
diff --git a/media/test/data/bear-640x360-v_frag-cbcs.mp4 b/media/test/data/bear-640x360-v_frag-cbcs.mp4 new file mode 100644 index 0000000..3a7cc1210 --- /dev/null +++ b/media/test/data/bear-640x360-v_frag-cbcs.mp4 Binary files differ
diff --git a/media/test/data/bear-640x360-v_frag-cenc-mdat.mp4 b/media/test/data/bear-640x360-v_frag-cenc-mdat.mp4 new file mode 100644 index 0000000..1b63dd4 --- /dev/null +++ b/media/test/data/bear-640x360-v_frag-cenc-mdat.mp4 Binary files differ
diff --git a/media/test/data/bear-640x360-v_frag-cenc.mp4 b/media/test/data/bear-640x360-v_frag-cenc.mp4 index 1b63dd4..90643ae 100644 --- a/media/test/data/bear-640x360-v_frag-cenc.mp4 +++ b/media/test/data/bear-640x360-v_frag-cenc.mp4 Binary files differ
diff --git a/media/test/data/bear-640x360-v_frag-cens.mp4 b/media/test/data/bear-640x360-v_frag-cens.mp4 new file mode 100644 index 0000000..eed8159 --- /dev/null +++ b/media/test/data/bear-640x360-v_frag-cens.mp4 Binary files differ
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc index 7e85e858..2c574da 100644 --- a/media/test/pipeline_integration_test.cc +++ b/media/test/pipeline_integration_test.cc
@@ -395,11 +395,13 @@ class FailingVideoDecoder : public VideoDecoder { public: std::string GetDisplayName() const override { return "FailingVideoDecoder"; } - void Initialize(const VideoDecoderConfig& config, - bool low_delay, - CdmContext* cdm_context, - const InitCB& init_cb, - const OutputCB& output_cb) override { + void Initialize( + const VideoDecoderConfig& config, + bool low_delay, + CdmContext* cdm_context, + const InitCB& init_cb, + const OutputCB& output_cb, + const WaitingForDecryptionKeyCB& waiting_for_decryption_key_cb) override { init_cb.Run(true); } void Decode(const scoped_refptr<DecoderBuffer>& buffer, @@ -1848,7 +1850,7 @@ MAYBE_EME_TEST_P(MSEPipelineIntegrationTest, MAYBE_EME(ConfigChange_Encrypted_MP4_CENC_VideoOnly)) { - MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video, + MockMediaSource source("bear-640x360-v_frag-cenc-mdat.mp4", kMP4Video, kAppendWholeFile); FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); EXPECT_EQ(PIPELINE_OK, @@ -1948,7 +1950,7 @@ // Config changes from encrypted to clear are not currently supported. MAYBE_EME_TEST_P(MSEPipelineIntegrationTest, MAYBE_EME(ConfigChange_EncryptedThenClear_MP4_CENC)) { - MockMediaSource source("bear-640x360-v_frag-cenc.mp4", kMP4Video, + MockMediaSource source("bear-640x360-v_frag-cenc-mdat.mp4", kMP4Video, kAppendWholeFile); FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); EXPECT_EQ(PIPELINE_OK, @@ -2203,6 +2205,25 @@ Stop(); } +// Older packagers saved sample encryption auxiliary information in the +// beginning of mdat box. +MAYBE_EME_TEST_P(MSEPipelineIntegrationTest, + MAYBE_EME(EncryptedPlayback_MP4_CENC_MDAT_Video)) { + MockMediaSource source("bear-640x360-v_frag-cenc-mdat.mp4", kMP4Video, + kAppendWholeFile); + FakeEncryptedMedia encrypted_media(new KeyProvidingApp()); + EXPECT_EQ(PIPELINE_OK, + StartPipelineWithEncryptedMedia(&source, &encrypted_media)); + + source.EndOfStream(); + + Play(); + + ASSERT_TRUE(WaitUntilOnEnded()); + source.Shutdown(); + Stop(); +} + MAYBE_EME_TEST_P(MSEPipelineIntegrationTest, MAYBE_EME(EncryptedPlayback_MP4_CENC_SENC_Video)) { MockMediaSource source("bear-640x360-v_frag-cenc-senc.mp4", kMP4Video,
diff --git a/media/video/video_encode_accelerator.h b/media/video/video_encode_accelerator.h index 409e2a5f..2e00b82 100644 --- a/media/video/video_encode_accelerator.h +++ b/media/video/video_encode_accelerator.h
@@ -161,7 +161,7 @@ // handed back to the client, and afterwards the |flush_callback| will be // called. The FlushCallback takes a boolean argument: |true| indicates the // flush is complete; |false| indicates the flush is cancelled due to errors - // or destruction. The client should not invoke Flush() or Encode() while the\ + // or destruction. The client should not invoke Flush() or Encode() while the // previous Flush() is not finished yet. virtual void Flush(FlushCallback flush_callback);
diff --git a/mojo/edk/embedder/entrypoints.cc b/mojo/edk/embedder/entrypoints.cc index 112cd517..a2aba1b 100644 --- a/mojo/edk/embedder/entrypoints.cc +++ b/mojo/edk/embedder/entrypoints.cc
@@ -33,30 +33,36 @@ return g_core->QueryHandleSignalsState(handle, signals_state); } -MojoResult MojoCreateWatcherImpl(MojoWatcherCallback callback, - MojoHandle* watcher_handle) { - return g_core->CreateWatcher(callback, watcher_handle); +MojoResult MojoCreateTrapImpl(MojoTrapEventHandler handler, + const MojoCreateTrapOptions* options, + MojoHandle* trap_handle) { + return g_core->CreateTrap(handler, options, trap_handle); } -MojoResult MojoArmWatcherImpl(MojoHandle watcher_handle, - uint32_t* num_ready_contexts, - uintptr_t* ready_contexts, - MojoResult* ready_results, - MojoHandleSignalsState* ready_signals_states) { - return g_core->ArmWatcher(watcher_handle, num_ready_contexts, ready_contexts, - ready_results, ready_signals_states); +MojoResult MojoArmTrapImpl(MojoHandle trap_handle, + const MojoArmTrapOptions* options, + uint32_t* num_ready_triggers, + uintptr_t* ready_triggers, + MojoResult* ready_results, + MojoHandleSignalsState* ready_signals_states) { + return g_core->ArmTrap(trap_handle, options, num_ready_triggers, + ready_triggers, ready_results, ready_signals_states); } -MojoResult MojoWatchImpl(MojoHandle watcher_handle, - MojoHandle handle, - MojoHandleSignals signals, - MojoWatchCondition condition, - uintptr_t context) { - return g_core->Watch(watcher_handle, handle, signals, condition, context); +MojoResult MojoAddTriggerImpl(MojoHandle trap_handle, + MojoHandle handle, + MojoHandleSignals signals, + MojoTriggerCondition condition, + uintptr_t context, + const MojoAddTriggerOptions* options) { + return g_core->AddTrigger(trap_handle, handle, signals, condition, context, + options); } -MojoResult MojoCancelWatchImpl(MojoHandle watcher_handle, uintptr_t context) { - return g_core->CancelWatch(watcher_handle, context); +MojoResult MojoRemoveTriggerImpl(MojoHandle trap_handle, + uintptr_t context, + const MojoRemoveTriggerOptions* options) { + return g_core->RemoveTrigger(trap_handle, context, options); } MojoResult MojoCreateMessageImpl(const MojoCreateMessageOptions* options, @@ -277,10 +283,10 @@ MojoDuplicateBufferHandleImpl, MojoMapBufferImpl, MojoUnmapBufferImpl, - MojoCreateWatcherImpl, - MojoWatchImpl, - MojoCancelWatchImpl, - MojoArmWatcherImpl, + MojoCreateTrapImpl, + MojoAddTriggerImpl, + MojoRemoveTriggerImpl, + MojoArmTrapImpl, MojoFuseMessagePipesImpl, MojoCreateMessageImpl, MojoDestroyMessageImpl,
diff --git a/mojo/edk/system/BUILD.gn b/mojo/edk/system/BUILD.gn index dfe6940..63bc3861 100644 --- a/mojo/edk/system/BUILD.gn +++ b/mojo/edk/system/BUILD.gn
@@ -154,7 +154,7 @@ "shared_buffer_dispatcher_unittest.cc", "shared_buffer_unittest.cc", "signals_unittest.cc", - "watcher_unittest.cc", + "trap_unittest.cc", ] if (!is_ios) {
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc index 271c041..eaa6937 100644 --- a/mojo/edk/system/core.cc +++ b/mojo/edk/system/core.cc
@@ -432,51 +432,70 @@ return MOJO_RESULT_OK; } -MojoResult Core::CreateWatcher(MojoWatcherCallback callback, - MojoHandle* watcher_handle) { - RequestContext request_context; - if (!watcher_handle) +MojoResult Core::CreateTrap(MojoTrapEventHandler handler, + const MojoCreateTrapOptions* options, + MojoHandle* trap_handle) { + if (options && options->struct_size != sizeof(*options)) return MOJO_RESULT_INVALID_ARGUMENT; - *watcher_handle = AddDispatcher(new WatcherDispatcher(callback)); - if (*watcher_handle == MOJO_HANDLE_INVALID) + + RequestContext request_context; + if (!trap_handle) + return MOJO_RESULT_INVALID_ARGUMENT; + *trap_handle = AddDispatcher(new WatcherDispatcher(handler)); + if (*trap_handle == MOJO_HANDLE_INVALID) return MOJO_RESULT_RESOURCE_EXHAUSTED; return MOJO_RESULT_OK; } -MojoResult Core::Watch(MojoHandle watcher_handle, - MojoHandle handle, - MojoHandleSignals signals, - MojoWatchCondition condition, - uintptr_t context) { +MojoResult Core::AddTrigger(MojoHandle trap_handle, + MojoHandle handle, + MojoHandleSignals signals, + MojoTriggerCondition condition, + uintptr_t context, + const MojoAddTriggerOptions* options) { + if (options && options->struct_size != sizeof(*options)) + return MOJO_RESULT_INVALID_ARGUMENT; + RequestContext request_context; - scoped_refptr<Dispatcher> watcher = GetDispatcher(watcher_handle); + scoped_refptr<Dispatcher> watcher = GetDispatcher(trap_handle); if (!watcher || watcher->GetType() != Dispatcher::Type::WATCHER) return MOJO_RESULT_INVALID_ARGUMENT; + scoped_refptr<Dispatcher> dispatcher = GetDispatcher(handle); if (!dispatcher) return MOJO_RESULT_INVALID_ARGUMENT; + return watcher->WatchDispatcher(std::move(dispatcher), signals, condition, context); } -MojoResult Core::CancelWatch(MojoHandle watcher_handle, uintptr_t context) { +MojoResult Core::RemoveTrigger(MojoHandle trap_handle, + uintptr_t context, + const MojoRemoveTriggerOptions* options) { + if (options && options->struct_size != sizeof(*options)) + return MOJO_RESULT_INVALID_ARGUMENT; + RequestContext request_context; - scoped_refptr<Dispatcher> watcher = GetDispatcher(watcher_handle); + scoped_refptr<Dispatcher> watcher = GetDispatcher(trap_handle); if (!watcher || watcher->GetType() != Dispatcher::Type::WATCHER) return MOJO_RESULT_INVALID_ARGUMENT; return watcher->CancelWatch(context); } -MojoResult Core::ArmWatcher(MojoHandle watcher_handle, - uint32_t* num_ready_contexts, - uintptr_t* ready_contexts, - MojoResult* ready_results, - MojoHandleSignalsState* ready_signals_states) { +MojoResult Core::ArmTrap(MojoHandle trap_handle, + const MojoArmTrapOptions* options, + uint32_t* num_ready_triggers, + uintptr_t* ready_triggers, + MojoResult* ready_results, + MojoHandleSignalsState* ready_signals_states) { + if (options && options->struct_size != sizeof(*options)) + return MOJO_RESULT_INVALID_ARGUMENT; + RequestContext request_context; - scoped_refptr<Dispatcher> watcher = GetDispatcher(watcher_handle); + scoped_refptr<Dispatcher> watcher = GetDispatcher(trap_handle); if (!watcher || watcher->GetType() != Dispatcher::Type::WATCHER) return MOJO_RESULT_INVALID_ARGUMENT; - return watcher->Arm(num_ready_contexts, ready_contexts, ready_results, + return watcher->Arm(num_ready_triggers, ready_triggers, ready_results, ready_signals_states); }
diff --git a/mojo/edk/system/core.h b/mojo/edk/system/core.h index d5b4194..b8deb3c 100644 --- a/mojo/edk/system/core.h +++ b/mojo/edk/system/core.h
@@ -26,8 +26,8 @@ #include "mojo/public/c/system/data_pipe.h" #include "mojo/public/c/system/message_pipe.h" #include "mojo/public/c/system/platform_handle.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" -#include "mojo/public/c/system/watcher.h" #include "mojo/public/cpp/system/message_pipe.h" namespace base { @@ -179,19 +179,24 @@ MojoResult Close(MojoHandle handle); MojoResult QueryHandleSignalsState(MojoHandle handle, MojoHandleSignalsState* signals_state); - MojoResult CreateWatcher(MojoWatcherCallback callback, - MojoHandle* watcher_handle); - MojoResult Watch(MojoHandle watcher_handle, - MojoHandle handle, - MojoHandleSignals signals, - MojoWatchCondition condition, - uintptr_t context); - MojoResult CancelWatch(MojoHandle watcher_handle, uintptr_t context); - MojoResult ArmWatcher(MojoHandle watcher_handle, - uint32_t* num_ready_contexts, - uintptr_t* ready_contexts, - MojoResult* ready_results, - MojoHandleSignalsState* ready_signals_states); + MojoResult CreateTrap(MojoTrapEventHandler handler, + const MojoCreateTrapOptions* options, + MojoHandle* trap_handle); + MojoResult AddTrigger(MojoHandle trap_handle, + MojoHandle handle, + MojoHandleSignals signals, + MojoTriggerCondition condition, + uintptr_t context, + const MojoAddTriggerOptions* options); + MojoResult RemoveTrigger(MojoHandle trap_handle, + uintptr_t context, + const MojoRemoveTriggerOptions* options); + MojoResult ArmTrap(MojoHandle trap_handle, + const MojoArmTrapOptions* options, + uint32_t* num_ready_triggers, + uintptr_t* ready_triggers, + MojoResult* ready_results, + MojoHandleSignalsState* ready_signals_states); MojoResult CreateMessage(const MojoCreateMessageOptions* options, MojoMessageHandle* message_handle); MojoResult DestroyMessage(MojoMessageHandle message_handle);
diff --git a/mojo/edk/system/dispatcher.cc b/mojo/edk/system/dispatcher.cc index 3ad0601..43959288 100644 --- a/mojo/edk/system/dispatcher.cc +++ b/mojo/edk/system/dispatcher.cc
@@ -25,7 +25,7 @@ MojoResult Dispatcher::WatchDispatcher(scoped_refptr<Dispatcher> dispatcher, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, uintptr_t context) { return MOJO_RESULT_INVALID_ARGUMENT; }
diff --git a/mojo/edk/system/dispatcher.h b/mojo/edk/system/dispatcher.h index 3c3de63..ec3d019 100644 --- a/mojo/edk/system/dispatcher.h +++ b/mojo/edk/system/dispatcher.h
@@ -25,6 +25,7 @@ #include "mojo/public/c/system/buffer.h" #include "mojo/public/c/system/data_pipe.h" #include "mojo/public/c/system/message_pipe.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" namespace mojo { @@ -73,7 +74,7 @@ virtual MojoResult WatchDispatcher(scoped_refptr<Dispatcher> dispatcher, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, uintptr_t context); virtual MojoResult CancelWatch(uintptr_t context); virtual MojoResult Arm(uint32_t* num_ready_contexts,
diff --git a/mojo/edk/system/request_context.cc b/mojo/edk/system/request_context.cc index 5de65d7..4de4343 100644 --- a/mojo/edk/system/request_context.cc +++ b/mojo/edk/system/request_context.cc
@@ -36,9 +36,9 @@ // since we're starting over at the bottom of the stack. tls_context_->Set(nullptr); - MojoWatcherNotificationFlags flags = MOJO_WATCHER_NOTIFICATION_FLAG_NONE; - if (source_ == Source::SYSTEM) - flags |= MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM; + MojoTrapEventFlags flags = MOJO_TRAP_EVENT_FLAG_NONE; + if (source_ == Source::LOCAL_API_CALL) + flags |= MOJO_TRAP_EVENT_FLAG_WITHIN_API_CALL; // We send all cancellation notifications first. This is necessary because // it's possible that cancelled watches have other pending notifications
diff --git a/mojo/edk/system/signals_unittest.cc b/mojo/edk/system/signals_unittest.cc index 4c43379..becba29 100644 --- a/mojo/edk/system/signals_unittest.cc +++ b/mojo/edk/system/signals_unittest.cc
@@ -7,6 +7,7 @@ #include "mojo/public/c/system/data_pipe.h" #include "mojo/public/c/system/functions.h" #include "mojo/public/c/system/message_pipe.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" namespace mojo { @@ -130,24 +131,28 @@ EXPECT_EQ(MOJO_RESULT_OK, MojoQueryHandleSignalsState(a, &state)); EXPECT_TRUE(state.satisfiable_signals & MOJO_HANDLE_SIGNAL_PEER_REMOTE); EXPECT_FALSE(state.satisfied_signals & MOJO_HANDLE_SIGNAL_PEER_REMOTE); - EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(a, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_NOT_SATISFIED)); + EXPECT_EQ(MOJO_RESULT_OK, + WaitForSignals(a, MOJO_HANDLE_SIGNAL_PEER_REMOTE, + MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED)); EXPECT_EQ(MOJO_RESULT_OK, MojoQueryHandleSignalsState(b, &state)); EXPECT_TRUE(state.satisfiable_signals & MOJO_HANDLE_SIGNAL_PEER_REMOTE); EXPECT_FALSE(state.satisfied_signals & MOJO_HANDLE_SIGNAL_PEER_REMOTE); - EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(b, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_NOT_SATISFIED)); + EXPECT_EQ(MOJO_RESULT_OK, + WaitForSignals(b, MOJO_HANDLE_SIGNAL_PEER_REMOTE, + MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED)); RunTestClient("RemotePeersClient", [&](MojoHandle h) { // The bootstrap pipe should eventually signal remoteness. - EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(h, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_SATISFIED)); + EXPECT_EQ(MOJO_RESULT_OK, + WaitForSignals(h, MOJO_HANDLE_SIGNAL_PEER_REMOTE, + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED)); // And so should |a| after we send its peer. WriteMessageWithHandles(h, ":)", &b, 1); - EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(a, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_SATISFIED)); + EXPECT_EQ(MOJO_RESULT_OK, + WaitForSignals(a, MOJO_HANDLE_SIGNAL_PEER_REMOTE, + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED)); EXPECT_EQ(MOJO_RESULT_OK, MojoQueryHandleSignalsState(a, &state)); EXPECT_TRUE(state.satisfied_signals & MOJO_HANDLE_SIGNAL_PEER_REMOTE); @@ -155,8 +160,9 @@ MojoHandle c, d; CreateMessagePipe(&c, &d); EXPECT_EQ(MOJO_RESULT_OK, MojoFuseMessagePipes(d, a)); - EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(c, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_SATISFIED)); + EXPECT_EQ(MOJO_RESULT_OK, + WaitForSignals(c, MOJO_HANDLE_SIGNAL_PEER_REMOTE, + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED)); EXPECT_EQ(MOJO_RESULT_OK, MojoQueryHandleSignalsState(c, &state)); EXPECT_TRUE(state.satisfied_signals & MOJO_HANDLE_SIGNAL_PEER_REMOTE); @@ -172,7 +178,7 @@ // Wait for |a| to see its peer as local again. EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(a, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_NOT_SATISFIED)); + MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED)); EXPECT_EQ(MOJO_RESULT_OK, MojoQueryHandleSignalsState(a, &state)); EXPECT_FALSE(state.satisfied_signals & MOJO_HANDLE_SIGNAL_PEER_REMOTE); }); @@ -180,15 +186,17 @@ DEFINE_TEST_CLIENT_TEST_WITH_PIPE(RemotePeersClient, SignalsTest, h) { // The bootstrap pipe should eventually signal remoteness. - EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(h, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_SATISFIED)); + EXPECT_EQ(MOJO_RESULT_OK, + WaitForSignals(h, MOJO_HANDLE_SIGNAL_PEER_REMOTE, + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED)); MojoHandle b; EXPECT_EQ(":)", ReadMessageWithHandles(h, &b, 1)); // And so should |b|. - EXPECT_EQ(MOJO_RESULT_OK, WaitForSignals(b, MOJO_HANDLE_SIGNAL_PEER_REMOTE, - MOJO_WATCH_CONDITION_SATISFIED)); + EXPECT_EQ(MOJO_RESULT_OK, + WaitForSignals(b, MOJO_HANDLE_SIGNAL_PEER_REMOTE, + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED)); // Wait for the test to signal that it's ready to read |b| back. EXPECT_EQ("OK!", ReadMessage(h));
diff --git a/mojo/edk/system/watcher_unittest.cc b/mojo/edk/system/trap_unittest.cc similarity index 96% rename from mojo/edk/system/watcher_unittest.cc rename to mojo/edk/system/trap_unittest.cc index 544b0f2..3081a22 100644 --- a/mojo/edk/system/watcher_unittest.cc +++ b/mojo/edk/system/trap_unittest.cc
@@ -19,14 +19,39 @@ #include "base/time/time.h" #include "mojo/edk/test/mojo_test_base.h" #include "mojo/public/c/system/data_pipe.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" -#include "mojo/public/c/system/watcher.h" #include "testing/gtest/include/gtest/gtest.h" namespace mojo { namespace edk { namespace { +// TODO(https://crbug.com/819046): These are temporary wrappers to reduce +// changes necessary during the API rename. Remove them. + +MojoResult MojoWatch(MojoHandle trap_handle, + MojoHandle handle, + MojoHandleSignals signals, + MojoTriggerCondition condition, + uintptr_t context) { + return MojoAddTrigger(trap_handle, handle, signals, condition, context, + nullptr); +} + +MojoResult MojoCancelWatch(MojoHandle trap_handle, uintptr_t context) { + return MojoRemoveTrigger(trap_handle, context, nullptr); +} + +MojoResult MojoArmWatcher(MojoHandle trap_handle, + uint32_t* num_ready_contexts, + uintptr_t* ready_contexts, + MojoResult* ready_results, + MojoHandleSignalsState* ready_signals) { + return MojoArmTrap(trap_handle, nullptr, num_ready_contexts, ready_contexts, + ready_results, ready_signals); +} + using WatcherTest = test::MojoTestBase; class WatchHelper { @@ -38,7 +63,7 @@ ~WatchHelper() {} MojoResult CreateWatcher(MojoHandle* handle) { - return MojoCreateWatcher(&Notify, handle); + return MojoCreateTrap(&Notify, nullptr, handle); } uintptr_t CreateContext(const ContextCallback& callback) { @@ -85,11 +110,9 @@ DISALLOW_COPY_AND_ASSIGN(NotificationContext); }; - static void Notify(uintptr_t context, - MojoResult result, - MojoHandleSignalsState state, - MojoWatcherNotificationFlags flags) { - reinterpret_cast<NotificationContext*>(context)->Notify(result, state); + static void Notify(const MojoTrapEvent* event) { + reinterpret_cast<NotificationContext*>(event->trigger_context) + ->Notify(event->result, event->signals_state); } DISALLOW_COPY_AND_ASSIGN(WatchHelper); @@ -109,25 +132,19 @@ DISALLOW_COPY_AND_ASSIGN(ThreadedRunner); }; -void ExpectNoNotification(uintptr_t context, - MojoResult result, - MojoHandleSignalsState state, - MojoWatcherNotificationFlags flags) { +void ExpectNoNotification(const MojoTrapEvent* event) { NOTREACHED(); } -void ExpectOnlyCancel(uintptr_t context, - MojoResult result, - MojoHandleSignalsState state, - MojoWatcherNotificationFlags flags) { - EXPECT_EQ(result, MOJO_RESULT_CANCELLED); +void ExpectOnlyCancel(const MojoTrapEvent* event) { + EXPECT_EQ(event->result, MOJO_RESULT_CANCELLED); } TEST_F(WatcherTest, InvalidArguments) { EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, - MojoCreateWatcher(&ExpectNoNotification, nullptr)); + MojoCreateTrap(&ExpectNoNotification, nullptr, nullptr)); MojoHandle w; - EXPECT_EQ(MOJO_RESULT_OK, MojoCreateWatcher(&ExpectNoNotification, &w)); + EXPECT_EQ(MOJO_RESULT_OK, MojoCreateTrap(&ExpectNoNotification, nullptr, &w)); // Try to watch unwatchable handles. EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, @@ -698,7 +715,7 @@ TEST_F(WatcherTest, ArmWithNoWatches) { MojoHandle w; - EXPECT_EQ(MOJO_RESULT_OK, MojoCreateWatcher(&ExpectNoNotification, &w)); + EXPECT_EQ(MOJO_RESULT_OK, MojoCreateTrap(&ExpectNoNotification, nullptr, &w)); EXPECT_EQ(MOJO_RESULT_NOT_FOUND, MojoArmWatcher(w, nullptr, nullptr, nullptr, nullptr)); EXPECT_EQ(MOJO_RESULT_OK, MojoClose(w)); @@ -709,7 +726,7 @@ CreateMessagePipe(&a, &b); MojoHandle w; - EXPECT_EQ(MOJO_RESULT_OK, MojoCreateWatcher(&ExpectOnlyCancel, &w)); + EXPECT_EQ(MOJO_RESULT_OK, MojoCreateTrap(&ExpectOnlyCancel, nullptr, &w)); EXPECT_EQ(MOJO_RESULT_OK, MojoWatch(w, a, MOJO_HANDLE_SIGNAL_READABLE, MOJO_WATCH_CONDITION_SATISFIED, 0)); EXPECT_EQ(MOJO_RESULT_ALREADY_EXISTS, @@ -723,7 +740,7 @@ TEST_F(WatcherTest, CancelUnknownWatch) { MojoHandle w; - EXPECT_EQ(MOJO_RESULT_OK, MojoCreateWatcher(&ExpectNoNotification, &w)); + EXPECT_EQ(MOJO_RESULT_OK, MojoCreateTrap(&ExpectNoNotification, nullptr, &w)); EXPECT_EQ(MOJO_RESULT_NOT_FOUND, MojoCancelWatch(w, 1234)); } @@ -732,7 +749,7 @@ CreateMessagePipe(&a, &b); MojoHandle w; - EXPECT_EQ(MOJO_RESULT_OK, MojoCreateWatcher(&ExpectOnlyCancel, &w)); + EXPECT_EQ(MOJO_RESULT_OK, MojoCreateTrap(&ExpectOnlyCancel, nullptr, &w)); EXPECT_EQ(MOJO_RESULT_OK, MojoWatch(w, a, MOJO_HANDLE_SIGNAL_WRITABLE, MOJO_WATCH_CONDITION_SATISFIED, 0)); @@ -759,7 +776,7 @@ CreateMessagePipe(&a, &b); MojoHandle w; - EXPECT_EQ(MOJO_RESULT_OK, MojoCreateWatcher(&ExpectOnlyCancel, &w)); + EXPECT_EQ(MOJO_RESULT_OK, MojoCreateTrap(&ExpectOnlyCancel, nullptr, &w)); EXPECT_EQ(MOJO_RESULT_OK, MojoWatch(w, a, MOJO_HANDLE_SIGNAL_READABLE, MOJO_WATCH_CONDITION_SATISFIED, 0)); @@ -1638,7 +1655,7 @@ // Create a watcher and watch all of them. MojoHandle w; - EXPECT_EQ(MOJO_RESULT_OK, MojoCreateWatcher(&ExpectOnlyCancel, &w)); + EXPECT_EQ(MOJO_RESULT_OK, MojoCreateTrap(&ExpectOnlyCancel, nullptr, &w)); for (size_t i = 0; i < kNumTestHandles; ++i) { EXPECT_EQ(MOJO_RESULT_OK, MojoWatch(w, handles[i], MOJO_HANDLE_SIGNAL_READABLE, @@ -1725,12 +1742,9 @@ base::Closure g_do_random_thing_callback; -void ReadAllMessages(uintptr_t context, - MojoResult result, - MojoHandleSignalsState state, - MojoWatcherNotificationFlags flags) { - if (result == MOJO_RESULT_OK) { - MojoHandle handle = static_cast<MojoHandle>(context); +void ReadAllMessages(const MojoTrapEvent* event) { + if (event->result == MOJO_RESULT_OK) { + MojoHandle handle = static_cast<MojoHandle>(event->trigger_context); MojoMessageHandle message; while (MojoReadMessage(handle, &message, MOJO_READ_MESSAGE_FLAG_NONE) == MOJO_RESULT_OK) { @@ -1787,7 +1801,13 @@ &num_ready_contexts, &ready_context, &ready_result, &ready_state) == MOJO_RESULT_FAILED_PRECONDITION && ready_result == MOJO_RESULT_OK) { - ReadAllMessages(ready_context, ready_result, ready_state, 0); + MojoTrapEvent event; + event.struct_size = sizeof(event); + event.trigger_context = ready_context; + event.result = ready_result; + event.signals_state = ready_state; + event.flags = MOJO_TRAP_EVENT_FLAG_NONE; + ReadAllMessages(&event); } break; } @@ -1822,7 +1842,7 @@ kNumWatchedHandles); for (size_t i = 0; i < kNumWatchers; ++i) - MojoCreateWatcher(&ReadAllMessages, &watchers[i]); + MojoCreateTrap(&ReadAllMessages, nullptr, &watchers[i]); for (size_t i = 0; i < kNumWatchedHandles; i += 2) CreateMessagePipe(&watched_handles[i], &watched_handles[i + 1]);
diff --git a/mojo/edk/system/watch.cc b/mojo/edk/system/watch.cc index 63d8beb5..bc1d843 100644 --- a/mojo/edk/system/watch.cc +++ b/mojo/edk/system/watch.cc
@@ -14,7 +14,7 @@ const scoped_refptr<Dispatcher>& dispatcher, uintptr_t context, MojoHandleSignals signals, - MojoWatchCondition condition) + MojoTriggerCondition condition) : watcher_(watcher), dispatcher_(dispatcher), context_(context), @@ -31,15 +31,15 @@ RequestContext* const request_context = RequestContext::current(); const bool notify_success = (state.satisfies_any(signals_) && - condition_ == MOJO_WATCH_CONDITION_SATISFIED) || + condition_ == MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED) || (!state.satisfies_all(signals_) && - condition_ == MOJO_WATCH_CONDITION_NOT_SATISFIED); + condition_ == MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED); if (notify_success) { rv = MOJO_RESULT_OK; if (allowed_to_call_callback && rv != last_known_result_) { request_context->AddWatchNotifyFinalizer(this, MOJO_RESULT_OK, state); } - } else if (condition_ == MOJO_WATCH_CONDITION_SATISFIED && + } else if (condition_ == MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED && !state.can_satisfy_any(signals_)) { rv = MOJO_RESULT_FAILED_PRECONDITION; if (allowed_to_call_callback && rv != last_known_result_) { @@ -60,7 +60,7 @@ void Watch::InvokeCallback(MojoResult result, const HandleSignalsState& state, - MojoWatcherNotificationFlags flags) { + MojoTrapEventFlags flags) { // We hold the lock through invocation to ensure that only one notification // callback runs for this context at any given time. base::AutoLock lock(notification_lock_);
diff --git a/mojo/edk/system/watch.h b/mojo/edk/system/watch.h index e706e91..07d6169 100644 --- a/mojo/edk/system/watch.h +++ b/mojo/edk/system/watch.h
@@ -10,6 +10,7 @@ #include "base/synchronization/lock.h" #include "mojo/edk/system/atomic_flag.h" #include "mojo/edk/system/handle_signals_state.h" +#include "mojo/public/c/system/trap.h" namespace mojo { namespace edk { @@ -31,7 +32,7 @@ const scoped_refptr<Dispatcher>& dispatcher, uintptr_t context, MojoHandleSignals signals, - MojoWatchCondition condition); + MojoTriggerCondition condition); // Notifies the Watch of a potential state change. // @@ -60,7 +61,7 @@ // down into the WatcherDispatcher to do the actual notification call. void InvokeCallback(MojoResult result, const HandleSignalsState& state, - MojoWatcherNotificationFlags flags); + MojoTrapEventFlags flags); const scoped_refptr<Dispatcher>& dispatcher() const { return dispatcher_; } uintptr_t context() const { return context_; } @@ -96,7 +97,7 @@ const scoped_refptr<Dispatcher> dispatcher_; const uintptr_t context_; const MojoHandleSignals signals_; - const MojoWatchCondition condition_; + const MojoTriggerCondition condition_; // The result code with which this Watch would notify if currently armed, // based on the last known signaling state of |dispatcher_|. Guarded by the
diff --git a/mojo/edk/system/watcher_dispatcher.cc b/mojo/edk/system/watcher_dispatcher.cc index f84db482..6e8a442 100644 --- a/mojo/edk/system/watcher_dispatcher.cc +++ b/mojo/edk/system/watcher_dispatcher.cc
@@ -15,8 +15,8 @@ namespace mojo { namespace edk { -WatcherDispatcher::WatcherDispatcher(MojoWatcherCallback callback) - : callback_(callback) {} +WatcherDispatcher::WatcherDispatcher(MojoTrapEventHandler handler) + : handler_(handler) {} void WatcherDispatcher::NotifyHandleState(Dispatcher* dispatcher, const HandleSignalsState& state) { @@ -58,11 +58,17 @@ watch->Cancel(); } -void WatcherDispatcher::InvokeWatchCallback( - uintptr_t context, - MojoResult result, - const HandleSignalsState& state, - MojoWatcherNotificationFlags flags) { +void WatcherDispatcher::InvokeWatchCallback(uintptr_t context, + MojoResult result, + const HandleSignalsState& state, + MojoTrapEventFlags flags) { + MojoTrapEvent event; + event.struct_size = sizeof(event); + event.trigger_context = context; + event.result = result; + event.signals_state = static_cast<MojoHandleSignalsState>(state); + event.flags = flags; + { // We avoid holding the lock during dispatch. It's OK for notification // callbacks to close this watcher, and it's OK for notifications to race @@ -81,7 +87,7 @@ return; } - callback_(context, result, static_cast<MojoHandleSignalsState>(state), flags); + handler_(&event); } Dispatcher::Type WatcherDispatcher::GetType() const { @@ -113,7 +119,7 @@ MojoResult WatcherDispatcher::WatchDispatcher( scoped_refptr<Dispatcher> dispatcher, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, uintptr_t context) { // NOTE: Because it's critical to avoid acquiring any other dispatcher locks // while |lock_| is held, we defer adding oursevles to the dispatcher until
diff --git a/mojo/edk/system/watcher_dispatcher.h b/mojo/edk/system/watcher_dispatcher.h index 4b681f7..3048a58 100644 --- a/mojo/edk/system/watcher_dispatcher.h +++ b/mojo/edk/system/watcher_dispatcher.h
@@ -16,7 +16,7 @@ #include "mojo/edk/system/dispatcher.h" #include "mojo/edk/system/handle_signals_state.h" #include "mojo/edk/system/system_impl_export.h" -#include "mojo/public/c/system/watcher.h" +#include "mojo/public/c/system/trap.h" namespace mojo { namespace edk { @@ -26,9 +26,9 @@ // The dispatcher type which backs watcher handles. class WatcherDispatcher : public Dispatcher { public: - // Constructs a new WatcherDispatcher which invokes |callback| when a + // Constructs a new WatcherDispatcher which invokes |handler| when a // registered watch observes some relevant state change. - explicit WatcherDispatcher(MojoWatcherCallback callback); + explicit WatcherDispatcher(MojoTrapEventHandler handler); // Methods used by watched dispatchers to notify watchers of events. void NotifyHandleState(Dispatcher* dispatcher, @@ -40,14 +40,14 @@ void InvokeWatchCallback(uintptr_t context, MojoResult result, const HandleSignalsState& state, - MojoWatcherNotificationFlags flags); + MojoTrapEventFlags flags); // Dispatcher: Type GetType() const override; MojoResult Close() override; MojoResult WatchDispatcher(scoped_refptr<Dispatcher> dispatcher, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, uintptr_t context) override; MojoResult CancelWatch(uintptr_t context) override; MojoResult Arm(uint32_t* num_ready_contexts, @@ -62,7 +62,7 @@ ~WatcherDispatcher() override; - const MojoWatcherCallback callback_; + const MojoTrapEventHandler handler_; // Guards access to the fields below. //
diff --git a/mojo/edk/test/mojo_test_base.cc b/mojo/edk/test/mojo_test_base.cc index ad4e7c80..aff9c2a 100644 --- a/mojo/edk/test/mojo_test_base.cc +++ b/mojo/edk/test/mojo_test_base.cc
@@ -14,7 +14,7 @@ #include "mojo/public/c/system/buffer.h" #include "mojo/public/c/system/data_pipe.h" #include "mojo/public/c/system/functions.h" -#include "mojo/public/c/system/watcher.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/cpp/system/handle.h" #include "mojo/public/cpp/system/message_pipe.h" #include "mojo/public/cpp/system/wait.h" @@ -298,7 +298,7 @@ // static MojoResult MojoTestBase::WaitForSignals(MojoHandle handle, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, MojoHandleSignalsState* state) { return Wait(Handle(handle), signals, condition, state); } @@ -307,7 +307,8 @@ MojoResult MojoTestBase::WaitForSignals(MojoHandle handle, MojoHandleSignals signals, MojoHandleSignalsState* state) { - return Wait(Handle(handle), signals, MOJO_WATCH_CONDITION_SATISFIED, state); + return Wait(Handle(handle), signals, MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, + state); } } // namespace test
diff --git a/mojo/edk/test/mojo_test_base.h b/mojo/edk/test/mojo_test_base.h index 9c13074e..6dcc467 100644 --- a/mojo/edk/test/mojo_test_base.h +++ b/mojo/edk/test/mojo_test_base.h
@@ -16,6 +16,7 @@ #include "base/memory/ref_counted.h" #include "mojo/edk/embedder/embedder.h" #include "mojo/edk/test/multiprocess_test_helper.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" #include "mojo/public/cpp/system/message_pipe.h" #include "testing/gtest/include/gtest/gtest.h" @@ -160,7 +161,7 @@ // Helper to block the calling thread waiting for signals to go high or low. static MojoResult WaitForSignals(MojoHandle handle, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, MojoHandleSignalsState* state = nullptr); // Like above but only waits for signals to go high.
diff --git a/mojo/public/c/system/BUILD.gn b/mojo/public/c/system/BUILD.gn index 08185c7..bf4a3a5 100644 --- a/mojo/public/c/system/BUILD.gn +++ b/mojo/public/c/system/BUILD.gn
@@ -16,8 +16,8 @@ "system_export.h", "thunks.cc", "thunks.h", + "trap.h", "types.h", - "watcher.h", ] defines = [ "MOJO_SYSTEM_IMPLEMENTATION" ]
diff --git a/mojo/public/c/system/core.h b/mojo/public/c/system/core.h index 03c0652..bc6ef8c6 100644 --- a/mojo/public/c/system/core.h +++ b/mojo/public/c/system/core.h
@@ -16,7 +16,7 @@ #include "mojo/public/c/system/message_pipe.h" #include "mojo/public/c/system/platform_handle.h" #include "mojo/public/c/system/system_export.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" -#include "mojo/public/c/system/watcher.h" #endif // MOJO_PUBLIC_C_SYSTEM_CORE_H_
diff --git a/mojo/public/c/system/functions.h b/mojo/public/c/system/functions.h index d0656c6..5ce0dab 100644 --- a/mojo/public/c/system/functions.h +++ b/mojo/public/c/system/functions.h
@@ -42,7 +42,7 @@ // // Concurrent operations on |handle| may succeed (or fail as usual) if they // happen before the close, be cancelled with result |MOJO_RESULT_CANCELLED| if -// they properly overlap (this is likely the case with watchers), or fail with +// they properly overlap (this is likely the case with traps), or fail with // |MOJO_RESULT_INVALID_ARGUMENT| if they happen after. MOJO_SYSTEM_EXPORT MojoResult MojoClose(MojoHandle handle);
diff --git a/mojo/public/c/system/thunks.cc b/mojo/public/c/system/thunks.cc index 89cbf75..b3a0564 100644 --- a/mojo/public/c/system/thunks.cc +++ b/mojo/public/c/system/thunks.cc
@@ -138,34 +138,40 @@ return g_thunks.UnmapBuffer(buffer); } -MojoResult MojoCreateWatcher(MojoWatcherCallback callback, - MojoHandle* watcher_handle) { - assert(g_thunks.CreateWatcher); - return g_thunks.CreateWatcher(callback, watcher_handle); +MojoResult MojoCreateTrap(MojoTrapEventHandler handler, + const MojoCreateTrapOptions* options, + MojoHandle* trap_handle) { + assert(g_thunks.CreateTrap); + return g_thunks.CreateTrap(handler, options, trap_handle); } -MojoResult MojoWatch(MojoHandle watcher_handle, - MojoHandle handle, - MojoHandleSignals signals, - MojoWatchCondition condition, - uintptr_t context) { - assert(g_thunks.Watch); - return g_thunks.Watch(watcher_handle, handle, signals, condition, context); +MojoResult MojoAddTrigger(MojoHandle trap_handle, + MojoHandle handle, + MojoHandleSignals signals, + MojoTriggerCondition condition, + uintptr_t context, + const MojoAddTriggerOptions* options) { + assert(g_thunks.AddTrigger); + return g_thunks.AddTrigger(trap_handle, handle, signals, condition, context, + options); } -MojoResult MojoCancelWatch(MojoHandle watcher_handle, uintptr_t context) { - assert(g_thunks.CancelWatch); - return g_thunks.CancelWatch(watcher_handle, context); +MojoResult MojoRemoveTrigger(MojoHandle trap_handle, + uintptr_t context, + const MojoRemoveTriggerOptions* options) { + assert(g_thunks.RemoveTrigger); + return g_thunks.RemoveTrigger(trap_handle, context, options); } -MojoResult MojoArmWatcher(MojoHandle watcher_handle, - uint32_t* num_ready_contexts, - uintptr_t* ready_contexts, - MojoResult* ready_results, - MojoHandleSignalsState* ready_signals_states) { - assert(g_thunks.ArmWatcher); - return g_thunks.ArmWatcher(watcher_handle, num_ready_contexts, ready_contexts, - ready_results, ready_signals_states); +MojoResult MojoArmTrap(MojoHandle trap_handle, + const MojoArmTrapOptions* options, + uint32_t* num_ready_triggers, + uintptr_t* ready_triggers, + MojoResult* ready_results, + MojoHandleSignalsState* ready_signals_states) { + assert(g_thunks.ArmTrap); + return g_thunks.ArmTrap(trap_handle, options, num_ready_triggers, + ready_triggers, ready_results, ready_signals_states); } MojoResult MojoFuseMessagePipes(MojoHandle handle0, MojoHandle handle1) {
diff --git a/mojo/public/c/system/thunks.h b/mojo/public/c/system/thunks.h index e19d2f1..0564ea60 100644 --- a/mojo/public/c/system/thunks.h +++ b/mojo/public/c/system/thunks.h
@@ -72,19 +72,24 @@ void** buffer, MojoMapBufferFlags flags); MojoResult (*UnmapBuffer)(void* buffer); - MojoResult (*CreateWatcher)(MojoWatcherCallback callback, - MojoHandle* watcher_handle); - MojoResult (*Watch)(MojoHandle watcher_handle, - MojoHandle handle, - MojoHandleSignals signals, - MojoWatchCondition condition, - uintptr_t context); - MojoResult (*CancelWatch)(MojoHandle watcher_handle, uintptr_t context); - MojoResult (*ArmWatcher)(MojoHandle watcher_handle, - uint32_t* num_ready_contexts, - uintptr_t* ready_contexts, - MojoResult* ready_results, - MojoHandleSignalsState* ready_signals_states); + MojoResult (*CreateTrap)(MojoTrapEventHandler handler, + const struct MojoCreateTrapOptions* options, + MojoHandle* trap_handle); + MojoResult (*AddTrigger)(MojoHandle trap_handle, + MojoHandle handle, + MojoHandleSignals signals, + MojoTriggerCondition condition, + uintptr_t context, + const struct MojoAddTriggerOptions* options); + MojoResult (*RemoveTrigger)(MojoHandle trap_handle, + uintptr_t context, + const struct MojoRemoveTriggerOptions* options); + MojoResult (*ArmTrap)(MojoHandle trap_handle, + const struct MojoArmTrapOptions* options, + uint32_t* num_ready_triggers, + uintptr_t* ready_triggers, + MojoResult* ready_results, + MojoHandleSignalsState* ready_signals_states); MojoResult (*FuseMessagePipes)(MojoHandle handle0, MojoHandle handle1); MojoResult (*CreateMessage)(const struct MojoCreateMessageOptions* options, MojoMessageHandle* message);
diff --git a/mojo/public/c/system/trap.h b/mojo/public/c/system/trap.h new file mode 100644 index 0000000..7c65af3 --- /dev/null +++ b/mojo/public/c/system/trap.h
@@ -0,0 +1,320 @@ +// 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 MOJO_PUBLIC_C_SYSTEM_TRAP_H_ +#define MOJO_PUBLIC_C_SYSTEM_TRAP_H_ + +#include <stdint.h> + +#include "mojo/public/c/system/macros.h" +#include "mojo/public/c/system/system_export.h" +#include "mojo/public/c/system/types.h" + +// Flags passed to trap event handlers within |MojoTrapEvent|. +typedef uint32_t MojoTrapEventFlags; + +#ifdef __cplusplus +const MojoTrapEventFlags MOJO_TRAP_EVENT_FLAG_NONE = 0; +const MojoTrapEventFlags MOJO_TRAP_EVENT_FLAG_WITHIN_API_CALL = 1 << 0; +#else +#define MOJO_TRAP_EVENT_FLAG_NONE ((MojoTrapEventFlags)0) +#define MOJO_TRAP_EVENT_FLAG_WITHIN_API_CALL ((MojoTrapEventFlags)1 << 0) +#endif + +// Structure passed to trap event handlers when invoked by a tripped trap. +struct MOJO_ALIGNAS(8) MojoTrapEvent { + // The size of this structure, used for versioning. + uint32_t struct_size; + + // May take on some combination of the following values: + // + // |MOJO_TRAP_EVENT_FLAG_NONE|: No flags. + // + // |MOJO_TRAP_EVENT_FLAG_WITHIN_API_CALL|: The trap was tripped within the + // extent of a user call to some Mojo API. This means that the event + // handler itself is re-entering user code. May happen, for example, if + // user code writes to an intra-process pipe and the receiving end trips + // a trap as a result. In that case the event handler executes within + // the extent of the |MojoWriteMessage()| call. + MojoTrapEventFlags flags; + + // The context for the trigger which tripped the trap. + uintptr_t trigger_context; + + // A result code indicating the cause of the event. May take on any of the + // following values: + // + // |MOJO_RESULT_OK|: The trigger's conditions were met. + // |MOJO_RESULT_FAILED_PRECONDITION|: The trigger's observed handle has + // changed state in such a way that the trigger's conditions can never + // be met again. + // |MOJO_RESULT_CANCELLED|: The trigger has been removed and will never + // cause another event to fire. This is always the last event fired by + // a trigger and it will fire when: the trigger is explicitly removed + // with |MojoRemoteTrigger()|, the trigger's owning trap handle is + // closed, or the handle observed by the trigger is closed. + // + // Unlike the other result types above |MOJO_RESULT_CANCELLED| can + // fire even when the trap is disarmed. + MojoResult result; + + // The last known signalling state of the trigger's observed handle at the + // time the trap was tripped. + struct MojoHandleSignalsState signals_state; +}; + +// Value given to |MojoAddTrigger| to configure what condition should cause it +// to trip its trap. May be one of the following values: +// +// |MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED| - A trigger added with this +// condition will trip its trap when any of its observed signals +// transition from being satisfied to being unsatisfied. +// |MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED| - A triger added with this +// condition will trip its trap when any of its observed signals +// transition from being unsatisfied to being satisfied, or when none of +// the observed signals can ever be satisfied again. +typedef uint32_t MojoTriggerCondition; + +#ifdef __cplusplus +const MojoTriggerCondition MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED = 0; +const MojoTriggerCondition MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED = 1; +#else +#define MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED ((MojoTriggerCondition)0) +#define MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED ((MojoTriggerCondition)1) +#endif + +// Flags passed to |MojoCreateTrap()| via |MojoCreateTrapOptions|. +typedef uint32_t MojoCreateTrapFlags; + +#ifdef __cplusplus +const MojoCreateTrapFlags MOJO_CREATE_TRAP_FLAG_NONE = 0; +#else +#define MOJO_CREATE_TRAP_FLAG_NONE ((MojoCreateTrapFlags)0) +#endif + +// Options passed to |MojoCreateTrap()|. +struct MOJO_ALIGNAS(8) MojoCreateTrapOptions { + // The size of this structure, used for versioning. + uint32_t struct_size; + + // Flags. Currently unused. + MojoCreateTrapFlags flags; +}; + +// Flags passed to |MojoAddTrigger()| via |MojoAddTriggerOptions|. +typedef uint32_t MojoAddTriggerFlags; + +#ifdef __cplusplus +const MojoAddTriggerFlags MOJO_ADD_TRIGGER_FLAG_NONE = 0; +#else +#define MOJO_ADD_TRIGGER_FLAG_NONE ((MojoAddTriggerFlags)0) +#endif + +// Options passed to |MojoAddTrigger()|. +struct MOJO_ALIGNAS(8) MojoAddTriggerOptions { + // The size of this structure, used for versioning. + uint32_t struct_size; + + // Flags. Currently unused. + MojoAddTriggerFlags flags; +}; + +// Flags passed to |MojoRemoveTrigger()| via |MojoRemoveTriggerOptions|. +typedef uint32_t MojoRemoveTriggerFlags; + +#ifdef __cplusplus +const MojoRemoveTriggerFlags MOJO_REMOVE_TRIGGER_FLAG_NONE = 0; +#else +#define MOJO_REMOVE_TRIGGER_FLAG_NONE ((MojoRemoveTriggerFlags)0) +#endif + +// Options passed to |MojoRemoveTrigger()|. +struct MOJO_ALIGNAS(8) MojoRemoveTriggerOptions { + // The size of this structure, used for versioning. + uint32_t struct_size; + + // Flags. Currently unused. + MojoRemoveTriggerFlags flags; +}; + +// Flags passed to |MojoArmTrap()| via |MojoArmTrapOptions|. +typedef uint32_t MojoArmTrapFlags; + +#ifdef __cplusplus +const MojoArmTrapFlags MOJO_ARM_TRAP_FLAG_NONE = 0; +#else +#define MOJO_ARM_TRAP_FLAG_NONE ((MojoArmTrapFlags)0) +#endif + +// Options passed to |MojoArmTrap()|. +struct MOJO_ALIGNAS(8) MojoArmTrapOptions { + // The size of this structure, used for versioning. + uint32_t struct_size; + + // Flags. Currently unused. + MojoArmTrapFlags flags; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +// A user-provided callback to handle trap events. Passed to |MojoCreateTrap()|. +typedef void (*MojoTrapEventHandler)(const struct MojoTrapEvent* event); + +// Creates a new trap which can be used to detect signal changes on a handle. +// Traps execute arbitrary user code when tripped. +// +// Traps can trip only while armed**, and new traps are created in a disarmed +// state. Traps may be armed using |MojoArmTrap()|. +// +// Arming a trap is only possible when the trap has one or more triggers +// attached to it. Triggers can be added or removed using |MojoAddTrigger()| and +// |MojoRemoveTrigger()|. +// +// If a trap is tripped by any of its triggers, it is disarmed immediately and +// the traps |MojoTrapEventHandler| is invoked once for every relevant trigger. +// +// |options| may be null. +// +// ** An unarmed trap will still fire an event when a trigger is removed. This +// event will always convey the result |MOJO_RESULT_CANCELLED|. +// +// Parameters: +// |handler|: The |MojoTrapEventHandler| to invoke any time this trap is +// tripped. Note that this may be called from any arbitrary thread. +// |trap_handle|: The address at which to store the MojoHandle corresponding +// to the new trap if successfully created. +// +// Returns: +// |MOJO_RESULT_OK| if the trap has been successfully created. +// |MOJO_RESULT_RESOURCE_EXHAUSTED| if a handle could not be allocated for +// this trap. +MOJO_SYSTEM_EXPORT MojoResult +MojoCreateTrap(MojoTrapEventHandler handler, + const struct MojoCreateTrapOptions* options, + MojoHandle* trap_handle); + +// Adds a trigger to a trap. This configures the trap to invoke its event +// handler if the specified conditions are met (or can no longer be met) while +// the trap is armed. +// +// Note that event handler invocations for a given trigger are mutually +// exclusive in execution: the handler will never be entered for a trigger while +// another thread is executing it for the same trigger. Similarly, event +// handlers are never re-entered. If an event handler changes the state of the +// system such that another event would fire, that event is deferred until the +// first handler returns. +// +// Parameters: +// |trap_handle|: The trap to which this trigger is to be added. +// |handle|: The handle whose signals this trigger will observe. Must be a +// message pipe or data pipe handle. +// |signals|: The specific signal(s) this trigger will observe on |handle|. +// |condition|: The signaling condition this trigger will observe. i.e. +// whether to trip the trap when |signals| become satisfied or when they +// become unsatisfied. +// |context|: An arbitrary context value to be passed to the trap's event +// handler when this trigger was responsible for tripping the trap. See +// the |trigger_context| field in |MojoTrapEvent|. This value must be +// unique among all triggers on the trap. +// +// |options| may be null. +// +// Returns: +// |MOJO_RESULT_OK| if the handle is now being observed by the trigger. +// |MOJO_RESULT_INVALID_ARGUMENT| if |trap_handle| is not a trap handle, +// |handle| is not a valid message pipe or data pipe handle, or |signals| +// or |condition| are an invalid value. +// |MOJO_RESULT_ALREADY_EXISTS| if the trap already has a trigger associated +// with |context| or |handle|. +MOJO_SYSTEM_EXPORT MojoResult +MojoAddTrigger(MojoHandle trap_handle, + MojoHandle handle, + MojoHandleSignals signals, + MojoTriggerCondition condition, + uintptr_t context, + const struct MojoAddTriggerOptions* options); + +// Removes a trigger from a trap. +// +// This ensures that the trigger is removed as soon as possible. Removal may +// block an arbitrarily long time if the trap is already executing its handler. +// +// When removal is complete, the trap's handler is invoked one final time for +// time for |context|, with the result |MOJO_RESULT_CANCELLED|. +// +// The same behavior can be elicted by either closing the watched handle +// associated with this trigger, or by closing |trap_handle| itself. +// +// Parameters: +// |trap_handle|: The handle of the trap from which to remove a trigger. +// |context|: The context of the trigger to be removed. +// +// Returns: +// |MOJO_RESULT_OK| if the trigger has been removed. +// |MOJO_RESULT_INVALID_ARGUMENT| if |trap_handle| is not a trap handle. +// |MOJO_RESULT_NOT_FOUND| if there is no trigger registered on this trap for +// the given value of |context|. +MOJO_SYSTEM_EXPORT MojoResult +MojoRemoveTrigger(MojoHandle trap_handle, + uintptr_t context, + const struct MojoRemoveTriggerOptions* options); + +// Arms a trap, allowing it to invoke its event handler the next time any of its +// triggers' conditions are met. +// +// Parameters: +// |trap_handle|: The handle of the trap to be armed. +// |num_ready_triggers|: An address pointing to the number of elements +// available for storage in the following output buffer parameters. +// Optional and only used when |MOJO_RESULT_FAILED_PRECONDITION| is +// returned. See below. +// |ready_triggers|: An output buffer for contexts of triggers that would have +// tripped the trap immediately if it were armed. Optional and used only +// when |MOJO_RESULT_FAILED_PRECONDITION| is returned. See below. +// |ready_results|: An output buffer for |MojoResult| values corresponding to +// each trigger in |ready_triggers|. Optional and only used when +// |MOJO_RESULT_FAILED_PRECONDITION| is returned. See below. +// |ready_signals_states|: An output buffer for |MojoHandleSignalsState| +// structures corresponding to the handle observed by each respective +// trigger in |ready_triggers|. Optional and only used when +// |MOJO_RESULT_FAILED_PRECONDITION| is returned. See below. +// +// Returns: +// |MOJO_RESULT_OK| if the trap has been successfully armed. All arguments +// other than |trap_handle| are ignored in this case. +// |MOJO_RESULT_NOT_FOUND| if the trap does not have any triggers. All +// arguments other than |trap_handle| are ignored. +// |MOJO_RESULT_INVALID_ARGUMENT| if |trap_handle| is not a valid trap handle, +// or if |num_ready_triggers| is non-null and any of the output buffer +// paramters is null. +// |MOJO_RESULT_FAILED_PRECONDITION| if one or more triggers would have +// tripped the trap immediately upon arming. If |num_handles| is non-null, +// this assumes there is enough space for |*num_handles| entries in each +// of the subsequent output buffer parameters. +// +// At most |*num_handles| entries are populated in the output buffers, +// with each entry corresponding to one of the triggers which would have +// tripped the trap. The actual number of entries populated is written to +// |*num_handles| before returning. +// +// If there are more ready triggers than available provided storage, the +// subset presented to thecaller is arbitrary. The runtime makes an effort +// to circulate triggers returned by consecutive failed |MojoArmTrap()| +// calls so that callers may avoid handle starvation when observing a +// large number of active handles with a single trap. +MOJO_SYSTEM_EXPORT MojoResult +MojoArmTrap(MojoHandle trap_handle, + const struct MojoArmTrapOptions* options, + uint32_t* num_ready_triggers, + uintptr_t* ready_triggers, + MojoResult* ready_results, + struct MojoHandleSignalsState* ready_signals_states); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // MOJO_PUBLIC_C_SYSTEM_TRAP_H_
diff --git a/mojo/public/c/system/types.h b/mojo/public/c/system/types.h index 84e35b7..220f90f1 100644 --- a/mojo/public/c/system/types.h +++ b/mojo/public/c/system/types.h
@@ -77,7 +77,7 @@ // the resource being invalidated. // |MOJO_RESULT_SHOULD_WAIT| - The request cannot currently be completed // (e.g., if the data requested is not yet available). The caller should -// wait for it to be feasible using a watcher. +// wait for it to be feasible using a trap. // // The codes from |MOJO_RESULT_OK| to |MOJO_RESULT_DATA_LOSS| come from // Google3's canonical error codes. @@ -191,49 +191,6 @@ MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, "MojoHandleSignalsState has wrong size"); -// |MojoWatcherNotificationFlags|: Passed to a callback invoked by a watcher -// when some observed signals are raised or a watched handle is closed. May take -// on any combination of the following values: -// -// |MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being -// invoked as a result of a system-level event rather than a direct API -// call from user code. This may be used as an indication that user code -// is safe to call without fear of reentry. - -typedef uint32_t MojoWatcherNotificationFlags; - -#ifdef __cplusplus -const MojoWatcherNotificationFlags MOJO_WATCHER_NOTIFICATION_FLAG_NONE = 0; -const MojoWatcherNotificationFlags MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM = - 1 << 0; -#else -#define MOJO_WATCHER_NOTIFICATION_FLAG_NONE ((MojoWatcherNotificationFlags)0) -#define MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM \ - ((MojoWatcherNotificationFlags)1 << 0); -#endif - -// |MojoWatchCondition|: Given to |MojoWatch()| to indicate whether the -// watched signals should trigger a notification when becoming satisfied or -// becoming not-satisfied. -// -// |MOJO_WATCH_CONDITION_NOT_SATISFIED| - A watch added with this setting will -// trigger a notification when any of the watched signals transition from -// being not-satisfied to being satisfied. -// |MOJO_WATCH_CONDITION_SATISFIED| - A watch added with this setting will -// trigger a notification when any of the watched signals transition from -// being satisfied to being not-satisfied, or when none of the watched -// signals can ever be satisfied again. - -typedef uint32_t MojoWatchCondition; - -#ifdef __cplusplus -const MojoWatchCondition MOJO_WATCH_CONDITION_NOT_SATISFIED = 0; -const MojoWatchCondition MOJO_WATCH_CONDITION_SATISFIED = 1; -#else -#define MOJO_WATCH_CONDITION_NOT_SATISFIED ((MojoWatchCondition)0) -#define MOJO_WATCH_CONDITION_SATISFIED ((MojoWatchCondition)1) -#endif - // |MojoPropertyType|: Property types that can be passed to |MojoGetProperty()| // to retrieve system properties. May take the following values: // |MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED| - Whether making synchronous calls @@ -248,4 +205,9 @@ #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) #endif +// TODO(https://crbug.com/819046): Remove these aliases. +#define MOJO_WATCH_CONDITION_SATISFIED MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED +#define MOJO_WATCH_CONDITION_NOT_SATISFIED \ + MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED + #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_
diff --git a/mojo/public/c/system/watcher.h b/mojo/public/c/system/watcher.h deleted file mode 100644 index 10b9168..0000000 --- a/mojo/public/c/system/watcher.h +++ /dev/null
@@ -1,186 +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 MOJO_PUBLIC_C_SYSTEM_WATCHER_H_ -#define MOJO_PUBLIC_C_SYSTEM_WATCHER_H_ - -#include <stdint.h> - -#include "mojo/public/c/system/system_export.h" -#include "mojo/public/c/system/types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// A callback used to notify watchers about events on their watched handles. -// -// See documentation for |MojoWatcherNotificationFlags| for details regarding -// the possible values of |flags|. -// -// See documentation for |MojoWatch()| for details regarding the other arguments -// this callback receives when called. -typedef void (*MojoWatcherCallback)(uintptr_t context, - MojoResult result, - struct MojoHandleSignalsState signals_state, - MojoWatcherNotificationFlags flags); - -// Creates a new watcher. -// -// Watchers are used to trigger arbitrary code execution when one or more -// handles change state to meet certain conditions. -// -// A newly registered watcher is initially disarmed and may be armed using -// |MojoArmWatcher()|. A watcher is also always disarmed immediately before any -// invocation of one or more notification callbacks in response to a single -// handle's state changing in some relevant way. -// -// Parameters: -// |callback|: The |MojoWatcherCallback| to invoke any time the watcher is -// notified of an event. See |MojoWatch()| for details regarding arguments -// passed to the callback. Note that this may be called from any arbitrary -// thread. -// |watcher_handle|: The address at which to store the MojoHandle -// corresponding to the new watcher if successfully created. -// -// Returns: -// |MOJO_RESULT_OK| if the watcher has been successfully created. -// |MOJO_RESULT_RESOURCE_EXHAUSTED| if a handle could not be allocated for -// this watcher. -MOJO_SYSTEM_EXPORT MojoResult MojoCreateWatcher(MojoWatcherCallback callback, - MojoHandle* watcher_handle); - -// Adds a watch to a watcher. This allows the watcher to fire notifications -// regarding state changes on the handle corresponding to the arguments given. -// -// Note that notifications for a given watch context are guaranteed to be -// mutually exclusive in execution: the callback will never be entered for a -// given context while another invocation of the callback is still executing for -// the same context. As a result it is generally a good idea to ensure that -// callbacks do as little work as necessary in order to process the -// notification. -// -// Parameters: -// |watcher_handle|: The watcher to which |handle| is to be added. -// |handle|: The handle to add to the watcher. -// |signals|: The signals to watch for on |handle|. -// |level|: The level to watch for on |signals|. -// |context|: An arbitrary context value given to any invocation of the -// watcher's callback when invoked as a result of some state change -// relevant to this combination of |handle| and |signals|. Must be -// unique within any given watcher. -// -// Callback parameters (see |MojoWatcherNotificationCallback| above): -// When the watcher invokes its callback as a result of some notification -// relevant to this watch operation, |context| receives the value given here -// and |signals_state| receives the last known signals state of this handle. -// -// |result| is one of the following: -// |MOJO_RESULT_OK| if at least one of the watched signals is satisfied. The -// watcher must be armed for this notification to fire. -// |MOJO_RESULT_FAILED_PRECONDITION| if all of the watched signals are -// permanently unsatisfiable. The watcher must be armed for this -// notification to fire. -// |MOJO_RESULT_CANCELLED| if the watch has been cancelled. The may occur if -// the watcher has been closed, the watched handle has been closed, or -// the watch for |context| has been explicitly cancelled. This is always -// the last result received for any given context, and it is guaranteed -// to be received exactly once per watch, regardless of how the watch -// was cancelled. -// -// Returns: -// |MOJO_RESULT_OK| if the handle is now being watched by the watcher. -// |MOJO_RESULT_INVALID_ARGUMENT| if |watcher_handle| is not a watcher handle, -// |handle| is not a valid message pipe or data pipe handle. -// |MOJO_RESULT_ALREADY_EXISTS| if the watcher already has a watch registered -// for the given value of |context| or for the given |handle|. -MOJO_SYSTEM_EXPORT MojoResult MojoWatch(MojoHandle watcher_handle, - MojoHandle handle, - MojoHandleSignals signals, - MojoWatchCondition condition, - uintptr_t context); - -// Removes a watch from a watcher. -// -// This ensures that the watch is cancelled as soon as possible. Cancellation -// may be deferred (or may even block) an aritrarily long time if the watch is -// already dispatching one or more notifications. -// -// When cancellation is complete, the watcher's callback is invoked one final -// time for |context|, with the result |MOJO_RESULT_CANCELLED|. -// -// The same behavior can be elicted by either closing the watched handle -// associated with this context, or by closing |watcher_handle| itself. In the -// lastter case, all registered contexts on the watcher are implicitly cancelled -// in a similar fashion. -// -// Parameters: -// |watcher_handle|: The handle of the watcher from which to remove a watch. -// |context|: The context of the watch to be removed. -// -// Returns: -// |MOJO_RESULT_OK| if the watch has been cancelled. -// |MOJO_RESULT_INVALID_ARGUMENT| if |watcher_handle| is not a watcher handle. -// |MOJO_RESULT_NOT_FOUND| if there is no watch registered on this watcher for -// the given value of |context|. -MOJO_SYSTEM_EXPORT MojoResult MojoCancelWatch(MojoHandle watcher_handle, - uintptr_t context); - -// Arms a watcher, enabling a single future event on one of the watched handles -// to trigger a single notification for each relevant watch context associated -// with that handle. -// -// Parameters: -// |watcher_handle|: The handle of the watcher. -// |num_ready_contexts|: An address pointing to the number of elements -// available for storage in the remaining output buffers. Optional and -// only used on failure. See |MOJO_RESULT_FAILED_PRECONDITION| below for -// more details. -// |ready_contexts|: An output buffer for contexts corresponding to the -// watches which would have notified if the watcher were armed. Optional -// and only uesd on failure. See |MOJO_RESULT_FAILED_PRECONDITION| below -// for more details. -// |ready_results|: An output buffer for MojoResult values corresponding to -// each context in |ready_contexts|. Optional and only used on failure. -// See |MOJO_RESULT_FAILED_PRECONDITION| below for more details. -// |ready_signals_states|: An output buffer for |MojoHandleSignalsState| -// structures corresponding to each context in |ready_contexts|. Optional -// and only used on failure. See |MOJO_RESULT_FAILED_PRECONDITION| below -// for more details. -// -// Returns: -// |MOJO_RESULT_OK| if the watcher has been successfully armed. All arguments -// other than |watcher_handle| are ignored in this case. -// |MOJO_RESULT_NOT_FOUND| if the watcher does not have any registered watch -// contexts. All arguments other than |watcher_handle| are ignored in this -// case. -// |MOJO_RESULT_INVALID_ARGUMENT| if |watcher_handle| is not a valid watcher -// handle, or if |num_ready_contexts| is non-null but any of the output -// buffer paramters is null. -// |MOJO_RESULT_FAILED_PRECONDITION| if one or more watches would have -// notified immediately upon arming the watcher. If |num_handles| is -// non-null, this assumes there is enough space for |*num_handles| entries -// in each of the subsequent output buffer arguments. -// -// At most that many entries are placed in the output buffers, -// corresponding to the watches which would have signalled if the watcher -// had been armed successfully. The actual number of entries placed in the -// output buffers is written to |*num_ready_contexts| before returning. -// -// If more than (input) |*num_ready_contexts| watch contexts were ready to -// notify, the subset presented in output buffers is arbitrary, but the -// implementation makes a best effort to circulate the outputs across -// consecutive calls so that callers may reliably avoid handle starvation. -MOJO_SYSTEM_EXPORT MojoResult -MojoArmWatcher(MojoHandle watcher_handle, - uint32_t* num_ready_contexts, - uintptr_t* ready_contexts, - MojoResult* ready_results, - struct MojoHandleSignalsState* ready_signals_states); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // MOJO_PUBLIC_C_SYSTEM_WATCHER_H_
diff --git a/mojo/public/cpp/system/BUILD.gn b/mojo/public/cpp/system/BUILD.gn index e93d7278..2b02c3a 100644 --- a/mojo/public/cpp/system/BUILD.gn +++ b/mojo/public/cpp/system/BUILD.gn
@@ -44,12 +44,12 @@ "string_data_pipe_producer.cc", "string_data_pipe_producer.h", "system_export.h", + "trap.cc", + "trap.h", "wait.cc", "wait.h", "wait_set.cc", "wait_set.h", - "watcher.cc", - "watcher.h", ] public_deps = [
diff --git a/mojo/public/cpp/system/handle_signal_tracker.cc b/mojo/public/cpp/system/handle_signal_tracker.cc index 37b2c93..5c5b87fc 100644 --- a/mojo/public/cpp/system/handle_signal_tracker.cc +++ b/mojo/public/cpp/system/handle_signal_tracker.cc
@@ -14,12 +14,12 @@ : high_watcher_(FROM_HERE, SimpleWatcher::ArmingPolicy::MANUAL), low_watcher_(FROM_HERE, SimpleWatcher::ArmingPolicy::MANUAL) { MojoResult rv = high_watcher_.Watch( - handle, signals, MOJO_WATCH_CONDITION_SATISFIED, + handle, signals, MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, base::Bind(&HandleSignalTracker::OnNotify, base::Unretained(this))); DCHECK_EQ(MOJO_RESULT_OK, rv); rv = low_watcher_.Watch( - handle, signals, MOJO_WATCH_CONDITION_NOT_SATISFIED, + handle, signals, MOJO_TRIGGER_CONDITION_SIGNALS_UNSATISFIED, base::Bind(&HandleSignalTracker::OnNotify, base::Unretained(this))); DCHECK_EQ(MOJO_RESULT_OK, rv);
diff --git a/mojo/public/cpp/system/simple_watcher.cc b/mojo/public/cpp/system/simple_watcher.cc index 307e288..a582f59 100644 --- a/mojo/public/cpp/system/simple_watcher.cc +++ b/mojo/public/cpp/system/simple_watcher.cc
@@ -11,37 +11,37 @@ #include "base/synchronization/lock.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/heap_profiler.h" -#include "mojo/public/c/system/watcher.h" +#include "mojo/public/c/system/trap.h" namespace mojo { -// Thread-safe Context object used to dispatch watch notifications from a -// arbitrary threads. +// Thread-safe Context object used to schedule trap events from arbitrary +// threads. class SimpleWatcher::Context : public base::RefCountedThreadSafe<Context> { public: - // Creates a |Context| instance for a new watch on |watcher|, to watch - // |handle| for |signals|. + // Creates a |Context| instance for a new watch on |watcher|, to observe + // |signals| on |handle|. static scoped_refptr<Context> Create( base::WeakPtr<SimpleWatcher> watcher, scoped_refptr<base::SequencedTaskRunner> task_runner, - WatcherHandle watcher_handle, + TrapHandle trap_handle, Handle handle, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, int watch_id, - MojoResult* watch_result) { + MojoResult* result) { scoped_refptr<Context> context = new Context(watcher, task_runner, watch_id); - // If MojoWatch succeeds, it assumes ownership of a reference to |context|. - // In that case, this reference is balanced in CallNotify() when |result| is - // |MOJO_RESULT_CANCELLED|. + // If MojoAddTrigger succeeds, it effectively assumes ownership of a + // reference to |context|. In that case, this reference is balanced in + // CallNotify() when |result| is |MOJO_RESULT_CANCELLED|. context->AddRef(); - *watch_result = MojoWatch(watcher_handle.value(), handle.value(), signals, - condition, context->value()); - if (*watch_result != MOJO_RESULT_OK) { - // Balanced by the AddRef() above since watching failed. + *result = MojoAddTrigger(trap_handle.value(), handle.value(), signals, + condition, context->value(), nullptr); + if (*result != MOJO_RESULT_OK) { + // Balanced by the AddRef() above since MojoAddTrigger failed. context->Release(); return nullptr; } @@ -49,16 +49,13 @@ return context; } - static void CallNotify(uintptr_t context_value, - MojoResult result, - MojoHandleSignalsState signals_state, - MojoWatcherNotificationFlags flags) { - auto* context = reinterpret_cast<Context*>(context_value); - context->Notify(result, signals_state, flags); + static void CallNotify(const MojoTrapEvent* event) { + auto* context = reinterpret_cast<Context*>(event->trigger_context); + context->Notify(event->result, event->signals_state, event->flags); - // That was the last notification for the context. We can release the ref - // owned by the watch, which may in turn delete the Context. - if (result == MOJO_RESULT_CANCELLED) + // The trigger was removed. We can release the ref it owned, which in turn + // may delete the Context. + if (event->result == MOJO_RESULT_CANCELLED) context->Release(); } @@ -82,9 +79,9 @@ void Notify(MojoResult result, MojoHandleSignalsState signals_state, - MojoWatcherNotificationFlags flags) { + MojoTrapEventFlags flags) { if (result == MOJO_RESULT_CANCELLED) { - // The SimpleWatcher may have explicitly cancelled this watch, so we don't + // The SimpleWatcher may have explicitly removed this trigger, so we don't // bother dispatching the notification - it would be ignored anyway. // // TODO(rockot): This shouldn't really be necessary, but there are already @@ -98,7 +95,7 @@ HandleSignalsState state(signals_state.satisfied_signals, signals_state.satisfiable_signals); - if ((flags & MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM) && + if (!(flags & MOJO_TRAP_EVENT_FLAG_WITHIN_API_CALL) && task_runner_->RunsTasksInCurrentSequence() && weak_watcher_ && weak_watcher_->is_default_task_runner_) { // System notifications will trigger from the task runner passed to @@ -132,7 +129,7 @@ base::ThreadTaskRunnerHandle::Get()), heap_profiler_tag_(from_here.file_name()), weak_factory_(this) { - MojoResult rv = CreateWatcher(&Context::CallNotify, &watcher_handle_); + MojoResult rv = CreateTrap(&Context::CallNotify, &trap_handle_); DCHECK_EQ(MOJO_RESULT_OK, rv); DCHECK(task_runner_->RunsTasksInCurrentSequence()); } @@ -149,7 +146,7 @@ MojoResult SimpleWatcher::Watch(Handle handle, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, const ReadyCallbackWithState& callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!IsWatching()); @@ -159,15 +156,15 @@ handle_ = handle; watch_id_ += 1; - MojoResult watch_result = MOJO_RESULT_UNKNOWN; + MojoResult result = MOJO_RESULT_UNKNOWN; context_ = Context::Create(weak_factory_.GetWeakPtr(), task_runner_, - watcher_handle_.get(), handle_, signals, condition, - watch_id_, &watch_result); + trap_handle_.get(), handle_, signals, condition, + watch_id_, &result); if (!context_) { handle_.set_value(kInvalidHandleValue); callback_.Reset(); - DCHECK_EQ(MOJO_RESULT_INVALID_ARGUMENT, watch_result); - return watch_result; + DCHECK_EQ(MOJO_RESULT_INVALID_ARGUMENT, result); + return result; } if (arming_policy_ == ArmingPolicy::AUTOMATIC) @@ -191,13 +188,13 @@ handle_.set_value(kInvalidHandleValue); callback_.Reset(); - // Ensure |context_| is unset by the time we call MojoCancelWatch, as may + // Ensure |context_| is unset by the time we call MojoRemoveTrigger, as it may // re-enter the notification callback and we want to ensure |context_| is // unset by then. scoped_refptr<Context> context; std::swap(context, context_); MojoResult rv = - MojoCancelWatch(watcher_handle_.get().value(), context->value()); + MojoRemoveTrigger(trap_handle_.get().value(), context->value(), nullptr); // It's possible this cancellation could race with a handle closure // notification, in which case the watch may have already been implicitly @@ -215,9 +212,9 @@ if (!ready_state) ready_state = &local_ready_state; MojoResult rv = - MojoArmWatcher(watcher_handle_.get().value(), &num_ready_contexts, - &ready_context, &local_ready_result, - reinterpret_cast<MojoHandleSignalsState*>(ready_state)); + MojoArmTrap(trap_handle_.get().value(), nullptr, &num_ready_contexts, + &ready_context, &local_ready_result, + reinterpret_cast<MojoHandleSignalsState*>(ready_state)); if (rv == MOJO_RESULT_FAILED_PRECONDITION) { DCHECK(context_); DCHECK_EQ(1u, num_ready_contexts);
diff --git a/mojo/public/cpp/system/simple_watcher.h b/mojo/public/cpp/system/simple_watcher.h index 8702689..0784ee0 100644 --- a/mojo/public/cpp/system/simple_watcher.h +++ b/mojo/public/cpp/system/simple_watcher.h
@@ -16,7 +16,7 @@ #include "mojo/public/c/system/types.h" #include "mojo/public/cpp/system/handle_signals_state.h" #include "mojo/public/cpp/system/system_export.h" -#include "mojo/public/cpp/system/watcher.h" +#include "mojo/public/cpp/system/trap.h" namespace base { class SequencedTaskRunner; @@ -119,7 +119,7 @@ // Destroying the SimpleWatcher implicitly calls |Cancel()|. MojoResult Watch(Handle handle, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, const ReadyCallbackWithState& callback); // DEPRECATED: Please use the above signature instead. @@ -211,7 +211,7 @@ // base::SequencedTaskRunnerHandle::Get() for the thread. const bool is_default_task_runner_; - ScopedWatcherHandle watcher_handle_; + ScopedTrapHandle trap_handle_; // A thread-safe context object corresponding to the currently active watch, // if any.
diff --git a/mojo/public/cpp/system/trap.cc b/mojo/public/cpp/system/trap.cc new file mode 100644 index 0000000..65154c1 --- /dev/null +++ b/mojo/public/cpp/system/trap.cc
@@ -0,0 +1,20 @@ +// 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 "mojo/public/cpp/system/trap.h" + +#include "mojo/public/c/system/functions.h" + +namespace mojo { + +MojoResult CreateTrap(MojoTrapEventHandler handler, + ScopedTrapHandle* trap_handle) { + MojoHandle handle; + MojoResult rv = MojoCreateTrap(handler, nullptr, &handle); + if (rv == MOJO_RESULT_OK) + trap_handle->reset(TrapHandle(handle)); + return rv; +} + +} // namespace mojo
diff --git a/mojo/public/cpp/system/trap.h b/mojo/public/cpp/system/trap.h new file mode 100644 index 0000000..5414aaf --- /dev/null +++ b/mojo/public/cpp/system/trap.h
@@ -0,0 +1,36 @@ +// 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. + +#ifndef MOJO_PUBLIC_CPP_SYSTEM_TRAP_H_ +#define MOJO_PUBLIC_CPP_SYSTEM_TRAP_H_ + +#include "mojo/public/c/system/trap.h" +#include "mojo/public/c/system/types.h" +#include "mojo/public/cpp/system/handle.h" +#include "mojo/public/cpp/system/system_export.h" + +namespace mojo { + +// A strongly-typed representation of a |MojoHandle| for a trap. +class TrapHandle : public Handle { + public: + TrapHandle() = default; + explicit TrapHandle(MojoHandle value) : Handle(value) {} + + // Copying and assignment allowed. +}; + +static_assert(sizeof(TrapHandle) == sizeof(Handle), + "Bad size for C++ TrapHandle"); + +typedef ScopedHandleBase<TrapHandle> ScopedTrapHandle; +static_assert(sizeof(ScopedTrapHandle) == sizeof(TrapHandle), + "Bad size for C++ ScopedTrapHandle"); + +MOJO_CPP_SYSTEM_EXPORT MojoResult CreateTrap(MojoTrapEventHandler handler, + ScopedTrapHandle* trap_handle); + +} // namespace mojo + +#endif // MOJO_PUBLIC_CPP_SYSTEM_TRAP_H_
diff --git a/mojo/public/cpp/system/wait.cc b/mojo/public/cpp/system/wait.cc index 4f00587a..a1aa4bc1 100644 --- a/mojo/public/cpp/system/wait.cc +++ b/mojo/public/cpp/system/wait.cc
@@ -10,15 +10,15 @@ #include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/synchronization/waitable_event.h" -#include "mojo/public/c/system/watcher.h" -#include "mojo/public/cpp/system/watcher.h" +#include "mojo/public/c/system/trap.h" +#include "mojo/public/cpp/system/trap.h" namespace mojo { namespace { -class WatchContext : public base::RefCountedThreadSafe<WatchContext> { +class TriggerContext : public base::RefCountedThreadSafe<TriggerContext> { public: - WatchContext() + TriggerContext() : event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED) {} @@ -27,22 +27,19 @@ MojoHandleSignalsState wait_state() const { return wait_state_; } uintptr_t context_value() const { return reinterpret_cast<uintptr_t>(this); } - static void OnNotification(uintptr_t context_value, - MojoResult result, - MojoHandleSignalsState state, - MojoWatcherNotificationFlags flags) { - auto* context = reinterpret_cast<WatchContext*>(context_value); - context->Notify(result, state); - if (result == MOJO_RESULT_CANCELLED) { + static void OnNotification(const MojoTrapEvent* event) { + auto* context = reinterpret_cast<TriggerContext*>(event->trigger_context); + context->Notify(event->result, event->signals_state); + if (event->result == MOJO_RESULT_CANCELLED) { // Balanced in Wait() or WaitMany(). context->Release(); } } private: - friend class base::RefCountedThreadSafe<WatchContext>; + friend class base::RefCountedThreadSafe<TriggerContext>; - ~WatchContext() {} + ~TriggerContext() {} void Notify(MojoResult result, MojoHandleSignalsState state) { if (wait_result_ == MOJO_RESULT_UNKNOWN) { @@ -57,32 +54,32 @@ // NOTE: Although these are modified in Notify() which may be called from any // sequence, Notify() is guaranteed to never run concurrently with itself. // Furthermore, they are only modified once, before |event_| signals; so there - // is no need for a WatchContext user to synchronize access to these fields + // is no need for a TriggerContext user to synchronize access to these fields // apart from waiting on |event()|. MojoResult wait_result_ = MOJO_RESULT_UNKNOWN; MojoHandleSignalsState wait_state_ = {0, 0}; - DISALLOW_COPY_AND_ASSIGN(WatchContext); + DISALLOW_COPY_AND_ASSIGN(TriggerContext); }; } // namespace MojoResult Wait(Handle handle, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, MojoHandleSignalsState* signals_state) { - ScopedWatcherHandle watcher; - MojoResult rv = CreateWatcher(&WatchContext::OnNotification, &watcher); + ScopedTrapHandle trap; + MojoResult rv = CreateTrap(&TriggerContext::OnNotification, &trap); DCHECK_EQ(MOJO_RESULT_OK, rv); - scoped_refptr<WatchContext> context = new WatchContext; + scoped_refptr<TriggerContext> context = new TriggerContext; - // Balanced in WatchContext::OnNotification if MojoWatch() is successful. - // Otherwise balanced immediately below. + // Balanced in TriggerContext::OnNotification if MojoAddTrigger() is + // successful. Otherwise balanced immediately below. context->AddRef(); - rv = MojoWatch(watcher.get().value(), handle.value(), signals, condition, - context->context_value()); + rv = MojoAddTrigger(trap.get().value(), handle.value(), signals, condition, + context->context_value(), nullptr); if (rv == MOJO_RESULT_INVALID_ARGUMENT) { // Balanced above. context->Release(); @@ -94,8 +91,8 @@ uintptr_t ready_context; MojoResult ready_result; MojoHandleSignalsState ready_state; - rv = MojoArmWatcher(watcher.get().value(), &num_ready_contexts, - &ready_context, &ready_result, &ready_state); + rv = MojoArmTrap(trap.get().value(), nullptr, &num_ready_contexts, + &ready_context, &ready_result, &ready_state); if (rv == MOJO_RESULT_FAILED_PRECONDITION) { DCHECK_EQ(1u, num_ready_contexts); if (signals_state) @@ -123,22 +120,23 @@ if (!handles || !signals) return MOJO_RESULT_INVALID_ARGUMENT; - ScopedWatcherHandle watcher; - MojoResult rv = CreateWatcher(&WatchContext::OnNotification, &watcher); + ScopedTrapHandle trap; + MojoResult rv = CreateTrap(&TriggerContext::OnNotification, &trap); DCHECK_EQ(MOJO_RESULT_OK, rv); - std::vector<scoped_refptr<WatchContext>> contexts(num_handles); + std::vector<scoped_refptr<TriggerContext>> contexts(num_handles); std::vector<base::WaitableEvent*> events(num_handles); for (size_t i = 0; i < num_handles; ++i) { - contexts[i] = new WatchContext(); + contexts[i] = new TriggerContext(); - // Balanced in WatchContext::OnNotification if MojoWatch() is successful. - // Otherwise balanced immediately below. + // Balanced in TriggerContext::OnNotification if MojoAddTrigger() is + // successful. Otherwise balanced immediately below. contexts[i]->AddRef(); MojoResult rv = - MojoWatch(watcher.get().value(), handles[i].value(), signals[i], - MOJO_WATCH_CONDITION_SATISFIED, contexts[i]->context_value()); + MojoAddTrigger(trap.get().value(), handles[i].value(), signals[i], + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, + contexts[i]->context_value(), nullptr); if (rv == MOJO_RESULT_INVALID_ARGUMENT) { if (result_index) *result_index = i; @@ -156,8 +154,8 @@ uintptr_t ready_context = 0; MojoResult ready_result = MOJO_RESULT_UNKNOWN; MojoHandleSignalsState ready_state{0, 0}; - rv = MojoArmWatcher(watcher.get().value(), &num_ready_contexts, - &ready_context, &ready_result, &ready_state); + rv = MojoArmTrap(trap.get().value(), nullptr, &num_ready_contexts, + &ready_context, &ready_result, &ready_state); size_t index = num_handles; if (rv == MOJO_RESULT_FAILED_PRECONDITION) {
diff --git a/mojo/public/cpp/system/wait.h b/mojo/public/cpp/system/wait.h index ccd6ebe..651a37f 100644 --- a/mojo/public/cpp/system/wait.h +++ b/mojo/public/cpp/system/wait.h
@@ -7,6 +7,7 @@ #include <stddef.h> +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" #include "mojo/public/cpp/system/handle.h" #include "mojo/public/cpp/system/system_export.h" @@ -35,15 +36,16 @@ MOJO_CPP_SYSTEM_EXPORT MojoResult Wait(Handle handle, MojoHandleSignals signals, - MojoWatchCondition condition, + MojoTriggerCondition condition, MojoHandleSignalsState* signals_state = nullptr); // A pseudonym for the above Wait() which always waits on -// |MOJO_WATCH_CONDITION_SATISFIED|. +// |MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED|. inline MojoResult Wait(Handle handle, MojoHandleSignals signals, MojoHandleSignalsState* signals_state = nullptr) { - return Wait(handle, signals, MOJO_WATCH_CONDITION_SATISFIED, signals_state); + return Wait(handle, signals, MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, + signals_state); } // Waits on |handles[0]|, ..., |handles[num_handles-1]| until:
diff --git a/mojo/public/cpp/system/wait_set.cc b/mojo/public/cpp/system/wait_set.cc index e2a26f8..3ad9840 100644 --- a/mojo/public/cpp/system/wait_set.cc +++ b/mojo/public/cpp/system/wait_set.cc
@@ -16,7 +16,7 @@ #include "base/memory/ptr_util.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" -#include "mojo/public/cpp/system/watcher.h" +#include "mojo/public/cpp/system/trap.h" namespace mojo { @@ -25,13 +25,13 @@ State() : handle_event_(base::WaitableEvent::ResetPolicy::MANUAL, base::WaitableEvent::InitialState::NOT_SIGNALED) { - MojoResult rv = CreateWatcher(&Context::OnNotification, &watcher_handle_); + MojoResult rv = CreateTrap(&Context::OnNotification, &trap_handle_); DCHECK_EQ(MOJO_RESULT_OK, rv); } void ShutDown() { // NOTE: This may immediately invoke Notify for every context. - watcher_handle_.reset(); + trap_handle_.reset(); cancelled_contexts_.clear(); } @@ -52,7 +52,7 @@ } MojoResult AddHandle(Handle handle, MojoHandleSignals signals) { - DCHECK(watcher_handle_.is_valid()); + DCHECK(trap_handle_.is_valid()); scoped_refptr<Context> context = new Context(this, handle); @@ -68,14 +68,15 @@ } // Balanced in State::Notify() with MOJO_RESULT_CANCELLED if - // MojoWatch() succeeds. Otherwise balanced immediately below. + // MojoAddTrigger() succeeds. Otherwise balanced immediately below. context->AddRef(); // This can notify immediately if the watcher is already armed. Don't hold // |lock_| while calling it. MojoResult rv = - MojoWatch(watcher_handle_.get().value(), handle.value(), signals, - MOJO_WATCH_CONDITION_SATISFIED, context->context_value()); + MojoAddTrigger(trap_handle_.get().value(), handle.value(), signals, + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, + context->context_value(), nullptr); if (rv == MOJO_RESULT_INVALID_ARGUMENT) { base::AutoLock lock(lock_); handle_to_context_.erase(handle); @@ -91,7 +92,7 @@ } MojoResult RemoveHandle(Handle handle) { - DCHECK(watcher_handle_.is_valid()); + DCHECK(trap_handle_.is_valid()); scoped_refptr<Context> context; { @@ -116,8 +117,8 @@ // NOTE: This may enter the notification callback immediately, so don't hold // |lock_| while calling it. - MojoResult rv = MojoCancelWatch(watcher_handle_.get().value(), - context->context_value()); + MojoResult rv = MojoRemoveTrigger(trap_handle_.get().value(), + context->context_value(), nullptr); // We don't really care whether or not this succeeds. In either case, the // context was or will imminently be cancelled and moved from |contexts_| @@ -132,7 +133,7 @@ Handle* ready_handles, MojoResult* ready_results, MojoHandleSignalsState* signals_states) { - DCHECK(watcher_handle_.is_valid()); + DCHECK(trap_handle_.is_valid()); DCHECK(num_ready_handles); DCHECK(ready_handles); DCHECK(ready_results); @@ -152,13 +153,13 @@ MojoHandleSignalsState* out_states = signals_states; if (!out_states) { // If the caller didn't provide a buffer for signal states, we provide - // our own locally. MojoArmWatcher() requires one if we want to handle + // our own locally. MojoArmTrap() requires one if we want to handle // arming failure properly. ready_states.container().resize(num_ready_contexts); out_states = ready_states.container().data(); } - MojoResult rv = MojoArmWatcher( - watcher_handle_.get().value(), &num_ready_contexts, + MojoResult rv = MojoArmTrap( + trap_handle_.get().value(), nullptr, &num_ready_contexts, ready_contexts.container().data(), ready_results, out_states); if (rv == MOJO_RESULT_FAILED_PRECONDITION) { @@ -242,11 +243,9 @@ return reinterpret_cast<uintptr_t>(this); } - static void OnNotification(uintptr_t context, - MojoResult result, - MojoHandleSignalsState signals_state, - MojoWatcherNotificationFlags flags) { - reinterpret_cast<Context*>(context)->Notify(result, signals_state); + static void OnNotification(const MojoTrapEvent* event) { + reinterpret_cast<Context*>(event->trigger_context) + ->Notify(event->result, event->signals_state); } private: @@ -315,7 +314,7 @@ // Not guarded by lock. Must only be accessed from the WaitSet's owning // sequence. - ScopedWatcherHandle watcher_handle_; + ScopedTrapHandle trap_handle_; base::Lock lock_; std::map<uintptr_t, scoped_refptr<Context>> contexts_;
diff --git a/mojo/public/cpp/system/wait_set.h b/mojo/public/cpp/system/wait_set.h index 46d6b7d..efb54dea 100644 --- a/mojo/public/cpp/system/wait_set.h +++ b/mojo/public/cpp/system/wait_set.h
@@ -10,6 +10,7 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "mojo/public/c/system/trap.h" #include "mojo/public/c/system/types.h" #include "mojo/public/cpp/system/handle.h" #include "mojo/public/cpp/system/system_export.h"
diff --git a/mojo/public/cpp/system/watcher.cc b/mojo/public/cpp/system/watcher.cc deleted file mode 100644 index 0c62ba8..0000000 --- a/mojo/public/cpp/system/watcher.cc +++ /dev/null
@@ -1,20 +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 "mojo/public/cpp/system/watcher.h" - -#include "mojo/public/c/system/functions.h" - -namespace mojo { - -MojoResult CreateWatcher(MojoWatcherCallback callback, - ScopedWatcherHandle* watcher_handle) { - MojoHandle handle; - MojoResult rv = MojoCreateWatcher(callback, &handle); - if (rv == MOJO_RESULT_OK) - watcher_handle->reset(WatcherHandle(handle)); - return rv; -} - -} // namespace mojo
diff --git a/mojo/public/cpp/system/watcher.h b/mojo/public/cpp/system/watcher.h deleted file mode 100644 index d0a2578..0000000 --- a/mojo/public/cpp/system/watcher.h +++ /dev/null
@@ -1,37 +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. - -#ifndef MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ -#define MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_ - -#include "mojo/public/c/system/types.h" -#include "mojo/public/c/system/watcher.h" -#include "mojo/public/cpp/system/handle.h" -#include "mojo/public/cpp/system/system_export.h" - -namespace mojo { - -// A strongly-typed representation of a |MojoHandle| for a watcher. -class WatcherHandle : public Handle { - public: - WatcherHandle() = default; - explicit WatcherHandle(MojoHandle value) : Handle(value) {} - - // Copying and assignment allowed. -}; - -static_assert(sizeof(WatcherHandle) == sizeof(Handle), - "Bad size for C++ WatcherHandle"); - -typedef ScopedHandleBase<WatcherHandle> ScopedWatcherHandle; -static_assert(sizeof(ScopedWatcherHandle) == sizeof(WatcherHandle), - "Bad size for C++ ScopedWatcherHandle"); - -MOJO_CPP_SYSTEM_EXPORT MojoResult -CreateWatcher(MojoWatcherCallback callback, - ScopedWatcherHandle* watcher_handle); - -} // namespace mojo - -#endif // MOJO_PUBLIC_CPP_SYSTEM_WATCHER_H_
diff --git a/mojo/public/interfaces/bindings/tests/echo.mojom b/mojo/public/interfaces/bindings/tests/echo.mojom index 545c5c9..1418e3d2 100644 --- a/mojo/public/interfaces/bindings/tests/echo.mojom +++ b/mojo/public/interfaces/bindings/tests/echo.mojom
@@ -4,7 +4,7 @@ module test.echo.mojom; -import "echo_import/echo_import.mojom"; +import "mojo/public/interfaces/bindings/tests/echo_import/echo_import.mojom"; interface Echo { EchoPoint(test.echo_import.mojom.Point point)
diff --git a/mojo/public/interfaces/bindings/tests/sample_factory.mojom b/mojo/public/interfaces/bindings/tests/sample_factory.mojom index ade3bf3..cb718afd 100644 --- a/mojo/public/interfaces/bindings/tests/sample_factory.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_factory.mojom
@@ -5,7 +5,7 @@ [JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] module sample; -import "sample_import.mojom"; +import "mojo/public/interfaces/bindings/tests/sample_import.mojom"; // This sample shows how handles to MessagePipes can be sent as both parameters // to methods as well as fields on structs.
diff --git a/mojo/public/interfaces/bindings/tests/sample_import2.mojom b/mojo/public/interfaces/bindings/tests/sample_import2.mojom index ca4e81c0..a8c909a3 100644 --- a/mojo/public/interfaces/bindings/tests/sample_import2.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_import2.mojom
@@ -5,7 +5,7 @@ [JavaPackage="org.chromium.mojo.bindings.test.mojom.imported"] module imported; -import "sample_import.mojom"; +import "mojo/public/interfaces/bindings/tests/sample_import.mojom"; // This sample adds more types and constants to the "imported" namespace, // to test a bug with importing multiple modules with the same namespace.
diff --git a/mojo/public/interfaces/bindings/tests/sample_service.mojom b/mojo/public/interfaces/bindings/tests/sample_service.mojom index 761cb91a..62ff1a8b 100644 --- a/mojo/public/interfaces/bindings/tests/sample_service.mojom +++ b/mojo/public/interfaces/bindings/tests/sample_service.mojom
@@ -6,8 +6,8 @@ [JavaPackage="org.chromium.mojo.bindings.test.mojom.sample"] module sample; -import "sample_import.mojom"; -import "sample_import2.mojom"; +import "mojo/public/interfaces/bindings/tests/sample_import.mojom"; +import "mojo/public/interfaces/bindings/tests/sample_import2.mojom"; const uint8 kTwelve = 12;
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni index 40538c3..52fd516 100644 --- a/mojo/public/tools/bindings/mojom.gni +++ b/mojo/public/tools/bindings/mojom.gni
@@ -355,6 +355,24 @@ } } + target_sources_list = "$target_gen_dir/$target_name.sources_list" + sources_list = [] + if (defined(invoker.sources)) { + sources_list = invoker.sources + } + write_file(target_sources_list, sources_list) + + # a target implicitly depends on its own sources + deps_sources = [ rebase_path(target_sources_list, root_build_dir) ] + foreach(d, all_deps) { + dep_dir = get_label_info("$d", "target_gen_dir") + dep_short_name = get_label_info("$d", "name") + deps_sources += + [ rebase_path("$dep_dir/$dep_short_name.sources_list", root_build_dir) ] + } + + write_file("$target_gen_dir/$target_name.deps_sources_list", deps_sources) + if (defined(invoker.sources)) { parser_target_name = "${target_name}__parser" enabled_features = [] @@ -418,6 +436,38 @@ } } + if (defined(invoker.sources)) { + verify_deps_target_names = [] + if (!defined(invoker.skip_deps_check) || !invoker.skip_deps_check) { + verify_deps_target_name = "${target_name}__verify_deps" + verify_deps_target_names += [ ":$verify_deps_target_name" ] + source_file_name = target_name + action_foreach(verify_deps_target_name) { + script = mojom_generator_script + inputs = mojom_generator_sources + sources = invoker.sources + deps = [ + ":$parsed_target_name", + ] + outputs = [ + "{{source_gen_dir}}/{{source_name_part}}.v", + ] + + args = [ + "verify", + "{{source}}", + "-f", + rebase_path("$target_gen_dir/$source_file_name.deps_sources_list", + root_build_dir), + "--gen_dir", + rebase_path(root_gen_dir, root_build_dir), + "--depth", + rebase_path("//", root_build_dir), + ] + } + } + } + generator_cpp_message_ids_target_name = "${target_name}__generate_message_ids" # Generate code that is shared by different variants. @@ -522,9 +572,10 @@ inputs = mojom_generator_sources sources = invoker.sources deps = [ - ":$parsed_target_name", - "//mojo/public/tools/bindings:precompile_templates", - ] + ":$parsed_target_name", + "//mojo/public/tools/bindings:precompile_templates", + ] + verify_deps_target_names + outputs = generator_shared_cpp_outputs args = common_generator_args args += [ @@ -695,10 +746,10 @@ inputs = mojom_generator_sources sources = invoker.sources deps = [ - ":$parsed_target_name", - ":$type_mappings_target_name", - "//mojo/public/tools/bindings:precompile_templates", - ] + ":$parsed_target_name", + ":$type_mappings_target_name", + "//mojo/public/tools/bindings:precompile_templates", + ] + verify_deps_target_names outputs = generator_cpp_outputs args = common_generator_args args += [ @@ -946,10 +997,10 @@ inputs = mojom_generator_sources sources = enabled_sources deps = [ - ":$parsed_target_name", - ":$type_mappings_target_name", - "//mojo/public/tools/bindings:precompile_templates", - ] + ":$parsed_target_name", + ":$type_mappings_target_name", + "//mojo/public/tools/bindings:precompile_templates", + ] + verify_deps_target_names outputs = generator_java_outputs args = common_generator_args args += [ @@ -1033,9 +1084,9 @@ sources += invoker.sources } deps = [ - ":$parsed_target_name", - "//mojo/public/tools/bindings:precompile_templates", - ] + ":$parsed_target_name", + "//mojo/public/tools/bindings:precompile_templates", + ] + verify_deps_target_names outputs = generator_js_outputs args = common_generator_args args += [
diff --git a/mojo/public/tools/bindings/mojom_bindings_generator.py b/mojo/public/tools/bindings/mojom_bindings_generator.py index 804896c..7b0d3da 100755 --- a/mojo/public/tools/bindings/mojom_bindings_generator.py +++ b/mojo/public/tools/bindings/mojom_bindings_generator.py
@@ -174,14 +174,7 @@ MakeImportStackMessage(imported_filename_stack + [rel_filename.path]) sys.exit(1) - pickle_path = _GetPicklePath(rel_filename, args.output_dir) - try: - with open(pickle_path, "rb") as f: - tree = cPickle.load(f) - except (IOError, cPickle.UnpicklingError) as e: - print "%s: Error: %s" % (pickle_path, str(e)) - sys.exit(1) - + tree = _UnpickleAST(_GetPicklePath(rel_filename, args.output_dir)) dirname = os.path.dirname(rel_filename.path) # Process all our imports first and collect the module object for each. @@ -273,6 +266,13 @@ print "%s: Error: %s" % (output_file, str(e)) sys.exit(1) +def _UnpickleAST(input_file): + try: + with open(input_file, "rb") as f: + return cPickle.load(f) + except (IOError, cPickle.UnpicklingError) as e: + print "%s: Error: %s" % (input_file, str(e)) + sys.exit(1) def _ParseFile(args, rel_filename): try: @@ -288,7 +288,6 @@ except Error as e: print "%s: Error: %s" % (rel_filename.path, str(e)) sys.exit(1) - _PickleAST(tree, _GetPicklePath(rel_filename, args.output_dir)) @@ -305,7 +304,42 @@ template_expander.PrecompileTemplates(generator_modules, args.output_dir) return 0 +def _VerifyImportDeps(args, __): + fileutil.EnsureDirectoryExists(args.gen_dir) + for filename in args.filename: + rel_path = RelativePath(filename, args.depth) + tree = _UnpickleAST(_GetPicklePath(rel_path, args.gen_dir)) + + mojom_imports = set( + parsed_imp.import_filename for parsed_imp in tree.import_list + ) + + # read the paths from the file + f_deps = open(args.deps_file, 'r') + deps_sources = set() + for deps_path in f_deps: + deps_path = deps_path.rstrip('\n') + f_sources = open(deps_path, 'r') + + for source_file in f_sources: + source_dir = deps_path.split(args.gen_dir + "/", 1)[1] + full_source_path = os.path.dirname(source_dir) + "/" + \ + source_file + deps_sources.add(full_source_path.rstrip('\n')) + + if (not deps_sources.issuperset(mojom_imports)): + print ">>> [%s] Missing dependencies for the following imports: %s" % ( \ + args.filename[0], \ + list(mojom_imports.difference(deps_sources))) + sys.exit(1) + + source_filename, _ = os.path.splitext(rel_path.relative_path()) + output_file = source_filename + '.v' + output_file_path = os.path.join(args.gen_dir, output_file) + WriteFile("", output_file_path) + + return 0 def main(): parser = argparse.ArgumentParser( @@ -425,6 +459,22 @@ help="output directory for precompiled templates") precompile_parser.set_defaults(func=_Precompile) + verify_parser = subparsers.add_parser("verify", description="Checks " + "the set of imports against the set of dependencies.") + verify_parser.add_argument("filename", nargs="+", + help="mojom input file") + verify_parser.add_argument("-f", "--file", dest="deps_file", + help="file containing paths to the sources files for " + "dependencies") + verify_parser.add_argument("-g", "--gen_dir", + dest="gen_dir", + help="directory with the syntax tree") + verify_parser.add_argument( + "-d", "--depth", dest="depth", + help="depth from source root") + + verify_parser.set_defaults(func=_VerifyImportDeps) + args, remaining_args = parser.parse_known_args() return args.func(args, remaining_args)
diff --git a/net/BUILD.gn b/net/BUILD.gn index 6987995..b7c1c98 100644 --- a/net/BUILD.gn +++ b/net/BUILD.gn
@@ -1257,6 +1257,10 @@ "quic/core/frames/quic_mtu_discovery_frame.h", "quic/core/frames/quic_padding_frame.cc", "quic/core/frames/quic_padding_frame.h", + "quic/core/frames/quic_path_challenge_frame.cc", + "quic/core/frames/quic_path_challenge_frame.h", + "quic/core/frames/quic_path_response_frame.cc", + "quic/core/frames/quic_path_response_frame.h", "quic/core/frames/quic_ping_frame.cc", "quic/core/frames/quic_ping_frame.h", "quic/core/frames/quic_rst_stream_frame.cc", @@ -5156,6 +5160,7 @@ "quic/core/quic_sent_packet_manager_test.cc", "quic/core/quic_server_id_test.cc", "quic/core/quic_server_session_base_test.cc", + "quic/core/quic_session_test.cc", "quic/core/quic_simple_buffer_allocator_test.cc", "quic/core/quic_socket_address_coder_test.cc", "quic/core/quic_spdy_session_test.cc", @@ -6227,6 +6232,10 @@ "//net", ] dict = "data/fuzzer_dictionaries/net_url_request_fuzzer.dict" + + # TODO(crbug.com/820089): Figure out why this fuzzer's corpus explodes to + # 10 GB. For now, disable it on ClusterFuzz. + additional_configs = [ "//testing/libfuzzer:no_clusterfuzz" ] } fuzzer_test("net_auth_challenge_tokenizer_fuzzer") {
diff --git a/net/quic/chromium/quic_chromium_client_session.cc b/net/quic/chromium/quic_chromium_client_session.cc index f091f24..c7bb47c 100644 --- a/net/quic/chromium/quic_chromium_client_session.cc +++ b/net/quic/chromium/quic_chromium_client_session.cc
@@ -76,6 +76,12 @@ // The maximum size of uncompressed QUIC headers that will be allowed. const size_t kMaxUncompressedHeaderSize = 256 * 1024; +// The maximum time allowed to have no retransmittable packets on the wire +// (after sending the first retransmittable packet) if +// |migrate_session_early_v2_| is true. PING frames will be sent as needed to +// enforce this. +const size_t kDefaultRetransmittableOnWireTimeoutMillisecs = 100; + // Histograms for tracking down the crashes from http://crbug.com/354669 // Note: these values must be kept in sync with the corresponding values in: // tools/metrics/histograms/histograms.xml @@ -752,6 +758,11 @@ } connect_timing_.dns_start = dns_resolution_start_time; connect_timing_.dns_end = dns_resolution_end_time; + if (migrate_session_early_v2_) { + connection->set_retransmittable_on_wire_timeout( + QuicTime::Delta::FromMilliseconds( + kDefaultRetransmittableOnWireTimeoutMillisecs)); + } } QuicChromiumClientSession::~QuicChromiumClientSession() { @@ -1564,7 +1575,7 @@ void QuicChromiumClientSession::OnSuccessfulVersionNegotiation( const ParsedQuicVersion& version) { - logger_->OnSuccessfulVersionNegotiation(version.transport_version); + logger_->OnSuccessfulVersionNegotiation(version); QuicSpdySession::OnSuccessfulVersionNegotiation(version); } @@ -2716,7 +2727,7 @@ // push promise headers are received, send a PRIORITY frame for the // promised stream ID. Send |kDefaultPriority| since that will be the // initial SpdyPriority of the push promise stream when created. - const SpdyPriority priority = kDefaultPriority; + const SpdyPriority priority = QuicStream::kDefaultPriority; SpdyStreamId parent_stream_id = 0; int weight = 0; bool exclusive = false;
diff --git a/net/quic/chromium/quic_chromium_client_session_test.cc b/net/quic/chromium/quic_chromium_client_session_test.cc index b2d2b7f2..7bcd392 100644 --- a/net/quic/chromium/quic_chromium_client_session_test.cc +++ b/net/quic/chromium/quic_chromium_client_session_test.cc
@@ -36,9 +36,10 @@ #include "net/quic/core/quic_packet_writer.h" #include "net/quic/core/tls_client_handshaker.h" #include "net/quic/platform/api/quic_flags.h" -#include "net/quic/platform/impl/quic_test_impl.h" +#include "net/quic/platform/api/quic_test.h" #include "net/quic/test_tools/crypto_test_utils.h" #include "net/quic/test_tools/quic_client_promised_info_peer.h" +#include "net/quic/test_tools/quic_connection_peer.h" #include "net/quic/test_tools/quic_stream_peer.h" #include "net/quic/test_tools/quic_test_utils.h" #include "net/quic/test_tools/simple_quic_framer.h" @@ -112,7 +113,8 @@ &clock_, kServerHostname, Perspective::IS_SERVER, - false) { + false), + migrate_session_early_v2_(false) { // Advance the time, because timers do not like uninitialized times. clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1)); } @@ -145,10 +147,9 @@ /*stream_factory=*/nullptr, &crypto_client_stream_factory_, &clock_, &transport_security_state_, base::WrapUnique(static_cast<QuicServerInfo*>(nullptr)), session_key_, - /*require_confirmation=*/false, /*migrate_session_early*/ false, - /*migrate_session_on_network_change*/ false, - /*migrate_session_early_v2*/ false, - /*migrate_session_on_network_change_v2*/ false, + /*require_confirmation=*/false, /*migrate_session_early=*/false, + /*migrate_session_on_network_change=*/false, migrate_session_early_v2_, + /*migrate_session_on_network_change_v2=*/false, base::TimeDelta::FromSeconds(kMaxTimeOnNonDefaultNetworkSecs), kMaxMigrationsToNonDefaultNetworkOnPathDegrading, kQuicYieldAfterPacketsRead, @@ -220,6 +221,7 @@ QuicTestPacketMaker client_maker_; QuicTestPacketMaker server_maker_; ProofVerifyDetailsChromium verify_details_; + bool migrate_session_early_v2_; }; INSTANTIATE_TEST_CASE_P( @@ -1426,6 +1428,53 @@ EXPECT_TRUE(new_socket_data.AllWriteDataConsumed()); } +TEST_P(QuicChromiumClientSessionTest, RetransmittableOnWireTimeout) { + migrate_session_early_v2_ = true; + + MockQuicData quic_data; + quic_data.AddWrite(client_maker_.MakeInitialSettingsPacket(1, nullptr)); + quic_data.AddWrite(client_maker_.MakePingPacket(2, true)); + quic_data.AddRead(server_maker_.MakeAckPacket(1, 2, 1, 1, false)); + + quic_data.AddWrite(client_maker_.MakePingPacket(3, false)); + quic_data.AddRead(ASYNC, ERR_IO_PENDING); + quic_data.AddRead(ASYNC, OK); // EOF + quic_data.AddSocketDataToFactory(&socket_factory_); + + Initialize(); + CompleteCryptoHandshake(); + + EXPECT_EQ(QuicTime::Delta::FromMilliseconds(100), + session_->connection()->retransmittable_on_wire_timeout()); + + // Open a stream since the connection only sends PINGs to keep a + // retransmittable packet on the wire if there's an open stream. + EXPECT_TRUE(QuicChromiumClientSessionPeer::CreateOutgoingDynamicStream( + session_.get())); + + QuicAlarm* alarm = + QuicConnectionPeer::GetRetransmittableOnWireAlarm(session_->connection()); + EXPECT_FALSE(alarm->IsSet()); + + // Send PING, which will be ACKed by the server. After the ACK, there will be + // no retransmittable packets on the wire, so the alarm should be set. + session_->SendPing(); + base::RunLoop().RunUntilIdle(); + EXPECT_TRUE(alarm->IsSet()); + EXPECT_EQ(clock_.ApproximateNow() + QuicTime::Delta::FromMilliseconds(100), + alarm->deadline()); + + // Advance clock and simulate the alarm firing. This should cause a PING to be + // sent. + clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(100)); + alarm_factory_.FireAlarm(alarm); + base::RunLoop().RunUntilIdle(); + + quic_data.Resume(); + EXPECT_TRUE(quic_data.AllReadDataConsumed()); + EXPECT_TRUE(quic_data.AllWriteDataConsumed()); +} + } // namespace } // namespace test } // namespace net
diff --git a/net/quic/chromium/quic_connection_logger.cc b/net/quic/chromium/quic_connection_logger.cc index 048c492..d9e4cee 100644 --- a/net/quic/chromium/quic_connection_logger.cc +++ b/net/quic/chromium/quic_connection_logger.cc
@@ -711,10 +711,10 @@ } void QuicConnectionLogger::OnSuccessfulVersionNegotiation( - const QuicTransportVersion& version) { + const ParsedQuicVersion& version) { if (!net_log_is_capturing_) return; - string quic_version = QuicVersionToString(version); + string quic_version = QuicVersionToString(version.transport_version); net_log_.AddEvent(NetLogEventType::QUIC_SESSION_VERSION_NEGOTIATED, NetLog::StringCallback("version", &quic_version)); }
diff --git a/net/quic/chromium/quic_connection_logger.h b/net/quic/chromium/quic_connection_logger.h index 07b6894..25638374 100644 --- a/net/quic/chromium/quic_connection_logger.h +++ b/net/quic/chromium/quic_connection_logger.h
@@ -77,7 +77,7 @@ const std::string& error_details, ConnectionCloseSource source) override; void OnSuccessfulVersionNegotiation( - const QuicTransportVersion& version) override; + const ParsedQuicVersion& version) override; void OnRttChanged(QuicTime::Delta rtt) const override; void OnCryptoHandshakeMessageReceived(const CryptoHandshakeMessage& message);
diff --git a/net/quic/chromium/quic_network_transaction_unittest.cc b/net/quic/chromium/quic_network_transaction_unittest.cc index 9bcf030e..355f842 100644 --- a/net/quic/chromium/quic_network_transaction_unittest.cc +++ b/net/quic/chromium/quic_network_transaction_unittest.cc
@@ -53,7 +53,7 @@ #include "net/quic/core/quic_framer.h" #include "net/quic/platform/api/quic_str_cat.h" #include "net/quic/platform/api/quic_string_piece.h" -#include "net/quic/platform/impl/quic_test_impl.h" +#include "net/quic/platform/api/quic_test.h" #include "net/quic/test_tools/crypto_test_utils.h" #include "net/quic/test_tools/mock_clock.h" #include "net/quic/test_tools/mock_random.h"
diff --git a/net/quic/chromium/quic_stream_factory_test.cc b/net/quic/chromium/quic_stream_factory_test.cc index eaf756a..fd26cb78 100644 --- a/net/quic/chromium/quic_stream_factory_test.cc +++ b/net/quic/chromium/quic_stream_factory_test.cc
@@ -40,7 +40,7 @@ #include "net/quic/core/crypto/quic_decrypter.h" #include "net/quic/core/crypto/quic_encrypter.h" #include "net/quic/core/quic_client_promised_info.h" -#include "net/quic/platform/impl/quic_test_impl.h" +#include "net/quic/platform/api/quic_test.h" #include "net/quic/test_tools/mock_clock.h" #include "net/quic/test_tools/mock_random.h" #include "net/quic/test_tools/quic_config_peer.h"
diff --git a/net/quic/core/crypto/crypto_framer.cc b/net/quic/core/crypto/crypto_framer.cc index 16c6e52..3315914e 100644 --- a/net/quic/core/crypto/crypto_framer.cc +++ b/net/quic/core/crypto/crypto_framer.cc
@@ -9,6 +9,7 @@ #include "net/quic/core/quic_data_writer.h" #include "net/quic/core/quic_packets.h" #include "net/quic/platform/api/quic_fallthrough.h" +#include "net/quic/platform/api/quic_logging.h" #include "net/quic/platform/api/quic_ptr_util.h" #include "net/quic/platform/api/quic_str_cat.h" #include "net/quic/platform/api/quic_string.h" @@ -45,7 +46,11 @@ } // namespace CryptoFramer::CryptoFramer() - : visitor_(nullptr), error_detail_(""), num_entries_(0), values_len_(0) { + : visitor_(nullptr), + error_detail_(""), + num_entries_(0), + values_len_(0), + process_truncated_messages_(false) { Clear(); } @@ -302,11 +307,20 @@ } case STATE_READING_VALUES: if (reader.BytesRemaining() < values_len_) { - break; + if (!process_truncated_messages_) { + break; + } + QUIC_LOG(ERROR) << "Trunacted message. Missing " + << values_len_ - reader.BytesRemaining() << " bytes."; } for (const std::pair<QuicTag, size_t>& item : tags_and_lengths_) { QuicStringPiece value; - reader.ReadStringPiece(&value, item.second); + if (!reader.ReadStringPiece(&value, item.second)) { + DCHECK(process_truncated_messages_); + // Store an empty value. + message_.SetStringPiece(item.first, ""); + continue; + } message_.SetStringPiece(item.first, value); } visitor_->OnHandshakeMessage(message_);
diff --git a/net/quic/core/crypto/crypto_framer.h b/net/quic/core/crypto/crypto_framer.h index a3c3d09..c4bca2b 100644 --- a/net/quic/core/crypto/crypto_framer.h +++ b/net/quic/core/crypto/crypto_framer.h
@@ -84,6 +84,11 @@ const CryptoHandshakeMessage& message, Perspective perspective); + // Debug only method which permits processing truncated messages. + void set_process_truncated_messages(bool process_truncated_messages) { + process_truncated_messages_ = process_truncated_messages; + } + private: // Clears per-message state. Does not clear the visitor. void Clear(); @@ -123,6 +128,8 @@ std::vector<std::pair<QuicTag, size_t>> tags_and_lengths_; // Cumulative length of all values in the message currently being parsed. size_t values_len_; + // Set to true to allow of processing of truncated messages for debugging. + bool process_truncated_messages_; }; } // namespace net
diff --git a/net/quic/core/frames/quic_frame.h b/net/quic/core/frames/quic_frame.h index affa1d6..66b3290 100644 --- a/net/quic/core/frames/quic_frame.h +++ b/net/quic/core/frames/quic_frame.h
@@ -14,6 +14,8 @@ #include "net/quic/core/frames/quic_goaway_frame.h" #include "net/quic/core/frames/quic_mtu_discovery_frame.h" #include "net/quic/core/frames/quic_padding_frame.h" +#include "net/quic/core/frames/quic_path_challenge_frame.h" +#include "net/quic/core/frames/quic_path_response_frame.h" #include "net/quic/core/frames/quic_ping_frame.h" #include "net/quic/core/frames/quic_rst_stream_frame.h" #include "net/quic/core/frames/quic_stop_waiting_frame.h"
diff --git a/net/quic/core/frames/quic_path_challenge_frame.cc b/net/quic/core/frames/quic_path_challenge_frame.cc new file mode 100644 index 0000000..a7463e5 --- /dev/null +++ b/net/quic/core/frames/quic_path_challenge_frame.cc
@@ -0,0 +1,35 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/quic/core/frames/quic_path_challenge_frame.h" +#include "net/quic/platform/api/quic_bug_tracker.h" + +namespace net { + +QuicPathChallengeFrame::QuicPathChallengeFrame() : QuicControlFrame(0) {} + +QuicPathChallengeFrame::QuicPathChallengeFrame( + QuicControlFrameId control_frame_id, + const QuicPathFrameBuffer& data_buff) + : QuicControlFrame(control_frame_id) { + memcpy(data_buffer.data(), data_buff.data(), data_buffer.size()); +} + +QuicPathChallengeFrame::~QuicPathChallengeFrame() {} + +std::ostream& operator<<(std::ostream& os, + const QuicPathChallengeFrame& frame) { + os << "{ control_frame_id: " << frame.control_frame_id + << ", data: " << static_cast<unsigned>(frame.data_buffer[0]) << " " + << static_cast<unsigned>(frame.data_buffer[1]) << " " + << static_cast<unsigned>(frame.data_buffer[2]) << " " + << static_cast<unsigned>(frame.data_buffer[3]) << " " + << static_cast<unsigned>(frame.data_buffer[4]) << " " + << static_cast<unsigned>(frame.data_buffer[5]) << " " + << static_cast<unsigned>(frame.data_buffer[6]) << " " + << static_cast<unsigned>(frame.data_buffer[7]) << " }\n"; + return os; +} + +} // namespace net
diff --git a/net/quic/core/frames/quic_path_challenge_frame.h b/net/quic/core/frames/quic_path_challenge_frame.h new file mode 100644 index 0000000..3fabb7b --- /dev/null +++ b/net/quic/core/frames/quic_path_challenge_frame.h
@@ -0,0 +1,37 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_QUIC_CORE_FRAMES_QUIC_PATH_CHALLENGE_FRAME_H_ +#define NET_QUIC_CORE_FRAMES_QUIC_PATH_CHALLENGE_FRAME_H_ + +#include <memory> +#include <ostream> + +#include "net/quic/core/frames/quic_control_frame.h" +#include "net/quic/core/quic_types.h" + +namespace net { + +// Size of the entire IETF Quic Path Challenge frame, including +// type byte. +const size_t kQuicPathChallengeFrameSize = (kQuicPathFrameBufferSize + 1); + +struct QUIC_EXPORT_PRIVATE QuicPathChallengeFrame : public QuicControlFrame { + QuicPathChallengeFrame(); + QuicPathChallengeFrame(QuicControlFrameId control_frame_id, + const QuicPathFrameBuffer& data_buff); + ~QuicPathChallengeFrame(); + + friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( + std::ostream& os, + const QuicPathChallengeFrame& frame); + + QuicPathFrameBuffer data_buffer; + + private: + DISALLOW_COPY_AND_ASSIGN(QuicPathChallengeFrame); +}; +} // namespace net + +#endif // NET_QUIC_CORE_FRAMES_QUIC_PATH_CHALLENGE_FRAME_H_
diff --git a/net/quic/core/frames/quic_path_response_frame.cc b/net/quic/core/frames/quic_path_response_frame.cc new file mode 100644 index 0000000..2d0068a73 --- /dev/null +++ b/net/quic/core/frames/quic_path_response_frame.cc
@@ -0,0 +1,34 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/quic/core/frames/quic_path_response_frame.h" +#include "net/quic/platform/api/quic_bug_tracker.h" + +namespace net { + +QuicPathResponseFrame::QuicPathResponseFrame() : QuicControlFrame(0) {} + +QuicPathResponseFrame::QuicPathResponseFrame( + QuicControlFrameId control_frame_id, + const QuicPathFrameBuffer& data_buff) + : QuicControlFrame(control_frame_id) { + memcpy(data_buffer.data(), data_buff.data(), data_buffer.size()); +} + +QuicPathResponseFrame::~QuicPathResponseFrame() {} + +std::ostream& operator<<(std::ostream& os, const QuicPathResponseFrame& frame) { + os << "{ control_frame_id: " << frame.control_frame_id + << ", data: " << static_cast<unsigned>(frame.data_buffer[0]) << " " + << static_cast<unsigned>(frame.data_buffer[1]) << " " + << static_cast<unsigned>(frame.data_buffer[2]) << " " + << static_cast<unsigned>(frame.data_buffer[3]) << " " + << static_cast<unsigned>(frame.data_buffer[4]) << " " + << static_cast<unsigned>(frame.data_buffer[5]) << " " + << static_cast<unsigned>(frame.data_buffer[6]) << " " + << static_cast<unsigned>(frame.data_buffer[7]) << " }\n"; + return os; +} + +} // namespace net
diff --git a/net/quic/core/frames/quic_path_response_frame.h b/net/quic/core/frames/quic_path_response_frame.h new file mode 100644 index 0000000..c56dc67 --- /dev/null +++ b/net/quic/core/frames/quic_path_response_frame.h
@@ -0,0 +1,37 @@ +// Copyright (c) 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NET_QUIC_CORE_FRAMES_QUIC_PATH_RESPONSE_FRAME_H_ +#define NET_QUIC_CORE_FRAMES_QUIC_PATH_RESPONSE_FRAME_H_ + +#include <memory> +#include <ostream> + +#include "net/quic/core/frames/quic_control_frame.h" +#include "net/quic/core/quic_types.h" + +namespace net { + +// Size of the entire IETF Quic Path Response frame, including +// type byte. +const size_t kQuicPathResponseFrameSize = (kQuicPathFrameBufferSize + 1); + +struct QUIC_EXPORT_PRIVATE QuicPathResponseFrame : public QuicControlFrame { + QuicPathResponseFrame(); + QuicPathResponseFrame(QuicControlFrameId control_frame_id, + const QuicPathFrameBuffer& data_buff); + ~QuicPathResponseFrame(); + + friend QUIC_EXPORT_PRIVATE std::ostream& operator<<( + std::ostream& os, + const QuicPathResponseFrame& frame); + + QuicPathFrameBuffer data_buffer; + + private: + DISALLOW_COPY_AND_ASSIGN(QuicPathResponseFrame); +}; +} // namespace net + +#endif // NET_QUIC_CORE_FRAMES_QUIC_PATH_RESPONSE_FRAME_H_
diff --git a/net/quic/core/quic_connection.cc b/net/quic/core/quic_connection.cc index ff28588..17c18118f 100644 --- a/net/quic/core/quic_connection.cc +++ b/net/quic/core/quic_connection.cc
@@ -529,8 +529,7 @@ version_negotiation_state_ = NEGOTIATED_VERSION; visitor_->OnSuccessfulVersionNegotiation(received_version); if (debug_visitor_ != nullptr) { - debug_visitor_->OnSuccessfulVersionNegotiation( - received_version.transport_version); + debug_visitor_->OnSuccessfulVersionNegotiation(received_version); } QUIC_DLOG(INFO) << ENDPOINT << "version negotiated " << ParsedQuicVersionToString(received_version); @@ -1446,7 +1445,7 @@ stats_.bytes_received += packet.length(); ++stats_.packets_received; - // Ensure the time coming from the packet reader is within a minute of now. + // Ensure the time coming from the packet reader is within 2 minutes of now. if (std::abs((packet.receipt_time() - clock_->ApproximateNow()).ToSeconds()) > 2 * 60) { QUIC_BUG << "Packet receipt time:" @@ -1634,7 +1633,7 @@ version_negotiation_state_ = NEGOTIATED_VERSION; visitor_->OnSuccessfulVersionNegotiation(version()); if (debug_visitor_ != nullptr) { - debug_visitor_->OnSuccessfulVersionNegotiation(transport_version()); + debug_visitor_->OnSuccessfulVersionNegotiation(version()); } } } else { @@ -1645,7 +1644,7 @@ version_negotiation_state_ = NEGOTIATED_VERSION; visitor_->OnSuccessfulVersionNegotiation(version()); if (debug_visitor_ != nullptr) { - debug_visitor_->OnSuccessfulVersionNegotiation(transport_version()); + debug_visitor_->OnSuccessfulVersionNegotiation(version()); } } } @@ -1673,12 +1672,40 @@ UMA_HISTOGRAM_COUNTS_1000("Net.QuicSession.NumQueuedPacketsBeforeWrite", queued_packets_.size()); - QueuedPacketList::iterator packet_iterator = queued_packets_.begin(); - while (packet_iterator != queued_packets_.end() && - WritePacket(&(*packet_iterator))) { - delete[] packet_iterator->encrypted_buffer; - ClearSerializedPacket(&(*packet_iterator)); - packet_iterator = queued_packets_.erase(packet_iterator); + if (GetQuicReloadableFlag(quic_fix_write_out_of_order_queued_packet_crash)) { + while (!queued_packets_.empty()) { + // WritePacket() can potentially clear all queued packets, so we need to + // save the first queued packet to a local variable before calling it. + SerializedPacket packet(std::move(queued_packets_.front())); + queued_packets_.pop_front(); + + const bool write_result = WritePacket(&packet); + + if (connected_ && !write_result) { + // Write failed but connection is open, re-insert |packet| into the + // front of the queue, it will be retried later. + queued_packets_.emplace_front(std::move(packet)); + break; + } + + delete[] packet.encrypted_buffer; + ClearSerializedPacket(&packet); + if (!connected_) { + DCHECK(queued_packets_.empty()) << "Queued packets should have been " + "cleared while closing connection"; + break; + } + + // Continue to send the next packet in queue. + } + } else { + QueuedPacketList::iterator packet_iterator = queued_packets_.begin(); + while (packet_iterator != queued_packets_.end() && + WritePacket(&(*packet_iterator))) { + delete[] packet_iterator->encrypted_buffer; + ClearSerializedPacket(&(*packet_iterator)); + packet_iterator = queued_packets_.erase(packet_iterator); + } } } @@ -1829,8 +1856,8 @@ } // Copy the buffer so it's owned in the future. char* buffer_copy = CopyBuffer(*packet); - termination_packets_->push_back(std::unique_ptr<QuicEncryptedPacket>( - new QuicEncryptedPacket(buffer_copy, encrypted_length, true))); + termination_packets_->emplace_back( + new QuicEncryptedPacket(buffer_copy, encrypted_length, true)); // This assures we won't try to write *forced* packets when blocked. // Return true to stop processing. if (writer_->IsWriteBlocked()) { @@ -1899,7 +1926,7 @@ return false; } - if (result.status != WRITE_STATUS_ERROR && debug_visitor_ != nullptr) { + if (debug_visitor_ != nullptr) { // Pass the write result to the visitor. debug_visitor_->OnPacketSent(*packet, packet->original_packet_number, packet->transmission_type, packet_send_time);
diff --git a/net/quic/core/quic_connection.h b/net/quic/core/quic_connection.h index 4d03bc8..4242e797 100644 --- a/net/quic/core/quic_connection.h +++ b/net/quic/core/quic_connection.h
@@ -262,7 +262,7 @@ // Called when the version negotiation is successful. virtual void OnSuccessfulVersionNegotiation( - const QuicTransportVersion& version) {} + const ParsedQuicVersion& version) {} // Called when a CachedNetworkParameters is sent to the client. virtual void OnSendConnectionState( @@ -356,7 +356,7 @@ void AdjustNetworkParameters(QuicBandwidth bandwidth, QuicTime::Delta rtt); // Returns the max pacing rate for the connection. - QuicBandwidth MaxPacingRate() const; + virtual QuicBandwidth MaxPacingRate() const; // Sets the number of active streams on the connection for congestion control. void SetNumOpenStreams(size_t num_streams); @@ -764,6 +764,13 @@ void SetRetransmittableOnWireAlarm(); + // Sets the current per-packet options for the connection. The QuicConnection + // does not take ownership of |options|; |options| must live for as long as + // the QuicConnection is in use. + void set_per_packet_options(PerPacketOptions* options) { + per_packet_options_ = options; + } + protected: // Calls cancel() on all the alarms owned by this connection. void CancelAllAlarms(); @@ -786,12 +793,6 @@ // Returns the current per-packet options for the connection. PerPacketOptions* per_packet_options() { return per_packet_options_; } - // Sets the current per-packet options for the connection. The QuicConnection - // does not take ownership of |options|; |options| must live for as long as - // the QuicConnection is in use. - void set_per_packet_options(PerPacketOptions* options) { - per_packet_options_ = options; - } AddressChangeType active_peer_migration_type() { return active_peer_migration_type_;
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc index b4b3ad02..ec6307d5 100644 --- a/net/quic/core/quic_connection_test.cc +++ b/net/quic/core/quic_connection_test.cc
@@ -1339,6 +1339,31 @@ EXPECT_EQ(kPeerAddress, connection_.peer_address()); } +TEST_P(QuicConnectionTest, WriteOutOfOrderQueuedPackets) { + // When the flag is false, this test will trigger a use-after-free, which + // often means crashes, but not always, i.e. it can't be reliably tested. + SetQuicReloadableFlag(quic_fix_write_out_of_order_queued_packet_crash, true); + set_perspective(Perspective::IS_CLIENT); + + BlockOnNextWrite(); + + QuicStreamId stream_id = 2; + connection_.SendStreamDataWithString(stream_id, "foo", 0, NO_FIN); + + EXPECT_EQ(1u, connection_.NumQueuedPackets()); + + writer_->SetWritable(); + connection_.SendConnectivityProbingPacket(writer_.get(), + connection_.peer_address()); + + EXPECT_CALL(visitor_, OnConnectionClosed(QUIC_INTERNAL_ERROR, + "Packet written out of order.", + ConnectionCloseSource::FROM_SELF)); + EXPECT_QUIC_BUG(connection_.OnCanWrite(), + "Attempt to write packet:1 after:2"); + EXPECT_FALSE(connection_.connected()); +} + TEST_P(QuicConnectionTest, ReceiveConnectivityProbingAtServer) { EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)); set_perspective(Perspective::IS_SERVER);
diff --git a/net/quic/core/quic_flags_list.h b/net/quic/core/quic_flags_list.h index cc59183..a924ada8 100644 --- a/net/quic/core/quic_flags_list.h +++ b/net/quic/core/quic_flags_list.h
@@ -3,7 +3,9 @@ // found in the LICENSE file. // This file intentionally does not have header guards, it's included -// inside a macro to generate values. +// inside a macro to generate values. The following line silences a +// presubmit warning that would otherwise be triggered by this: +// no-include-guard-because-multiply-included // This file contains the list of QUIC protocol flags. @@ -126,10 +128,6 @@ FLAGS_quic_reloadable_flag_quic_streams_unblocked_by_session2, false) -// If true, inspects CHLO packets for indicator tags to allow early session -// creation. -QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_inspect_chlo_tags, true) - // When true, ignore the specified ack delay if it causes the RTT sample to be // less than min_rtt. QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_min_rtt_ack_delay, true) @@ -146,7 +144,7 @@ QUIC_FLAG( bool, FLAGS_quic_reloadable_flag_quic_close_session_on_too_many_outstanding_sent_packets, - false) + true) // If true, enable QUIC v99. QUIC_FLAG(bool, FLAGS_quic_enable_version_99, false) @@ -187,4 +185,20 @@ // If true, Http2FrameDecoderAdapter will pass decoded HTTP/2 SETTINGS through // the SpdyFramerVisitorInterface callback OnSetting(), which will also accept // unknown SETTINGS IDs. -QUIC_FLAG(bool, FLAGS_quic_restart_flag_http2_propagate_unknown_settings, true) +QUIC_FLAG(bool, FLAGS_quic_restart_flag_http2_propagate_unknown_settings, false) + +// If true, enable fast path in QuicStream::OnStreamDataAcked. +QUIC_FLAG(bool, + FLAGS_quic_reloadable_flag_quic_fast_path_on_stream_data_acked, + false) + +// If true, fix a use-after-free bug caused by writing an out-of-order queued +// packet. +QUIC_FLAG( + bool, + FLAGS_quic_reloadable_flag_quic_fix_write_out_of_order_queued_packet_crash, + false) + +// If true, QUIC streams are registered in the QuicStream constructor instead +// of in the QuicSpdyStream constructor. +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_register_streams_early, false)
diff --git a/net/quic/core/quic_framer.cc b/net/quic/core/quic_framer.cc index 75bcf35..6b7a2ad6 100644 --- a/net/quic/core/quic_framer.cc +++ b/net/quic/core/quic_framer.cc
@@ -1593,8 +1593,8 @@ last_timestamp_ = CalculateTimestampFromWire(time_delta_us); ack_frame->received_packet_times.reserve(num_received_packets); - ack_frame->received_packet_times.push_back( - std::make_pair(seq_num, creation_time_ + last_timestamp_)); + ack_frame->received_packet_times.emplace_back( + seq_num, creation_time_ + last_timestamp_); for (uint8_t i = 1; i < num_received_packets; ++i) { if (!reader->ReadUInt8(&delta_from_largest_observed)) { @@ -1614,8 +1614,8 @@ last_timestamp_ = last_timestamp_ + QuicTime::Delta::FromMicroseconds( incremental_time_delta_us); - ack_frame->received_packet_times.push_back( - std::make_pair(seq_num, creation_time_ + last_timestamp_)); + ack_frame->received_packet_times.emplace_back( + seq_num, creation_time_ + last_timestamp_); } } return true; @@ -2976,4 +2976,76 @@ return true; } +// IETF-format Padding frames. +// Padding is just N bytes of 0x00. There is no varint62/etc +// encoding required. +bool QuicFramer::AppendIetfPaddingFrame(const QuicPaddingFrame& frame, + QuicDataWriter* writer) { + DCHECK_GT(version_.transport_version, QUIC_VERSION_37); + // The base AppendPaddingFrame assumes that the type byte has + // been written. It will actually write num_padding_bytes-1 + // bytes. This takes care of that issue. + if (!writer->WriteUInt8(0)) { + set_detailed_error("Can not write close frame type byte"); + return false; + } + return AppendPaddingFrame(frame, writer); +} +// Read the padding. Has to do it one byte at a time, stopping +// when we either A) reach the end of the buffer or B) reach a +// non-0x00 byte. +void QuicFramer::ProcessIetfPaddingFrame(QuicDataReader* reader, + QuicPaddingFrame* frame) { + DCHECK_GT(version_.transport_version, QUIC_VERSION_37); + ProcessPaddingFrame(reader, frame); +} + +// IETF Quic Path Challenge/Response frames. +bool QuicFramer::ProcessIetfPathChallengeFrame(QuicDataReader* reader, + QuicPathChallengeFrame* frame) { + if (!reader->ReadBytes(frame->data_buffer.data(), kQuicPathFrameBufferSize)) { + set_detailed_error("Can not read path Challenge data"); + return false; + } + return true; +} +bool QuicFramer::ProcessIetfPathResponseFrame(QuicDataReader* reader, + QuicPathResponseFrame* frame) { + if (!reader->ReadBytes(frame->data_buffer.data(), kQuicPathFrameBufferSize)) { + set_detailed_error("Can not read path Response data"); + return false; + } + return true; +} + +bool QuicFramer::AppendIetfPathChallengeFrameAndTypeByte( + const QuicPathChallengeFrame& frame, + QuicDataWriter* writer) { + if (!writer->WriteUInt8(IETF_PATH_CHALLENGE)) { + set_detailed_error("Can not write Path Challenge frame type byte"); + return false; + } + + if (!writer->WriteBytes(frame.data_buffer.data(), kQuicPathFrameBufferSize)) { + set_detailed_error("Writing Path Challenge data failed."); + return false; + } + return true; +} + +bool QuicFramer::AppendIetfPathResponseFrameAndTypeByte( + const QuicPathResponseFrame& frame, + QuicDataWriter* writer) { + if (!writer->WriteUInt8(IETF_PATH_RESPONSE)) { + set_detailed_error("Can not write Path Response frame type byte"); + return false; + } + + if (!writer->WriteBytes(frame.data_buffer.data(), kQuicPathFrameBufferSize)) { + set_detailed_error("Writing Path Response data failed."); + return false; + } + return true; +} + } // namespace net
diff --git a/net/quic/core/quic_framer.h b/net/quic/core/quic_framer.h index 1e30193..56651db 100644 --- a/net/quic/core/quic_framer.h +++ b/net/quic/core/quic_framer.h
@@ -556,6 +556,24 @@ bool AppendIetfAckFrameAndTypeByte(const QuicAckFrame& frame, QuicDataWriter* writer); + // Add/remove IETF-Format padding. + bool AppendIetfPaddingFrame(const QuicPaddingFrame& frame, + QuicDataWriter* writer); + void ProcessIetfPaddingFrame(QuicDataReader* reader, QuicPaddingFrame* frame); + + // Quic IETF PATH Challenge/Response frames. + bool ProcessIetfPathChallengeFrame(QuicDataReader* reader, + QuicPathChallengeFrame* frame); + bool ProcessIetfPathResponseFrame(QuicDataReader* reader, + QuicPathResponseFrame* frame); + + bool AppendIetfPathChallengeFrameAndTypeByte( + const QuicPathChallengeFrame& frame, + QuicDataWriter* writer); + bool AppendIetfPathResponseFrameAndTypeByte( + const QuicPathResponseFrame& frame, + QuicDataWriter* writer); + bool RaiseError(QuicErrorCode error); void set_error(QuicErrorCode error) { error_ = error; }
diff --git a/net/quic/core/quic_framer_test.cc b/net/quic/core/quic_framer_test.cc index 9fa263f..667f591 100644 --- a/net/quic/core/quic_framer_test.cc +++ b/net/quic/core/quic_framer_test.cc
@@ -482,7 +482,6 @@ return BuildUnsizedDataPacket(&framer_, header, frames, packet_size); } - QuicFlagSaver flags_; test::TestEncrypter* encrypter_; test::TestDecrypter* decrypter_; ParsedQuicVersion version_;
diff --git a/net/quic/core/quic_ietf_framer_test.cc b/net/quic/core/quic_ietf_framer_test.cc index 5373d6f..42d84f8 100644 --- a/net/quic/core/quic_ietf_framer_test.cc +++ b/net/quic/core/quic_ietf_framer_test.cc
@@ -101,7 +101,7 @@ &framer_, source_stream_frame, last_frame_bit, &writer)); // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -157,7 +157,6 @@ QuicAckFrame transmit_frame = InitAckFrame(frame->ranges); transmit_frame.ack_delay_time = QuicTime::Delta::FromMicroseconds(frame->delay_time); - QUIC_LOG(INFO) << "XXXXXXXXXX transmit frame is " << transmit_frame; // write the frame to the packet buffer. EXPECT_TRUE(QuicFramerPeer::AppendIetfAckFrameAndTypeByte( @@ -165,7 +164,7 @@ // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -179,7 +178,7 @@ EXPECT_TRUE(QuicFramerPeer::ProcessIetfAckFrame( &framer_, &reader, received_frame_type, &receive_frame)); - // Now check that things are correct + // Now check that the received frame matches the sent frame. EXPECT_EQ(transmit_frame.largest_acked, receive_frame.largest_acked); // The ~0x7 needs some explaining. The ack frame format down shifts the // delay time by 3 (divide by 8) to allow for greater ranges in delay time. @@ -205,6 +204,82 @@ return true; } + // encode, decode, and check a Path Challenge frame. + bool TryPathChallengeFrame(char* packet_buffer, + size_t packet_buffer_size, + const QuicPathFrameBuffer& data) { + // Make a writer so that the serialized packet is placed in + // packet_buffer. + QuicDataWriter writer(packet_buffer_size, packet_buffer, + NETWORK_BYTE_ORDER); + + QuicPathChallengeFrame transmit_frame(0, data); + + // write the frame to the packet buffer. + EXPECT_TRUE(QuicFramerPeer::AppendIetfPathChallengeFrameAndTypeByte( + &framer_, transmit_frame, &writer)); + + // Check for correct length in the packet buffer. + EXPECT_EQ(kQuicPathChallengeFrameSize, writer.length()); + + // now set up a reader to read in the frame. + QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); + + // read in the frame type + uint8_t received_frame_type; + EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); + EXPECT_EQ(received_frame_type, IETF_PATH_CHALLENGE); + + QuicPathChallengeFrame receive_frame; + + EXPECT_TRUE(QuicFramerPeer::ProcessIetfPathChallengeFrame(&framer_, &reader, + &receive_frame)); + + // Now check that the received frame matches the sent frame. + EXPECT_EQ( + 0, memcmp(transmit_frame.data_buffer.data(), + receive_frame.data_buffer.data(), kQuicPathFrameBufferSize)); + return true; + } + + // encode, decode, and check a Path Response frame. + bool TryPathResponseFrame(char* packet_buffer, + size_t packet_buffer_size, + const QuicPathFrameBuffer& data) { + // Make a writer so that the serialized packet is placed in + // packet_buffer. + QuicDataWriter writer(packet_buffer_size, packet_buffer, + NETWORK_BYTE_ORDER); + + QuicPathResponseFrame transmit_frame(0, data); + + // Write the frame to the packet buffer. + EXPECT_TRUE(QuicFramerPeer::AppendIetfPathResponseFrameAndTypeByte( + &framer_, transmit_frame, &writer)); + + // Check for correct length in the packet buffer. + EXPECT_EQ(kQuicPathResponseFrameSize, writer.length()); + + // Set up a reader to read in the frame. + QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); + + // Read in the frame type + uint8_t received_frame_type; + EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); + EXPECT_EQ(received_frame_type, IETF_PATH_RESPONSE); + + QuicPathResponseFrame receive_frame; + + EXPECT_TRUE(QuicFramerPeer::ProcessIetfPathResponseFrame(&framer_, &reader, + &receive_frame)); + + // Now check that the received frame matches the sent frame. + EXPECT_EQ( + 0, memcmp(transmit_frame.data_buffer.data(), + receive_frame.data_buffer.data(), kQuicPathFrameBufferSize)); + return true; + } + QuicTime start_; QuicFramer framer_; }; @@ -393,7 +468,7 @@ // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -434,7 +509,7 @@ // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -476,7 +551,7 @@ // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -513,7 +588,7 @@ // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -551,7 +626,7 @@ // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -592,7 +667,7 @@ // better have something in the packet buffer. EXPECT_NE(0u, writer.length()); - // now set up a reader to read in the thing in. + // now set up a reader to read in the frame. QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); // read in the frame type @@ -627,12 +702,156 @@ TEST_F(QuicIetfFramerTest, AckFrame) { char packet_buffer[kNormalPacketBufferSize]; for (auto ack_frame_variant : ack_frame_variants) { - QUIC_LOG(INFO) << "Doing an ack, delay = " << ack_frame_variant.delay_time; EXPECT_TRUE( TryAckFrame(packet_buffer, sizeof(packet_buffer), &ack_frame_variant)); } } +TEST_F(QuicIetfFramerTest, PaddingEntirePacket) { + char packet_buffer[kNormalPacketBufferSize]; + + // ensure that buffer is not all 0 prior to the test. + memset(packet_buffer, 0xff, sizeof(packet_buffer)); + + // Set up the writer and transmit QuicPaddingFrame + QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, + NETWORK_BYTE_ORDER); + QuicPaddingFrame transmit_frame(sizeof(packet_buffer)); + + // Fill buffer with padding. + EXPECT_TRUE(QuicFramerPeer::AppendIetfPaddingFrame(&framer_, transmit_frame, + &writer)); + + // better have written to the entire packet buffer. + EXPECT_EQ(kNormalPacketBufferSize, writer.length()); + + // see if entire buffer is 0 + for (auto i = 0; i != sizeof(packet_buffer); i++) { + EXPECT_EQ(0, packet_buffer[i]) + << "Packet_buffer[" << i << "] is " << packet_buffer[i] << " not 0x00"; + } + + // set up reader and empty receive QuicPaddingFrame. + QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); + QuicPaddingFrame receive_frame; + + // read in the frame type + uint8_t received_frame_type; + EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); + EXPECT_EQ(received_frame_type, 0u); + + // deframe it + QuicFramerPeer::ProcessIetfPaddingFrame(&framer_, &reader, &receive_frame); + + // Now check that received == sent + EXPECT_EQ(transmit_frame.num_padding_bytes, receive_frame.num_padding_bytes); + int packet_buffer_size = static_cast<int>(sizeof(packet_buffer)); + EXPECT_EQ(packet_buffer_size, receive_frame.num_padding_bytes); + EXPECT_EQ(packet_buffer_size, transmit_frame.num_padding_bytes); +} + +// Place a padding frame between two non-padding frames: +// app_close +// padding +// connection_close +// we do a loop, with different amounts of padding in each. +TEST_F(QuicIetfFramerTest, PaddingSandwich) { + int pad_lengths[] = {1, 2, 5, 10, 20, 50, 100, 200, 500, 0}; + int* pad_length = pad_lengths; + while (*pad_length) { + char packet_buffer[kNormalPacketBufferSize]; + + // ensure that buffer is not all 0 prior to the test. + memset(packet_buffer, 0xff, sizeof(packet_buffer)); + + // Set up the writer and transmit Quic...Frames + QuicDataWriter writer(sizeof(packet_buffer), packet_buffer, + NETWORK_BYTE_ORDER); + QuicPaddingFrame transmit_pad_frame(*pad_length); + QuicString app_close_test_string = "Ich Bin Ein Jelly Donut?"; + QuicConnectionCloseFrame transmit_app_close_frame; + transmit_app_close_frame.error_code = static_cast<QuicErrorCode>(0); + transmit_app_close_frame.error_details = app_close_test_string; + + QuicString conn_close_test_string = "I am a Berliner?"; + QuicConnectionCloseFrame transmit_conn_close_frame; + transmit_conn_close_frame.error_code = static_cast<QuicErrorCode>(0); + transmit_conn_close_frame.error_details = conn_close_test_string; + + // Put in the frames. App close first. + EXPECT_TRUE(QuicFramerPeer::AppendIetfApplicationCloseFrame( + &framer_, transmit_app_close_frame, &writer)); + + size_t pre_padding_len = writer.length(); + // padding next. + EXPECT_TRUE(QuicFramerPeer::AppendIetfPaddingFrame( + &framer_, transmit_pad_frame, &writer)); + size_t post_padding_len = writer.length(); + EXPECT_EQ(static_cast<int>(post_padding_len - pre_padding_len), + *pad_length); + + // finally, connection close + EXPECT_TRUE(QuicFramerPeer::AppendIetfConnectionCloseFrame( + &framer_, transmit_conn_close_frame, &writer)); + + // see if buffer from offset pre_padding_len, for *pad_len, is 0 + for (auto i = pre_padding_len; i != pre_padding_len + (*pad_length); i++) { + EXPECT_EQ(0, packet_buffer[i]) << "Packet_buffer[" << i << "] is " + << packet_buffer[i] << " not 0x00"; + } + + // set up reader and empty receive QuicFrames. + QuicDataReader reader(packet_buffer, writer.length(), NETWORK_BYTE_ORDER); + QuicPaddingFrame receive_pad_frame; + QuicConnectionCloseFrame receive_app_close_frame; + QuicConnectionCloseFrame receive_conn_close_frame; + + // read in the frame type and data for the app-close frame + uint8_t received_frame_type; + EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); + EXPECT_EQ(received_frame_type, IETF_APPLICATION_CLOSE); + EXPECT_TRUE(QuicFramerPeer::ProcessIetfApplicationCloseFrame( + &framer_, &reader, received_frame_type, &receive_app_close_frame)); + + // Now the padding. + EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); + EXPECT_EQ(received_frame_type, IETF_PADDING); + QuicFramerPeer::ProcessIetfPaddingFrame(&framer_, &reader, + &receive_pad_frame); + // check that pad size is correct + EXPECT_EQ(receive_pad_frame.num_padding_bytes, *pad_length); + + // Now get the connection close frame. + EXPECT_TRUE(reader.ReadUInt8(&received_frame_type)); + EXPECT_EQ(received_frame_type, IETF_CONNECTION_CLOSE); + EXPECT_TRUE(QuicFramerPeer::ProcessIetfConnectionCloseFrame( + &framer_, &reader, received_frame_type, &receive_conn_close_frame)); + + pad_length++; + } +} + +TEST_F(QuicIetfFramerTest, PathChallengeFrame) { + QuicPathFrameBuffer buffer0 = {0, 0, 0, 0, 0, 0, 0, 0}; + QuicPathFrameBuffer buffer1 = {0x80, 0x91, 0xa2, 0xb3, + 0xc4, 0xd5, 0xe5, 0xf7}; + char packet_buffer[kNormalPacketBufferSize]; + EXPECT_TRUE( + TryPathChallengeFrame(packet_buffer, sizeof(packet_buffer), buffer0)); + EXPECT_TRUE( + TryPathChallengeFrame(packet_buffer, sizeof(packet_buffer), buffer1)); +} + +TEST_F(QuicIetfFramerTest, PathResponseFrame) { + QuicPathFrameBuffer buffer0 = {0, 0, 0, 0, 0, 0, 0, 0}; + QuicPathFrameBuffer buffer1 = {0x80, 0x91, 0xa2, 0xb3, + 0xc4, 0xd5, 0xe5, 0xf7}; + char packet_buffer[kNormalPacketBufferSize]; + EXPECT_TRUE( + TryPathResponseFrame(packet_buffer, sizeof(packet_buffer), buffer0)); + EXPECT_TRUE( + TryPathResponseFrame(packet_buffer, sizeof(packet_buffer), buffer1)); +} } // namespace } // namespace test } // namespace net
diff --git a/net/quic/core/quic_sent_packet_manager.cc b/net/quic/core/quic_sent_packet_manager.cc index 6d51479f3..e6eb9cd 100644 --- a/net/quic/core/quic_sent_packet_manager.cc +++ b/net/quic/core/quic_sent_packet_manager.cc
@@ -349,8 +349,8 @@ // If data is associated with the most recent transmission of this // packet, then inform the caller. if (it->in_flight) { - packets_acked_.push_back( - AckedPacket(packet_number, it->bytes_sent, QuicTime::Zero())); + packets_acked_.emplace_back(packet_number, it->bytes_sent, + QuicTime::Zero()); } else { // Unackable packets are skipped earlier. largest_newly_acked_ = packet_number;
diff --git a/net/quic/core/quic_sent_packet_manager.h b/net/quic/core/quic_sent_packet_manager.h index f401c52..4cf0f8a1 100644 --- a/net/quic/core/quic_sent_packet_manager.h +++ b/net/quic/core/quic_sent_packet_manager.h
@@ -251,6 +251,10 @@ void SetSessionNotifier(SessionNotifierInterface* session_notifier); + QuicPacketCount initial_congestion_window() const { + return initial_congestion_window_; + } + QuicPacketNumber largest_packet_peer_knows_is_acked() const { return largest_packet_peer_knows_is_acked_; }
diff --git a/net/quic/core/quic_session.cc b/net/quic/core/quic_session.cc index 7bc3d44..94b5d3d3 100644 --- a/net/quic/core/quic_session.cc +++ b/net/quic/core/quic_session.cc
@@ -17,6 +17,8 @@ #include "net/quic/platform/api/quic_str_cat.h" #include "net/quic/platform/api/quic_string.h" +using net::SpdyPriority; + namespace net { namespace { @@ -59,10 +61,15 @@ control_frame_manager_(this), can_use_slices_(GetQuicReloadableFlag(quic_use_mem_slices)), session_unblocks_stream_( - GetQuicReloadableFlag(quic_streams_unblocked_by_session2)) { + GetQuicReloadableFlag(quic_streams_unblocked_by_session2)), + register_streams_early_( + GetQuicReloadableFlag(quic_register_streams_early)) { if (use_control_frame_manager()) { QUIC_FLAG_COUNT(quic_reloadable_flag_quic_use_control_frame_manager); } + if (register_streams_early()) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_register_streams_early); + } } void QuicSession::Initialize() { @@ -299,19 +306,12 @@ // streams become pending, WillingAndAbleToWrite will be true, which will // cause the connection to request resumption before yielding to other // connections. - size_t num_writes = write_blocked_streams_.NumBlockedStreams(); - if (flow_controller_.IsBlocked()) { - // If we are connection level flow control blocked, then only allow the - // crypto and headers streams to try writing as all other streams will be - // blocked. - num_writes = 0; - if (write_blocked_streams_.crypto_stream_blocked()) { - num_writes += 1; - } - if (write_blocked_streams_.headers_stream_blocked()) { - num_writes += 1; - } - } + // If we are connection level flow control blocked, then only allow the + // crypto and headers streams to try writing as all other streams will be + // blocked. + size_t num_writes = flow_controller_.IsBlocked() + ? write_blocked_streams_.NumBlockedSpecialStreams() + : write_blocked_streams_.NumBlockedStreams(); if (num_writes == 0 && (!use_control_frame_manager() || !control_frame_manager_.WillingToWrite())) { return; @@ -323,7 +323,7 @@ control_frame_manager_.OnCanWrite(); } for (size_t i = 0; i < num_writes; ++i) { - if (!(write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || + if (!(write_blocked_streams_.HasWriteBlockedSpecialStream() || write_blocked_streams_.HasWriteBlockedDataStreams())) { // Writing one stream removed another!? Something's broken. QUIC_BUG << "WriteBlockedStream is missing"; @@ -364,7 +364,7 @@ return (use_control_frame_manager() && control_frame_manager_.WillingToWrite()) || !streams_with_pending_retransmission_.empty() || - write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || + write_blocked_streams_.HasWriteBlockedSpecialStream() || (!flow_controller_.IsBlocked() && write_blocked_streams_.HasWriteBlockedDataStreams()); } @@ -372,7 +372,7 @@ bool QuicSession::HasPendingHandshake() const { return QuicContainsKey(streams_with_pending_retransmission_, kCryptoStreamId) || - write_blocked_streams_.crypto_stream_blocked(); + write_blocked_streams_.IsStreamBlocked(kCryptoStreamId); } bool QuicSession::HasOpenDynamicStreams() const { @@ -752,6 +752,28 @@ void QuicSession::OnCryptoHandshakeMessageReceived( const CryptoHandshakeMessage& /*message*/) {} +void QuicSession::RegisterStreamPriority(QuicStreamId id, + SpdyPriority priority) { + // Static streams do not need to be registered with the write blocked list, + // since it has special handling for them. + if (!register_streams_early() || !QuicContainsKey(static_stream_map_, id)) { + write_blocked_streams()->RegisterStream(id, priority); + } +} + +void QuicSession::UnregisterStreamPriority(QuicStreamId id) { + // Static streams do not need to be registered with the write blocked list, + // since it has special handling for them. + if (!register_streams_early() || !QuicContainsKey(static_stream_map_, id)) { + write_blocked_streams()->UnregisterStream(id); + } +} + +void QuicSession::UpdateStreamPriority(QuicStreamId id, + SpdyPriority new_priority) { + write_blocked_streams()->UpdateStreamPriority(id, new_priority); +} + QuicConfig* QuicSession::config() { return &config_; } @@ -951,7 +973,7 @@ } bool QuicSession::HasDataToWrite() const { - return write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || + return write_blocked_streams_.HasWriteBlockedSpecialStream() || write_blocked_streams_.HasWriteBlockedDataStreams() || connection_->HasQueuedData() || !streams_with_pending_retransmission_.empty() ||
diff --git a/net/quic/core/quic_session.h b/net/quic/core/quic_session.h index a1db9b3..822fab6 100644 --- a/net/quic/core/quic_session.h +++ b/net/quic/core/quic_session.h
@@ -200,6 +200,15 @@ virtual void OnCryptoHandshakeMessageReceived( const CryptoHandshakeMessage& message); + // Called by the stream on creation to set priority in the write blocked list. + virtual void RegisterStreamPriority(QuicStreamId id, SpdyPriority priority); + // Called by the stream on deletion to clear priority crom the write blocked + // list. + virtual void UnregisterStreamPriority(QuicStreamId id); + // Called by the stream on SetPriority to update priority on the write blocked + // list. + virtual void UpdateStreamPriority(QuicStreamId id, SpdyPriority new_priority); + // Returns mutable config for this session. Returned config is owned // by QuicSession. QuicConfig* config(); @@ -304,6 +313,8 @@ bool session_unblocks_stream() const { return session_unblocks_stream_; } + bool register_streams_early() const { return register_streams_early_; } + bool use_control_frame_manager() const; bool session_decides_what_to_write() const; @@ -474,8 +485,12 @@ // May be null. Visitor* visitor_; - ClosedStreams closed_streams_; + // A list of streams which need to write more data. Stream register + // themselves in their constructor, and unregisterm themselves in their + // destructors, so the write blocked list must outlive all streams. + QuicWriteBlockedList write_blocked_streams_; + ClosedStreams closed_streams_; // Streams which are closed, but need to be kept alive. Currently, the only // reason is the stream's sent data (including FIN) does not get fully acked. ZombieStreamMap zombie_streams_; @@ -507,9 +522,6 @@ // been consumed. QuicUnorderedSet<QuicStreamId> draining_streams_; - // A list of streams which need to write more data. - QuicWriteBlockedList write_blocked_streams_; - QuicStreamId largest_peer_created_stream_id_; // A counter for peer initiated streams which are in the dynamic_stream_map_. @@ -552,6 +564,9 @@ // Latched value of quic_reloadable_flag_quic_streams_unblocked_by_session2. const bool session_unblocks_stream_; + // Latched value of quic_reloadable_flag_quic_register_streams_early. + const bool register_streams_early_; + DISALLOW_COPY_AND_ASSIGN(QuicSession); };
diff --git a/net/quic/core/quic_session_test.cc b/net/quic/core/quic_session_test.cc new file mode 100644 index 0000000..fc553c42 --- /dev/null +++ b/net/quic/core/quic_session_test.cc
@@ -0,0 +1,1496 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/quic/core/quic_session.h" + +#include <cstdint> +#include <set> +#include <utility> + +#include "base/callback.h" +#include "base/rand_util.h" +#include "build/build_config.h" +#include "net/quic/core/crypto/crypto_protocol.h" +#include "net/quic/core/crypto/null_encrypter.h" +#include "net/quic/core/quic_crypto_stream.h" +#include "net/quic/core/quic_data_writer.h" +#include "net/quic/core/quic_packets.h" +#include "net/quic/core/quic_stream.h" +#include "net/quic/core/quic_utils.h" +#include "net/quic/platform/api/quic_flags.h" +#include "net/quic/platform/api/quic_map_util.h" +#include "net/quic/platform/api/quic_ptr_util.h" +#include "net/quic/platform/api/quic_str_cat.h" +#include "net/quic/platform/api/quic_string.h" +#include "net/quic/platform/api/quic_string_piece.h" +#include "net/quic/platform/api/quic_test.h" +#include "net/quic/test_tools/quic_config_peer.h" +#include "net/quic/test_tools/quic_connection_peer.h" +#include "net/quic/test_tools/quic_flow_controller_peer.h" +#include "net/quic/test_tools/quic_session_peer.h" +#include "net/quic/test_tools/quic_stream_peer.h" +#include "net/quic/test_tools/quic_stream_send_buffer_peer.h" +#include "net/quic/test_tools/quic_test_utils.h" +#include "net/test/gtest_util.h" +#include "testing/gmock_mutant.h" + +using testing::_; +using testing::AtLeast; +using testing::InSequence; +using testing::Invoke; +using testing::Return; +using testing::StrictMock; +using net::kV3HighestPriority; +using net::SpdyPriority; + +namespace net { +namespace test { +namespace { + +class TestCryptoStream : public QuicCryptoStream, public QuicCryptoHandshaker { + public: + explicit TestCryptoStream(QuicSession* session) + : QuicCryptoStream(session), + QuicCryptoHandshaker(this, session), + encryption_established_(false), + handshake_confirmed_(false), + params_(new QuicCryptoNegotiatedParameters) {} + + void OnHandshakeMessage(const CryptoHandshakeMessage& /*message*/) override { + encryption_established_ = true; + handshake_confirmed_ = true; + CryptoHandshakeMessage msg; + QuicString error_details; + session()->config()->SetInitialStreamFlowControlWindowToSend( + kInitialStreamFlowControlWindowForTest); + session()->config()->SetInitialSessionFlowControlWindowToSend( + kInitialSessionFlowControlWindowForTest); + session()->config()->ToHandshakeMessage(&msg); + const QuicErrorCode error = + session()->config()->ProcessPeerHello(msg, CLIENT, &error_details); + EXPECT_EQ(QUIC_NO_ERROR, error); + session()->OnConfigNegotiated(); + session()->connection()->SetDefaultEncryptionLevel( + ENCRYPTION_FORWARD_SECURE); + session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED); + } + + // QuicCryptoStream implementation + bool encryption_established() const override { + return encryption_established_; + } + bool handshake_confirmed() const override { return handshake_confirmed_; } + const QuicCryptoNegotiatedParameters& crypto_negotiated_params() + const override { + return *params_; + } + CryptoMessageParser* crypto_message_parser() override { + return QuicCryptoHandshaker::crypto_message_parser(); + } + + MOCK_METHOD0(OnCanWrite, void()); + + MOCK_CONST_METHOD0(HasPendingRetransmission, bool()); + + private: + using QuicCryptoStream::session; + + bool encryption_established_; + bool handshake_confirmed_; + QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_; +}; + +class TestStream : public QuicStream { + public: + TestStream(QuicStreamId id, QuicSession* session) : QuicStream(id, session) { + if (!session->register_streams_early()) { + session->RegisterStreamPriority(id, QuicStream::kDefaultPriority); + } + } + + ~TestStream() override { + if (!session()->register_streams_early()) { + session()->UnregisterStreamPriority(id()); + } + } + + using QuicStream::CloseWriteSide; + + void OnDataAvailable() override {} + + MOCK_METHOD0(OnCanWrite, void()); + MOCK_METHOD3(RetransmitStreamData, + bool(QuicStreamOffset, QuicByteCount, bool)); + + MOCK_CONST_METHOD0(HasPendingRetransmission, bool()); +}; + +class TestSession : public QuicSession { + public: + explicit TestSession(QuicConnection* connection) + : QuicSession(connection, nullptr, DefaultQuicConfig()), + crypto_stream_(this), + writev_consumes_all_data_(false) { + Initialize(); + this->connection()->SetEncrypter( + ENCRYPTION_FORWARD_SECURE, + new NullEncrypter(connection->perspective())); + } + + ~TestSession() override { delete connection(); } + + TestCryptoStream* GetMutableCryptoStream() override { + return &crypto_stream_; + } + + const TestCryptoStream* GetCryptoStream() const override { + return &crypto_stream_; + } + + TestStream* CreateOutgoingDynamicStream() override { + TestStream* stream = new TestStream(GetNextOutgoingStreamId(), this); + ActivateStream(QuicWrapUnique(stream)); + return stream; + } + + TestStream* CreateIncomingDynamicStream(QuicStreamId id) override { + // Enforce the limit on the number of open streams. + if (GetNumOpenIncomingStreams() + 1 > max_open_incoming_streams()) { + connection()->CloseConnection( + QUIC_TOO_MANY_OPEN_STREAMS, "Too many streams!", + ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); + return nullptr; + } else { + TestStream* stream = new TestStream(id, this); + ActivateStream(QuicWrapUnique(stream)); + return stream; + } + } + + bool IsClosedStream(QuicStreamId id) { + return QuicSession::IsClosedStream(id); + } + + QuicStream* GetOrCreateDynamicStream(QuicStreamId stream_id) { + return QuicSession::GetOrCreateDynamicStream(stream_id); + } + + QuicConsumedData WritevData(QuicStream* stream, + QuicStreamId id, + size_t write_length, + QuicStreamOffset offset, + StreamSendingState state) override { + bool fin = state != NO_FIN; + QuicConsumedData consumed(write_length, fin); + if (!writev_consumes_all_data_) { + consumed = + QuicSession::WritevData(stream, id, write_length, offset, state); + } + if (fin && consumed.fin_consumed) { + stream->set_fin_sent(true); + } + QuicSessionPeer::GetWriteBlockedStreams(this)->UpdateBytesForStream( + id, consumed.bytes_consumed); + return consumed; + } + + void set_writev_consumes_all_data(bool val) { + writev_consumes_all_data_ = val; + } + + QuicConsumedData SendStreamData(QuicStream* stream) { + struct iovec iov; + if (stream->id() != kCryptoStreamId) { + this->connection()->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); + } + MakeIOVector("not empty", &iov); + QuicStreamPeer::SendBuffer(stream).SaveStreamData(&iov, 1, 0, 9); + QuicConsumedData consumed = WritevData(stream, stream->id(), 9, 0, FIN); + QuicStreamPeer::SendBuffer(stream).OnStreamDataConsumed( + consumed.bytes_consumed); + return consumed; + } + + bool ClearControlFrame(const QuicFrame& frame) { + DeleteFrame(&const_cast<QuicFrame&>(frame)); + return true; + } + + QuicConsumedData SendLargeFakeData(QuicStream* stream, int bytes) { + DCHECK(writev_consumes_all_data_); + return WritevData(stream, stream->id(), bytes, 0, FIN); + } + + using QuicSession::closed_streams; + using QuicSession::next_outgoing_stream_id; + using QuicSession::PostProcessAfterData; + using QuicSession::zombie_streams; + + private: + StrictMock<TestCryptoStream> crypto_stream_; + + bool writev_consumes_all_data_; +}; + +class QuicSessionTestBase : public QuicTestWithParam<ParsedQuicVersion> { + protected: + explicit QuicSessionTestBase(Perspective perspective) + : connection_( + new StrictMock<MockQuicConnection>(&helper_, + &alarm_factory_, + perspective, + SupportedVersions(GetParam()))), + session_(connection_) { + session_.config()->SetInitialStreamFlowControlWindowToSend( + kInitialStreamFlowControlWindowForTest); + session_.config()->SetInitialSessionFlowControlWindowToSend( + kInitialSessionFlowControlWindowForTest); + connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1)); + TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); + EXPECT_CALL(*crypto_stream, HasPendingRetransmission()) + .Times(testing::AnyNumber()); + } + + void CheckClosedStreams() { + for (QuicStreamId i = kCryptoStreamId; i < 100; i++) { + if (!QuicContainsKey(closed_streams_, i)) { + EXPECT_FALSE(session_.IsClosedStream(i)) << " stream id: " << i; + } else { + EXPECT_TRUE(session_.IsClosedStream(i)) << " stream id: " << i; + } + } + } + + void CloseStream(QuicStreamId id) { + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillOnce(Invoke(&session_, &TestSession::ClearControlFrame)); + EXPECT_CALL(*connection_, OnStreamReset(id, _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(id, _, _)); + } + session_.CloseStream(id); + closed_streams_.insert(id); + } + + QuicTransportVersion transport_version() const { + return connection_->transport_version(); + } + + QuicStreamId GetNthClientInitiatedId(int n) { return 3 + 2 * n; } + + QuicStreamId GetNthServerInitiatedId(int n) { return 2 + 2 * n; } + + MockQuicConnectionHelper helper_; + MockAlarmFactory alarm_factory_; + StrictMock<MockQuicConnection>* connection_; + TestSession session_; + std::set<QuicStreamId> closed_streams_; +}; + +class QuicSessionTestServer : public QuicSessionTestBase { + protected: + QuicSessionTestServer() : QuicSessionTestBase(Perspective::IS_SERVER) {} +}; + +INSTANTIATE_TEST_CASE_P(Tests, + QuicSessionTestServer, + ::testing::ValuesIn(AllSupportedVersions())); + +TEST_P(QuicSessionTestServer, PeerAddress) { + EXPECT_EQ(QuicSocketAddress(QuicIpAddress::Loopback4(), kTestPort), + session_.peer_address()); +} + +TEST_P(QuicSessionTestServer, SelfAddress) { + EXPECT_EQ(QuicSocketAddress(), session_.self_address()); +} + +TEST_P(QuicSessionTestServer, IsCryptoHandshakeConfirmed) { + EXPECT_FALSE(session_.IsCryptoHandshakeConfirmed()); + CryptoHandshakeMessage message; + session_.GetMutableCryptoStream()->OnHandshakeMessage(message); + EXPECT_TRUE(session_.IsCryptoHandshakeConfirmed()); +} + +TEST_P(QuicSessionTestServer, IsClosedStreamDefault) { + // Ensure that no streams are initially closed. + for (QuicStreamId i = kCryptoStreamId; i < 100; i++) { + EXPECT_FALSE(session_.IsClosedStream(i)) << "stream id: " << i; + } +} + +TEST_P(QuicSessionTestServer, AvailableStreams) { + ASSERT_TRUE(session_.GetOrCreateDynamicStream(9) != nullptr); + // Both 5 and 7 should be available. + EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 5)); + EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 7)); + ASSERT_TRUE(session_.GetOrCreateDynamicStream(7) != nullptr); + ASSERT_TRUE(session_.GetOrCreateDynamicStream(5) != nullptr); +} + +TEST_P(QuicSessionTestServer, IsClosedStreamLocallyCreated) { + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + EXPECT_EQ(GetNthServerInitiatedId(0), stream2->id()); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + EXPECT_EQ(GetNthServerInitiatedId(1), stream4->id()); + + CheckClosedStreams(); + CloseStream(GetNthServerInitiatedId(0)); + CheckClosedStreams(); + CloseStream(GetNthServerInitiatedId(1)); + CheckClosedStreams(); +} + +TEST_P(QuicSessionTestServer, IsClosedStreamPeerCreated) { + QuicStreamId stream_id1 = GetNthClientInitiatedId(0); + QuicStreamId stream_id2 = GetNthClientInitiatedId(1); + session_.GetOrCreateDynamicStream(stream_id1); + session_.GetOrCreateDynamicStream(stream_id2); + + CheckClosedStreams(); + CloseStream(stream_id1); + CheckClosedStreams(); + CloseStream(stream_id2); + // Create a stream, and make another available. + QuicStream* stream3 = session_.GetOrCreateDynamicStream(stream_id2 + 4); + CheckClosedStreams(); + // Close one, but make sure the other is still not closed + CloseStream(stream3->id()); + CheckClosedStreams(); +} + +TEST_P(QuicSessionTestServer, MaximumAvailableOpenedStreams) { + QuicStreamId stream_id = GetNthClientInitiatedId(0); + session_.GetOrCreateDynamicStream(stream_id); + EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0); + EXPECT_NE(nullptr, + session_.GetOrCreateDynamicStream( + stream_id + 2 * (session_.max_open_incoming_streams() - 1))); +} + +TEST_P(QuicSessionTestServer, TooManyAvailableStreams) { + QuicStreamId stream_id1 = GetNthClientInitiatedId(0); + QuicStreamId stream_id2; + EXPECT_NE(nullptr, session_.GetOrCreateDynamicStream(stream_id1)); + // A stream ID which is too large to create. + stream_id2 = GetNthClientInitiatedId(2 * session_.MaxAvailableStreams() + 4); + EXPECT_CALL(*connection_, + CloseConnection(QUIC_TOO_MANY_AVAILABLE_STREAMS, _, _)); + EXPECT_EQ(nullptr, session_.GetOrCreateDynamicStream(stream_id2)); +} + +TEST_P(QuicSessionTestServer, ManyAvailableStreams) { + // When max_open_streams_ is 200, should be able to create 200 streams + // out-of-order, that is, creating the one with the largest stream ID first. + QuicSessionPeer::SetMaxOpenIncomingStreams(&session_, 200); + QuicStreamId stream_id = GetNthClientInitiatedId(0); + // Create one stream. + session_.GetOrCreateDynamicStream(stream_id); + EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0); + // Create the largest stream ID of a threatened total of 200 streams. + session_.GetOrCreateDynamicStream(stream_id + 2 * (200 - 1)); +} + +TEST_P(QuicSessionTestServer, DebugDFatalIfMarkingClosedStreamWriteBlocked) { + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + QuicStreamId closed_stream_id = stream2->id(); + // Close the stream. + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(closed_stream_id, _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(closed_stream_id, _, _)); + } + stream2->Reset(QUIC_BAD_APPLICATION_PAYLOAD); + QuicString msg = + QuicStrCat("Marking unknown stream ", closed_stream_id, " blocked."); + EXPECT_QUIC_BUG(session_.MarkConnectionLevelWriteBlocked(closed_stream_id), + msg); +} + +TEST_P(QuicSessionTestServer, OnCanWrite) { + session_.set_writev_consumes_all_data(true); + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + TestStream* stream6 = session_.CreateOutgoingDynamicStream(); + + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + session_.MarkConnectionLevelWriteBlocked(stream6->id()); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + + InSequence s; + + // Reregister, to test the loop limit. + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendStreamData(stream2); + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + })); + // 2 will get called a second time as it didn't finish its block + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendStreamData(stream2); + })); + EXPECT_CALL(*stream6, OnCanWrite()).WillOnce(Invoke([this, stream6]() { + session_.SendStreamData(stream6); + })); + // 4 will not get called, as we exceeded the loop limit. + session_.OnCanWrite(); + EXPECT_TRUE(session_.WillingAndAbleToWrite()); +} + +TEST_P(QuicSessionTestServer, TestBatchedWrites) { + session_.set_writev_consumes_all_data(true); + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + TestStream* stream6 = session_.CreateOutgoingDynamicStream(); + + session_.set_writev_consumes_all_data(true); + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + + // With two sessions blocked, we should get two write calls. They should both + // go to the first stream as it will only write 6k and mark itself blocked + // again. + InSequence s; + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendLargeFakeData(stream2, 6000); + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + })); + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendLargeFakeData(stream2, 6000); + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + })); + session_.OnCanWrite(); + + // We should get one more call for stream2, at which point it has used its + // write quota and we move over to stream 4. + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendLargeFakeData(stream2, 6000); + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + })); + EXPECT_CALL(*stream4, OnCanWrite()).WillOnce(Invoke([this, stream4]() { + session_.SendLargeFakeData(stream4, 6000); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + })); + session_.OnCanWrite(); + + // Now let stream 4 do the 2nd of its 3 writes, but add a block for a high + // priority stream 6. 4 should be preempted. 6 will write but *not* block so + // will cede back to 4. + stream6->SetPriority(kV3HighestPriority); + EXPECT_CALL(*stream4, OnCanWrite()) + .WillOnce(Invoke([this, stream4, stream6]() { + session_.SendLargeFakeData(stream4, 6000); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + session_.MarkConnectionLevelWriteBlocked(stream6->id()); + })); + EXPECT_CALL(*stream6, OnCanWrite()) + .WillOnce(Invoke([this, stream4, stream6]() { + session_.SendStreamData(stream6); + session_.SendLargeFakeData(stream4, 6000); + })); + session_.OnCanWrite(); + + // Stream4 alread did 6k worth of writes, so after doing another 12k it should + // cede and 2 should resume. + EXPECT_CALL(*stream4, OnCanWrite()).WillOnce(Invoke([this, stream4]() { + session_.SendLargeFakeData(stream4, 12000); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + })); + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendLargeFakeData(stream2, 6000); + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + })); + session_.OnCanWrite(); +} + +TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) { + // Encryption needs to be established before data can be sent. + CryptoHandshakeMessage msg; + MockPacketWriter* writer = static_cast<MockPacketWriter*>( + QuicConnectionPeer::GetWriter(session_.connection())); + session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); + + // Drive congestion control manually. + MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; + QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); + + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + TestStream* stream6 = session_.CreateOutgoingDynamicStream(); + + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + session_.MarkConnectionLevelWriteBlocked(stream6->id()); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + + EXPECT_CALL(*send_algorithm, CanSend(_)).WillRepeatedly(Return(true)); + EXPECT_CALL(*send_algorithm, GetCongestionWindow()) + .WillRepeatedly(Return(kMaxPacketSize * 10)); + EXPECT_CALL(*send_algorithm, InRecovery()).WillRepeatedly(Return(false)); + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendStreamData(stream2); + })); + EXPECT_CALL(*stream4, OnCanWrite()).WillOnce(Invoke([this, stream4]() { + session_.SendStreamData(stream4); + })); + EXPECT_CALL(*stream6, OnCanWrite()).WillOnce(Invoke([this, stream6]() { + session_.SendStreamData(stream6); + })); + + // Expect that we only send one packet, the writes from different streams + // should be bundled together. + EXPECT_CALL(*writer, WritePacket(_, _, _, _, _)) + .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0))); + EXPECT_CALL(*send_algorithm, OnPacketSent(_, _, _, _, _)); + EXPECT_CALL(*send_algorithm, OnApplicationLimited(_)); + session_.OnCanWrite(); + EXPECT_FALSE(session_.WillingAndAbleToWrite()); +} + +TEST_P(QuicSessionTestServer, OnCanWriteCongestionControlBlocks) { + session_.set_writev_consumes_all_data(true); + InSequence s; + + // Drive congestion control manually. + MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; + QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); + + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + TestStream* stream6 = session_.CreateOutgoingDynamicStream(); + + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + session_.MarkConnectionLevelWriteBlocked(stream6->id()); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(true)); + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendStreamData(stream2); + })); + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(true)); + EXPECT_CALL(*stream6, OnCanWrite()).WillOnce(Invoke([this, stream6]() { + session_.SendStreamData(stream6); + })); + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(false)); + // stream4->OnCanWrite is not called. + + session_.OnCanWrite(); + EXPECT_TRUE(session_.WillingAndAbleToWrite()); + + // Still congestion-control blocked. + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(false)); + session_.OnCanWrite(); + EXPECT_TRUE(session_.WillingAndAbleToWrite()); + + // stream4->OnCanWrite is called once the connection stops being + // congestion-control blocked. + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(true)); + EXPECT_CALL(*stream4, OnCanWrite()).WillOnce(Invoke([this, stream4]() { + session_.SendStreamData(stream4); + })); + EXPECT_CALL(*send_algorithm, OnApplicationLimited(_)); + session_.OnCanWrite(); + EXPECT_FALSE(session_.WillingAndAbleToWrite()); +} + +TEST_P(QuicSessionTestServer, OnCanWriteWriterBlocks) { + // Drive congestion control manually in order to ensure that + // application-limited signaling is handled correctly. + MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; + QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); + EXPECT_CALL(*send_algorithm, CanSend(_)).WillRepeatedly(Return(true)); + + // Drive packet writer manually. + MockPacketWriter* writer = static_cast<MockPacketWriter*>( + QuicConnectionPeer::GetWriter(session_.connection())); + EXPECT_CALL(*writer, IsWriteBlocked()).WillRepeatedly(Return(true)); + EXPECT_CALL(*writer, IsWriteBlockedDataBuffered()) + .WillRepeatedly(Return(true)); + EXPECT_CALL(*writer, WritePacket(_, _, _, _, _)).Times(0); + + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + + EXPECT_CALL(*stream2, OnCanWrite()).Times(0); + EXPECT_CALL(*send_algorithm, OnApplicationLimited(_)).Times(0); + + session_.OnCanWrite(); + EXPECT_TRUE(session_.WillingAndAbleToWrite()); +} + +TEST_P(QuicSessionTestServer, BufferedHandshake) { + session_.set_writev_consumes_all_data(true); + EXPECT_FALSE(session_.HasPendingHandshake()); // Default value. + + // Test that blocking other streams does not change our status. + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + EXPECT_FALSE(session_.HasPendingHandshake()); + + TestStream* stream3 = session_.CreateOutgoingDynamicStream(); + session_.MarkConnectionLevelWriteBlocked(stream3->id()); + EXPECT_FALSE(session_.HasPendingHandshake()); + + // Blocking (due to buffering of) the Crypto stream is detected. + session_.MarkConnectionLevelWriteBlocked(kCryptoStreamId); + EXPECT_TRUE(session_.HasPendingHandshake()); + + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + EXPECT_TRUE(session_.HasPendingHandshake()); + + InSequence s; + // Force most streams to re-register, which is common scenario when we block + // the Crypto stream, and only the crypto stream can "really" write. + + // Due to prioritization, we *should* be asked to write the crypto stream + // first. + // Don't re-register the crypto stream (which signals complete writing). + TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); + EXPECT_CALL(*crypto_stream, OnCanWrite()); + + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendStreamData(stream2); + })); + EXPECT_CALL(*stream3, OnCanWrite()).WillOnce(Invoke([this, stream3]() { + session_.SendStreamData(stream3); + })); + EXPECT_CALL(*stream4, OnCanWrite()).WillOnce(Invoke([this, stream4]() { + session_.SendStreamData(stream4); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + })); + + session_.OnCanWrite(); + EXPECT_TRUE(session_.WillingAndAbleToWrite()); + EXPECT_FALSE(session_.HasPendingHandshake()); // Crypto stream wrote. +} + +TEST_P(QuicSessionTestServer, OnCanWriteWithClosedStream) { + session_.set_writev_consumes_all_data(true); + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + TestStream* stream6 = session_.CreateOutgoingDynamicStream(); + + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + session_.MarkConnectionLevelWriteBlocked(stream6->id()); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + CloseStream(stream6->id()); + + InSequence s; + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillRepeatedly(Invoke(&session_, &TestSession::ClearControlFrame)); + } + EXPECT_CALL(*stream2, OnCanWrite()).WillOnce(Invoke([this, stream2]() { + session_.SendStreamData(stream2); + })); + EXPECT_CALL(*stream4, OnCanWrite()).WillOnce(Invoke([this, stream4]() { + session_.SendStreamData(stream4); + })); + session_.OnCanWrite(); + EXPECT_FALSE(session_.WillingAndAbleToWrite()); +} + +TEST_P(QuicSessionTestServer, OnCanWriteLimitsNumWritesIfFlowControlBlocked) { + // Drive congestion control manually in order to ensure that + // application-limited signaling is handled correctly. + MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; + QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); + EXPECT_CALL(*send_algorithm, CanSend(_)).WillRepeatedly(Return(true)); + + // Ensure connection level flow control blockage. + QuicFlowControllerPeer::SetSendWindowOffset(session_.flow_controller(), 0); + EXPECT_TRUE(session_.flow_controller()->IsBlocked()); + EXPECT_TRUE(session_.IsConnectionFlowControlBlocked()); + EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); + + // Mark the crypto and headers streams as write blocked, we expect them to be + // allowed to write later. + session_.MarkConnectionLevelWriteBlocked(kCryptoStreamId); + + // Create a data stream, and although it is write blocked we never expect it + // to be allowed to write as we are connection level flow control blocked. + TestStream* stream = session_.CreateOutgoingDynamicStream(); + session_.MarkConnectionLevelWriteBlocked(stream->id()); + EXPECT_CALL(*stream, OnCanWrite()).Times(0); + + // The crypto and headers streams should be called even though we are + // connection flow control blocked. + TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); + EXPECT_CALL(*crypto_stream, OnCanWrite()); + + // After the crypto and header streams perform a write, the connection will be + // blocked by the flow control, hence it should become application-limited. + EXPECT_CALL(*send_algorithm, OnApplicationLimited(_)); + + session_.OnCanWrite(); + EXPECT_FALSE(session_.WillingAndAbleToWrite()); +} + +TEST_P(QuicSessionTestServer, SendGoAway) { + MockPacketWriter* writer = static_cast<MockPacketWriter*>( + QuicConnectionPeer::GetWriter(session_.connection())); + EXPECT_CALL(*writer, WritePacket(_, _, _, _, _)) + .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0))); + + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillOnce( + Invoke(connection_, &MockQuicConnection::ReallySendControlFrame)); + } else { + EXPECT_CALL(*connection_, SendGoAway(_, _, _)) + .WillOnce(Invoke(connection_, &MockQuicConnection::ReallySendGoAway)); + } + session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); + EXPECT_TRUE(session_.goaway_sent()); + + const QuicStreamId kTestStreamId = 5u; + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)).Times(0); + EXPECT_CALL(*connection_, + OnStreamReset(kTestStreamId, QUIC_STREAM_PEER_GOING_AWAY)) + .Times(0); + } else { + EXPECT_CALL(*connection_, + SendRstStream(kTestStreamId, QUIC_STREAM_PEER_GOING_AWAY, 0)) + .Times(0); + } + EXPECT_TRUE(session_.GetOrCreateDynamicStream(kTestStreamId)); +} + +TEST_P(QuicSessionTestServer, DoNotSendGoAwayTwice) { + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillOnce(Invoke(&session_, &TestSession::ClearControlFrame)); + } else { + EXPECT_CALL(*connection_, SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, + "Going Away.")) + .Times(1); + } + session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); + EXPECT_TRUE(session_.goaway_sent()); + session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); +} + +TEST_P(QuicSessionTestServer, InvalidGoAway) { + QuicGoAwayFrame go_away(kInvalidControlFrameId, QUIC_PEER_GOING_AWAY, + session_.next_outgoing_stream_id(), ""); + session_.OnGoAway(go_away); +} + +// Test that server session will send a connectivity probe in response to a +// connectivity probe on the same path. +TEST_P(QuicSessionTestServer, ServerReplyToConnecitivityProbe) { + QuicSocketAddress old_peer_address = + QuicSocketAddress(QuicIpAddress::Loopback4(), kTestPort); + EXPECT_EQ(old_peer_address, session_.peer_address()); + + QuicSocketAddress new_peer_address = + QuicSocketAddress(QuicIpAddress::Loopback4(), kTestPort + 1); + + MockPacketWriter* writer = static_cast<MockPacketWriter*>( + QuicConnectionPeer::GetWriter(session_.connection())); + EXPECT_CALL(*writer, WritePacket(_, _, _, new_peer_address, _)) + .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0))); + EXPECT_CALL(*connection_, + SendConnectivityProbingPacket(nullptr, new_peer_address)) + .WillOnce( + Invoke(connection_, + &MockQuicConnection::ReallySendConnectivityProbingPacket)); + session_.OnConnectivityProbeReceived(session_.self_address(), + new_peer_address); + EXPECT_EQ(old_peer_address, session_.peer_address()); +} + +TEST_P(QuicSessionTestServer, IncreasedTimeoutAfterCryptoHandshake) { + EXPECT_EQ(kInitialIdleTimeoutSecs + 3, + QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); + CryptoHandshakeMessage msg; + session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); + EXPECT_EQ(kMaximumIdleTimeoutSecs + 3, + QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); +} + +TEST_P(QuicSessionTestServer, OnStreamFrameFinStaticStreamId) { + // Send two bytes of payload. + QuicStreamFrame data1(kCryptoStreamId, true, 0, QuicStringPiece("HT")); + EXPECT_CALL(*connection_, + CloseConnection( + QUIC_INVALID_STREAM_ID, "Attempt to close a static stream", + ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET)); + session_.OnStreamFrame(data1); +} + +TEST_P(QuicSessionTestServer, OnRstStreamStaticStreamId) { + // Send two bytes of payload. + QuicRstStreamFrame rst1(kInvalidControlFrameId, kCryptoStreamId, + QUIC_ERROR_PROCESSING_STREAM, 0); + EXPECT_CALL(*connection_, + CloseConnection( + QUIC_INVALID_STREAM_ID, "Attempt to reset a static stream", + ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET)); + session_.OnRstStream(rst1); +} + +TEST_P(QuicSessionTestServer, OnStreamFrameInvalidStreamId) { + // Send two bytes of payload. + QuicStreamFrame data1(kInvalidStreamId, true, 0, QuicStringPiece("HT")); + EXPECT_CALL(*connection_, + CloseConnection( + QUIC_INVALID_STREAM_ID, "Recevied data for an invalid stream", + ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET)); + session_.OnStreamFrame(data1); +} + +TEST_P(QuicSessionTestServer, OnRstStreamInvalidStreamId) { + // Send two bytes of payload. + QuicRstStreamFrame rst1(kInvalidControlFrameId, kInvalidStreamId, + QUIC_ERROR_PROCESSING_STREAM, 0); + EXPECT_CALL(*connection_, + CloseConnection( + QUIC_INVALID_STREAM_ID, "Recevied data for an invalid stream", + ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET)); + session_.OnRstStream(rst1); +} + +TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedStream) { + // Test that if a stream is flow control blocked, then on receipt of the SHLO + // containing a suitable send window offset, the stream becomes unblocked. + + // Ensure that Writev consumes all the data it is given (simulate no socket + // blocking). + session_.set_writev_consumes_all_data(true); + + // Create a stream, and send enough data to make it flow control blocked. + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + QuicString body(kMinimumFlowControlSendWindow, '.'); + EXPECT_FALSE(stream2->flow_controller()->IsBlocked()); + EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); + EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)).Times(AtLeast(1)); + } else { + EXPECT_CALL(*connection_, SendBlocked(_)).Times(AtLeast(1)); + EXPECT_CALL(*connection_, SendBlocked(0)); + } + stream2->WriteOrBufferData(body, false, nullptr); + EXPECT_TRUE(stream2->flow_controller()->IsBlocked()); + EXPECT_TRUE(session_.IsConnectionFlowControlBlocked()); + EXPECT_TRUE(session_.IsStreamFlowControlBlocked()); + + if (!session_.session_unblocks_stream()) { + // The handshake message will call OnCanWrite, so the stream can resume + // writing. + EXPECT_CALL(*stream2, OnCanWrite()); + } + // Now complete the crypto handshake, resulting in an increased flow control + // send window. + CryptoHandshakeMessage msg; + session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); + if (session_.session_unblocks_stream()) { + EXPECT_TRUE( + QuicSessionPeer::IsStreamWriteBlocked(&session_, stream2->id())); + } else { + EXPECT_FALSE( + QuicSessionPeer::IsStreamWriteBlocked(&session_, stream2->id())); + } + // Stream is now unblocked. + EXPECT_FALSE(stream2->flow_controller()->IsBlocked()); + EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); + EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); +} + +TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) { + // Test that if the crypto stream is flow control blocked, then if the SHLO + // contains a larger send window offset, the stream becomes unblocked. + session_.set_writev_consumes_all_data(true); + TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); + EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); + EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); + EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); + EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); + EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillOnce(Invoke(&session_, &TestSession::ClearControlFrame)); + } else { + // Write until the crypto stream is flow control blocked. + EXPECT_CALL(*connection_, SendBlocked(kCryptoStreamId)); + } + for (QuicStreamId i = 0; + !crypto_stream->flow_controller()->IsBlocked() && i < 1000u; i++) { + EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); + EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); + QuicStreamOffset offset = crypto_stream->stream_bytes_written(); + QuicConfig config; + CryptoHandshakeMessage crypto_message; + config.ToHandshakeMessage(&crypto_message); + crypto_stream->SendHandshakeMessage(crypto_message); + char buf[1000]; + QuicDataWriter writer(1000, buf, NETWORK_BYTE_ORDER); + crypto_stream->WriteStreamData(offset, crypto_message.size(), &writer); + } + EXPECT_TRUE(crypto_stream->flow_controller()->IsBlocked()); + EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); + EXPECT_TRUE(session_.IsStreamFlowControlBlocked()); + EXPECT_FALSE(session_.HasDataToWrite()); + EXPECT_TRUE(crypto_stream->HasBufferedData()); + + if (!session_.session_unblocks_stream()) { + // The handshake message will call OnCanWrite, so the stream can + // resume writing. + EXPECT_CALL(*crypto_stream, OnCanWrite()); + } + // Now complete the crypto handshake, resulting in an increased flow control + // send window. + CryptoHandshakeMessage msg; + session_.GetMutableCryptoStream()->OnHandshakeMessage(msg); + if (session_.session_unblocks_stream()) { + EXPECT_TRUE( + QuicSessionPeer::IsStreamWriteBlocked(&session_, kCryptoStreamId)); + } else { + EXPECT_FALSE( + QuicSessionPeer::IsStreamWriteBlocked(&session_, kCryptoStreamId)); + } + // Stream is now unblocked and will no longer have buffered data. + EXPECT_FALSE(crypto_stream->flow_controller()->IsBlocked()); + EXPECT_FALSE(session_.IsConnectionFlowControlBlocked()); + EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); +} + +TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingRstOutOfOrder) { + // Test that when we receive an out of order stream RST we correctly adjust + // our connection level flow control receive window. + // On close, the stream should mark as consumed all bytes between the highest + // byte consumed so far and the final byte offset from the RST frame. + TestStream* stream = session_.CreateOutgoingDynamicStream(); + + const QuicStreamOffset kByteOffset = + 1 + kInitialSessionFlowControlWindowForTest / 2; + + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .Times(2) + .WillRepeatedly(Invoke(&session_, &TestSession::ClearControlFrame)); + EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _)); + } else { + // Expect no stream WINDOW_UPDATE frames, as stream read side closed. + EXPECT_CALL(*connection_, SendWindowUpdate(stream->id(), _)).Times(0); + // We do expect a connection level WINDOW_UPDATE when the stream is reset. + EXPECT_CALL(*connection_, + SendWindowUpdate( + 0, kInitialSessionFlowControlWindowForTest + kByteOffset)); + + EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); + } + QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream->id(), + QUIC_STREAM_CANCELLED, kByteOffset); + session_.OnRstStream(rst_frame); + session_.PostProcessAfterData(); + EXPECT_EQ(kByteOffset, session_.flow_controller()->bytes_consumed()); +} + +TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAndLocalReset) { + // Test the situation where we receive a FIN on a stream, and before we fully + // consume all the data from the sequencer buffer we locally RST the stream. + // The bytes between highest consumed byte, and the final byte offset that we + // determined when the FIN arrived, should be marked as consumed at the + // connection level flow controller when the stream is reset. + TestStream* stream = session_.CreateOutgoingDynamicStream(); + + const QuicStreamOffset kByteOffset = + kInitialSessionFlowControlWindowForTest / 2 - 1; + QuicStreamFrame frame(stream->id(), true, kByteOffset, "."); + session_.OnStreamFrame(frame); + session_.PostProcessAfterData(); + EXPECT_TRUE(connection_->connected()); + + EXPECT_EQ(0u, stream->flow_controller()->bytes_consumed()); + EXPECT_EQ(kByteOffset + frame.data_length, + stream->flow_controller()->highest_received_byte_offset()); + + // Reset stream locally. + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); + } + stream->Reset(QUIC_STREAM_CANCELLED); + EXPECT_EQ(kByteOffset + frame.data_length, + session_.flow_controller()->bytes_consumed()); +} + +TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAfterRst) { + // Test that when we RST the stream (and tear down stream state), and then + // receive a FIN from the peer, we correctly adjust our connection level flow + // control receive window. + + // Connection starts with some non-zero highest received byte offset, + // due to other active streams. + const uint64_t kInitialConnectionBytesConsumed = 567; + const uint64_t kInitialConnectionHighestReceivedOffset = 1234; + EXPECT_LT(kInitialConnectionBytesConsumed, + kInitialConnectionHighestReceivedOffset); + session_.flow_controller()->UpdateHighestReceivedOffset( + kInitialConnectionHighestReceivedOffset); + session_.flow_controller()->AddBytesConsumed(kInitialConnectionBytesConsumed); + + // Reset our stream: this results in the stream being closed locally. + TestStream* stream = session_.CreateOutgoingDynamicStream(); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); + } + stream->Reset(QUIC_STREAM_CANCELLED); + + // Now receive a response from the peer with a FIN. We should handle this by + // adjusting the connection level flow control receive window to take into + // account the total number of bytes sent by the peer. + const QuicStreamOffset kByteOffset = 5678; + QuicString body = "hello"; + QuicStreamFrame frame(stream->id(), true, kByteOffset, QuicStringPiece(body)); + session_.OnStreamFrame(frame); + + QuicStreamOffset total_stream_bytes_sent_by_peer = + kByteOffset + body.length(); + EXPECT_EQ(kInitialConnectionBytesConsumed + total_stream_bytes_sent_by_peer, + session_.flow_controller()->bytes_consumed()); + EXPECT_EQ( + kInitialConnectionHighestReceivedOffset + total_stream_bytes_sent_by_peer, + session_.flow_controller()->highest_received_byte_offset()); +} + +TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingRstAfterRst) { + // Test that when we RST the stream (and tear down stream state), and then + // receive a RST from the peer, we correctly adjust our connection level flow + // control receive window. + + // Connection starts with some non-zero highest received byte offset, + // due to other active streams. + const uint64_t kInitialConnectionBytesConsumed = 567; + const uint64_t kInitialConnectionHighestReceivedOffset = 1234; + EXPECT_LT(kInitialConnectionBytesConsumed, + kInitialConnectionHighestReceivedOffset); + session_.flow_controller()->UpdateHighestReceivedOffset( + kInitialConnectionHighestReceivedOffset); + session_.flow_controller()->AddBytesConsumed(kInitialConnectionBytesConsumed); + + // Reset our stream: this results in the stream being closed locally. + TestStream* stream = session_.CreateOutgoingDynamicStream(); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); + } + stream->Reset(QUIC_STREAM_CANCELLED); + EXPECT_TRUE(QuicStreamPeer::read_side_closed(stream)); + + // Now receive a RST from the peer. We should handle this by adjusting the + // connection level flow control receive window to take into account the total + // number of bytes sent by the peer. + const QuicStreamOffset kByteOffset = 5678; + QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream->id(), + QUIC_STREAM_CANCELLED, kByteOffset); + session_.OnRstStream(rst_frame); + + EXPECT_EQ(kInitialConnectionBytesConsumed + kByteOffset, + session_.flow_controller()->bytes_consumed()); + EXPECT_EQ(kInitialConnectionHighestReceivedOffset + kByteOffset, + session_.flow_controller()->highest_received_byte_offset()); +} + +TEST_P(QuicSessionTestServer, InvalidStreamFlowControlWindowInHandshake) { + // Test that receipt of an invalid (< default) stream flow control window from + // the peer results in the connection being torn down. + const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; + QuicConfigPeer::SetReceivedInitialStreamFlowControlWindow(session_.config(), + kInvalidWindow); + + EXPECT_CALL(*connection_, + CloseConnection(QUIC_FLOW_CONTROL_INVALID_WINDOW, _, _)); + session_.OnConfigNegotiated(); +} + +TEST_P(QuicSessionTestServer, InvalidSessionFlowControlWindowInHandshake) { + // Test that receipt of an invalid (< default) session flow control window + // from the peer results in the connection being torn down. + const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; + QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(session_.config(), + kInvalidWindow); + + EXPECT_CALL(*connection_, + CloseConnection(QUIC_FLOW_CONTROL_INVALID_WINDOW, _, _)); + session_.OnConfigNegotiated(); +} + +// Test negotiation of custom server initial flow control window. +TEST_P(QuicSessionTestServer, CustomFlowControlWindow) { + QuicTagVector copt; + copt.push_back(kIFW7); + QuicConfigPeer::SetReceivedConnectionOptions(session_.config(), copt); + + session_.OnConfigNegotiated(); + EXPECT_EQ(192 * 1024u, QuicFlowControllerPeer::ReceiveWindowSize( + session_.flow_controller())); +} + +TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) { + // Test that if we receive a stream RST with a highest byte offset that + // violates flow control, that we close the connection. + const uint64_t kLargeOffset = kInitialSessionFlowControlWindowForTest + 1; + EXPECT_CALL(*connection_, + CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _)) + .Times(2); + + // Check that stream frame + FIN results in connection close. + TestStream* stream = session_.CreateOutgoingDynamicStream(); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); + } + stream->Reset(QUIC_STREAM_CANCELLED); + QuicStreamFrame frame(stream->id(), true, kLargeOffset, QuicStringPiece()); + session_.OnStreamFrame(frame); + + // Check that RST results in connection close. + QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream->id(), + QUIC_STREAM_CANCELLED, kLargeOffset); + session_.OnRstStream(rst_frame); +} + +TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseServerRejectStream) { + // If a buggy/malicious peer creates too many streams that are not ended + // with a FIN or RST then we send an RST to refuse streams. + const QuicStreamId kMaxStreams = 5; + QuicSessionPeer::SetMaxOpenIncomingStreams(&session_, kMaxStreams); + const QuicStreamId kFirstStreamId = GetNthClientInitiatedId(0); + const QuicStreamId kFinalStreamId = GetNthClientInitiatedId(kMaxStreams); + // Create kMaxStreams data streams, and close them all without receiving a + // FIN or a RST_STREAM from the client. + for (QuicStreamId i = kFirstStreamId; i < kFinalStreamId; i += 2) { + QuicStreamFrame data1(i, false, 0, QuicStringPiece("HT")); + session_.OnStreamFrame(data1); + // EXPECT_EQ(1u, session_.GetNumOpenStreams()); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillOnce(Invoke(&session_, &TestSession::ClearControlFrame)); + EXPECT_CALL(*connection_, OnStreamReset(i, _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(i, _, _)); + } + session_.CloseStream(i); + } + + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)).Times(1); + EXPECT_CALL(*connection_, + OnStreamReset(kFinalStreamId, QUIC_REFUSED_STREAM)) + .Times(1); + } else { + EXPECT_CALL(*connection_, + SendRstStream(kFinalStreamId, QUIC_REFUSED_STREAM, _)) + .Times(1); + } + // Create one more data streams to exceed limit of open stream. + QuicStreamFrame data1(kFinalStreamId, false, 0, QuicStringPiece("HT")); + session_.OnStreamFrame(data1); + + // Called after any new data is received by the session, and triggers the + // call to close the connection. + session_.PostProcessAfterData(); +} + +TEST_P(QuicSessionTestServer, DrainingStreamsDoNotCountAsOpened) { + // Verify that a draining stream (which has received a FIN but not consumed + // it) does not count against the open quota (because it is closed from the + // protocol point of view). + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)).Times(0); + EXPECT_CALL(*connection_, OnStreamReset(_, QUIC_REFUSED_STREAM)).Times(0); + } else { + EXPECT_CALL(*connection_, SendRstStream(_, QUIC_REFUSED_STREAM, _)) + .Times(0); + } + const QuicStreamId kMaxStreams = 5; + QuicSessionPeer::SetMaxOpenIncomingStreams(&session_, kMaxStreams); + + // Create kMaxStreams + 1 data streams, and mark them draining. + const QuicStreamId kFirstStreamId = GetNthClientInitiatedId(0); + const QuicStreamId kFinalStreamId = + GetNthClientInitiatedId(2 * kMaxStreams + 1); + for (QuicStreamId i = kFirstStreamId; i < kFinalStreamId; i += 2) { + QuicStreamFrame data1(i, true, 0, QuicStringPiece("HT")); + session_.OnStreamFrame(data1); + EXPECT_EQ(1u, session_.GetNumOpenIncomingStreams()); + session_.StreamDraining(i); + EXPECT_EQ(0u, session_.GetNumOpenIncomingStreams()); + } + + // Called after any new data is received by the session, and triggers the call + // to close the connection. + session_.PostProcessAfterData(); +} + +TEST_P(QuicSessionTestServer, TestMaxIncomingAndOutgoingStreamsAllowed) { + // Tests that on server side, the value of max_open_incoming/outgoing streams + // are setup correctly during negotiation. + // The value for outgoing stream is limited to negotiated value and for + // incoming stream it is set to be larger than that. + session_.OnConfigNegotiated(); + // The max number of open outgoing streams is less than that of incoming + // streams, and it should be same as negotiated value. + EXPECT_LT(session_.max_open_outgoing_streams(), + session_.max_open_incoming_streams()); + EXPECT_EQ(session_.max_open_outgoing_streams(), + kDefaultMaxStreamsPerConnection); + EXPECT_GT(session_.max_open_incoming_streams(), + kDefaultMaxStreamsPerConnection); +} + +class QuicSessionTestClient : public QuicSessionTestBase { + protected: + QuicSessionTestClient() : QuicSessionTestBase(Perspective::IS_CLIENT) {} +}; + +INSTANTIATE_TEST_CASE_P(Tests, + QuicSessionTestClient, + ::testing::ValuesIn(AllSupportedVersions())); + +TEST_P(QuicSessionTestClient, AvailableStreamsClient) { + ASSERT_TRUE(session_.GetOrCreateDynamicStream(6) != nullptr); + // Both 2 and 4 should be available. + EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 2)); + EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 4)); + ASSERT_TRUE(session_.GetOrCreateDynamicStream(2) != nullptr); + ASSERT_TRUE(session_.GetOrCreateDynamicStream(4) != nullptr); + // And 5 should be not available. + EXPECT_FALSE(QuicSessionPeer::IsStreamAvailable(&session_, 5)); +} + +TEST_P(QuicSessionTestClient, RecordFinAfterReadSideClosed) { + // Verify that an incoming FIN is recorded in a stream object even if the read + // side has been closed. This prevents an entry from being made in + // locally_closed_streams_highest_offset_ (which will never be deleted). + TestStream* stream = session_.CreateOutgoingDynamicStream(); + QuicStreamId stream_id = stream->id(); + + // Close the read side manually. + QuicStreamPeer::CloseReadSide(stream); + + // Receive a stream data frame with FIN. + QuicStreamFrame frame(stream_id, true, 0, QuicStringPiece()); + session_.OnStreamFrame(frame); + EXPECT_TRUE(stream->fin_received()); + + // Reset stream locally. + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(stream->id(), _, _)); + } + stream->Reset(QUIC_STREAM_CANCELLED); + EXPECT_TRUE(QuicStreamPeer::read_side_closed(stream)); + + // Allow the session to delete the stream object. + session_.PostProcessAfterData(); + EXPECT_TRUE(connection_->connected()); + EXPECT_TRUE(QuicSessionPeer::IsStreamClosed(&session_, stream_id)); + EXPECT_FALSE(QuicSessionPeer::IsStreamCreated(&session_, stream_id)); + + // The stream is not waiting for the arrival of the peer's final offset as it + // was received with the FIN earlier. + EXPECT_EQ( + 0u, + QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); +} + +TEST_P(QuicSessionTestClient, TestMaxIncomingAndOutgoingStreamsAllowed) { + // Tests that on client side, the value of max_open_incoming/outgoing streams + // are setup correctly during negotiation. + // When flag is true, the value for outgoing stream is limited to negotiated + // value and for incoming stream it is set to be larger than that. + session_.OnConfigNegotiated(); + EXPECT_LT(session_.max_open_outgoing_streams(), + session_.max_open_incoming_streams()); + EXPECT_EQ(session_.max_open_outgoing_streams(), + kDefaultMaxStreamsPerConnection); +} + +TEST_P(QuicSessionTestServer, ZombieStreams) { + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + QuicStreamPeer::SetStreamBytesWritten(3, stream2); + EXPECT_TRUE(stream2->IsWaitingForAcks()); + + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(2, _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(2, _, _)); + } + session_.CloseStream(2); + EXPECT_TRUE(QuicContainsKey(session_.zombie_streams(), 2)); + EXPECT_TRUE(session_.closed_streams()->empty()); + session_.OnStreamDoneWaitingForAcks(2); + EXPECT_FALSE(QuicContainsKey(session_.zombie_streams(), 2)); + EXPECT_EQ(1u, session_.closed_streams()->size()); + EXPECT_EQ(2u, session_.closed_streams()->front()->id()); +} + +TEST_P(QuicSessionTestServer, OnStreamFrameLost) { + QuicConnectionPeer::SetSessionDecidesWhatToWrite(connection_); + InSequence s; + + // Drive congestion control manually. + MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; + QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); + + TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream(); + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + + QuicStreamFrame frame1(kCryptoStreamId, false, 0, 1300); + QuicStreamFrame frame2(stream2->id(), false, 0, 9); + QuicStreamFrame frame3(stream4->id(), false, 0, 9); + + // Lost data on cryption stream, streams 2 and 4. + EXPECT_CALL(*stream4, HasPendingRetransmission()).WillOnce(Return(true)); + EXPECT_CALL(*crypto_stream, HasPendingRetransmission()) + .WillOnce(Return(true)); + EXPECT_CALL(*stream2, HasPendingRetransmission()).WillOnce(Return(true)); + session_.OnFrameLost(QuicFrame(&frame3)); + session_.OnFrameLost(QuicFrame(&frame1)); + session_.OnFrameLost(QuicFrame(&frame2)); + EXPECT_TRUE(session_.WillingAndAbleToWrite()); + + // Mark streams 2 and 4 write blocked. + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + + // Lost data is retransmitted before new data, and retransmissions for crypto + // stream go first. + // Do not check congestion window when crypto stream has lost data. + EXPECT_CALL(*send_algorithm, CanSend(_)).Times(0); + EXPECT_CALL(*crypto_stream, OnCanWrite()); + EXPECT_CALL(*crypto_stream, HasPendingRetransmission()) + .WillOnce(Return(false)); + // Check congestion window for non crypto streams. + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(true)); + EXPECT_CALL(*stream4, OnCanWrite()); + EXPECT_CALL(*stream4, HasPendingRetransmission()).WillOnce(Return(false)); + // Connection is blocked. + EXPECT_CALL(*send_algorithm, CanSend(_)).WillRepeatedly(Return(false)); + + session_.OnCanWrite(); + EXPECT_TRUE(session_.WillingAndAbleToWrite()); + + // Unblock connection. + // Stream 2 retransmits lost data. + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(true)); + EXPECT_CALL(*stream2, OnCanWrite()); + EXPECT_CALL(*stream2, HasPendingRetransmission()).WillOnce(Return(false)); + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(true)); + // Stream 2 sends new data. + EXPECT_CALL(*stream2, OnCanWrite()); + EXPECT_CALL(*send_algorithm, CanSend(_)).WillOnce(Return(true)); + EXPECT_CALL(*stream4, OnCanWrite()); + EXPECT_CALL(*send_algorithm, OnApplicationLimited(_)); + + session_.OnCanWrite(); + EXPECT_FALSE(session_.WillingAndAbleToWrite()); +} + +TEST_P(QuicSessionTestServer, DonotRetransmitDataOfClosedStreams) { + QuicConnectionPeer::SetSessionDecidesWhatToWrite(connection_); + InSequence s; + + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + TestStream* stream6 = session_.CreateOutgoingDynamicStream(); + + QuicStreamFrame frame1(stream2->id(), false, 0, 9); + QuicStreamFrame frame2(stream4->id(), false, 0, 9); + QuicStreamFrame frame3(stream6->id(), false, 0, 9); + + EXPECT_CALL(*stream6, HasPendingRetransmission()).WillOnce(Return(true)); + EXPECT_CALL(*stream4, HasPendingRetransmission()).WillOnce(Return(true)); + EXPECT_CALL(*stream2, HasPendingRetransmission()).WillOnce(Return(true)); + session_.OnFrameLost(QuicFrame(&frame3)); + session_.OnFrameLost(QuicFrame(&frame2)); + session_.OnFrameLost(QuicFrame(&frame1)); + + session_.MarkConnectionLevelWriteBlocked(stream2->id()); + session_.MarkConnectionLevelWriteBlocked(stream4->id()); + session_.MarkConnectionLevelWriteBlocked(stream6->id()); + + // Reset stream 4 locally. + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)); + EXPECT_CALL(*connection_, OnStreamReset(stream4->id(), _)); + } else { + EXPECT_CALL(*connection_, SendRstStream(stream4->id(), _, _)); + } + stream4->Reset(QUIC_STREAM_CANCELLED); + + // Verify stream 4 is removed from streams with lost data list. + EXPECT_CALL(*stream6, OnCanWrite()); + EXPECT_CALL(*stream6, HasPendingRetransmission()).WillOnce(Return(false)); + EXPECT_CALL(*stream2, OnCanWrite()); + EXPECT_CALL(*stream2, HasPendingRetransmission()).WillOnce(Return(false)); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillRepeatedly(Invoke(&session_, &TestSession::ClearControlFrame)); + } + EXPECT_CALL(*stream2, OnCanWrite()); + EXPECT_CALL(*stream6, OnCanWrite()); + session_.OnCanWrite(); +} + +TEST_P(QuicSessionTestServer, RetransmitFrames) { + QuicConnectionPeer::SetSessionDecidesWhatToWrite(connection_); + MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; + QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); + InSequence s; + + TestStream* stream2 = session_.CreateOutgoingDynamicStream(); + TestStream* stream4 = session_.CreateOutgoingDynamicStream(); + TestStream* stream6 = session_.CreateOutgoingDynamicStream(); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillOnce(Invoke(&session_, &TestSession::ClearControlFrame)); + session_.SendWindowUpdate(stream2->id(), 9); + } + + QuicStreamFrame frame1(stream2->id(), false, 0, 9); + QuicStreamFrame frame2(stream4->id(), false, 0, 9); + QuicStreamFrame frame3(stream6->id(), false, 0, 9); + QuicWindowUpdateFrame window_update(1, stream2->id(), 9); + QuicFrames frames; + frames.push_back(QuicFrame(&frame1)); + frames.push_back(QuicFrame(&window_update)); + frames.push_back(QuicFrame(&frame2)); + frames.push_back(QuicFrame(&frame3)); + EXPECT_FALSE(session_.WillingAndAbleToWrite()); + + EXPECT_CALL(*stream2, RetransmitStreamData(_, _, _)).WillOnce(Return(true)); + if (session_.use_control_frame_manager()) { + EXPECT_CALL(*connection_, SendControlFrame(_)) + .WillOnce(Invoke(&session_, &TestSession::ClearControlFrame)); + } + EXPECT_CALL(*stream4, RetransmitStreamData(_, _, _)).WillOnce(Return(true)); + EXPECT_CALL(*stream6, RetransmitStreamData(_, _, _)).WillOnce(Return(true)); + EXPECT_CALL(*send_algorithm, OnApplicationLimited(_)); + session_.RetransmitFrames(frames, TLP_RETRANSMISSION); +} + +} // namespace +} // namespace test +} // namespace net
diff --git a/net/quic/core/quic_spdy_session.cc b/net/quic/core/quic_spdy_session.cc index 445b36a..f0544730 100644 --- a/net/quic/core/quic_spdy_session.cc +++ b/net/quic/core/quic_spdy_session.cc
@@ -533,20 +533,6 @@ // Implemented in Chromium for stats tracking. } -void QuicSpdySession::RegisterStreamPriority(QuicStreamId id, - SpdyPriority priority) { - write_blocked_streams()->RegisterStream(id, priority); -} - -void QuicSpdySession::UnregisterStreamPriority(QuicStreamId id) { - write_blocked_streams()->UnregisterStream(id); -} - -void QuicSpdySession::UpdateStreamPriority(QuicStreamId id, - SpdyPriority new_priority) { - write_blocked_streams()->UpdateStreamPriority(id, new_priority); -} - QuicSpdyStream* QuicSpdySession::GetSpdyDataStream( const QuicStreamId stream_id) { return static_cast<QuicSpdyStream*>(GetOrCreateDynamicStream(stream_id));
diff --git a/net/quic/core/quic_spdy_session.h b/net/quic/core/quic_spdy_session.h index 7268cc2..fd9600a 100644 --- a/net/quic/core/quic_spdy_session.h +++ b/net/quic/core/quic_spdy_session.h
@@ -120,15 +120,6 @@ // |delta| indicates how long that piece of data has been blocked. virtual void OnHeadersHeadOfLineBlocking(QuicTime::Delta delta); - // Called by the stream on creation to set priority in the write blocked list. - virtual void RegisterStreamPriority(QuicStreamId id, SpdyPriority priority); - // Called by the stream on deletion to clear priority crom the write blocked - // list. - virtual void UnregisterStreamPriority(QuicStreamId id); - // Called by the stream on SetPriority to update priority on the write blocked - // list. - virtual void UpdateStreamPriority(QuicStreamId id, SpdyPriority new_priority); - void OnConfigNegotiated() override; bool server_push_enabled() const { return server_push_enabled_; }
diff --git a/net/quic/core/quic_spdy_session_test.cc b/net/quic/core/quic_spdy_session_test.cc index 8267f806..f1eac816 100644 --- a/net/quic/core/quic_spdy_session_test.cc +++ b/net/quic/core/quic_spdy_session_test.cc
@@ -239,9 +239,9 @@ bool writev_consumes_all_data_; }; -class QuicSessionTestBase : public QuicTestWithParam<ParsedQuicVersion> { +class QuicSpdySessionTestBase : public QuicTestWithParam<ParsedQuicVersion> { protected: - explicit QuicSessionTestBase(Perspective perspective) + explicit QuicSpdySessionTestBase(Perspective perspective) : connection_( new StrictMock<MockQuicConnection>(&helper_, &alarm_factory_, @@ -329,39 +329,40 @@ SpdyHeaderBlock headers_; }; -class QuicSessionTestServer : public QuicSessionTestBase { +class QuicSpdySessionTestServer : public QuicSpdySessionTestBase { protected: - QuicSessionTestServer() : QuicSessionTestBase(Perspective::IS_SERVER) {} + QuicSpdySessionTestServer() + : QuicSpdySessionTestBase(Perspective::IS_SERVER) {} }; INSTANTIATE_TEST_CASE_P(Tests, - QuicSessionTestServer, + QuicSpdySessionTestServer, ::testing::ValuesIn(AllSupportedVersions())); -TEST_P(QuicSessionTestServer, PeerAddress) { +TEST_P(QuicSpdySessionTestServer, PeerAddress) { EXPECT_EQ(QuicSocketAddress(QuicIpAddress::Loopback4(), kTestPort), session_.peer_address()); } -TEST_P(QuicSessionTestServer, SelfAddress) { +TEST_P(QuicSpdySessionTestServer, SelfAddress) { EXPECT_EQ(QuicSocketAddress(), session_.self_address()); } -TEST_P(QuicSessionTestServer, IsCryptoHandshakeConfirmed) { +TEST_P(QuicSpdySessionTestServer, IsCryptoHandshakeConfirmed) { EXPECT_FALSE(session_.IsCryptoHandshakeConfirmed()); CryptoHandshakeMessage message; session_.GetMutableCryptoStream()->OnHandshakeMessage(message); EXPECT_TRUE(session_.IsCryptoHandshakeConfirmed()); } -TEST_P(QuicSessionTestServer, IsClosedStreamDefault) { +TEST_P(QuicSpdySessionTestServer, IsClosedStreamDefault) { // Ensure that no streams are initially closed. for (QuicStreamId i = kCryptoStreamId; i < 100; i++) { EXPECT_FALSE(session_.IsClosedStream(i)) << "stream id: " << i; } } -TEST_P(QuicSessionTestServer, AvailableStreams) { +TEST_P(QuicSpdySessionTestServer, AvailableStreams) { ASSERT_TRUE(session_.GetOrCreateDynamicStream(9) != nullptr); // Both 5 and 7 should be available. EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 5)); @@ -370,7 +371,7 @@ ASSERT_TRUE(session_.GetOrCreateDynamicStream(5) != nullptr); } -TEST_P(QuicSessionTestServer, IsClosedStreamLocallyCreated) { +TEST_P(QuicSpdySessionTestServer, IsClosedStreamLocallyCreated) { TestStream* stream2 = session_.CreateOutgoingDynamicStream(); EXPECT_EQ(GetNthServerInitiatedId(0), stream2->id()); QuicSpdyStream* stream4 = session_.CreateOutgoingDynamicStream(); @@ -383,7 +384,7 @@ CheckClosedStreams(); } -TEST_P(QuicSessionTestServer, IsClosedStreamPeerCreated) { +TEST_P(QuicSpdySessionTestServer, IsClosedStreamPeerCreated) { QuicStreamId stream_id1 = GetNthClientInitiatedId(0); QuicStreamId stream_id2 = GetNthClientInitiatedId(1); session_.GetOrCreateDynamicStream(stream_id1); @@ -401,7 +402,7 @@ CheckClosedStreams(); } -TEST_P(QuicSessionTestServer, MaximumAvailableOpenedStreams) { +TEST_P(QuicSpdySessionTestServer, MaximumAvailableOpenedStreams) { QuicStreamId stream_id = GetNthClientInitiatedId(0); session_.GetOrCreateDynamicStream(stream_id); EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0); @@ -410,7 +411,7 @@ stream_id + 2 * (session_.max_open_incoming_streams() - 1))); } -TEST_P(QuicSessionTestServer, TooManyAvailableStreams) { +TEST_P(QuicSpdySessionTestServer, TooManyAvailableStreams) { QuicStreamId stream_id1 = GetNthClientInitiatedId(0); QuicStreamId stream_id2; EXPECT_NE(nullptr, session_.GetOrCreateDynamicStream(stream_id1)); @@ -421,7 +422,7 @@ EXPECT_EQ(nullptr, session_.GetOrCreateDynamicStream(stream_id2)); } -TEST_P(QuicSessionTestServer, ManyAvailableStreams) { +TEST_P(QuicSpdySessionTestServer, ManyAvailableStreams) { // When max_open_streams_ is 200, should be able to create 200 streams // out-of-order, that is, creating the one with the largest stream ID first. QuicSessionPeer::SetMaxOpenIncomingStreams(&session_, 200); @@ -433,7 +434,8 @@ session_.GetOrCreateDynamicStream(stream_id + 2 * (200 - 1)); } -TEST_P(QuicSessionTestServer, DebugDFatalIfMarkingClosedStreamWriteBlocked) { +TEST_P(QuicSpdySessionTestServer, + DebugDFatalIfMarkingClosedStreamWriteBlocked) { TestStream* stream2 = session_.CreateOutgoingDynamicStream(); QuicStreamId closed_stream_id = stream2->id(); // Close the stream. @@ -450,7 +452,7 @@ msg); } -TEST_P(QuicSessionTestServer, OnCanWrite) { +TEST_P(QuicSpdySessionTestServer, OnCanWrite) { session_.set_writev_consumes_all_data(true); TestStream* stream2 = session_.CreateOutgoingDynamicStream(); TestStream* stream4 = session_.CreateOutgoingDynamicStream(); @@ -479,7 +481,7 @@ EXPECT_TRUE(session_.WillingAndAbleToWrite()); } -TEST_P(QuicSessionTestServer, TestBatchedWrites) { +TEST_P(QuicSpdySessionTestServer, TestBatchedWrites) { session_.set_writev_consumes_all_data(true); TestStream* stream2 = session_.CreateOutgoingDynamicStream(); TestStream* stream4 = session_.CreateOutgoingDynamicStream(); @@ -545,7 +547,7 @@ session_.OnCanWrite(); } -TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) { +TEST_P(QuicSpdySessionTestServer, OnCanWriteBundlesStreams) { // Encryption needs to be established before data can be sent. CryptoHandshakeMessage msg; MockPacketWriter* writer = static_cast<MockPacketWriter*>( @@ -592,7 +594,7 @@ EXPECT_FALSE(session_.WillingAndAbleToWrite()); } -TEST_P(QuicSessionTestServer, OnCanWriteCongestionControlBlocks) { +TEST_P(QuicSpdySessionTestServer, OnCanWriteCongestionControlBlocks) { session_.set_writev_consumes_all_data(true); InSequence s; @@ -638,7 +640,7 @@ EXPECT_FALSE(session_.WillingAndAbleToWrite()); } -TEST_P(QuicSessionTestServer, OnCanWriteWriterBlocks) { +TEST_P(QuicSpdySessionTestServer, OnCanWriteWriterBlocks) { // Drive congestion control manually in order to ensure that // application-limited signaling is handled correctly. MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; @@ -664,7 +666,7 @@ EXPECT_TRUE(session_.WillingAndAbleToWrite()); } -TEST_P(QuicSessionTestServer, BufferedHandshake) { +TEST_P(QuicSpdySessionTestServer, BufferedHandshake) { session_.set_writev_consumes_all_data(true); EXPECT_FALSE(session_.HasPendingHandshake()); // Default value. @@ -711,7 +713,7 @@ EXPECT_FALSE(session_.HasPendingHandshake()); // Crypto stream wrote. } -TEST_P(QuicSessionTestServer, OnCanWriteWithClosedStream) { +TEST_P(QuicSpdySessionTestServer, OnCanWriteWithClosedStream) { session_.set_writev_consumes_all_data(true); TestStream* stream2 = session_.CreateOutgoingDynamicStream(); TestStream* stream4 = session_.CreateOutgoingDynamicStream(); @@ -737,7 +739,8 @@ EXPECT_FALSE(session_.WillingAndAbleToWrite()); } -TEST_P(QuicSessionTestServer, OnCanWriteLimitsNumWritesIfFlowControlBlocked) { +TEST_P(QuicSpdySessionTestServer, + OnCanWriteLimitsNumWritesIfFlowControlBlocked) { // Drive congestion control manually in order to ensure that // application-limited signaling is handled correctly. MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; @@ -777,7 +780,7 @@ EXPECT_FALSE(session_.WillingAndAbleToWrite()); } -TEST_P(QuicSessionTestServer, SendGoAway) { +TEST_P(QuicSpdySessionTestServer, SendGoAway) { MockPacketWriter* writer = static_cast<MockPacketWriter*>( QuicConnectionPeer::GetWriter(session_.connection())); EXPECT_CALL(*writer, WritePacket(_, _, _, _, _)) @@ -808,7 +811,7 @@ EXPECT_TRUE(session_.GetOrCreateDynamicStream(kTestStreamId)); } -TEST_P(QuicSessionTestServer, DoNotSendGoAwayTwice) { +TEST_P(QuicSpdySessionTestServer, DoNotSendGoAwayTwice) { if (session_.use_control_frame_manager()) { EXPECT_CALL(*connection_, SendControlFrame(_)) .WillOnce(Invoke(&session_, &TestSession::ClearControlFrame)); @@ -822,7 +825,7 @@ session_.SendGoAway(QUIC_PEER_GOING_AWAY, "Going Away."); } -TEST_P(QuicSessionTestServer, InvalidGoAway) { +TEST_P(QuicSpdySessionTestServer, InvalidGoAway) { QuicGoAwayFrame go_away(kInvalidControlFrameId, QUIC_PEER_GOING_AWAY, session_.next_outgoing_stream_id(), ""); session_.OnGoAway(go_away); @@ -830,7 +833,7 @@ // Test that server session will send a connectivity probe in response to a // connectivity probe on the same path. -TEST_P(QuicSessionTestServer, ServerReplyToConnecitivityProbe) { +TEST_P(QuicSpdySessionTestServer, ServerReplyToConnecitivityProbe) { QuicSocketAddress old_peer_address = QuicSocketAddress(QuicIpAddress::Loopback4(), kTestPort); EXPECT_EQ(old_peer_address, session_.peer_address()); @@ -852,7 +855,7 @@ EXPECT_EQ(old_peer_address, session_.peer_address()); } -TEST_P(QuicSessionTestServer, IncreasedTimeoutAfterCryptoHandshake) { +TEST_P(QuicSpdySessionTestServer, IncreasedTimeoutAfterCryptoHandshake) { EXPECT_EQ(kInitialIdleTimeoutSecs + 3, QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); CryptoHandshakeMessage msg; @@ -861,7 +864,7 @@ QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds()); } -TEST_P(QuicSessionTestServer, RstStreamBeforeHeadersDecompressed) { +TEST_P(QuicSpdySessionTestServer, RstStreamBeforeHeadersDecompressed) { // Send two bytes of payload. QuicStreamFrame data1(GetNthClientInitiatedId(0), false, 0, QuicStringPiece("HT")); @@ -882,7 +885,7 @@ EXPECT_TRUE(connection_->connected()); } -TEST_P(QuicSessionTestServer, OnStreamFrameFinStaticStreamId) { +TEST_P(QuicSpdySessionTestServer, OnStreamFrameFinStaticStreamId) { // Send two bytes of payload. QuicStreamFrame data1(kCryptoStreamId, true, 0, QuicStringPiece("HT")); EXPECT_CALL(*connection_, @@ -892,7 +895,7 @@ session_.OnStreamFrame(data1); } -TEST_P(QuicSessionTestServer, OnRstStreamStaticStreamId) { +TEST_P(QuicSpdySessionTestServer, OnRstStreamStaticStreamId) { // Send two bytes of payload. QuicRstStreamFrame rst1(kInvalidControlFrameId, kCryptoStreamId, QUIC_ERROR_PROCESSING_STREAM, 0); @@ -903,7 +906,7 @@ session_.OnRstStream(rst1); } -TEST_P(QuicSessionTestServer, OnStreamFrameInvalidStreamId) { +TEST_P(QuicSpdySessionTestServer, OnStreamFrameInvalidStreamId) { // Send two bytes of payload. QuicStreamFrame data1(kInvalidStreamId, true, 0, QuicStringPiece("HT")); EXPECT_CALL(*connection_, @@ -913,7 +916,7 @@ session_.OnStreamFrame(data1); } -TEST_P(QuicSessionTestServer, OnRstStreamInvalidStreamId) { +TEST_P(QuicSpdySessionTestServer, OnRstStreamInvalidStreamId) { // Send two bytes of payload. QuicRstStreamFrame rst1(kInvalidControlFrameId, kInvalidStreamId, QUIC_ERROR_PROCESSING_STREAM, 0); @@ -924,7 +927,7 @@ session_.OnRstStream(rst1); } -TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedStream) { +TEST_P(QuicSpdySessionTestServer, HandshakeUnblocksFlowControlBlockedStream) { // Test that if a stream is flow control blocked, then on receipt of the SHLO // containing a suitable send window offset, the stream becomes unblocked. @@ -971,7 +974,8 @@ EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); } -TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) { +TEST_P(QuicSpdySessionTestServer, + HandshakeUnblocksFlowControlBlockedCryptoStream) { // Test that if the crypto stream is flow control blocked, then if the SHLO // contains a larger send window offset, the stream becomes unblocked. session_.set_writev_consumes_all_data(true); @@ -1039,7 +1043,7 @@ // NOTE: It's not possible to use the standard MAYBE_ convention to disable // this test on iOS because when this test gets instantiated it ends up with // various names that are dependent on the parameters passed. -TEST_P(QuicSessionTestServer, +TEST_P(QuicSpdySessionTestServer, HandshakeUnblocksFlowControlBlockedHeadersStream) { // Test that if the header stream is flow control blocked, then if the SHLO // contains a larger send window offset, the stream becomes unblocked. @@ -1102,7 +1106,8 @@ } #endif // !defined(OS_IOS) -TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingRstOutOfOrder) { +TEST_P(QuicSpdySessionTestServer, + ConnectionFlowControlAccountingRstOutOfOrder) { // Test that when we receive an out of order stream RST we correctly adjust // our connection level flow control receive window. // On close, the stream should mark as consumed all bytes between the highest @@ -1134,7 +1139,8 @@ EXPECT_EQ(kByteOffset, session_.flow_controller()->bytes_consumed()); } -TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAndLocalReset) { +TEST_P(QuicSpdySessionTestServer, + ConnectionFlowControlAccountingFinAndLocalReset) { // Test the situation where we receive a FIN on a stream, and before we fully // consume all the data from the sequencer buffer we locally RST the stream. // The bytes between highest consumed byte, and the final byte offset that we @@ -1165,7 +1171,7 @@ session_.flow_controller()->bytes_consumed()); } -TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAfterRst) { +TEST_P(QuicSpdySessionTestServer, ConnectionFlowControlAccountingFinAfterRst) { // Test that when we RST the stream (and tear down stream state), and then // receive a FIN from the peer, we correctly adjust our connection level flow // control receive window. @@ -1207,7 +1213,7 @@ session_.flow_controller()->highest_received_byte_offset()); } -TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingRstAfterRst) { +TEST_P(QuicSpdySessionTestServer, ConnectionFlowControlAccountingRstAfterRst) { // Test that when we RST the stream (and tear down stream state), and then // receive a RST from the peer, we correctly adjust our connection level flow // control receive window. @@ -1247,7 +1253,7 @@ session_.flow_controller()->highest_received_byte_offset()); } -TEST_P(QuicSessionTestServer, InvalidStreamFlowControlWindowInHandshake) { +TEST_P(QuicSpdySessionTestServer, InvalidStreamFlowControlWindowInHandshake) { // Test that receipt of an invalid (< default) stream flow control window from // the peer results in the connection being torn down. const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; @@ -1259,7 +1265,7 @@ session_.OnConfigNegotiated(); } -TEST_P(QuicSessionTestServer, InvalidSessionFlowControlWindowInHandshake) { +TEST_P(QuicSpdySessionTestServer, InvalidSessionFlowControlWindowInHandshake) { // Test that receipt of an invalid (< default) session flow control window // from the peer results in the connection being torn down. const uint32_t kInvalidWindow = kMinimumFlowControlSendWindow - 1; @@ -1272,7 +1278,7 @@ } // Test negotiation of custom server initial flow control window. -TEST_P(QuicSessionTestServer, CustomFlowControlWindow) { +TEST_P(QuicSpdySessionTestServer, CustomFlowControlWindow) { QuicTagVector copt; copt.push_back(kIFW7); QuicConfigPeer::SetReceivedConnectionOptions(session_.config(), copt); @@ -1282,7 +1288,7 @@ session_.flow_controller())); } -TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) { +TEST_P(QuicSpdySessionTestServer, FlowControlWithInvalidFinalOffset) { // Test that if we receive a stream RST with a highest byte offset that // violates flow control, that we close the connection. const uint64_t kLargeOffset = kInitialSessionFlowControlWindowForTest + 1; @@ -1308,7 +1314,7 @@ session_.OnRstStream(rst_frame); } -TEST_P(QuicSessionTestServer, WindowUpdateUnblocksHeadersStream) { +TEST_P(QuicSpdySessionTestServer, WindowUpdateUnblocksHeadersStream) { // Test that a flow control blocked headers stream gets unblocked on recipt of // a WINDOW_UPDATE frame. @@ -1331,7 +1337,8 @@ EXPECT_FALSE(session_.IsStreamFlowControlBlocked()); } -TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseServerRejectStream) { +TEST_P(QuicSpdySessionTestServer, + TooManyUnfinishedStreamsCauseServerRejectStream) { // If a buggy/malicious peer creates too many streams that are not ended // with a FIN or RST then we send an RST to refuse streams. const QuicStreamId kMaxStreams = 5; @@ -1374,7 +1381,7 @@ session_.PostProcessAfterData(); } -TEST_P(QuicSessionTestServer, DrainingStreamsDoNotCountAsOpened) { +TEST_P(QuicSpdySessionTestServer, DrainingStreamsDoNotCountAsOpened) { // Verify that a draining stream (which has received a FIN but not consumed // it) does not count against the open quota (because it is closed from the // protocol point of view). @@ -1405,7 +1412,7 @@ session_.PostProcessAfterData(); } -TEST_P(QuicSessionTestServer, TestMaxIncomingAndOutgoingStreamsAllowed) { +TEST_P(QuicSpdySessionTestServer, TestMaxIncomingAndOutgoingStreamsAllowed) { // Tests that on server side, the value of max_open_incoming/outgoing streams // are setup correctly during negotiation. // The value for outgoing stream is limited to negotiated value and for @@ -1421,16 +1428,17 @@ kDefaultMaxStreamsPerConnection); } -class QuicSessionTestClient : public QuicSessionTestBase { +class QuicSpdySessionTestClient : public QuicSpdySessionTestBase { protected: - QuicSessionTestClient() : QuicSessionTestBase(Perspective::IS_CLIENT) {} + QuicSpdySessionTestClient() + : QuicSpdySessionTestBase(Perspective::IS_CLIENT) {} }; INSTANTIATE_TEST_CASE_P(Tests, - QuicSessionTestClient, + QuicSpdySessionTestClient, ::testing::ValuesIn(AllSupportedVersions())); -TEST_P(QuicSessionTestClient, AvailableStreamsClient) { +TEST_P(QuicSpdySessionTestClient, AvailableStreamsClient) { ASSERT_TRUE(session_.GetOrCreateDynamicStream(6) != nullptr); // Both 2 and 4 should be available. EXPECT_TRUE(QuicSessionPeer::IsStreamAvailable(&session_, 2)); @@ -1441,7 +1449,7 @@ EXPECT_FALSE(QuicSessionPeer::IsStreamAvailable(&session_, 5)); } -TEST_P(QuicSessionTestClient, RecordFinAfterReadSideClosed) { +TEST_P(QuicSpdySessionTestClient, RecordFinAfterReadSideClosed) { // Verify that an incoming FIN is recorded in a stream object even if the read // side has been closed. This prevents an entry from being made in // locally_closed_streams_highest_offset_ (which will never be deleted). @@ -1479,7 +1487,7 @@ QuicSessionPeer::GetLocallyClosedStreamsHighestOffset(&session_).size()); } -TEST_P(QuicSessionTestClient, TestMaxIncomingAndOutgoingStreamsAllowed) { +TEST_P(QuicSpdySessionTestClient, TestMaxIncomingAndOutgoingStreamsAllowed) { // Tests that on client side, the value of max_open_incoming/outgoing streams // are setup correctly during negotiation. // When flag is true, the value for outgoing stream is limited to negotiated @@ -1491,7 +1499,7 @@ kDefaultMaxStreamsPerConnection); } -TEST_P(QuicSessionTestClient, EnableDHDTThroughConnectionOption) { +TEST_P(QuicSpdySessionTestClient, EnableDHDTThroughConnectionOption) { QuicTagVector copt; copt.push_back(kDHDT); QuicConfigPeer::SetConnectionOptionsToSend(session_.config(), copt); @@ -1501,7 +1509,7 @@ 0UL); } -TEST_P(QuicSessionTestClient, WritePriority) { +TEST_P(QuicSpdySessionTestClient, WritePriority) { TestHeadersStream* headers_stream = new TestHeadersStream(&session_); QuicSpdySessionPeer::SetHeadersStream(&session_, headers_stream); @@ -1536,7 +1544,7 @@ } } -TEST_P(QuicSessionTestServer, ZombieStreams) { +TEST_P(QuicSpdySessionTestServer, ZombieStreams) { TestStream* stream2 = session_.CreateOutgoingDynamicStream(); QuicStreamPeer::SetStreamBytesWritten(3, stream2); EXPECT_TRUE(stream2->IsWaitingForAcks()); @@ -1556,7 +1564,7 @@ EXPECT_EQ(2u, session_.closed_streams()->front()->id()); } -TEST_P(QuicSessionTestServer, OnStreamFrameLost) { +TEST_P(QuicSpdySessionTestServer, OnStreamFrameLost) { QuicConnectionPeer::SetSessionDecidesWhatToWrite(connection_); InSequence s; @@ -1619,7 +1627,7 @@ EXPECT_FALSE(session_.WillingAndAbleToWrite()); } -TEST_P(QuicSessionTestServer, DonotRetransmitDataOfClosedStreams) { +TEST_P(QuicSpdySessionTestServer, DonotRetransmitDataOfClosedStreams) { QuicConnectionPeer::SetSessionDecidesWhatToWrite(connection_); InSequence s; @@ -1665,7 +1673,7 @@ session_.OnCanWrite(); } -TEST_P(QuicSessionTestServer, RetransmitFrames) { +TEST_P(QuicSpdySessionTestServer, RetransmitFrames) { QuicConnectionPeer::SetSessionDecidesWhatToWrite(connection_); MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>; QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm); @@ -1702,7 +1710,7 @@ session_.RetransmitFrames(frames, TLP_RETRANSMISSION); } -TEST_P(QuicSessionTestServer, OnPriorityFrame) { +TEST_P(QuicSpdySessionTestServer, OnPriorityFrame) { QuicStreamId stream_id = GetNthClientInitiatedId(0); TestStream* stream = session_.CreateIncomingDynamicStream(stream_id); session_.OnPriorityFrame(stream_id, kV3HighestPriority);
diff --git a/net/quic/core/quic_spdy_stream.cc b/net/quic/core/quic_spdy_stream.cc index 016587c..a425ecb 100644 --- a/net/quic/core/quic_spdy_stream.cc +++ b/net/quic/core/quic_spdy_stream.cc
@@ -30,18 +30,19 @@ spdy_session_(spdy_session), visitor_(nullptr), headers_decompressed_(false), - priority_(kDefaultPriority), trailers_decompressed_(false), trailers_consumed_(false) { DCHECK_NE(kCryptoStreamId, id); // Don't receive any callbacks from the sequencer until headers // are complete. sequencer()->SetBlockedUntilFlush(); - spdy_session_->RegisterStreamPriority(id, priority_); + if (!session()->register_streams_early()) { + spdy_session_->RegisterStreamPriority(id, priority()); + } } QuicSpdyStream::~QuicSpdyStream() { - if (spdy_session_ != nullptr) { + if (spdy_session_ != nullptr && !session()->register_streams_early()) { spdy_session_->UnregisterStreamPriority(id()); } } @@ -51,7 +52,7 @@ bool fin, QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) { size_t bytes_written = spdy_session_->WriteHeaders( - id(), std::move(header_block), fin, priority_, std::move(ack_listener)); + id(), std::move(header_block), fin, priority(), std::move(ack_listener)); if (fin) { // TODO(rch): Add test to ensure fin_sent_ is set whenever a fin is sent. set_fin_sent(true); @@ -87,8 +88,9 @@ // Write the trailing headers with a FIN, and close stream for writing: // trailers are the last thing to be sent on a stream. const bool kFin = true; - size_t bytes_written = spdy_session_->WriteHeaders( - id(), std::move(trailer_block), kFin, priority_, std::move(ack_listener)); + size_t bytes_written = + spdy_session_->WriteHeaders(id(), std::move(trailer_block), kFin, + priority(), std::move(ack_listener)); set_fin_sent(kFin); // Trailers are the last thing to be sent on a stream, but if there is still @@ -137,12 +139,6 @@ } } -void QuicSpdyStream::SetPriority(SpdyPriority priority) { - DCHECK_EQ(0u, stream_bytes_written()); - priority_ = priority; - spdy_session_->UpdateStreamPriority(id(), priority); -} - void QuicSpdyStream::OnStreamHeadersPriority(SpdyPriority priority) { DCHECK_EQ(Perspective::IS_SERVER, session()->connection()->perspective()); SetPriority(priority); @@ -308,10 +304,6 @@ } } -SpdyPriority QuicSpdyStream::priority() const { - return priority_; -} - void QuicSpdyStream::ClearSession() { spdy_session_ = nullptr; }
diff --git a/net/quic/core/quic_spdy_stream.h b/net/quic/core/quic_spdy_stream.h index 48e92200..947b323 100644 --- a/net/quic/core/quic_spdy_stream.h +++ b/net/quic/core/quic_spdy_stream.h
@@ -35,12 +35,6 @@ class QuicSpdySession; -// This is somewhat arbitrary. It's possible, but unlikely, we will either fail -// to set a priority client-side, or cancel a stream before stripping the -// priority from the wire server-side. In either case, start out with a -// priority in the middle. -const SpdyPriority kDefaultPriority = 3; - // A QUIC stream that can send and receive HTTP2 (SPDY) headers. class QUIC_EXPORT_PRIVATE QuicSpdyStream : public QuicStream { public: @@ -164,12 +158,6 @@ // been received and there are no trailers. bool FinishedReadingTrailers() const; - SpdyPriority priority() const; - - // Sets priority_ to priority. This should only be called before bytes are - // written to the server. - void SetPriority(SpdyPriority priority); - // Called when owning session is getting deleted to avoid subsequent // use of the spdy_session_ member. void ClearSession(); @@ -202,8 +190,6 @@ Visitor* visitor_; // True if the headers have been completely decompressed. bool headers_decompressed_; - // The priority of the stream, once parsed. - SpdyPriority priority_; // Contains a copy of the decompressed header (name, value) pairs until they // are consumed via Readv. QuicHeaderList header_list_;
diff --git a/net/quic/core/quic_stream.cc b/net/quic/core/quic_stream.cc index 7d237bc..98f7e08 100644 --- a/net/quic/core/quic_stream.cc +++ b/net/quic/core/quic_stream.cc
@@ -13,6 +13,8 @@ #include "net/quic/platform/api/quic_str_cat.h" #include "net/quic/platform/api/quic_string.h" +using net::SpdyPriority; + namespace net { #define ENDPOINT \ @@ -40,10 +42,14 @@ } // namespace +// static +const SpdyPriority QuicStream::kDefaultPriority; + QuicStream::QuicStream(QuicStreamId id, QuicSession* session) : sequencer_(this, session->connection()->clock()), id_(id), session_(session), + priority_(kDefaultPriority), stream_bytes_read_(0), stream_error_(QUIC_STREAM_NO_ERROR), connection_error_(QUIC_NO_ERROR), @@ -75,6 +81,9 @@ buffered_data_threshold_( GetQuicFlag(FLAGS_quic_buffered_data_threshold)) { SetFromConfig(); + if (session_->register_streams_early()) { + session_->RegisterStreamPriority(id, priority_); + } } QuicStream::~QuicStream() { @@ -85,6 +94,9 @@ << send_buffer_.stream_bytes_outstanding() << ", fin_outstanding: " << fin_outstanding_; } + if (session_ != nullptr && session_->register_streams_early()) { + session_->UnregisterStreamPriority(id()); + } } void QuicStream::SetFromConfig() {} @@ -215,6 +227,16 @@ error, details, ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); } +SpdyPriority QuicStream::priority() const { + return priority_; +} + +void QuicStream::SetPriority(SpdyPriority priority) { + DCHECK_EQ(0u, stream_bytes_written()); + priority_ = priority; + session_->UpdateStreamPriority(id(), priority); +} + void QuicStream::WriteOrBufferData( QuicStringPiece data, bool fin,
diff --git a/net/quic/core/quic_stream.h b/net/quic/core/quic_stream.h index adc0279..d4a63972 100644 --- a/net/quic/core/quic_stream.h +++ b/net/quic/core/quic_stream.h
@@ -34,6 +34,7 @@ #include "net/quic/platform/api/quic_reference_counted.h" #include "net/quic/platform/api/quic_string.h" #include "net/quic/platform/api/quic_string_piece.h" +#include "net/spdy/core/spdy_protocol.h" namespace net { @@ -45,6 +46,15 @@ class QUIC_EXPORT_PRIVATE QuicStream { public: + // This is somewhat arbitrary. It's possible, but unlikely, we will either + // fail to set a priority client-side, or cancel a stream before stripping the + // priority from the wire server-side. In either case, start out with a + // priority in the middle. + static const SpdyPriority kDefaultPriority = 3; + static_assert(kDefaultPriority == + (kV3LowestPriority + kV3HighestPriority) / 2, + "Unexpected value of kDefaultPriority"); + QuicStream(QuicStreamId id, QuicSession* session); virtual ~QuicStream(); @@ -93,6 +103,12 @@ virtual void CloseConnectionWithDetails(QuicErrorCode error, const QuicString& details); + SpdyPriority priority() const; + + // Sets priority_ to priority. This should only be called before bytes are + // written to the server. + void SetPriority(SpdyPriority priority); + // Returns true if this stream is still waiting for acks of sent data. // This will return false if all data has been acked, or if the stream // is no longer interested in data being acked (which happens when @@ -338,6 +354,8 @@ QuicStreamId id_; // Pointer to the owning QuicSession object. QuicSession* session_; + // The priority of the stream, once parsed. + SpdyPriority priority_; // Bytes read refers to payload bytes only: they do not include framing, // encryption overhead etc. uint64_t stream_bytes_read_;
diff --git a/net/quic/core/quic_stream_send_buffer.cc b/net/quic/core/quic_stream_send_buffer.cc index df147826..5d2cfc2 100644 --- a/net/quic/core/quic_stream_send_buffer.cc +++ b/net/quic/core/quic_stream_send_buffer.cc
@@ -47,7 +47,17 @@ write_index_(-1), use_write_index_(GetQuicReloadableFlag(quic_use_write_index)), free_mem_slice_out_of_order_( - GetQuicReloadableFlag(quic_free_mem_slice_out_of_order)) {} + GetQuicReloadableFlag(quic_free_mem_slice_out_of_order)), + enable_fast_path_on_data_acked_( + free_mem_slice_out_of_order_ && + GetQuicReloadableFlag(quic_fast_path_on_stream_data_acked)) { + if (free_mem_slice_out_of_order_) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_free_mem_slice_out_of_order); + } + if (enable_fast_path_on_data_acked_) { + QUIC_FLAG_COUNT(quic_reloadable_flag_quic_fast_path_on_stream_data_acked); + } +} QuicStreamSendBuffer::~QuicStreamSendBuffer() {} @@ -184,6 +194,29 @@ if (data_length == 0) { return true; } + if (enable_fast_path_on_data_acked_) { + if (bytes_acked_.IsDisjoint( + Interval<QuicStreamOffset>(offset, offset + data_length))) { + // Optimization for the typical case, when all data is newly acked. + if (stream_bytes_outstanding_ < data_length) { + return false; + } + bytes_acked_.Add(offset, offset + data_length); + *newly_acked_length = data_length; + stream_bytes_outstanding_ -= data_length; + pending_retransmissions_.Difference(offset, offset + data_length); + if (!FreeMemSlices(offset, offset + data_length)) { + return false; + } + CleanUpBufferedSlices(); + return true; + } + // Exit if no new data gets acked. + if (bytes_acked_.Contains(offset, offset + data_length)) { + return true; + } + } + // Execute the slow path if newly acked data fill in existing holes. QuicIntervalSet<QuicStreamOffset> newly_acked(offset, offset + data_length); newly_acked.Difference(bytes_acked_); for (const auto& interval : newly_acked) { @@ -203,25 +236,7 @@ newly_acked.rbegin()->max())) { return false; } - while (!buffered_slices_.empty() && - buffered_slices_.front().slice.empty()) { - // Remove data which stops waiting for acks. Please note, mem slices can - // be released out of order, but send buffer is cleaned up in order. - if (use_write_index_) { - QUIC_BUG_IF(write_index_ == 0) - << "Fail to advance current_write_slice_. It points to the slice " - "whose data has all be written and ACK'ed or ignored. " - "current_write_slice_ offset " - << buffered_slices_[write_index_].offset << " length " - << buffered_slices_[write_index_].slice.length(); - if (write_index_ > 0) { - // If write index is pointing to any slice, reduce the index as the - // slices are all shifted to the left by one. - --write_index_; - } - } - buffered_slices_.pop_front(); - } + CleanUpBufferedSlices(); return true; } while (!buffered_slices_.empty() && @@ -312,6 +327,28 @@ return true; } +void QuicStreamSendBuffer::CleanUpBufferedSlices() { + DCHECK(free_mem_slice_out_of_order_); + while (!buffered_slices_.empty() && buffered_slices_.front().slice.empty()) { + // Remove data which stops waiting for acks. Please note, mem slices can + // be released out of order, but send buffer is cleaned up in order. + if (use_write_index_) { + QUIC_BUG_IF(write_index_ == 0) + << "Fail to advance current_write_slice_. It points to the slice " + "whose data has all be written and ACK'ed or ignored. " + "current_write_slice_ offset " + << buffered_slices_[write_index_].offset << " length " + << buffered_slices_[write_index_].slice.length(); + if (write_index_ > 0) { + // If write index is pointing to any slice, reduce the index as the + // slices are all shifted to the left by one. + --write_index_; + } + } + buffered_slices_.pop_front(); + } +} + bool QuicStreamSendBuffer::IsStreamDataOutstanding( QuicStreamOffset offset, QuicByteCount data_length) const {
diff --git a/net/quic/core/quic_stream_send_buffer.h b/net/quic/core/quic_stream_send_buffer.h index 5bf0d6a3..242f663d 100644 --- a/net/quic/core/quic_stream_send_buffer.h +++ b/net/quic/core/quic_stream_send_buffer.h
@@ -137,6 +137,9 @@ // not exist or has been acked. bool FreeMemSlices(QuicStreamOffset start, QuicStreamOffset end); + // Cleanup empty slices in order from buffered_slices_. + void CleanUpBufferedSlices(); + QuicDeque<BufferedSlice> buffered_slices_; // Offset of next inserted byte. @@ -165,6 +168,10 @@ // Latched value of quic_reloadable_flag_quic_free_mem_slice_out_of_order. const bool free_mem_slice_out_of_order_; + + // Latched value of quic_reloadable_flag_quic_free_mem_slice_out_of_order and + // quic_reloadable_flag_quic_fast_path_on_stream_data_acked. + const bool enable_fast_path_on_data_acked_; }; } // namespace net
diff --git a/net/quic/core/quic_stream_test.cc b/net/quic/core/quic_stream_test.cc index af56b2eff..f4732985 100644 --- a/net/quic/core/quic_stream_test.cc +++ b/net/quic/core/quic_stream_test.cc
@@ -123,7 +123,9 @@ .Times(AnyNumber()); write_blocked_list_ = QuicSessionPeer::GetWriteBlockedStreams(session_.get()); - write_blocked_list_->RegisterStream(kTestStreamId, kV3HighestPriority); + if (!session_->register_streams_early()) { + write_blocked_list_->RegisterStream(kTestStreamId, kV3HighestPriority); + } } bool fin_sent() { return QuicStreamPeer::FinSent(stream_); } @@ -134,7 +136,7 @@ } bool HasWriteBlockedStreams() { - return write_blocked_list_->HasWriteBlockedCryptoOrHeadersStream() || + return write_blocked_list_->HasWriteBlockedSpecialStream() || write_blocked_list_->HasWriteBlockedDataStreams(); }
diff --git a/net/quic/core/quic_types.h b/net/quic/core/quic_types.h index d237227..34fbcc8 100644 --- a/net/quic/core/quic_types.h +++ b/net/quic/core/quic_types.h
@@ -33,6 +33,9 @@ typedef uint64_t QuicIetfStreamId; typedef uint64_t QuicIetfStreamOffset; +const size_t kQuicPathFrameBufferSize = 8; + +typedef std::array<uint8_t, kQuicPathFrameBufferSize> QuicPathFrameBuffer; // A struct for functions which consume data payloads and fins. struct QUIC_EXPORT_PRIVATE QuicConsumedData { QuicConsumedData(size_t bytes_consumed, bool fin_consumed); @@ -156,8 +159,9 @@ IETF_STREAM_ID_BLOCKED = 0x0a, IETF_NEW_CONNECTION_ID = 0x0b, IETF_STOP_SENDING = 0x0c, - IETF_PONG = 0x0d, - IETF_ACK = 0x0e, + IETF_ACK = 0x0d, + IETF_PATH_CHALLENGE = 0x0e, + IETF_PATH_RESPONSE = 0x0f, // the low-3 bits of the stream frame type value are actually flags // declaring what parts of the frame are/are-not present, as well as // some other control information. The code would then do something
diff --git a/net/quic/core/quic_write_blocked_list.h b/net/quic/core/quic_write_blocked_list.h index a2b6033..f9a7538 100644 --- a/net/quic/core/quic_write_blocked_list.h +++ b/net/quic/core/quic_write_blocked_list.h
@@ -30,22 +30,26 @@ return priority_write_scheduler_.HasReadyStreams(); } - bool HasWriteBlockedCryptoOrHeadersStream() const { + bool HasWriteBlockedSpecialStream() const { return crypto_stream_blocked_ || headers_stream_blocked_; } - size_t NumBlockedStreams() const { - size_t num_blocked = priority_write_scheduler_.NumReadyStreams(); + size_t NumBlockedSpecialStreams() const { + size_t num_blocked = 0; if (crypto_stream_blocked_) { ++num_blocked; } if (headers_stream_blocked_) { ++num_blocked; } - return num_blocked; } + size_t NumBlockedStreams() const { + return NumBlockedSpecialStreams() + + priority_write_scheduler_.NumReadyStreams(); + } + bool ShouldYield(QuicStreamId id) const { if (id == kCryptoStreamId) { return false; // The crypto stream yields to none. @@ -156,9 +160,6 @@ return priority_write_scheduler_.IsStreamReady(stream_id); } - bool crypto_stream_blocked() const { return crypto_stream_blocked_; } - bool headers_stream_blocked() const { return headers_stream_blocked_; } - private: QuicPriorityWriteScheduler priority_write_scheduler_;
diff --git a/net/quic/core/quic_write_blocked_list_test.cc b/net/quic/core/quic_write_blocked_list_test.cc index 91d0313..3afb06d 100644 --- a/net/quic/core/quic_write_blocked_list_test.cc +++ b/net/quic/core/quic_write_blocked_list_test.cc
@@ -39,13 +39,16 @@ EXPECT_TRUE(write_blocked_list.IsStreamBlocked(kCryptoStreamId)); EXPECT_EQ(5u, write_blocked_list.NumBlockedStreams()); - EXPECT_TRUE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_TRUE(write_blocked_list.HasWriteBlockedSpecialStream()); + EXPECT_EQ(2u, write_blocked_list.NumBlockedSpecialStreams()); EXPECT_TRUE(write_blocked_list.HasWriteBlockedDataStreams()); // The Crypto stream is highest priority. EXPECT_EQ(kCryptoStreamId, write_blocked_list.PopFront()); + EXPECT_EQ(1u, write_blocked_list.NumBlockedSpecialStreams()); EXPECT_FALSE(write_blocked_list.IsStreamBlocked(kCryptoStreamId)); // Followed by the Headers stream. EXPECT_EQ(kHeadersStreamId, write_blocked_list.PopFront()); + EXPECT_EQ(0u, write_blocked_list.NumBlockedSpecialStreams()); EXPECT_FALSE(write_blocked_list.IsStreamBlocked(kHeadersStreamId)); // Streams with same priority are popped in the order they were inserted. EXPECT_EQ(23u, write_blocked_list.PopFront()); @@ -57,7 +60,7 @@ EXPECT_FALSE(write_blocked_list.IsStreamBlocked(40)); EXPECT_EQ(0u, write_blocked_list.NumBlockedStreams()); - EXPECT_FALSE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_FALSE(write_blocked_list.HasWriteBlockedSpecialStream()); EXPECT_FALSE(write_blocked_list.HasWriteBlockedDataStreams()); } @@ -67,10 +70,10 @@ write_blocked_list.AddStream(kCryptoStreamId); EXPECT_EQ(1u, write_blocked_list.NumBlockedStreams()); - EXPECT_TRUE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_TRUE(write_blocked_list.HasWriteBlockedSpecialStream()); EXPECT_EQ(kCryptoStreamId, write_blocked_list.PopFront()); EXPECT_EQ(0u, write_blocked_list.NumBlockedStreams()); - EXPECT_FALSE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_FALSE(write_blocked_list.HasWriteBlockedSpecialStream()); } TEST_F(QuicWriteBlockedListTest, HeadersStream) { @@ -79,10 +82,10 @@ write_blocked_list.AddStream(kHeadersStreamId); EXPECT_EQ(1u, write_blocked_list.NumBlockedStreams()); - EXPECT_TRUE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_TRUE(write_blocked_list.HasWriteBlockedSpecialStream()); EXPECT_EQ(kHeadersStreamId, write_blocked_list.PopFront()); EXPECT_EQ(0u, write_blocked_list.NumBlockedStreams()); - EXPECT_FALSE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_FALSE(write_blocked_list.HasWriteBlockedSpecialStream()); } TEST_F(QuicWriteBlockedListTest, VerifyHeadersStream) { @@ -93,14 +96,14 @@ write_blocked_list.AddStream(kHeadersStreamId); EXPECT_EQ(2u, write_blocked_list.NumBlockedStreams()); - EXPECT_TRUE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_TRUE(write_blocked_list.HasWriteBlockedSpecialStream()); EXPECT_TRUE(write_blocked_list.HasWriteBlockedDataStreams()); // In newer QUIC versions, there is a headers stream which is // higher priority than data streams. EXPECT_EQ(kHeadersStreamId, write_blocked_list.PopFront()); EXPECT_EQ(5u, write_blocked_list.PopFront()); EXPECT_EQ(0u, write_blocked_list.NumBlockedStreams()); - EXPECT_FALSE(write_blocked_list.HasWriteBlockedCryptoOrHeadersStream()); + EXPECT_FALSE(write_blocked_list.HasWriteBlockedSpecialStream()); EXPECT_FALSE(write_blocked_list.HasWriteBlockedDataStreams()); }
diff --git a/net/quic/platform/api/quic_test.h b/net/quic/platform/api/quic_test.h index b976b45..ca0b71e 100644 --- a/net/quic/platform/api/quic_test.h +++ b/net/quic/platform/api/quic_test.h
@@ -7,6 +7,8 @@ #include "net/quic/platform/impl/quic_test_impl.h" +using QuicFlagSaver = QuicFlagSaverImpl; + // Defines the base classes to be used in QUIC tests. using QuicTest = QuicTestImpl; template <class T>
diff --git a/net/quic/platform/impl/quic_test_impl.cc b/net/quic/platform/impl/quic_test_impl.cc index dc1709b..739a4951 100644 --- a/net/quic/platform/impl/quic_test_impl.cc +++ b/net/quic/platform/impl/quic_test_impl.cc
@@ -7,7 +7,7 @@ #include "base/logging.h" #include "net/quic/platform/api/quic_flags.h" -QuicFlagSaver::QuicFlagSaver() { +QuicFlagSaverImpl::QuicFlagSaverImpl() { #define QUIC_FLAG(type, flag, value) \ CHECK_EQ(value, flag) \ << "Flag set to an unexpected value. A prior test is likely " \ @@ -16,7 +16,7 @@ #undef QUIC_FLAG } -QuicFlagSaver::~QuicFlagSaver() { +QuicFlagSaverImpl::~QuicFlagSaverImpl() { #define QUIC_FLAG(type, flag, value) flag = value; #include "net/quic/core/quic_flags_list.h" #undef QUIC_FLAG
diff --git a/net/quic/platform/impl/quic_test_impl.h b/net/quic/platform/impl/quic_test_impl.h index 6be16527..4f6a418 100644 --- a/net/quic/platform/impl/quic_test_impl.h +++ b/net/quic/platform/impl/quic_test_impl.h
@@ -10,21 +10,21 @@ // When constructed, checks that all QUIC flags have their correct default // values and when destructed, restores those values. -class QuicFlagSaver { +class QuicFlagSaverImpl { public: - QuicFlagSaver(); - ~QuicFlagSaver(); + QuicFlagSaverImpl(); + ~QuicFlagSaverImpl(); }; class QuicTestImpl : public ::testing::Test { private: - QuicFlagSaver flags_; // Save/restore all QUIC flag values. + QuicFlagSaverImpl flags_; // Save/restore all QUIC flag values. }; template <class T> class QuicTestWithParamImpl : public ::testing::TestWithParam<T> { private: - QuicFlagSaver flags_; // Save/restore all QUIC flag values. + QuicFlagSaverImpl flags_; // Save/restore all QUIC flag values. }; #endif // NET_QUIC_PLATFORM_IMPL_QUIC_TEST_IMPL_H_
diff --git a/net/quic/quartc/quartc_session.cc b/net/quic/quartc/quartc_session.cc index 5bb483b..5b41d1d5 100644 --- a/net/quic/quartc/quartc_session.cc +++ b/net/quic/quartc/quartc_session.cc
@@ -14,10 +14,6 @@ namespace { -// Default priority for incoming QUIC streams. -// TODO(zhihuang): Determine if this value is correct. -static const SpdyPriority kDefaultPriority = 3; - // Arbitrary server port number for net::QuicCryptoClientConfig. const int kQuicServerPort = 0; @@ -165,8 +161,10 @@ } QuartcStream* QuartcSession::CreateOutgoingDynamicStream() { - return ActivateDataStream( - CreateDataStream(GetNextOutgoingStreamId(), kDefaultPriority)); + // Use default priority for incoming QUIC streams. + // TODO(zhihuang): Determine if this value is correct. + return ActivateDataStream(CreateDataStream(GetNextOutgoingStreamId(), + QuicStream::kDefaultPriority)); } void QuartcSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) { @@ -186,7 +184,9 @@ // QuicStream::OnClose), the stream is already closed so return. return; } - write_blocked_streams()->UnregisterStream(stream_id); + if (!register_streams_early()) { + write_blocked_streams()->UnregisterStream(stream_id); + } QuicSession::CloseStream(stream_id); } @@ -319,7 +319,7 @@ } QuicStream* QuartcSession::CreateIncomingDynamicStream(QuicStreamId id) { - return ActivateDataStream(CreateDataStream(id, kDefaultPriority)); + return ActivateDataStream(CreateDataStream(id, QuicStream::kDefaultPriority)); } std::unique_ptr<QuartcStream> QuartcSession::CreateDataStream( @@ -334,7 +334,11 @@ // Register the stream to the QuicWriteBlockedList. |priority| is clamped // between 0 and 7, with 0 being the highest priority and 7 the lowest // priority. - write_blocked_streams()->RegisterStream(stream->id(), priority); + if (!register_streams_early()) { + write_blocked_streams()->RegisterStream(stream->id(), priority); + } else { + write_blocked_streams()->UpdateStreamPriority(stream->id(), priority); + } if (IsIncomingStream(id)) { DCHECK(session_delegate_);
diff --git a/net/quic/quartc/quartc_stream_test.cc b/net/quic/quartc/quartc_stream_test.cc index 27065ad..41b1716 100644 --- a/net/quic/quartc/quartc_stream_test.cc +++ b/net/quic/quartc/quartc_stream_test.cc
@@ -20,7 +20,6 @@ namespace { -static const SpdyPriority kDefaultPriority = 3; static const QuicStreamId kStreamId = 5; static const QuartcStreamInterface::WriteParameters kDefaultParam; @@ -177,7 +176,10 @@ QuicMakeUnique<MockQuartcStreamDelegate>(kStreamId, &read_buffer_); stream_ = new QuartcStream(kStreamId, session_.get()); stream_->SetDelegate(mock_stream_delegate_.get()); - session_->RegisterReliableStream(stream_->stream_id(), kDefaultPriority); + if (!session_->register_streams_early()) { + session_->RegisterReliableStream(stream_->stream_id(), + QuicStream::kDefaultPriority); + } session_->ActivateReliableStream(std::unique_ptr<QuartcStream>(stream_)); }
diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc index d2e4147b..c2f6feb 100644 --- a/net/quic/test_tools/crypto_test_utils.cc +++ b/net/quic/test_tools/crypto_test_utils.cc
@@ -901,7 +901,7 @@ CryptoFramer::ConstructHandshakeMessage(msg, Perspective::IS_CLIENT)); std::unique_ptr<CryptoHandshakeMessage> parsed(CryptoFramer::ParseMessage( bytes->AsStringPiece(), Perspective::IS_CLIENT)); - CHECK(parsed.get()); + CHECK(parsed); return *parsed; }
diff --git a/net/quic/test_tools/quic_framer_peer.cc b/net/quic/test_tools/quic_framer_peer.cc index e9d65f4..87f67c5 100644 --- a/net/quic/test_tools/quic_framer_peer.cc +++ b/net/quic/test_tools/quic_framer_peer.cc
@@ -117,6 +117,49 @@ } // static +bool QuicFramerPeer::AppendIetfPaddingFrame(QuicFramer* framer, + const QuicPaddingFrame& frame, + QuicDataWriter* writer) { + return framer->AppendIetfPaddingFrame(frame, writer); +} +// static +void QuicFramerPeer::ProcessIetfPaddingFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicPaddingFrame* frame) { + framer->ProcessIetfPaddingFrame(reader, frame); +} + +// static +bool QuicFramerPeer::ProcessIetfPathChallengeFrame( + QuicFramer* framer, + QuicDataReader* reader, + QuicPathChallengeFrame* frame) { + return framer->ProcessIetfPathChallengeFrame(reader, frame); +} +// static +bool QuicFramerPeer::ProcessIetfPathResponseFrame( + QuicFramer* framer, + QuicDataReader* reader, + QuicPathResponseFrame* frame) { + return framer->ProcessIetfPathResponseFrame(reader, frame); +} + +// static +bool QuicFramerPeer::AppendIetfPathChallengeFrameAndTypeByte( + QuicFramer* framer, + const QuicPathChallengeFrame& frame, + QuicDataWriter* writer) { + return framer->AppendIetfPathChallengeFrameAndTypeByte(frame, writer); +} +// static +bool QuicFramerPeer::AppendIetfPathResponseFrameAndTypeByte( + QuicFramer* framer, + const QuicPathResponseFrame& frame, + QuicDataWriter* writer) { + return framer->AppendIetfPathResponseFrameAndTypeByte(frame, writer); +} + +// static void QuicFramerPeer::SwapCrypters(QuicFramer* framer1, QuicFramer* framer2) { for (int i = ENCRYPTION_NONE; i < NUM_ENCRYPTION_LEVELS; i++) { framer1->encrypter_[i].swap(framer2->encrypter_[i]);
diff --git a/net/quic/test_tools/quic_framer_peer.h b/net/quic/test_tools/quic_framer_peer.h index de18e9e9..a266100 100644 --- a/net/quic/test_tools/quic_framer_peer.h +++ b/net/quic/test_tools/quic_framer_peer.h
@@ -77,6 +77,30 @@ const QuicAckFrame& frame, QuicDataWriter* writer); + // Add/remove IETF-Format padding. + static bool AppendIetfPaddingFrame(QuicFramer* framer, + const QuicPaddingFrame& frame, + QuicDataWriter* writer); + static void ProcessIetfPaddingFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicPaddingFrame* frame); + + static bool ProcessIetfPathChallengeFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicPathChallengeFrame* frame); + static bool ProcessIetfPathResponseFrame(QuicFramer* framer, + QuicDataReader* reader, + QuicPathResponseFrame* frame); + + static bool AppendIetfPathChallengeFrameAndTypeByte( + QuicFramer* framer, + const QuicPathChallengeFrame& frame, + QuicDataWriter* writer); + static bool AppendIetfPathResponseFrameAndTypeByte( + QuicFramer* framer, + const QuicPathResponseFrame& frame, + QuicDataWriter* writer); + private: DISALLOW_COPY_AND_ASSIGN(QuicFramerPeer); };
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h index 8544ec8d..809fd03 100644 --- a/net/quic/test_tools/quic_test_utils.h +++ b/net/quic/test_tools/quic_test_utils.h
@@ -891,8 +891,7 @@ MOCK_METHOD1(OnPacketHeader, void(const QuicPacketHeader& header)); - MOCK_METHOD1(OnSuccessfulVersionNegotiation, - void(const QuicTransportVersion&)); + MOCK_METHOD1(OnSuccessfulVersionNegotiation, void(const ParsedQuicVersion&)); MOCK_METHOD1(OnStreamFrame, void(const QuicStreamFrame&));
diff --git a/net/socket/ssl_client_socket_impl.cc b/net/socket/ssl_client_socket_impl.cc index 550267a7..e5f787e 100644 --- a/net/socket/ssl_client_socket_impl.cc +++ b/net/socket/ssl_client_socket_impl.cc
@@ -720,6 +720,7 @@ SSL_is_token_binding_negotiated(ssl_.get()); ssl_info->token_binding_key_param = static_cast<net::TokenBindingParam>( SSL_get_negotiated_token_binding_param(ssl_.get())); + ssl_info->dummy_pq_padding_received = SSL_dummy_pq_padding_used(ssl_.get()); ssl_info->pinning_failure_log = pinning_failure_log_; ssl_info->ocsp_result = server_cert_verify_result_.ocsp_result; ssl_info->is_fatal_cert_error = is_fatal_cert_error_;
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc index c88c009..918fa659 100644 --- a/net/socket/ssl_client_socket_pool.cc +++ b/net/socket/ssl_client_socket_pool.cc
@@ -426,6 +426,13 @@ base::TimeDelta::FromMilliseconds(1), base::TimeDelta::FromMinutes(1), 100); } + + if (ssl_info.dummy_pq_padding_received) { + UMA_HISTOGRAM_CUSTOM_TIMES("Net.SSL_Connection_Latency_PQPadding", + connect_duration, + base::TimeDelta::FromMilliseconds(1), + base::TimeDelta::FromMinutes(1), 100); + } } base::UmaHistogramSparse("Net.SSL_Connection_Error", std::abs(result));
diff --git a/net/ssl/ssl_info.cc b/net/ssl/ssl_info.cc index f80610f2..4a04e91b 100644 --- a/net/ssl/ssl_info.cc +++ b/net/ssl/ssl_info.cc
@@ -40,6 +40,7 @@ channel_id_sent = false; token_binding_negotiated = false; token_binding_key_param = TB_PARAM_ECDSAP256; + dummy_pq_padding_received = false; handshake_type = HANDSHAKE_UNKNOWN; base::STLClearObject(&public_key_hashes); base::STLClearObject(&pinning_failure_log);
diff --git a/net/ssl/ssl_info.h b/net/ssl/ssl_info.h index 2d903cf2..77a979e 100644 --- a/net/ssl/ssl_info.h +++ b/net/ssl/ssl_info.h
@@ -113,6 +113,11 @@ // extension. TokenBindingParam token_binding_key_param; + // True if the server echoed a dummy post-quantum padding extension. See + // https://crbug.com/801302. + // TODO(agl): remove by 2018-05-31. + bool dummy_pq_padding_received; + HandshakeType handshake_type; // The hashes, in several algorithms, of the SubjectPublicKeyInfos from
diff --git a/net/tools/quic/chlo_extractor.cc b/net/tools/quic/chlo_extractor.cc index 2fadb6d..8dea877 100644 --- a/net/tools/quic/chlo_extractor.cc +++ b/net/tools/quic/chlo_extractor.cc
@@ -110,22 +110,20 @@ if (!crypto_framer.ProcessInput(data, Perspective::IS_SERVER)) { return false; } - if (FLAGS_quic_reloadable_flag_quic_inspect_chlo_tags) { - // Interrogate the crypto framer and see if there are any - // intersecting tags between what we saw in the maybe-CHLO and the - // indicator set. - for (const QuicTag tag : create_session_tag_indicators_) { - if (crypto_framer.HasTag(tag)) { - chlo_contains_tags_ = true; - } + // Interrogate the crypto framer and see if there are any + // intersecting tags between what we saw in the maybe-CHLO and the + // indicator set. + for (const QuicTag tag : create_session_tag_indicators_) { + if (crypto_framer.HasTag(tag)) { + chlo_contains_tags_ = true; } - if (chlo_contains_tags_ && delegate_) { - // Unfortunately, because this is a partial CHLO, - // OnHandshakeMessage was never called, so the ALPN was never - // extracted. Fake it up a bit and send it to the delegate so that - // the correct dispatch can happen. - crypto_framer.ForceHandshake(); - } + } + if (chlo_contains_tags_ && delegate_) { + // Unfortunately, because this is a partial CHLO, + // OnHandshakeMessage was never called, so the ALPN was never + // extracted. Fake it up a bit and send it to the delegate so that + // the correct dispatch can happen. + crypto_framer.ForceHandshake(); } }
diff --git a/net/tools/quic/crypto_message_printer_bin.cc b/net/tools/quic/crypto_message_printer_bin.cc index b466a008..26017544 100644 --- a/net/tools/quic/crypto_message_printer_bin.cc +++ b/net/tools/quic/crypto_message_printer_bin.cc
@@ -68,6 +68,7 @@ net::CryptoMessagePrinter printer(perspective); net::CryptoFramer framer; framer.set_visitor(&printer); + framer.set_process_truncated_messages(true); std::string input = net::QuicTextUtils::HexDecode(argv[1]); if (!framer.ProcessInput(input, perspective)) { return 1;
diff --git a/net/tools/quic/quic_client_epoll_network_helper.h b/net/tools/quic/quic_client_epoll_network_helper.h index 61fbaf0..a5117fd6 100644 --- a/net/tools/quic/quic_client_epoll_network_helper.h +++ b/net/tools/quic/quic_client_epoll_network_helper.h
@@ -92,6 +92,9 @@ void set_max_reads_per_epoll_loop(int num_reads) { max_reads_per_epoll_loop_ = num_reads; } + // If |fd| is an open UDP socket, unregister and close it. Otherwise, do + // nothing. + void CleanUpUDPSocket(int fd); private: friend class test::QuicClientPeer; @@ -99,10 +102,6 @@ // Used for testing. void SetClientPort(int port); - // If |fd| is an open UDP socket, unregister and close it. Otherwise, do - // nothing. - void CleanUpUDPSocket(int fd); - // Actually clean up |fd|. void CleanUpUDPSocketImpl(int fd);
diff --git a/net/tools/quic/quic_dispatcher.cc b/net/tools/quic/quic_dispatcher.cc index 8ed5d9e6..b00f12b 100644 --- a/net/tools/quic/quic_dispatcher.cc +++ b/net/tools/quic/quic_dispatcher.cc
@@ -60,9 +60,9 @@ // QuicPacketCreator::DelegateInterface methods: void OnSerializedPacket(SerializedPacket* serialized_packet) override { // Make a copy of the serialized packet to send later. - packets_.push_back(std::unique_ptr<QuicEncryptedPacket>( + packets_.emplace_back( new QuicEncryptedPacket(CopyBuffer(*serialized_packet), - serialized_packet->encrypted_length, true))); + serialized_packet->encrypted_length, true)); serialized_packet->encrypted_buffer = nullptr; DeleteFrames(&(serialized_packet->retransmittable_frames)); serialized_packet->retransmittable_frames.clear(); @@ -279,6 +279,8 @@ const QuicReceivedPacket& packet) { current_self_address_ = self_address; current_peer_address_ = peer_address; + // GetClientAddress must be called after current_peer_address_ is set. + current_client_address_ = GetClientAddress(); current_packet_ = &packet; // ProcessPacket will cause the packet to be dispatched in // OnUnauthenticatedPublicHeader, or sent to the time wait list manager @@ -286,6 +288,8 @@ framer_.ProcessPacket(packet); // TODO(rjshade): Return a status describing if/why a packet was dropped, // and log somehow. Maybe expose as a varz. + // TODO(wub): Consider invalidate the current_* variables so processing of the + // next packet does not use them incorrectly. } bool QuicDispatcher::OnUnauthenticatedPublicHeader( @@ -886,6 +890,7 @@ StatelessRejectorProcessDoneCallback(QuicDispatcher* dispatcher, ParsedQuicVersion first_version) : dispatcher_(dispatcher), + current_client_address_(dispatcher->current_client_address_), current_peer_address_(dispatcher->current_peer_address_), current_self_address_(dispatcher->current_self_address_), current_packet_( @@ -894,12 +899,13 @@ void Run(std::unique_ptr<StatelessRejector> rejector) override { dispatcher_->OnStatelessRejectorProcessDone( - std::move(rejector), current_peer_address_, current_self_address_, - std::move(current_packet_), first_version_); + std::move(rejector), current_client_address_, current_peer_address_, + current_self_address_, std::move(current_packet_), first_version_); } private: QuicDispatcher* dispatcher_; + QuicSocketAddress current_client_address_; QuicSocketAddress current_peer_address_; QuicSocketAddress current_self_address_; std::unique_ptr<QuicReceivedPacket> current_packet_; @@ -937,7 +943,7 @@ version.transport_version, GetSupportedTransportVersions(), crypto_config_, &compressed_certs_cache_, helper()->GetClock(), helper()->GetRandomGenerator(), current_packet_->length(), - GetClientAddress(), current_self_address_)); + current_client_address_, current_self_address_)); ChloValidator validator(session_helper_.get(), current_self_address_, rejector.get()); if (!ChloExtractor::Extract(*current_packet_, GetSupportedVersions(), @@ -982,6 +988,7 @@ void QuicDispatcher::OnStatelessRejectorProcessDone( std::unique_ptr<StatelessRejector> rejector, + const QuicSocketAddress& current_client_address, const QuicSocketAddress& current_peer_address, const QuicSocketAddress& current_self_address, std::unique_ptr<QuicReceivedPacket> current_packet, @@ -1004,6 +1011,7 @@ // Reset current_* to correspond to the packet which initiated the stateless // reject logic. + current_client_address_ = current_client_address; current_peer_address_ = current_peer_address; current_self_address_ = current_self_address; current_packet_ = current_packet.get();
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h index 8339e82..79672f23 100644 --- a/net/tools/quic/quic_dispatcher.h +++ b/net/tools/quic/quic_dispatcher.h
@@ -209,8 +209,13 @@ // and delivers any buffered packets for that connection id. void ProcessChlo(); - // Returns client address used for stateless rejector to generate and validate - // source address token. + // Returns the actual client address of the current packet. + // This function should only be called once per packet at the very beginning + // of ProcessPacket(), its result is saved to |current_client_address_|, which + // is guaranteed to be valid even in the stateless rejector's callback(i.e. + // OnStatelessRejectorProcessDone). + // By default, this function returns |current_peer_address_|, subclasses have + // the option to override this function to return a different address. virtual const QuicSocketAddress GetClientAddress() const; // Return true if dispatcher wants to destroy session outside of @@ -225,14 +230,19 @@ const ParsedQuicVersionVector& GetSupportedVersions(); - QuicConnectionId current_connection_id() { return current_connection_id_; } - const QuicSocketAddress& current_self_address() { + QuicConnectionId current_connection_id() const { + return current_connection_id_; + } + const QuicSocketAddress& current_self_address() const { return current_self_address_; } - const QuicSocketAddress& current_peer_address() { + const QuicSocketAddress& current_peer_address() const { return current_peer_address_; } - const QuicReceivedPacket& current_packet() { return *current_packet_; } + const QuicSocketAddress& current_client_address() const { + return current_client_address_; + } + const QuicReceivedPacket& current_packet() const { return *current_packet_; } const QuicConfig& config() const { return config_; } @@ -327,8 +337,11 @@ // Invoked when StatelessRejector::Process completes. |first_version| is the // version of the packet which initiated the stateless reject. + // WARNING: This function can be called when a async proof returns, i.e. not + // from a stack traceable to ProcessPacket(). void OnStatelessRejectorProcessDone( std::unique_ptr<StatelessRejector> rejector, + const QuicSocketAddress& current_client_address, const QuicSocketAddress& current_peer_address, const QuicSocketAddress& current_self_address, std::unique_ptr<QuicReceivedPacket> current_packet, @@ -388,6 +401,9 @@ QuicConnectionIdSet temporarily_buffered_connections_; // Information about the packet currently being handled. + + // Used for stateless rejector to generate and validate source address token. + QuicSocketAddress current_client_address_; QuicSocketAddress current_peer_address_; QuicSocketAddress current_self_address_; const QuicReceivedPacket* current_packet_;
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc index eca86ff..5ae1d3c 100644 --- a/net/tools/quic/quic_dispatcher_test.cc +++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -139,6 +139,7 @@ MOCK_METHOD1(ShouldCreateOrBufferPacketForConnection, bool(QuicConnectionId connection_id)); + using QuicDispatcher::current_client_address; using QuicDispatcher::current_peer_address; using QuicDispatcher::current_self_address; }; @@ -1801,6 +1802,7 @@ : QuicDispatcherTest( std::unique_ptr<FakeProofSource>(new FakeProofSource())), client_addr_(QuicIpAddress::Loopback4(), 1234), + client_addr_2_(QuicIpAddress::Loopback4(), 1357), crypto_config_peer_(&crypto_config_), signed_config_(new QuicSignedServerConfig) { SetQuicReloadableFlag(enable_quic_stateless_reject_support, true); @@ -1822,6 +1824,11 @@ signed_config_, QuicDispatcherPeer::GetCache(dispatcher_.get()), &full_chlo_); + crypto_test_utils::GenerateFullCHLO( + chlo_, &crypto_config_, server_addr_, client_addr_2_, version, clock_, + signed_config_, QuicDispatcherPeer::GetCache(dispatcher_.get()), + &full_chlo_2_); + GetFakeProofSource()->Activate(); } @@ -1830,9 +1837,13 @@ } QuicString SerializeFullCHLO() { - return full_chlo_.GetSerialized(Perspective::IS_CLIENT) - .AsStringPiece() - .as_string(); + return QuicString( + full_chlo_.GetSerialized(Perspective::IS_CLIENT).AsStringPiece()); + } + + QuicString SerializeFullCHLOForClient2() { + return QuicString( + full_chlo_2_.GetSerialized(Perspective::IS_CLIENT).AsStringPiece()); } QuicString SerializeCHLO() { @@ -1842,14 +1853,15 @@ } // Sets up a session, and crypto stream based on the test parameters. - QuicServerSessionBase* GetSession(QuicConnectionId connection_id) { + QuicServerSessionBase* GetSession(QuicConnectionId connection_id, + QuicSocketAddress client_address) { auto it = sessions_.find(connection_id); if (it != sessions_.end()) { return it->second.session; } TestQuicSpdyServerSession* session; - CreateSession(dispatcher_.get(), config_, connection_id, client_addr_, + CreateSession(dispatcher_.get(), config_, connection_id, client_address, &mock_helper_, &mock_alarm_factory_, &crypto_config_, QuicDispatcherPeer::GetCache(dispatcher_.get()), &session); @@ -1870,6 +1882,7 @@ protected: const QuicSocketAddress client_addr_; + const QuicSocketAddress client_addr_2_; private: QuicCryptoServerConfigPeer crypto_config_peer_; @@ -1877,7 +1890,8 @@ QuicReferenceCountedPointer<QuicSignedServerConfig> signed_config_; const QuicClock* clock_; CryptoHandshakeMessage chlo_; - CryptoHandshakeMessage full_chlo_; + CryptoHandshakeMessage full_chlo_; // CHLO for client_addr_ + CryptoHandshakeMessage full_chlo_2_; // CHLO for client_addr_2_ struct SessionInfo { TestQuicSpdyServerSession* session; @@ -1899,9 +1913,9 @@ EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id)); EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_, QuicStringPiece("HTTP/1"))) - .WillOnce(testing::Return(GetSession(conn_id))); + .WillOnce(testing::Return(GetSession(conn_id, client_addr_))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( - GetSession(conn_id)->connection()), + GetSession(conn_id, client_addr_)->connection()), ProcessUdpPacket(_, _, _)) .WillOnce(WithArg<2>( Invoke([this, conn_id](const QuicEncryptedPacket& packet) { @@ -1910,7 +1924,7 @@ EXPECT_CALL(check, Call(2)); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( - GetSession(conn_id)->connection()), + GetSession(conn_id, client_addr_)->connection()), ProcessUdpPacket(_, _, _)) .WillOnce(WithArg<2>( Invoke([this, conn_id](const QuicEncryptedPacket& packet) { @@ -1933,6 +1947,83 @@ ProcessPacket(client_addr_, conn_id, true, "My name is Data"); } +TEST_F(AsyncGetProofTest, RestorePacketContext) { + QuicConnectionId conn_id_1 = 1; + QuicConnectionId conn_id_2 = 2; + + testing::MockFunction<void(int check_point)> check; + { + InSequence s; + EXPECT_CALL(check, Call(1)); + EXPECT_CALL(*dispatcher_, + ShouldCreateOrBufferPacketForConnection(conn_id_1)); + + EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_1, client_addr_, + QuicStringPiece("HTTP/1"))) + .WillOnce(testing::Return(GetSession(conn_id_1, client_addr_))); + EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( + GetSession(conn_id_1, client_addr_)->connection()), + ProcessUdpPacket(_, _, _)) + .WillRepeatedly(WithArg<2>( + Invoke([this, conn_id_1](const QuicEncryptedPacket& packet) { + ValidatePacket(conn_id_1, packet); + }))); + + EXPECT_CALL(check, Call(2)); + + EXPECT_CALL(*dispatcher_, + ShouldCreateOrBufferPacketForConnection(conn_id_2)); + EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_2, client_addr_2_, + QuicStringPiece("HTTP/1"))) + .WillOnce(testing::Return(GetSession(conn_id_2, client_addr_2_))); + EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( + GetSession(conn_id_2, client_addr_2_)->connection()), + ProcessUdpPacket(_, _, _)) + .WillOnce(WithArg<2>( + Invoke([this, conn_id_2](const QuicEncryptedPacket& packet) { + ValidatePacket(conn_id_2, packet); + }))); + } + + // Send a CHLO that the StatelessRejector will accept. + ProcessPacket(client_addr_, conn_id_1, true, SerializeFullCHLO()); + ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1); + + // Send another CHLO that the StatelessRejector will accept. + ProcessPacket(client_addr_2_, conn_id_2, true, SerializeFullCHLOForClient2()); + ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 2); + + // Complete the first ProofSource::GetProof call and verify that a session is + // created. + check.Call(1); + + EXPECT_EQ(client_addr_2_, dispatcher_->current_client_address()); + EXPECT_EQ(client_addr_2_, dispatcher_->current_peer_address()); + + // Runs the async proof callback for conn_id_1 from client_addr_. + GetFakeProofSource()->InvokePendingCallback(0); + + EXPECT_EQ(client_addr_, dispatcher_->current_client_address()); + EXPECT_EQ(client_addr_, dispatcher_->current_peer_address()); + + ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 1); + + // Complete the second ProofSource::GetProof call and verify that a session is + // created. + check.Call(2); + + EXPECT_EQ(client_addr_, dispatcher_->current_client_address()); + EXPECT_EQ(client_addr_, dispatcher_->current_peer_address()); + + // Runs the async proof callback for conn_id_2 from client_addr_2_. + GetFakeProofSource()->InvokePendingCallback(0); + + EXPECT_EQ(client_addr_2_, dispatcher_->current_client_address()); + EXPECT_EQ(client_addr_2_, dispatcher_->current_peer_address()); + + ASSERT_EQ(GetFakeProofSource()->NumPendingCallbacks(), 0); +} + // Test a simple situation of connections which the StatelessRejector will // reject. TEST_F(AsyncGetProofTest, BasicReject) { @@ -1988,9 +2079,9 @@ ShouldCreateOrBufferPacketForConnection(conn_id_2)); EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_2, client_addr_, QuicStringPiece("HTTP/1"))) - .WillOnce(testing::Return(GetSession(conn_id_2))); + .WillOnce(testing::Return(GetSession(conn_id_2, client_addr_))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( - GetSession(conn_id_2)->connection()), + GetSession(conn_id_2, client_addr_)->connection()), ProcessUdpPacket(_, _, _)) .WillOnce(WithArg<2>( Invoke([this, conn_id_2](const QuicEncryptedPacket& packet) { @@ -1999,7 +2090,7 @@ EXPECT_CALL(check, Call(2)); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( - GetSession(conn_id_2)->connection()), + GetSession(conn_id_2, client_addr_)->connection()), ProcessUdpPacket(_, _, _)) .WillOnce(WithArg<2>( Invoke([this, conn_id_2](const QuicEncryptedPacket& packet) { @@ -2013,9 +2104,9 @@ EXPECT_CALL(check, Call(4)); EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id_1, client_addr_, QuicStringPiece("HTTP/1"))) - .WillOnce(testing::Return(GetSession(conn_id_1))); + .WillOnce(testing::Return(GetSession(conn_id_1, client_addr_))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( - GetSession(conn_id_1)->connection()), + GetSession(conn_id_1, client_addr_)->connection()), ProcessUdpPacket(_, _, _)) .WillRepeatedly(WithArg<2>( Invoke([this, conn_id_1](const QuicEncryptedPacket& packet) { @@ -2245,9 +2336,9 @@ EXPECT_CALL(*dispatcher_, ShouldCreateOrBufferPacketForConnection(conn_id)); EXPECT_CALL(*dispatcher_, CreateQuicSession(conn_id, client_addr_, QuicStringPiece("HTTP/1"))) - .WillOnce(testing::Return(GetSession(conn_id))); + .WillOnce(testing::Return(GetSession(conn_id, client_addr_))); EXPECT_CALL(*reinterpret_cast<MockQuicConnection*>( - GetSession(conn_id)->connection()), + GetSession(conn_id, client_addr_)->connection()), ProcessUdpPacket(_, _, _)) .WillOnce(WithArg<2>( Invoke([this, conn_id](const QuicEncryptedPacket& packet) {
diff --git a/net/tools/quic/quic_simple_server_session_test.cc b/net/tools/quic/quic_simple_server_session_test.cc index 6800e761..677df664 100644 --- a/net/tools/quic/quic_simple_server_session_test.cc +++ b/net/tools/quic/quic_simple_server_session_test.cc
@@ -522,14 +522,15 @@ string body(body_size, 'a'); response_cache_.AddSimpleResponse(resource_host, path, 200, body); push_resources.push_back(QuicHttpResponseCache::ServerPushInfo( - resource_url, SpdyHeaderBlock(), kDefaultPriority, body)); + resource_url, SpdyHeaderBlock(), QuicStream::kDefaultPriority, body)); // PUSH_PROMISED are sent for all the resources. EXPECT_CALL(*session_, WritePushPromiseMock(GetNthClientInitiatedId(0), stream_id, _)); if (i <= kMaxStreamsForTest) { // |kMaxStreamsForTest| promised responses should be sent. EXPECT_CALL(*session_, - WriteHeadersMock(stream_id, _, false, kDefaultPriority, _)); + WriteHeadersMock(stream_id, _, false, + QuicStream::kDefaultPriority, _)); // Since flow control window is smaller than response body, not the // whole body will be sent. EXPECT_CALL(*connection_, SendStreamData(stream_id, _, 0, NO_FIN)) @@ -573,7 +574,7 @@ // After an open stream is marked draining, a new stream is expected to be // created and a response sent on the stream. EXPECT_CALL(*session_, WriteHeadersMock(next_out_going_stream_id, _, false, - kDefaultPriority, _)); + QuicStream::kDefaultPriority, _)); EXPECT_CALL(*connection_, SendStreamData(next_out_going_stream_id, _, 0, NO_FIN)) .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false))); @@ -622,7 +623,7 @@ QuicStreamId stream_not_reset = GetNthServerInitiatedId(kMaxStreamsForTest); InSequence s; EXPECT_CALL(*session_, WriteHeadersMock(stream_not_reset, _, false, - kDefaultPriority, _)); + QuicStream::kDefaultPriority, _)); EXPECT_CALL(*connection_, SendStreamData(stream_not_reset, _, 0, NO_FIN)) .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false))); if (session_->use_control_frame_manager()) { @@ -630,8 +631,8 @@ } else { EXPECT_CALL(*connection_, SendBlocked(stream_not_reset)); } - EXPECT_CALL(*session_, - WriteHeadersMock(stream_got_reset, _, false, kDefaultPriority, _)) + EXPECT_CALL(*session_, WriteHeadersMock(stream_got_reset, _, false, + QuicStream::kDefaultPriority, _)) .Times(0); session_->StreamDraining(GetNthServerInitiatedId(0)); @@ -657,8 +658,8 @@ EXPECT_CALL(*connection_, SendRstStream(stream_got_reset, QUIC_RST_ACKNOWLEDGEMENT, _)); } - EXPECT_CALL(*session_, - WriteHeadersMock(stream_to_open, _, false, kDefaultPriority, _)); + EXPECT_CALL(*session_, WriteHeadersMock(stream_to_open, _, false, + QuicStream::kDefaultPriority, _)); EXPECT_CALL(*connection_, SendStreamData(stream_to_open, _, 0, NO_FIN)) .WillOnce(Return(QuicConsumedData(kStreamFlowControlWindowSize, false)));
diff --git a/net/tools/quic/quic_simple_server_stream_test.cc b/net/tools/quic/quic_simple_server_stream_test.cc index 1d119ac..5163c42 100644 --- a/net/tools/quic/quic_simple_server_stream_test.cc +++ b/net/tools/quic/quic_simple_server_stream_test.cc
@@ -26,12 +26,12 @@ #include "testing/gtest/include/gtest/gtest.h" using std::string; +using testing::_; using testing::AnyNumber; using testing::InSequence; using testing::Invoke; using testing::Return; using testing::StrictMock; -using testing::_; namespace net { namespace test { @@ -423,7 +423,8 @@ string request_path = "/foo"; string body = "Yummm"; QuicHttpResponseCache::ServerPushInfo push_info( - QuicUrl(host, "/bar"), SpdyHeaderBlock(), kDefaultPriority, "Push body"); + QuicUrl(host, "/bar"), SpdyHeaderBlock(), QuicStream::kDefaultPriority, + "Push body"); std::list<QuicHttpResponseCache::ServerPushInfo> push_resources; push_resources.push_back(push_info); response_cache_.AddSimpleResponseWithServerPushResources(
diff --git a/net/tools/quic/quic_spdy_client_base.cc b/net/tools/quic/quic_spdy_client_base.cc index 6cad4ee..b7bf7c3 100644 --- a/net/tools/quic/quic_spdy_client_base.cc +++ b/net/tools/quic/quic_spdy_client_base.cc
@@ -153,7 +153,7 @@ auto* stream = static_cast<QuicSpdyClientStream*>( client_session()->CreateOutgoingDynamicStream()); if (stream) { - stream->SetPriority(kDefaultPriority); + stream->SetPriority(QuicStream::kDefaultPriority); stream->set_visitor(this); } return stream;
diff --git a/printing/printing_context_win.cc b/printing/printing_context_win.cc index 5ae219df..ff0d7054 100644 --- a/printing/printing_context_win.cc +++ b/printing/printing_context_win.cc
@@ -217,7 +217,7 @@ if (show_system_dialog) { PrintingContext::Result result = PrintingContext::FAILED; AskUserForSettings(page_count, false, false, - base::Bind(&AssignResult, &result)); + base::BindOnce(&AssignResult, &result)); return result; } // Set printer then refresh printer settings.
diff --git a/printing/printing_context_win_unittest.cc b/printing/printing_context_win_unittest.cc index 9ba225e..0763474b 100644 --- a/printing/printing_context_win_unittest.cc +++ b/printing/printing_context_win_unittest.cc
@@ -148,11 +148,9 @@ MockPrintingContextWin context(this); context.AskUserForSettings( - 123, - false, - false, - base::Bind(&PrintingContextTest::PrintSettingsCallback, - base::Unretained(this))); + 123, false, false, + base::BindOnce(&PrintingContextTest::PrintSettingsCallback, + base::Unretained(this))); EXPECT_EQ(PrintingContext::OK, result()); PrintSettings settings = context.settings(); EXPECT_EQ(0u, settings.ranges().size());
diff --git a/remoting/android/java/src/org/chromium/chromoting/SimulatedTouchInputStrategy.java b/remoting/android/java/src/org/chromium/chromoting/SimulatedTouchInputStrategy.java index 2c3981ab..6abcf29f 100644 --- a/remoting/android/java/src/org/chromium/chromoting/SimulatedTouchInputStrategy.java +++ b/remoting/android/java/src/org/chromium/chromoting/SimulatedTouchInputStrategy.java
@@ -74,7 +74,7 @@ // factor to make the interaction more intuitive and useful for our scenario. ViewConfiguration config = ViewConfiguration.get(context); int scaledDoubleTapSlopInPx = config.getScaledDoubleTapSlop(); - scaledDoubleTapSlopInPx *= DOUBLE_TAP_SLOP_SCALE_FACTOR; + scaledDoubleTapSlopInPx = (int) (scaledDoubleTapSlopInPx * DOUBLE_TAP_SLOP_SCALE_FACTOR); mDoubleTapSlopSquareInPx = scaledDoubleTapSlopInPx * scaledDoubleTapSlopInPx; mRenderData.drawCursor = false;
diff --git a/remoting/android/java/src/org/chromium/chromoting/jni/TouchEventData.java b/remoting/android/java/src/org/chromium/chromoting/jni/TouchEventData.java index 9f25748..48c014af 100644 --- a/remoting/android/java/src/org/chromium/chromoting/jni/TouchEventData.java +++ b/remoting/android/java/src/org/chromium/chromoting/jni/TouchEventData.java
@@ -76,7 +76,7 @@ // MotionEvent angle is measured in radians and our API expects a positive value in degrees. if (touchPointAngleInRadians < 0.0f) { - touchPointAngleInRadians += (2 * Math.PI); + touchPointAngleInRadians = (float) (touchPointAngleInRadians + (2 * Math.PI)); } mTouchPointAngleInDegrees = (float) Math.toDegrees(touchPointAngleInRadians); }
diff --git a/remoting/host/current_process_stats_agent.cc b/remoting/host/current_process_stats_agent.cc index 49bc2ab..d848a33 100644 --- a/remoting/host/current_process_stats_agent.cc +++ b/remoting/host/current_process_stats_agent.cc
@@ -26,13 +26,17 @@ protocol::ProcessResourceUsage current; current.set_process_name(process_name_); current.set_processor_usage(metrics_->GetPlatformIndependentCPUUsage()); - current.set_working_set_size(metrics_->GetWorkingSetSize()); -// The concept of "Page File" is only well defined on Windows. +// The concepts of "Page File" and "Working Set" are only well defined on +// Windows. +// TODO: Currently, this code is only run on Windows. In the future, if/when +// this code runs on other platforms, consistent memory metrics should be +// obtained from the memory-infra service. #if defined(OS_WIN) PROCESS_MEMORY_COUNTERS pmc; if (::GetProcessMemoryInfo(::GetCurrentProcess(), &pmc, sizeof(pmc))) { current.set_pagefile_size(pmc.PagefileUsage); + current.set_working_set_size(pmc.WorkingSetSize); } #endif
diff --git a/services/audio/public/mojom/BUILD.gn b/services/audio/public/mojom/BUILD.gn index 330ebef..d78c98f 100644 --- a/services/audio/public/mojom/BUILD.gn +++ b/services/audio/public/mojom/BUILD.gn
@@ -15,6 +15,7 @@ public_deps = [ ":constants", "//media/mojo/interfaces", + "//mojo/common:common_custom_types", ] }
diff --git a/services/data_decoder/public/cpp/test_data_decoder_service.cc b/services/data_decoder/public/cpp/test_data_decoder_service.cc index e34d7f4..f5a9569 100644 --- a/services/data_decoder/public/cpp/test_data_decoder_service.cc +++ b/services/data_decoder/public/cpp/test_data_decoder_service.cc
@@ -16,4 +16,64 @@ TestDataDecoderService::~TestDataDecoderService() = default; +CrashyDataDecoderService::CrashyDataDecoderService(bool crash_json, + bool crash_image) + : real_service_(DataDecoderService::Create()), + crash_json_(crash_json), + crash_image_(crash_image) {} + +CrashyDataDecoderService::~CrashyDataDecoderService() = default; + +// service_manager::Service: +void CrashyDataDecoderService::OnStart() { + real_service_->OnStart(); +} + +void CrashyDataDecoderService::OnBindInterface( + const service_manager::BindSourceInfo& source_info, + const std::string& interface_name, + mojo::ScopedMessagePipeHandle interface_pipe) { + DCHECK(interface_name == mojom::JsonParser::Name_ || + interface_name == mojom::ImageDecoder::Name_); + if (interface_name == mojom::JsonParser::Name_ && crash_json_) { + DCHECK(!json_parser_binding_); + json_parser_binding_ = std::make_unique<mojo::Binding<mojom::JsonParser>>( + this, mojom::JsonParserRequest(std::move(interface_pipe))); + return; + } + if (interface_name == mojom::ImageDecoder::Name_ && crash_image_) { + DCHECK(!image_decoder_binding_); + image_decoder_binding_ = + std::make_unique<mojo::Binding<mojom::ImageDecoder>>( + this, mojom::ImageDecoderRequest(std::move(interface_pipe))); + return; + } + real_service_->OnBindInterface(source_info, interface_name, + std::move(interface_pipe)); +} + +// Overridden from mojom::ImageDecoder: +void CrashyDataDecoderService::DecodeImage( + const std::vector<uint8_t>& encoded_data, + mojom::ImageCodec codec, + bool shrink_to_fit, + int64_t max_size_in_bytes, + const gfx::Size& desired_image_frame_size, + DecodeImageCallback callback) { + image_decoder_binding_.reset(); +} + +void CrashyDataDecoderService::DecodeAnimation( + const std::vector<uint8_t>& encoded_data, + bool shrink_to_fit, + int64_t max_size_in_bytes, + DecodeAnimationCallback callback) { + image_decoder_binding_.reset(); +} + +void CrashyDataDecoderService::Parse(const std::string& json, + ParseCallback callback) { + json_parser_binding_.reset(); +} + } // namespace data_decoder \ No newline at end of file
diff --git a/services/data_decoder/public/cpp/test_data_decoder_service.h b/services/data_decoder/public/cpp/test_data_decoder_service.h index 8b59f28..6a8b9d2 100644 --- a/services/data_decoder/public/cpp/test_data_decoder_service.h +++ b/services/data_decoder/public/cpp/test_data_decoder_service.h
@@ -8,6 +8,11 @@ #include <memory> #include "base/macros.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "services/data_decoder/data_decoder_service.h" +#include "services/data_decoder/public/mojom/image_decoder.mojom.h" +#include "services/data_decoder/public/mojom/json_parser.mojom.h" +#include "services/service_manager/public/cpp/service.h" #include "services/service_manager/public/cpp/test/test_connector_factory.h" namespace service_manager { @@ -34,6 +39,52 @@ DISALLOW_COPY_AND_ASSIGN(TestDataDecoderService); }; +// An implementation of the DataDecoderService that closes the connection when +// a call is made on an interface. +// Can be used with a TestConnectorFactory to simulate crashes in the service +// while processing a call. +class CrashyDataDecoderService : public service_manager::Service, + public mojom::ImageDecoder, + public mojom::JsonParser { + public: + CrashyDataDecoderService(bool crash_json, bool crash_image); + ~CrashyDataDecoderService() override; + + // service_manager::Service: + void OnStart() override; + void OnBindInterface(const service_manager::BindSourceInfo& source_info, + const std::string& interface_name, + mojo::ScopedMessagePipeHandle interface_pipe) override; + + // mojom::ImageDecoder implementation: + void DecodeImage(const std::vector<uint8_t>& encoded_data, + mojom::ImageCodec codec, + bool shrink_to_fit, + int64_t max_size_in_bytes, + const gfx::Size& desired_image_frame_size, + DecodeImageCallback callback) override; + void DecodeAnimation(const std::vector<uint8_t>& encoded_data, + bool shrink_to_fit, + int64_t max_size_in_bytes, + DecodeAnimationCallback callback) override; + + // mojom::JsonParser implementation. + void Parse(const std::string& json, ParseCallback callback) override; + + private: + std::unique_ptr<mojo::Binding<mojom::ImageDecoder>> image_decoder_binding_; + std::unique_ptr<mojo::Binding<mojom::JsonParser>> json_parser_binding_; + + // An instance of the actual DataDecoderService we forward requests to for + // interfaces that should not crash. + std::unique_ptr<service_manager::Service> real_service_; + + bool crash_json_ = false; + bool crash_image_ = false; + + DISALLOW_COPY_AND_ASSIGN(CrashyDataDecoderService); +}; + } // namespace data_decoder #endif // SERVICES_DATA_DECODER_PUBLIC_CPP_TEST_DATA_DECODER_SERVICE_H_
diff --git a/services/device/generic_sensor/fake_platform_sensor_and_provider.cc b/services/device/generic_sensor/fake_platform_sensor_and_provider.cc index 166f9951..0d53e3bc 100644 --- a/services/device/generic_sensor/fake_platform_sensor_and_provider.cc +++ b/services/device/generic_sensor/fake_platform_sensor_and_provider.cc
@@ -51,7 +51,7 @@ } double FakePlatformSensor::GetMaximumSupportedFrequency() { - return 50.0; + return maximum_supported_frequency_; } double FakePlatformSensor::GetMinimumSupportedFrequency() {
diff --git a/services/device/generic_sensor/fake_platform_sensor_and_provider.h b/services/device/generic_sensor/fake_platform_sensor_and_provider.h index 79cf9cd1..eeaac4f 100644 --- a/services/device/generic_sensor/fake_platform_sensor_and_provider.h +++ b/services/device/generic_sensor/fake_platform_sensor_and_provider.h
@@ -22,6 +22,10 @@ MOCK_METHOD1(StartSensor, bool(const PlatformSensorConfiguration& configuration)); + void set_maximum_supported_frequency(double maximum_supported_frequency) { + maximum_supported_frequency_ = maximum_supported_frequency; + } + protected: void StopSensor() override {} @@ -35,6 +39,8 @@ double GetMaximumSupportedFrequency() override; double GetMinimumSupportedFrequency() override; + double maximum_supported_frequency_ = 50.0; + ~FakePlatformSensor() override; DISALLOW_COPY_AND_ASSIGN(FakePlatformSensor);
diff --git a/services/device/generic_sensor/platform_sensor_fusion.cc b/services/device/generic_sensor/platform_sensor_fusion.cc index d7168a2b..16812034 100644 --- a/services/device/generic_sensor/platform_sensor_fusion.cc +++ b/services/device/generic_sensor/platform_sensor_fusion.cc
@@ -4,6 +4,8 @@ #include "services/device/generic_sensor/platform_sensor_fusion.h" +#include <algorithm> + #include "base/logging.h" #include "base/memory/scoped_refptr.h" #include "services/device/generic_sensor/platform_sensor_fusion_algorithm.h" @@ -144,7 +146,10 @@ // Remove all the previously added source configs. StopSensor(); for (const auto& pair : source_sensors_) { - if (!pair.second->StartListening(this, configuration)) { + if (!pair.second->StartListening( + this, PlatformSensorConfiguration( + std::min(configuration.frequency(), + pair.second->GetMaximumSupportedFrequency())))) { StopSensor(); return false; } @@ -164,12 +169,23 @@ bool PlatformSensorFusion::CheckSensorConfiguration( const PlatformSensorConfiguration& configuration) { for (const auto& pair : source_sensors_) { - if (!pair.second->CheckSensorConfiguration(configuration)) + if (!pair.second->CheckSensorConfiguration(PlatformSensorConfiguration( + std::min(configuration.frequency(), + pair.second->GetMaximumSupportedFrequency())))) return false; } return true; } +double PlatformSensorFusion::GetMaximumSupportedFrequency() { + double maximum_frequency = 0.0; + for (const auto& pair : source_sensors_) { + maximum_frequency = std::max(maximum_frequency, + pair.second->GetMaximumSupportedFrequency()); + } + return maximum_frequency; +} + void PlatformSensorFusion::OnSensorReadingChanged(mojom::SensorType type) { SensorReading reading; reading.raw.timestamp =
diff --git a/services/device/generic_sensor/platform_sensor_fusion.h b/services/device/generic_sensor/platform_sensor_fusion.h index 0ce3d9fb..d25a5abd 100644 --- a/services/device/generic_sensor/platform_sensor_fusion.h +++ b/services/device/generic_sensor/platform_sensor_fusion.h
@@ -48,6 +48,7 @@ PlatformSensorConfiguration GetDefaultConfiguration() override; bool CheckSensorConfiguration( const PlatformSensorConfiguration& configuration) override; + double GetMaximumSupportedFrequency() override; // PlatformSensor::Client: void OnSensorReadingChanged(mojom::SensorType type) override;
diff --git a/services/device/generic_sensor/platform_sensor_fusion_unittest.cc b/services/device/generic_sensor/platform_sensor_fusion_unittest.cc index 91106d5..e7ac303 100644 --- a/services/device/generic_sensor/platform_sensor_fusion_unittest.cc +++ b/services/device/generic_sensor/platform_sensor_fusion_unittest.cc
@@ -328,4 +328,33 @@ EXPECT_FALSE(fusion_sensor_); } +TEST_F(PlatformSensorFusionTest, + FusionSensorMaximumSupportedFrequencyIsTheMaximumOfItsSourceSensors) { + EXPECT_FALSE(provider_->GetSensor(SensorType::ACCELEROMETER)); + CreateAccelerometer(); + scoped_refptr<PlatformSensor> accelerometer = + provider_->GetSensor(SensorType::ACCELEROMETER); + EXPECT_TRUE(accelerometer); + static_cast<FakePlatformSensor*>(accelerometer.get()) + ->set_maximum_supported_frequency(30.0); + + EXPECT_FALSE(provider_->GetSensor(SensorType::MAGNETOMETER)); + CreateMagnetometer(); + scoped_refptr<PlatformSensor> magnetometer = + provider_->GetSensor(SensorType::MAGNETOMETER); + EXPECT_TRUE(magnetometer); + static_cast<FakePlatformSensor*>(magnetometer.get()) + ->set_maximum_supported_frequency(20.0); + + CreateAbsoluteOrientationEulerAnglesFusionSensor(); + EXPECT_TRUE(fusion_sensor_); + EXPECT_EQ(SensorType::ABSOLUTE_ORIENTATION_EULER_ANGLES, + fusion_sensor_->GetType()); + EXPECT_EQ(30.0, fusion_sensor_->GetMaximumSupportedFrequency()); + auto client = std::make_unique<testing::NiceMock<MockPlatformSensorClient>>( + fusion_sensor_); + EXPECT_TRUE(fusion_sensor_->StartListening( + client.get(), PlatformSensorConfiguration(30.0))); +} + } // namespace device
diff --git a/services/device/public/mojom/BUILD.gn b/services/device/public/mojom/BUILD.gn index 0691ad5..fc5fb1f 100644 --- a/services/device/public/mojom/BUILD.gn +++ b/services/device/public/mojom/BUILD.gn
@@ -32,7 +32,9 @@ public_deps = [ ":constants", + "//mojo/common:common_custom_types", "//services/network/public/mojom", + "//services/network/public/mojom:mutable_network_traffic_annotation_interface", ] # The blink variant of the Device Service mojom are depended on by the
diff --git a/services/device/public/mojom/sensor_provider.mojom b/services/device/public/mojom/sensor_provider.mojom index da07a846..b341f5fa 100644 --- a/services/device/public/mojom/sensor_provider.mojom +++ b/services/device/public/mojom/sensor_provider.mojom
@@ -4,7 +4,7 @@ module device.mojom; -import "sensor.mojom"; +import "services/device/public/mojom/sensor.mojom"; struct SensorInitParams { // The Sensor interface.
diff --git a/services/network/network_service.h b/services/network/network_service.h index 23c188a..51922c3 100644 --- a/services/network/network_service.h +++ b/services/network/network_service.h
@@ -104,8 +104,6 @@ private: class MojoNetLog; - friend class NetworkService; - // service_manager::Service implementation. void OnBindInterface(const service_manager::BindSourceInfo& source_info, const std::string& interface_name,
diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn index 4c448790b..95ab4d8 100644 --- a/services/network/public/mojom/BUILD.gn +++ b/services/network/public/mojom/BUILD.gn
@@ -78,6 +78,7 @@ ":mutable_network_traffic_annotation_interface", ":udp_socket_interface", "//mojo/common:common_custom_types", + "//net/interfaces", "//services/proxy_resolver/public/mojom", "//url/mojom:url_mojom_gurl", "//url/mojom:url_mojom_origin",
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom index 24c0dd5..adc7838 100644 --- a/services/network/public/mojom/network_service.mojom +++ b/services/network/public/mojom/network_service.mojom
@@ -4,13 +4,13 @@ module network.mojom; -import "cookie_manager.mojom"; -import "network_change_manager.mojom"; -import "proxy_config.mojom"; +import "services/network/public/mojom/cookie_manager.mojom"; +import "services/network/public/mojom/network_change_manager.mojom"; +import "services/network/public/mojom/proxy_config.mojom"; import "net/interfaces/ip_endpoint.mojom"; -import "url_loader.mojom"; -import "url_loader_factory.mojom"; -import "restricted_cookie_manager.mojom"; +import "services/network/public/mojom/url_loader.mojom"; +import "services/network/public/mojom/url_loader_factory.mojom"; +import "services/network/public/mojom/restricted_cookie_manager.mojom"; import "mojo/common/file_path.mojom"; import "mojo/common/time.mojom"; import "url/mojom/origin.mojom";
diff --git a/services/network/public/mojom/network_service_test.mojom b/services/network/public/mojom/network_service_test.mojom index a78397bf..9bf1cee 100644 --- a/services/network/public/mojom/network_service_test.mojom +++ b/services/network/public/mojom/network_service_test.mojom
@@ -4,7 +4,7 @@ module network.mojom; -import "network_change_manager.mojom"; +import "services/network/public/mojom/network_change_manager.mojom"; [Native] struct CertVerifyResult;
diff --git a/services/network/public/mojom/restricted_cookie_manager.mojom b/services/network/public/mojom/restricted_cookie_manager.mojom index c634478..2a7745a 100644 --- a/services/network/public/mojom/restricted_cookie_manager.mojom +++ b/services/network/public/mojom/restricted_cookie_manager.mojom
@@ -4,7 +4,7 @@ module network.mojom; -import "cookie_manager.mojom"; +import "services/network/public/mojom/cookie_manager.mojom"; import "mojo/common/time.mojom"; import "url/mojom/url.mojom";
diff --git a/services/network/public/mojom/udp_socket.mojom b/services/network/public/mojom/udp_socket.mojom index 5ea79d8..1b21aba 100644 --- a/services/network/public/mojom/udp_socket.mojom +++ b/services/network/public/mojom/udp_socket.mojom
@@ -4,7 +4,7 @@ module network.mojom; -import "mutable_network_traffic_annotation_tag.mojom"; +import "services/network/public/mojom/mutable_network_traffic_annotation_tag.mojom"; import "mojo/common/read_only_buffer.mojom"; import "net/interfaces/address_family.mojom"; import "net/interfaces/ip_address.mojom";
diff --git a/services/network/public/mojom/url_loader_factory.mojom b/services/network/public/mojom/url_loader_factory.mojom index 6308b65c..37b3957 100644 --- a/services/network/public/mojom/url_loader_factory.mojom +++ b/services/network/public/mojom/url_loader_factory.mojom
@@ -4,8 +4,8 @@ module network.mojom; -import "mutable_network_traffic_annotation_tag.mojom"; -import "url_loader.mojom"; +import "services/network/public/mojom/mutable_network_traffic_annotation_tag.mojom"; +import "services/network/public/mojom/url_loader.mojom"; const uint32 kURLLoadOptionNone = 0; // Sends the net::SSLInfo struct in OnReceiveResponse.
diff --git a/services/preferences/public/mojom/BUILD.gn b/services/preferences/public/mojom/BUILD.gn index 890e1fe2..d512a9e 100644 --- a/services/preferences/public/mojom/BUILD.gn +++ b/services/preferences/public/mojom/BUILD.gn
@@ -11,5 +11,6 @@ ] public_deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", ] }
diff --git a/services/proxy_resolver/public/mojom/BUILD.gn b/services/proxy_resolver/public/mojom/BUILD.gn index 430e7073..50af318 100644 --- a/services/proxy_resolver/public/mojom/BUILD.gn +++ b/services/proxy_resolver/public/mojom/BUILD.gn
@@ -9,7 +9,6 @@ "proxy_resolver.mojom", ] deps = [ - "//mojo/common:common_custom_types", "//net/interfaces", "//url/mojom:url_mojom_gurl", ]
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc index daddf7e..2bc1700 100644 --- a/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_linux.cc
@@ -200,7 +200,7 @@ dump->platform_private_footprint->rss_anon_bytes = rss_anon_bytes; dump->platform_private_footprint->vm_swap_bytes = vm_swap_bytes; - dump->resident_set_kb = process_metrics->GetWorkingSetSize() / 1024; + dump->resident_set_kb = process_metrics->GetRSS() / 1024; return true; }
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_win.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_win.cc index 4c6c2525..dfd08fa 100644 --- a/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_win.cc +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/os_metrics_win.cc
@@ -27,7 +27,11 @@ size_t private_bytes = 0; process_metrics->GetMemoryBytes(&private_bytes, nullptr); dump->platform_private_footprint->private_bytes = private_bytes; - dump->resident_set_kb = process_metrics->GetWorkingSetSize() / 1024; + + PROCESS_MEMORY_COUNTERS pmc; + if (::GetProcessMemoryInfo(::GetCurrentProcess(), &pmc, sizeof(pmc))) { + dump->resident_set_kb = pmc.WorkingSetSize / 1024; + } return true; }
diff --git a/services/resource_coordinator/public/mojom/coordination_unit.mojom b/services/resource_coordinator/public/mojom/coordination_unit.mojom index ab65398..c086930 100644 --- a/services/resource_coordinator/public/mojom/coordination_unit.mojom +++ b/services/resource_coordinator/public/mojom/coordination_unit.mojom
@@ -5,7 +5,7 @@ module resource_coordinator.mojom; import "mojo/common/time.mojom"; -import "signals.mojom"; +import "services/resource_coordinator/public/mojom/signals.mojom"; // Any new type here needs to be mirrored between coordination_unit_types.h and // coordination_unit.mojom, and have mappings between the two defined in
diff --git a/services/resource_coordinator/public/mojom/coordination_unit_introspector.mojom b/services/resource_coordinator/public/mojom/coordination_unit_introspector.mojom index 3767566c..a19f567 100644 --- a/services/resource_coordinator/public/mojom/coordination_unit_introspector.mojom +++ b/services/resource_coordinator/public/mojom/coordination_unit_introspector.mojom
@@ -4,7 +4,7 @@ module resource_coordinator.mojom; -import "coordination_unit.mojom"; +import "services/resource_coordinator/public/mojom/coordination_unit.mojom"; import "mojo/common/process_id.mojom"; import "mojo/common/time.mojom";
diff --git a/services/resource_coordinator/public/mojom/coordination_unit_provider.mojom b/services/resource_coordinator/public/mojom/coordination_unit_provider.mojom index d96fc30..8e05533 100644 --- a/services/resource_coordinator/public/mojom/coordination_unit_provider.mojom +++ b/services/resource_coordinator/public/mojom/coordination_unit_provider.mojom
@@ -4,7 +4,7 @@ module resource_coordinator.mojom; -import "coordination_unit.mojom"; +import "services/resource_coordinator/public/mojom/coordination_unit.mojom"; interface CoordinationUnitProvider { CreateFrameCoordinationUnit(FrameCoordinationUnit& request, CoordinationUnitID id);
diff --git a/services/resource_coordinator/public/mojom/page_signal.mojom b/services/resource_coordinator/public/mojom/page_signal.mojom index 8ff3be0..318cbfe 100644 --- a/services/resource_coordinator/public/mojom/page_signal.mojom +++ b/services/resource_coordinator/public/mojom/page_signal.mojom
@@ -4,7 +4,7 @@ module resource_coordinator.mojom; -import "coordination_unit.mojom"; +import "services/resource_coordinator/public/mojom/coordination_unit.mojom"; import "mojo/common/time.mojom"; // A PageSignalReceiver implementation receives page-scoped signal from
diff --git a/services/shape_detection/public/mojom/facedetection_provider.mojom b/services/shape_detection/public/mojom/facedetection_provider.mojom index 33346d4..3c42027b 100644 --- a/services/shape_detection/public/mojom/facedetection_provider.mojom +++ b/services/shape_detection/public/mojom/facedetection_provider.mojom
@@ -6,7 +6,7 @@ module shape_detection.mojom; -import "facedetection.mojom"; +import "services/shape_detection/public/mojom/facedetection.mojom"; interface FaceDetectionProvider { CreateFaceDetection(FaceDetection& request, FaceDetectorOptions options);
diff --git a/services/ui/public/interfaces/ime/BUILD.gn b/services/ui/public/interfaces/ime/BUILD.gn index f709bc274..457116a 100644 --- a/services/ui/public/interfaces/ime/BUILD.gn +++ b/services/ui/public/interfaces/ime/BUILD.gn
@@ -16,6 +16,7 @@ public_deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//ui/events/mojo:interfaces", "//ui/gfx/geometry/mojo", "//ui/gfx/range/mojo",
diff --git a/services/ui/ws/remote_event_dispatcher.cc b/services/ui/ws/remote_event_dispatcher.cc index d5842585..a951ecf 100644 --- a/services/ui/ws/remote_event_dispatcher.cc +++ b/services/ui/ws/remote_event_dispatcher.cc
@@ -6,6 +6,8 @@ #include "services/ui/ws/display.h" #include "services/ui/ws/display_manager.h" +#include "services/ui/ws/platform_display.h" +#include "services/ui/ws/window_manager_state.h" #include "services/ui/ws/window_server.h" namespace ui { @@ -16,6 +18,39 @@ RemoteEventDispatcherImpl::~RemoteEventDispatcherImpl() {} +void RemoteEventDispatcherImpl::AdjustEventLocationForPixelLayout( + Display* display, + ui::LocatedEvent* event) { + WindowManagerState* window_manager_state = + window_server_->GetWindowManagerState(); + if (!window_manager_state) + return; + + // Only need to adjust the location of events when there is capture. + PlatformDisplay* platform_display_with_capture = + window_manager_state->platform_display_with_capture(); + if (!platform_display_with_capture || + display->platform_display() == platform_display_with_capture) { + return; + } + + // The event is from a display other than the display with capture. On device + // events originate from the display with capture and are in terms of the + // pixel layout (see comments in EventLocation). Convert the location to be + // relative to the display with capture in terms of the pixel layout to match + // what happens on device. + gfx::PointF capture_relative_location = event->location_f(); + capture_relative_location += display->GetViewportMetrics() + .bounds_in_pixels.origin() + .OffsetFromOrigin(); + capture_relative_location -= + platform_display_with_capture->GetViewportMetrics() + .bounds_in_pixels.origin() + .OffsetFromOrigin(); + event->set_location_f(capture_relative_location); + event->set_root_location_f(capture_relative_location); +} + void RemoteEventDispatcherImpl::DispatchEvent(int64_t display_id, std::unique_ptr<ui::Event> event, DispatchEventCallback cb) { @@ -41,6 +76,8 @@ return; } + AdjustEventLocationForPixelLayout(display, located_event); + // If this is a mouse pointer event, then we have to also update the // location of the cursor on the screen. if (event->IsMousePointerEvent())
diff --git a/services/ui/ws/remote_event_dispatcher.h b/services/ui/ws/remote_event_dispatcher.h index 38c0c7a..adf408f 100644 --- a/services/ui/ws/remote_event_dispatcher.h +++ b/services/ui/ws/remote_event_dispatcher.h
@@ -10,6 +10,7 @@ namespace ui { namespace ws { +class Display; class WindowServer; class RemoteEventDispatcherImpl : public mojom::RemoteEventDispatcher { @@ -18,6 +19,11 @@ ~RemoteEventDispatcherImpl() override; private: + // Adjusts the location as necessary of |event|. |display| is the display + // the event is targetted at. + void AdjustEventLocationForPixelLayout(Display* display, + ui::LocatedEvent* event); + // mojom::RemoteEventDispatcher: void DispatchEvent(int64_t display_id, std::unique_ptr<ui::Event> event,
diff --git a/services/ui/ws/window_manager_state.h b/services/ui/ws/window_manager_state.h index 75ca802..7c4fb35 100644 --- a/services/ui/ws/window_manager_state.h +++ b/services/ui/ws/window_manager_state.h
@@ -110,6 +110,10 @@ // notifies |closure| immediately if IsProcessingEvent() returns false. void ScheduleCallbackWhenDoneProcessingEvents(base::OnceClosure closure); + PlatformDisplay* platform_display_with_capture() { + return platform_display_with_capture_; + } + private: class ProcessedEventTarget; friend class Display;
diff --git a/services/viz/privileged/interfaces/BUILD.gn b/services/viz/privileged/interfaces/BUILD.gn index 3add225..11e07736 100644 --- a/services/viz/privileged/interfaces/BUILD.gn +++ b/services/viz/privileged/interfaces/BUILD.gn
@@ -11,6 +11,7 @@ public_deps = [ "//components/discardable_memory/public/interfaces", + "//mojo/common:common_custom_types", "//services/viz/privileged/interfaces/compositing", "//services/viz/privileged/interfaces/gl", "//services/viz/public/interfaces",
diff --git a/testing/buildbot/chromium.clang.json b/testing/buildbot/chromium.clang.json index 0566fbe..0463bef0 100644 --- a/testing/buildbot/chromium.clang.json +++ b/testing/buildbot/chromium.clang.json
@@ -6853,6 +6853,12 @@ }, { "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "app_shell_unittests" + }, + { + "swarming": { "can_use_on_swarming_builders": true, "shards": 5 }, @@ -7202,6 +7208,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, {
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 437f331..0ebf7d44 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -1092,6 +1092,12 @@ "swarming": { "can_use_on_swarming_builders": false }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": false + }, "test": "base_unittests" }, { @@ -1425,6 +1431,12 @@ "swarming": { "can_use_on_swarming_builders": false }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": false + }, "test": "base_unittests" }, { @@ -1814,6 +1826,12 @@ "swarming": { "can_use_on_swarming_builders": false }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": false + }, "test": "base_unittests" }, { @@ -2147,6 +2165,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, { @@ -7269,6 +7293,12 @@ }, { "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "app_shell_unittests" + }, + { + "swarming": { "can_use_on_swarming_builders": true, "shards": 5 }, @@ -9086,7 +9116,8 @@ "isolated_scripts": [ { "args": [ - "--debug" + "--debug", + "--additional-driver-flag=--enable-blink-features=HeapIncrementalMarking" ], "isolate_name": "webkit_layout_tests_exparchive", "merge": {
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 87b4751..0b2d16c 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -18,6 +18,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, { @@ -472,6 +478,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, { @@ -914,6 +926,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, { @@ -1357,6 +1375,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, { @@ -1800,6 +1824,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, {
diff --git a/testing/buildbot/chromium.memory.json b/testing/buildbot/chromium.memory.json index 52972a6..5469c8ec 100644 --- a/testing/buildbot/chromium.memory.json +++ b/testing/buildbot/chromium.memory.json
@@ -2832,6 +2832,12 @@ "swarming": { "can_use_on_swarming_builders": true }, + "test": "app_shell_unittests" + }, + { + "swarming": { + "can_use_on_swarming_builders": true + }, "test": "base_unittests" }, {
diff --git a/testing/buildbot/chromium.perf.json b/testing/buildbot/chromium.perf.json index 88fb1d7..4848b5e1 100644 --- a/testing/buildbot/chromium.perf.json +++ b/testing/buildbot/chromium.perf.json
@@ -44276,7 +44276,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44308,7 +44308,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44338,7 +44338,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44370,7 +44370,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44400,7 +44400,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44432,7 +44432,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44462,7 +44462,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44494,7 +44494,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44524,7 +44524,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44556,7 +44556,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44586,7 +44586,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44618,7 +44618,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44648,7 +44648,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44680,7 +44680,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44710,7 +44710,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44742,7 +44742,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44772,7 +44772,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44804,7 +44804,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44834,7 +44834,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44866,7 +44866,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44896,7 +44896,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44928,7 +44928,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44958,7 +44958,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -44990,7 +44990,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45020,7 +45020,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45052,7 +45052,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45082,7 +45082,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45114,7 +45114,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45144,7 +45144,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45176,7 +45176,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45206,7 +45206,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45238,7 +45238,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45268,7 +45268,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45300,7 +45300,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45330,7 +45330,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45362,7 +45362,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45392,7 +45392,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45422,7 +45422,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45454,7 +45454,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45484,7 +45484,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45516,7 +45516,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45546,7 +45546,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45578,7 +45578,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45608,7 +45608,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45640,7 +45640,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45670,7 +45670,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45702,7 +45702,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45732,7 +45732,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45764,7 +45764,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45794,7 +45794,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45824,7 +45824,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45856,7 +45856,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45886,7 +45886,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45918,7 +45918,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45948,7 +45948,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -45980,7 +45980,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46010,7 +46010,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46042,7 +46042,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46072,7 +46072,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46104,7 +46104,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46134,7 +46134,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46166,7 +46166,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46196,7 +46196,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46228,7 +46228,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46258,7 +46258,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46290,7 +46290,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46320,7 +46320,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46352,7 +46352,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46382,7 +46382,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46414,7 +46414,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46444,7 +46444,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46476,7 +46476,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46506,7 +46506,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46538,7 +46538,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46568,7 +46568,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46600,7 +46600,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46630,7 +46630,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46662,7 +46662,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46692,7 +46692,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46724,7 +46724,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46754,7 +46754,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46786,7 +46786,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46816,7 +46816,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46848,7 +46848,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46878,7 +46878,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46910,7 +46910,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46940,7 +46940,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -46972,7 +46972,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47002,7 +47002,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47034,7 +47034,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47064,7 +47064,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47096,7 +47096,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47126,7 +47126,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47158,7 +47158,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47188,7 +47188,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47218,7 +47218,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47250,7 +47250,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47282,7 +47282,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47312,7 +47312,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47342,7 +47342,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47374,7 +47374,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47406,7 +47406,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47436,7 +47436,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47468,7 +47468,7 @@ { "gpu": "8086:1616", "id": "build180-b4", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47498,7 +47498,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47530,7 +47530,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47560,7 +47560,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47592,7 +47592,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47622,7 +47622,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47654,7 +47654,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47684,7 +47684,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47716,7 +47716,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47746,7 +47746,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47778,7 +47778,7 @@ { "gpu": "8086:1616", "id": "build118-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47808,7 +47808,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47838,7 +47838,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47870,7 +47870,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47902,7 +47902,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47932,7 +47932,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47964,7 +47964,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -47994,7 +47994,7 @@ { "gpu": "8086:1616", "id": "build117-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -48024,7 +48024,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -48056,7 +48056,7 @@ { "gpu": "8086:1616", "id": "build119-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -48086,7 +48086,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ], @@ -48118,7 +48118,7 @@ { "gpu": "8086:1616", "id": "build120-b1", - "os": "Windows-10-10240", + "os": "Windows-10-16299.248", "pool": "Chrome-perf" } ],
diff --git a/testing/buildbot/chromium.webrtc.fyi.json b/testing/buildbot/chromium.webrtc.fyi.json index dfe64d57..b6506ef 100644 --- a/testing/buildbot/chromium.webrtc.fyi.json +++ b/testing/buildbot/chromium.webrtc.fyi.json
@@ -34,12 +34,17 @@ }, "Mac Builder": { "additional_compile_targets": [ - "all" + "browser_tests", + "capture_unittests", + "content_browsertests", + "content_unittests", + "frame_analyzer", + "jingle_unittests", + "remoting_unittests" ] }, "Mac Builder (dbg)": { "additional_compile_targets": [ - "all", "browser_tests", "capture_unittests", "content_browsertests",
diff --git a/testing/buildbot/filters/mash.ash_unittests.filter b/testing/buildbot/filters/mash.ash_unittests.filter index 351c9cd..ab0af2ac 100644 --- a/testing/buildbot/filters/mash.ash_unittests.filter +++ b/testing/buildbot/filters/mash.ash_unittests.filter
@@ -181,6 +181,7 @@ # TODO: Needs cursor manager support. http://crbug.com/698033 -PartialScreenshotControllerTest.CursorVisibilityTest -PartialScreenshotControllerTest.LargeCursor +-PowerButtonControllerTest.HideCursorAfterShowMenu # TODO: Needs LockStateController. http://crbug.com/632189. -PreferredReservedAcceleratorsTest.AcceleratorsWithFullscreen @@ -193,10 +194,6 @@ -ResizeShadowAndCursorTest.MouseHover -ResizeShadowAndCursorTest.Touch -# shelf_view.cc(366) Check failed: TYPE_APP_LIST != model_->items()[index].type -# http://crbug.com/814015 --RootWindowControllerTest.MoveWindows_Basic - # TODO: Triage -ShelfLayoutManagerTest.SwipingUpOnShelfInLaptopModeForFullscreenAppList -ShelfLayoutManagerTest.SwipingUpOnShelfInTabletModeForFullscreenAppList
diff --git a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter index 2236366..8a81dfe 100644 --- a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter +++ b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter
@@ -183,8 +183,6 @@ # http://crbug.com/721414 # TODO(rockot): add support for webRequest API. --ExtensionWebRequestApiTest.PostData1 --ExtensionWebRequestApiTest.PostData2 -ExtensionWebRequestApiTest.WebRequestBlocking -ExtensionWebRequestApiTest.WebRequestClientsGoogleComProtection -ExtensionWebRequestApiTest.WebRequestDeclarative2 @@ -306,9 +304,6 @@ -ChromeResourceDispatcherHostDelegateBrowserTest.ThrottlesAddedExactlyOnceToLargeSniffedDownloads -ChromeResourceDispatcherHostDelegateBrowserTest.ThrottlesAddedExactlyOnceToTinySniffedDownloads -ChromeResourceDispatcherHostDelegateBrowserTest.MirrorRequestHeader -# These tests rely on using a delegate to ResourceDispatcherHost. --ContentFaviconDriverTest.ReloadBypassingCache --ContentFaviconDriverTest.MixedContentSecureFaviconAllowed # Add support of download_to_file for URLLoader. # http://crbug.com/791702
diff --git a/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter b/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter index 5e59aa63..d1b598c 100644 --- a/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter +++ b/testing/buildbot/filters/mojo.fyi.viz.content_browsertests.filter
@@ -23,10 +23,10 @@ -SitePerProcessBrowserTest.HiddenOOPIFWillNotGenerateCompositorFramesAfterNavigation # Further WaitForChildFrameSurfaceReady doesn't work http://crbug.com/787945 +-SitePerProcessBrowserTest.CompositorViewportPixelSizeTest -SitePerProcessBrowserTest.GestureFlingStartEventsBubble -SitePerProcessBrowserTest.NavigateCrashedSubframeToSameSite -SitePerProcessBrowserTest.OOPIFDetachDuringAnimation --SitePerProcessBrowserTest.PhysicalBackingSizeTest -SitePerProcessBrowserTest.ScrollBubblingFromNestedOOPIFTest -SitePerProcessBrowserTest.ScrollBubblingFromOOPIFTest -SitePerProcessBrowserTest.ScrollBubblingFromOOPIFWithBodyOverflowHidden
diff --git a/testing/buildbot/filters/viz.content_browsertests.filter b/testing/buildbot/filters/viz.content_browsertests.filter index 587c8e1..3b0a143f 100644 --- a/testing/buildbot/filters/viz.content_browsertests.filter +++ b/testing/buildbot/filters/viz.content_browsertests.filter
@@ -30,6 +30,7 @@ -SitePerProcessBrowserTest.HiddenOOPIFWillNotGenerateCompositorFramesAfterNavigation # Further WaitForChildFrameSurfaceReady doesn't work http://crbug.com/787945 +-SitePerProcessBrowserTest.CompositorViewportPixelSizeTest -SitePerProcessBrowserTest.GestureFlingStartEventsBubble -SitePerProcessBrowserTest.NavigateCrashedSubframeToSameSite -SitePerProcessBrowserTest.OOPIFDetachDuringAnimation @@ -39,7 +40,6 @@ -SitePerProcessBrowserTest.ScrollLocalSubframeInOOPIF -SitePerProcessBrowserTest.TwoSubframesCreatePopupMenuWidgetsSimultaneously -SitePerProcessBrowserTest.ViewBoundsInNestedFrameTest --SitePerProcessBrowserTest.PhysicalBackingSizeTest -SitePerProcessHitTestBrowserTest.AsynchronousHitTestChildTimeout* -SitePerProcessHitTestBrowserTest.CancelWheelScrollBubblingOnWheelTargetDeletion* -SitePerProcessHitTestBrowserTest.CreateContextMenuTest*
diff --git a/testing/buildbot/generate_buildbot_json.py b/testing/buildbot/generate_buildbot_json.py index 2522040..29a9dd60 100755 --- a/testing/buildbot/generate_buildbot_json.py +++ b/testing/buildbot/generate_buildbot_json.py
@@ -201,9 +201,15 @@ relative_path), 'wb') as fp: # pragma: no cover fp.write(contents) # pragma: no cover + def pyl_file_path(self, filename): + if self.args and self.args.pyl_files_dir: + return os.path.join(self.args.pyl_files_dir, filename) + return filename + def load_pyl_file(self, filename): try: - return ast.literal_eval(self.read_file(filename)) + return ast.literal_eval(self.read_file( + self.pyl_file_path(filename))) except (SyntaxError, ValueError) as e: # pragma: no cover raise BBGenErr('Failed to parse pyl file "%s": %s' % (filename, e)) # pragma: no cover @@ -598,7 +604,8 @@ for waterfall in self.waterfalls: should_gen = not filters or waterfall['name'] in filters if should_gen: - self.write_file(waterfall['name'] + suffix, + file_path = waterfall['name'] + suffix + self.write_file(self.pyl_file_path(file_path), self.generate_waterfall_json(waterfall)) def check_input_file_consistency(self): @@ -660,7 +667,8 @@ ungenerated_waterfalls = set() for waterfall in self.waterfalls: expected = self.generate_waterfall_json(waterfall) - current = self.read_file(waterfall['name'] + '.json') + file_path = waterfall['name'] + '.json' + current = self.read_file(self.pyl_file_path(file_path)) if expected != current: ungenerated_waterfalls.add(waterfall['name']) if verbose: # pragma: no cover @@ -693,6 +701,9 @@ parser.add_argument( 'waterfall_filters', metavar='waterfalls', type=str, nargs='*', help='Optional list of waterfalls to generate.') + parser.add_argument( + '--pyl-files-dir', type=os.path.realpath, + help='Path to the directory containing the input .pyl files.') self.args = parser.parse_args(argv) def main(self, argv): # pragma: no cover
diff --git a/testing/buildbot/generate_buildbot_json_unittest.py b/testing/buildbot/generate_buildbot_json_unittest.py index c2bb2ef..1a97ca7e 100755 --- a/testing/buildbot/generate_buildbot_json_unittest.py +++ b/testing/buildbot/generate_buildbot_json_unittest.py
@@ -5,6 +5,8 @@ """Tests for generate_buildbot_json.py.""" +import argparse +import os import unittest import generate_buildbot_json @@ -1111,6 +1113,18 @@ fbb.files['chromium.test.json'] = MULTI_DIMENSION_OUTPUT fbb.check_output_file_consistency(verbose=True) + def test_relative_pyl_file_dir(self): + fbb = FakeBBGen(FOO_GTESTS_WATERFALL, + REUSING_TEST_WITH_DIFFERENT_NAME, + EMPTY_EXCEPTIONS) + fbb.args = argparse.Namespace(pyl_files_dir='relative/path/') + for file_name in list(fbb.files): + fbb.files[os.path.join('relative/path/', file_name)] = ( + fbb.files.pop(file_name)) + fbb.check_input_file_consistency() + fbb.files['relative/path/chromium.test.json'] = VARIATION_GTEST_OUTPUT + fbb.check_output_file_consistency(verbose=True) + if __name__ == '__main__': unittest.main()
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index cd2ad21..e80b1aeb 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -3638,6 +3638,7 @@ 'linux-blink-heap-incremental-marking': { 'args': [ '--debug', + '--additional-driver-flag=--enable-blink-features=HeapIncrementalMarking', ], }, 'WebKit Linux layout_ng Dummy Builder': {
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 8ce10fa6..80e766dd 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -291,7 +291,6 @@ }, 'aura_gtests': { - 'app_shell_unittests': {}, 'aura_unittests': {}, 'compositor_unittests': {}, 'wm_unittests': {}, @@ -1196,7 +1195,6 @@ 'linux_chromeos_specific_gtests': { 'app_list_presenter_unittests': {}, 'app_list_unittests': {}, - 'app_shell_unittests': {}, 'ash_content_unittests': {}, 'ash_unittests': {}, 'aura_unittests': {}, @@ -1300,6 +1298,7 @@ }, 'non_android_chromium_gtests': { + 'app_shell_unittests': {}, 'browser_tests': { 'swarming': { 'shards': 10,
diff --git a/testing/buildbot/tryserver.webrtc.json b/testing/buildbot/tryserver.webrtc.json index ab9bbc09..2fcbaf8 100644 --- a/testing/buildbot/tryserver.webrtc.json +++ b/testing/buildbot/tryserver.webrtc.json
@@ -3,42 +3,42 @@ "AAAAA2 See generate_buildbot_json.py to make changes": {}, "android_chromium_compile": { "additional_compile_targets": [ - "all" - ] - }, - "android_webrtc_compile_rel": { - "additional_compile_targets": [ - "all" + "browser_tests", + "capture_unittests", + "content_browsertests", + "content_unittests", + "jingle_unittests", + "remoting_unittests" ] }, "linux_chromium_compile": { "additional_compile_targets": [ - "all" - ] - }, - "linux_chromium_webrtc_compile_rel_ng": { - "additional_compile_targets": [ - "all" + "browser_tests", + "capture_unittests", + "content_browsertests", + "content_unittests", + "jingle_unittests", + "remoting_unittests" ] }, "mac_chromium_compile": { "additional_compile_targets": [ - "all" - ] - }, - "mac_chromium_webrtc_compile_rel_ng": { - "additional_compile_targets": [ - "all" + "browser_tests", + "capture_unittests", + "content_browsertests", + "content_unittests", + "jingle_unittests", + "remoting_unittests" ] }, "win_chromium_compile": { "additional_compile_targets": [ - "all" - ] - }, - "win_chromium_webrtc_compile_rel_ng": { - "additional_compile_targets": [ - "all" + "browser_tests", + "capture_unittests", + "content_browsertests", + "content_unittests", + "jingle_unittests", + "remoting_unittests" ] } }
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index a35d26db..f83b1a6 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1969,12 +1969,17 @@ }, 'Mac Builder': { 'additional_compile_targets': [ - 'all', + 'browser_tests', + 'capture_unittests', + 'content_browsertests', + 'content_unittests', + 'frame_analyzer', + 'jingle_unittests', + 'remoting_unittests', ], }, 'Mac Builder (dbg)': { 'additional_compile_targets': [ - 'all', 'browser_tests', 'capture_unittests', 'content_browsertests', @@ -2083,42 +2088,42 @@ 'machines': { 'win_chromium_compile': { 'additional_compile_targets': [ - 'all', + 'browser_tests', + 'capture_unittests', + 'content_browsertests', + 'content_unittests', + 'jingle_unittests', + 'remoting_unittests', ], }, 'mac_chromium_compile': { 'additional_compile_targets': [ - 'all', + 'browser_tests', + 'capture_unittests', + 'content_browsertests', + 'content_unittests', + 'jingle_unittests', + 'remoting_unittests', ], }, 'linux_chromium_compile': { 'additional_compile_targets': [ - 'all', + 'browser_tests', + 'capture_unittests', + 'content_browsertests', + 'content_unittests', + 'jingle_unittests', + 'remoting_unittests', ], }, 'android_chromium_compile': { 'additional_compile_targets': [ - 'all', - ], - }, - 'win_chromium_webrtc_compile_rel_ng': { - 'additional_compile_targets': [ - 'all', - ], - }, - 'mac_chromium_webrtc_compile_rel_ng': { - 'additional_compile_targets': [ - 'all', - ], - }, - 'linux_chromium_webrtc_compile_rel_ng': { - 'additional_compile_targets': [ - 'all', - ], - }, - 'android_webrtc_compile_rel': { - 'additional_compile_targets': [ - 'all', + 'browser_tests', + 'capture_unittests', + 'content_browsertests', + 'content_unittests', + 'jingle_unittests', + 'remoting_unittests', ], }, },
diff --git a/testing/scripts/run_performance_tests.py b/testing/scripts/run_performance_tests.py index 6c328e6..01274fd4 100755 --- a/testing/scripts/run_performance_tests.py +++ b/testing/scripts/run_performance_tests.py
@@ -63,9 +63,10 @@ ] # We currently have two different sharding schemes for android -# vs desktop. -CURRENT_DESKTOP_NUM_SHARDS = 5 -CURRENT_ANDROID_NUM_SHARDS = 21 +# vs desktop. When we are running at capacity we will have 26 +# desktop shards and 39 android. +CURRENT_DESKTOP_NUM_SHARDS = 26 +CURRENT_ANDROID_NUM_SHARDS = 39 def get_sharding_map_path(total_shards, testing): # Determine if we want to do a test run of the benchmarks or run the
diff --git a/testing/variations/README.md b/testing/variations/README.md index 044bc07..3a644615 100644 --- a/testing/variations/README.md +++ b/testing/variations/README.md
@@ -50,7 +50,7 @@ `experiments`. `platforms` is an array of strings, indicating the targetted platforms. The -strings may be `android`, `chromeos`, `ios`, `linux`, `mac`, or `windows`. +strings may be `android`, `chromeos`, `ios`, `linux`, `mac`, or `win`. `experiments` is an array containing the *experiments*.
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 12422f0..01b1bc78 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -872,6 +872,21 @@ ] } ], + "ChromeModernDesign": [ + { + "platforms": [ + "android" + ], + "experiments": [ + { + "name": "Modern", + "enable_features": [ + "ChromeModernDesign" + ] + } + ] + } + ], "ChromeSmartSelection": [ { "platforms": [ @@ -2346,24 +2361,6 @@ ] } ], - "OmniboxCombinedSpeculativeServiceWorker": [ - { - "platforms": [ - "android" - ], - "experiments": [ - { - "name": "PrewarmingWithServiceWorker2", - "enable_features": [ - "OmniboxSpeculativeServiceWorkerStartOnQueryInput" - ], - "disable_features": [ - "OmniboxSpareRenderer" - ] - } - ] - } - ], "OomIntervention": [ { "platforms": [ @@ -3538,6 +3535,27 @@ ] } ], + "SimplifyHttpsIndicator": [ + { + "platforms": [ + "chromeos", + "linux", + "win", + "mac" + ], + "experiments": [ + { + "name": "EvToSecure", + "params": { + "treatment": "ev-to-secure" + }, + "enable_features": [ + "SimplifyHttpsIndicator" + ] + } + ] + } + ], "SocketReadIfReady": [ { "platforms": [
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index a9835990..76637fda 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -57,7 +57,6 @@ # New failures are appended below by the script. crbug.com/714962 accessibility/adjacent-continuations-cause-assertion-failure.html [ Failure ] crbug.com/591099 accessibility/aom-relation-list-properties.html [ Failure ] -crbug.com/591099 accessibility/aria-activedescendant.html [ Failure Pass ] crbug.com/591099 accessibility/aria-labelledby-stay-within.html [ Failure ] crbug.com/591099 accessibility/aria-owns.html [ Failure ] crbug.com/591099 accessibility/aria-tab-roles.html [ Failure ] @@ -109,19 +108,17 @@ crbug.com/591099 animations/rotate-transform-equivalent.html [ Failure ] crbug.com/591099 animations/timing/timing-model.html [ Timeout ] crbug.com/714962 compositing/background-color/view-blending-base-background.html [ Failure ] -crbug.com/591099 compositing/direct-image-compositing.html [ Failure ] crbug.com/591099 compositing/draws-content/canvas-background-layer.html [ Failure ] crbug.com/591099 compositing/draws-content/webgl-background-layer.html [ Failure ] crbug.com/714962 compositing/flex-composited-animated-table-row-background.html [ Failure Pass ] -crbug.com/591099 compositing/generated-content.html [ Failure ] +crbug.com/591099 compositing/generated-content.html [ Failure Pass ] crbug.com/591099 compositing/geometry/bounds-ignores-hidden-dynamic.html [ Failure ] crbug.com/591099 compositing/geometry/bounds-ignores-hidden.html [ Failure ] crbug.com/591099 compositing/geometry/clipping-foreground.html [ Failure ] crbug.com/591099 compositing/geometry/composited-in-columns.html [ Failure ] crbug.com/591099 compositing/geometry/foreground-layer.html [ Failure ] crbug.com/591099 compositing/geometry/repaint-foreground-layer.html [ Failure ] -crbug.com/591099 compositing/geometry/root-layer-update.html [ Failure ] -crbug.com/591099 compositing/geometry/transfrom-origin-on-zero-size-layer.html [ Failure ] +crbug.com/591099 compositing/geometry/transfrom-origin-on-zero-size-layer.html [ Failure Pass ] crbug.com/591099 compositing/geometry/video-opacity-overlay.html [ Failure ] crbug.com/714962 compositing/gestures/gesture-tapHighlight-2-overflow-div-scrolled-inner.html [ Failure ] crbug.com/714962 compositing/gestures/gesture-tapHighlight-simple-multi-line.html [ Pass ] @@ -134,13 +131,13 @@ crbug.com/591099 compositing/overflow/nested-border-radius-clipping.html [ Failure ] crbug.com/591099 compositing/overflow/overflow-scroll-with-local-image-background.html [ Failure ] crbug.com/714962 compositing/overflow/rtl-overflow.html [ Failure ] -crbug.com/591099 compositing/overflow/scaled-mask.html [ Failure ] +crbug.com/591099 compositing/overflow/scaled-mask.html [ Failure Pass ] crbug.com/591099 compositing/overflow/scrolling-content-clip-to-viewport.html [ Failure ] crbug.com/591099 compositing/overflow/universal-accelerated-overflow-scroll.html [ Timeout ] crbug.com/591099 compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers.html [ Failure ] -crbug.com/591099 compositing/reflections/compositing-change-inside-reflection.html [ Failure ] +crbug.com/591099 compositing/reflections/compositing-change-inside-reflection.html [ Failure Pass ] crbug.com/591099 compositing/reflections/nested-reflection-mask-change.html [ Failure ] -crbug.com/591099 compositing/reflections/transform-inside-reflection.html [ Failure ] +crbug.com/591099 compositing/reflections/transform-inside-reflection.html [ Failure Pass ] crbug.com/591099 compositing/rtl/rtl-and-writing-mode-scrolling.html [ Failure ] crbug.com/591099 compositing/scrollbars/nested-overlay-scrollbars.html [ Failure ] crbug.com/591099 compositing/squashing/add-remove-squashed-layers.html [ Failure ] @@ -155,7 +152,6 @@ crbug.com/591099 css1/box_properties/float_on_text_elements.html [ Failure ] crbug.com/591099 css1/classification/list_style.html [ Failure ] crbug.com/591099 css1/classification/list_style_image.html [ Failure ] -crbug.com/591099 css1/color_and_background/background_repeat.html [ Failure ] crbug.com/591099 css1/pseudo/multiple_pseudo_elements.html [ Crash ] crbug.com/591099 css2.1/20110323/margin-applies-to-008.htm [ Failure ] crbug.com/714962 css2.1/20110323/overflow-applies-to-012.htm [ Failure ] @@ -166,13 +162,9 @@ crbug.com/591099 css2.1/t051201-c23-first-line-00-b.html [ Crash ] crbug.com/591099 css2.1/t051202-c26-psudo-nest-00-c.html [ Crash ] crbug.com/591099 css2.1/t0905-c414-flt-wrap-01-d-g.html [ Failure ] -crbug.com/591099 css2.1/t0905-c5525-fltblck-00-d-ag.html [ Failure ] -crbug.com/591099 css2.1/t0905-c5525-fltmrgn-00-c-ag.html [ Failure ] crbug.com/591099 css2.1/t1002-c5523-width-00-b-g.html [ Failure Pass ] crbug.com/591099 css2.1/t1005-c5524-width-00-b-g.html [ Failure Pass ] crbug.com/591099 css2.1/t1005-c5524-width-01-b-g.html [ Failure Pass ] -crbug.com/591099 css2.1/t1008-c44-ln-box-00-d-ag.html [ Failure Pass ] -crbug.com/591099 css2.1/t1008-c44-ln-box-03-d-ag.html [ Failure Pass ] crbug.com/591099 css2.1/t100801-c544-valgn-00-a-ag.html [ Failure ] crbug.com/591099 css2.1/t100801-c544-valgn-03-d-agi.html [ Failure ] crbug.com/591099 css2.1/t1202-counter-04-b.html [ Failure ] @@ -225,9 +217,8 @@ crbug.com/591099 editing/assert_selection.html [ Failure ] crbug.com/591099 editing/caret/caret-color-014.html [ Failure ] crbug.com/591099 editing/caret/caret-color-015.html [ Failure ] -crbug.com/591099 editing/deleting/4922367.html [ Failure ] crbug.com/591099 editing/deleting/5272440.html [ Failure ] -crbug.com/591099 editing/deleting/5369009.html [ Failure ] +crbug.com/591099 editing/deleting/5369009.html [ Failure Pass ] crbug.com/591099 editing/deleting/delete-at-paragraph-boundaries-011.html [ Failure ] crbug.com/591099 editing/deleting/merge-different-styles.html [ Failure ] crbug.com/591099 editing/deleting/merge-endOfParagraph.html [ Failure ] @@ -248,10 +239,9 @@ crbug.com/591099 editing/execCommand/query-command-state.html [ Timeout ] crbug.com/591099 editing/execCommand/query-format-block.html [ Timeout ] crbug.com/591099 editing/execCommand/remove-list-from-range-selection.html [ Failure ] -crbug.com/591099 editing/input/linux_rtl_composition_underline.html [ Failure ] +crbug.com/591099 editing/input/linux_rtl_composition_underline.html [ Failure Pass ] crbug.com/591099 editing/inserting/4875189-1.html [ Failure ] crbug.com/591099 editing/inserting/4959067.html [ Failure ] -crbug.com/591099 editing/inserting/5549929-2.html [ Failure ] crbug.com/591099 editing/inserting/editable-inline-element.html [ Failure ] crbug.com/591099 editing/inserting/insert-3800346-fix.html [ Failure ] crbug.com/591099 editing/inserting/insert-br-quoted-001.html [ Failure ] @@ -264,10 +254,7 @@ crbug.com/591099 editing/inserting/paragraph-separator-in-table-1.html [ Failure ] crbug.com/591099 editing/inserting/paragraph-separator-in-table-2.html [ Failure ] crbug.com/591099 editing/pasteboard/4631972.html [ Failure ] -crbug.com/591099 editing/pasteboard/4806874.html [ Failure ] -crbug.com/591099 editing/pasteboard/4947130.html [ Failure ] -crbug.com/591099 editing/pasteboard/5071074.html [ Failure ] -crbug.com/591099 editing/pasteboard/5134759.html [ Failure ] +crbug.com/591099 editing/pasteboard/5071074.html [ Failure Pass ] crbug.com/591099 editing/pasteboard/bad-placeholder.html [ Failure ] crbug.com/714962 editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html [ Failure ] crbug.com/714962 editing/pasteboard/copy-paste-pre-line-content.html [ Failure ] @@ -318,7 +305,6 @@ crbug.com/591099 editing/selection/extend-selection-word.html [ Timeout ] crbug.com/591099 editing/selection/focus-body.html [ Failure ] crbug.com/591099 editing/selection/home-end.html [ Timeout ] -crbug.com/591099 editing/selection/inline-closest-leaf-child.html [ Failure ] crbug.com/591099 editing/selection/line-wrap-2.html [ Failure ] crbug.com/591099 editing/selection/linux_selection_color.html [ Failure ] crbug.com/591099 editing/selection/mixed-editability-1.html [ Failure ] @@ -384,7 +370,7 @@ crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.html [ Timeout ] crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.html [ Timeout ] crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/successes.worker.html [ Timeout ] -crbug.com/591099 external/wpt/WebCryptoAPI/import_export/rsa_importKey.https.worker.html [ Timeout ] +crbug.com/591099 external/wpt/WebCryptoAPI/import_export/rsa_importKey.https.worker.html [ Pass Timeout ] crbug.com/591099 external/wpt/WebCryptoAPI/import_export/rsa_importKey.worker.html [ Timeout ] crbug.com/709227 external/wpt/WebCryptoAPI/import_export/symmetric_importKey.worker.html [ Failure ] crbug.com/714962 external/wpt/WebCryptoAPI/import_export/test_rsa_importKey.https.html [ Pass Timeout ] @@ -406,7 +392,7 @@ crbug.com/591099 external/wpt/css/CSS2/normal-flow/root-box-001.xht [ Failure ] crbug.com/591099 external/wpt/css/CSS2/positioning/abspos-007.xht [ Pass ] crbug.com/591099 external/wpt/css/CSS2/positioning/positioning-float-001.xht [ Pass ] -crbug.com/591099 external/wpt/css/CSS2/text/text-decoration-applies-to-015.xht [ Failure ] +crbug.com/591099 external/wpt/css/CSS2/text/text-decoration-applies-to-015.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-backgrounds/background-attachment-local/attachment-local-clipping-color-5.html [ Failure ] crbug.com/714962 external/wpt/css/css-backgrounds/background-attachment-local/attachment-local-clipping-image-5.html [ Failure ] crbug.com/714962 external/wpt/css/css-backgrounds/background-image-003.html [ Failure Pass ] @@ -1254,7 +1240,7 @@ crbug.com/714962 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/selectors4/class-id-attr-selector-invalidation-01.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/selectors4/dir-style-03a.html [ Pass ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-declaration-15.html [ Failure Pass ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-font-face-01.html [ Failure Pass ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-font-face-01.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-font-face-02.html [ Failure Pass ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-break-inside-001.html [ Failure ] crbug.com/591099 external/wpt/dom/interfaces.html [ Timeout ] @@ -1275,7 +1261,7 @@ crbug.com/591099 external/wpt/dom/ranges/Range-set.html [ Timeout ] crbug.com/591099 external/wpt/dom/ranges/Range-surroundContents.html [ Timeout ] crbug.com/591099 external/wpt/domxpath/xml_xpath_runner.html [ Timeout ] -crbug.com/591099 external/wpt/editing/run/backcolor.html [ Pass Timeout ] +crbug.com/591099 external/wpt/editing/run/backcolor.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/bold.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/fontname.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/fontsize.html [ Timeout ] @@ -1604,24 +1590,20 @@ crbug.com/591099 external/wpt/xhr/send-authentication-prompt-2-manual.htm [ Failure ] crbug.com/591099 fast/animation/scroll-animations/scrolltimeline-currenttime.html [ Failure ] crbug.com/591099 fast/backgrounds/animated-svg-as-mask.html [ Failure Pass ] -crbug.com/591099 fast/backgrounds/background-clip-text-multiline.html [ Failure Pass ] crbug.com/591099 fast/backgrounds/background-clip-text.html [ Failure ] crbug.com/591099 fast/backgrounds/background-inherit-color-bug.html [ Failure ] crbug.com/591099 fast/backgrounds/background-leakage-transforms.html [ Failure ] -crbug.com/591099 fast/backgrounds/background-origin-root-element.html [ Failure ] -crbug.com/591099 fast/backgrounds/body-generated-image-propagated-to-root.html [ Failure ] +crbug.com/591099 fast/backgrounds/background-origin-root-element.html [ Failure Pass ] crbug.com/591099 fast/backgrounds/border-radius-split-background-image.html [ Failure ] crbug.com/591099 fast/backgrounds/border-radius-split-background.html [ Failure ] -crbug.com/591099 fast/backgrounds/opacity-on-document-element.html [ Failure ] +crbug.com/591099 fast/backgrounds/opacity-on-document-element.html [ Failure Pass ] crbug.com/591099 fast/backgrounds/quirks-mode-line-box-backgrounds.html [ Failure ] -crbug.com/591099 fast/backgrounds/repeat/negative-offset-repeat-transformed.html [ Failure ] -crbug.com/591099 fast/backgrounds/repeat/negative-offset-repeat.html [ Failure ] crbug.com/591099 fast/backgrounds/repeat/noRepeatCorrectClip.html [ Failure ] crbug.com/591099 fast/backgrounds/selection-background-color-of-image-list-style.html [ Failure ] crbug.com/591099 fast/backgrounds/selection-background-color-of-list-style.html [ Failure ] crbug.com/591099 fast/backgrounds/size/backgroundSize16.html [ Failure ] crbug.com/591099 fast/backgrounds/size/contain-and-cover.html [ Failure ] -crbug.com/591099 fast/backgrounds/size/zero.html [ Failure ] +crbug.com/591099 fast/backgrounds/size/zero.html [ Failure Pass ] crbug.com/591099 fast/backgrounds/svg-as-mask.html [ Failure Pass ] crbug.com/591099 fast/block/basic/quirk-percent-height-table-cell.html [ Failure ] crbug.com/591099 fast/block/block-add-child-crash.html [ Crash ] @@ -1675,7 +1657,7 @@ crbug.com/591099 fast/borders/border-image-fill-inline-no-border.html [ Failure Pass ] crbug.com/591099 fast/borders/border-image-inherits-with-border.html [ Failure Pass ] crbug.com/714962 fast/borders/border-image-outset-split-inline.html [ Failure ] -crbug.com/714962 fast/borders/border-image-scaled.html [ Failure ] +crbug.com/714962 fast/borders/border-image-scaled.html [ Failure Pass ] crbug.com/714962 fast/borders/border-inner-bleed.html [ Failure ] crbug.com/714962 fast/borders/border-radius-inline-flow.html [ Failure ] crbug.com/591099 fast/borders/border-radius-mask-canvas-all.html [ Failure ] @@ -1705,7 +1687,7 @@ crbug.com/714962 fast/borders/borderRadiusSolid03.html [ Failure ] crbug.com/714962 fast/borders/borderRadiusSolid04.html [ Failure ] crbug.com/714962 fast/borders/dashed-1px-with-border-radius.html [ Failure ] -crbug.com/714962 fast/borders/different-color-borders.html [ Failure ] +crbug.com/714962 fast/borders/different-color-borders.html [ Failure Pass ] crbug.com/591099 fast/borders/inline-mask-overlay-image-outset-vertical-rl.html [ Failure ] crbug.com/591099 fast/borders/inline-mask-overlay-image-outset.html [ Failure ] crbug.com/591099 fast/borders/inline-mask-overlay-image.html [ Failure ] @@ -1721,32 +1703,28 @@ crbug.com/591099 fast/box-shadow/inset-subpixel.html [ Failure ] crbug.com/591099 fast/box-shadow/inset.html [ Failure ] crbug.com/591099 fast/box-sizing/replaced.html [ Failure Pass ] -crbug.com/714962 fast/canvas/canvas-textMetrics-width.html [ Failure ] -crbug.com/714962 fast/canvas/image-object-in-canvas.html [ Failure ] -crbug.com/591099 fast/canvas/patternfill-repeat.html [ Failure ] -crbug.com/714962 fast/canvas/setWidthResetAfterForcedRender.html [ Failure ] +crbug.com/714962 fast/canvas/canvas-textMetrics-width.html [ Failure Pass ] +crbug.com/714962 fast/canvas/image-object-in-canvas.html [ Failure Pass ] +crbug.com/591099 fast/canvas/patternfill-repeat.html [ Failure Pass ] +crbug.com/714962 fast/canvas/setWidthResetAfterForcedRender.html [ Failure Pass ] crbug.com/591099 fast/clip/overflow-border-radius-combinations.html [ Failure ] crbug.com/591099 fast/clip/overflow-border-radius-composited-parent.html [ Failure ] crbug.com/591099 fast/clip/overflow-border-radius-composited.html [ Failure ] -crbug.com/591099 fast/clip/overflow-border-radius-fixed-position.html [ Failure ] +crbug.com/591099 fast/clip/overflow-border-radius-fixed-position.html [ Failure Pass ] crbug.com/591099 fast/clip/overflow-border-radius-transformed.html [ Failure ] -crbug.com/591099 fast/css-generated-content/001.html [ Failure ] -crbug.com/591099 fast/css-generated-content/002.html [ Failure ] -crbug.com/591099 fast/css-generated-content/007.html [ Failure ] +crbug.com/591099 fast/css-generated-content/001.html [ Failure Pass ] +crbug.com/591099 fast/css-generated-content/007.html [ Failure Pass ] crbug.com/591099 fast/css-generated-content/009.html [ Failure ] crbug.com/591099 fast/css-generated-content/012.html [ Failure ] -crbug.com/591099 fast/css-generated-content/013.html [ Failure ] +crbug.com/591099 fast/css-generated-content/013.html [ Failure Pass ] crbug.com/591099 fast/css-generated-content/015.html [ Failure ] -crbug.com/591099 fast/css-generated-content/after-duplicated-after-split.html [ Failure ] -crbug.com/591099 fast/css-generated-content/after-order.html [ Failure ] -crbug.com/591099 fast/css-generated-content/before-with-first-letter.html [ Failure ] +crbug.com/591099 fast/css-generated-content/after-duplicated-after-split.html [ Failure Pass ] crbug.com/805301 fast/css-generated-content/crash-selection-editing-removes-pseudo.html [ Failure ] crbug.com/591099 fast/css-generated-content/empty-first-letter-with-columns-crash.html [ Crash ] crbug.com/591099 fast/css-generated-content/first-letter-in-nested-before-table.html [ Failure ] crbug.com/591099 fast/css-generated-content/first-letter-next-sibling-crash.html [ Crash ] crbug.com/591099 fast/css-generated-content/float-first-letter-siblings-convert-to-inline.html [ Crash ] crbug.com/714962 fast/css-generated-content/hover-inline.html [ Failure ] -crbug.com/591099 fast/css-generated-content/hover-style-change.html [ Failure ] crbug.com/591099 fast/css-generated-content/table-before-after-child-add.html [ Failure ] crbug.com/591099 fast/css-generated-content/table-cell-before-after-child-add.html [ Failure ] crbug.com/591099 fast/css-generated-content/table-cell-before-content.html [ Failure ] @@ -1910,7 +1888,7 @@ crbug.com/714962 fast/css/hover-pseudo-element-quirks.html [ Failure ] crbug.com/591099 fast/css/hover-subselector.html [ Failure ] crbug.com/591099 fast/css/ignore-empty-focus-ring-rects.html [ Failure ] -crbug.com/591099 fast/css/import_with_baseurl.html [ Failure Pass ] +crbug.com/591099 fast/css/import_with_baseurl.html [ Failure ] crbug.com/714962 fast/css/invalidation/sheet-loaded-before-invalidation.html [ Failure ] crbug.com/714962 fast/css/invalidation/style-invalidation-before-attach.html [ Failure ] crbug.com/591099 fast/css/large-numbers.html [ Timeout ] @@ -1945,13 +1923,13 @@ crbug.com/591099 fast/css/word-space-extra.html [ Failure ] crbug.com/714962 fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-decoration/text-decoration-skip-ink.html [ Failure ] -crbug.com/591099 fast/css3-text/css3-text-decoration/text-decoration-style-inherit-not-propagated-by-out-of-flow.html [ Failure ] -crbug.com/714962 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html [ Failure ] +crbug.com/591099 fast/css3-text/css3-text-decoration/text-decoration-style-inherit-not-propagated-by-out-of-flow.html [ Failure Pass ] +crbug.com/714962 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html [ Failure Pass ] crbug.com/591099 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-cjk.html [ Failure ] crbug.com/714962 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-dynamic.html [ Failure ] crbug.com/714962 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-subscript.html [ Failure ] -crbug.com/714962 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html [ Failure ] +crbug.com/714962 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html [ Failure Pass ] crbug.com/714962 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-vertical.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-indent/negative-text-indent-leading-out-of-flow-text-align-left-and-right.html [ Failure ] @@ -1961,9 +1939,9 @@ crbug.com/591099 fast/css3-text/css3-text-justify/text-justify-distribute.html [ Failure ] crbug.com/591099 fast/deprecated-flexbox/004.html [ Failure ] crbug.com/591099 fast/deprecated-flexbox/009-horizontal.html [ Failure ] -crbug.com/714962 fast/deprecated-flexbox/009.html [ Failure ] -crbug.com/714962 fast/deprecated-flexbox/023.html [ Failure ] -crbug.com/714962 fast/deprecated-flexbox/024.html [ Failure ] +crbug.com/714962 fast/deprecated-flexbox/009.html [ Failure Pass ] +crbug.com/714962 fast/deprecated-flexbox/023.html [ Failure Pass ] +crbug.com/714962 fast/deprecated-flexbox/024.html [ Failure Pass ] crbug.com/591099 fast/deprecated-flexbox/flexing-overflow-scroll-item.html [ Failure ] crbug.com/591099 fast/deprecated-flexbox/relpos-flex-item-with-percent-height-abspos-child.html [ Failure ] crbug.com/591099 fast/deprecated-flexbox/relpos-flex-item-with-percent-height-abspos-descendant.html [ Failure ] @@ -1973,14 +1951,13 @@ crbug.com/591099 fast/doctypes/002.html [ Failure ] crbug.com/591099 fast/doctypes/003.html [ Failure ] crbug.com/591099 fast/doctypes/004.html [ Failure ] -crbug.com/591099 fast/dom/34176.html [ Failure ] crbug.com/714962 fast/dom/Element/client-rect-list-argument.html [ Failure ] crbug.com/591099 fast/dom/Element/getBoundingClientRect.html [ Failure ] crbug.com/714962 fast/dom/Element/getClientRects.html [ Failure ] crbug.com/591099 fast/dom/HTMLMeterElement/meter-boundary-values.html [ Failure ] crbug.com/591099 fast/dom/HTMLMeterElement/meter-optimums.html [ Failure ] -crbug.com/591099 fast/dom/HTMLMeterElement/meter-styles.html [ Failure ] -crbug.com/591099 fast/dom/HTMLObjectElement/vspace-hspace-as-number.html [ Failure ] +crbug.com/591099 fast/dom/HTMLMeterElement/meter-styles.html [ Failure Pass ] +crbug.com/591099 fast/dom/HTMLObjectElement/vspace-hspace-as-number.html [ Failure Pass ] crbug.com/591099 fast/dom/HTMLProgressElement/progress-bar-value-pseudo-element.html [ Failure ] crbug.com/714962 fast/dom/Range/collapsed-range-bounding-client-rect.html [ Failure ] crbug.com/714962 fast/dom/Range/get-bounding-client-rect-empty-and-non-empty.html [ Timeout ] @@ -2016,25 +1993,16 @@ crbug.com/591099 fast/dom/shadow/selections-in-shadow.html [ Timeout ] crbug.com/591099 fast/dom/shadow/shadow-dom-event-dispatching-details-summary.html [ Pass ] crbug.com/591099 fast/dom/wrapper-classes.html [ Timeout ] -crbug.com/591099 fast/dynamic/011.html [ Failure ] -crbug.com/591099 fast/dynamic/012.html [ Failure ] crbug.com/591099 fast/dynamic/continuation-detach-crash.html [ Crash ] crbug.com/591099 fast/dynamic/first-letter-after-list-marker.html [ Failure ] -crbug.com/591099 fast/dynamic/float-withdrawal.html [ Failure ] crbug.com/714962 fast/dynamic/focus-clear-resolver-crash.html [ Failure ] -crbug.com/591099 fast/dynamic/insert-before-table-part-in-continuation.html [ Failure ] -crbug.com/591099 fast/dynamic/layer-hit-test-crash.html [ Failure ] -crbug.com/591099 fast/dynamic/noninlinebadness.html [ Failure ] -crbug.com/591099 fast/dynamic/outerHTML-doc.html [ Failure ] -crbug.com/591099 fast/dynamic/outerHTML-img.html [ Failure ] +crbug.com/591099 fast/dynamic/layer-hit-test-crash.html [ Failure Pass ] +crbug.com/591099 fast/dynamic/outerHTML-img.html [ Failure Pass ] crbug.com/591099 fast/dynamic/selection-highlight-adjust.html [ Failure ] crbug.com/591099 fast/dynamic/static-to-relative-with-absolute-child.html [ Crash ] -crbug.com/591099 fast/dynamic/staticY-marking-parents-regression.html [ Failure ] crbug.com/591099 fast/dynamic/text-combine.html [ Failure ] -crbug.com/591099 fast/dynamic/view-overflow.html [ Failure ] crbug.com/591099 fast/encoding/utf-16-big-endian.html [ Failure ] crbug.com/591099 fast/encoding/utf-16-little-endian.html [ Failure ] -crbug.com/591099 fast/encoding/xmacroman-encoding-test.html [ Failure ] crbug.com/714962 fast/events/document-elementFromPoint.html [ Failure ] crbug.com/714962 fast/events/drag-in-frames.html [ Failure ] crbug.com/714962 fast/events/event-on-culled_inline.html [ Failure ] @@ -2052,7 +2020,7 @@ crbug.com/591099 fast/events/pointerevents/mouse-pointer-capture.html [ Timeout ] crbug.com/591099 fast/events/pointerevents/mouse-pointer-event-properties.html [ Timeout ] crbug.com/591099 fast/events/pointerevents/mouse-pointer-preventdefault.html [ Timeout ] -crbug.com/591099 fast/events/pointerevents/multi-pointer-preventdefault.html [ Pass Timeout ] +crbug.com/591099 fast/events/pointerevents/multi-pointer-preventdefault.html [ Timeout ] crbug.com/591099 fast/events/pointerevents/touch-capture-in-iframe.html [ Timeout ] crbug.com/591099 fast/events/pointerevents/touch-capture.html [ Timeout ] crbug.com/714962 fast/events/pointerevents/touch-pointer-events.html [ Pass ] @@ -2108,7 +2076,6 @@ crbug.com/714962 fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar.html [ Failure ] crbug.com/714962 fast/forms/suggestion-picker/week-suggestion-picker-appearance.html [ Failure ] crbug.com/591099 fast/forms/text-control-intrinsic-widths.html [ Timeout ] -crbug.com/591099 fast/forms/text/input-readonly-autoscroll.html [ Failure ] crbug.com/591099 fast/forms/textarea/textarea-align.html [ Failure ] crbug.com/591099 fast/forms/textarea/textarea-metrics.html [ Timeout ] crbug.com/714962 fast/forms/textarea/textarea-resize-above-min-size-and-below-initial-size.html [ Pass ] @@ -2116,14 +2083,11 @@ crbug.com/591099 fast/forms/textarea/textarea-resize-orthogonal-containing-block.html [ Pass ] crbug.com/591099 fast/forms/time-multiple-fields/time-multiple-fields-stepup-stepdown-from-renderer.html [ Timeout ] crbug.com/591099 fast/frames/content-opacity-1.html [ Failure Pass ] -crbug.com/591099 fast/frames/content-opacity-2.html [ Failure Pass ] -crbug.com/591099 fast/frames/frameset-style-recalc.html [ Failure ] crbug.com/591099 fast/frames/iframe-with-frameborder.html [ Failure ] -crbug.com/591099 fast/frames/onlyCommentInIFrame.html [ Failure ] -crbug.com/591099 fast/gradients/generated-gradients.html [ Failure ] +crbug.com/591099 fast/gradients/generated-gradients.html [ Failure Pass ] crbug.com/591099 fast/gradients/list-item-gradient.html [ Failure ] crbug.com/591099 fast/gradients/radial-centered.html [ Failure ] -crbug.com/591099 fast/gradients/simple-gradients.html [ Failure ] +crbug.com/591099 fast/gradients/simple-gradients.html [ Failure Pass ] crbug.com/591099 fast/gradients/unprefixed-list-item-gradient.html [ Failure ] crbug.com/591099 fast/hidpi/broken-image-icon-hidpi.html [ Failure ] crbug.com/591099 fast/hidpi/image-set-list-style-image.html [ Failure ] @@ -2158,19 +2122,16 @@ crbug.com/591099 fast/inline/outline-continuations.html [ Failure ] crbug.com/714962 fast/inline/outline-offset.html [ Failure ] crbug.com/591099 fast/inline/styledEmptyInlinesWithBRs.html [ Failure ] -crbug.com/591099 fast/invalid/010.html [ Failure ] -crbug.com/591099 fast/invalid/021.html [ Failure ] -crbug.com/591099 fast/invalid/missing-address-end-tag.html [ Failure ] -crbug.com/591099 fast/invalid/missing-dl-end-tag.html [ Failure ] -crbug.com/591099 fast/invalid/missing-dt-end-tag.html [ Failure ] -crbug.com/591099 fast/invalid/missing-font-end-tag.html [ Failure ] +crbug.com/591099 fast/invalid/010.html [ Failure Pass ] +crbug.com/591099 fast/invalid/missing-address-end-tag.html [ Failure Pass ] +crbug.com/591099 fast/invalid/missing-dl-end-tag.html [ Failure Pass ] +crbug.com/591099 fast/invalid/missing-dt-end-tag.html [ Failure Pass ] +crbug.com/591099 fast/invalid/missing-font-end-tag.html [ Failure Pass ] crbug.com/591099 fast/js/dfg-arguments-alias-activation.html [ Timeout ] crbug.com/591099 fast/js/dfg-byte-array-put.html [ Timeout ] crbug.com/591099 fast/js/document-all-triggers-masquerades-watchpoint.html [ Timeout ] crbug.com/591099 fast/layers/layer-visibility.html [ Failure ] -crbug.com/591099 fast/layers/opacity-outline.html [ Failure ] crbug.com/591099 fast/layers/overflow-scroll-auto-switch.html [ Failure ] -crbug.com/591099 fast/layers/remove-only-this-layer-update.html [ Failure ] crbug.com/591099 fast/layers/scroll-rect-to-visible.html [ Failure ] crbug.com/591099 fast/lists/001-vertical.html [ Failure ] crbug.com/591099 fast/lists/001.html [ Failure ] @@ -2604,7 +2565,7 @@ crbug.com/714962 fast/overflow/childFocusRingClip.html [ Failure ] crbug.com/591099 fast/overflow/height-during-simplified-layout.html [ Failure ] crbug.com/591099 fast/overflow/image-selection-highlight.html [ Failure ] -crbug.com/591099 fast/overflow/infiniteRecursion.html [ Failure ] +crbug.com/591099 fast/overflow/infiniteRecursion.html [ Failure Pass ] crbug.com/714962 fast/overflow/line-clamp-hides-trailing-anchor.html [ Failure ] crbug.com/591099 fast/overflow/line-clamp.html [ Failure ] crbug.com/591099 fast/overflow/overflow-rtl-vertical.html [ Failure ] @@ -2652,16 +2613,13 @@ crbug.com/591099 fast/parser/001.html [ Failure ] crbug.com/591099 fast/parser/entities-in-html.html [ Failure ] crbug.com/591099 fast/parser/entities-in-xhtml.xhtml [ Failure ] -crbug.com/591099 fast/parser/nofoo-tags-inside-paragraph.html [ Failure ] -crbug.com/591099 fast/parser/xhtml-alternate-entities.xml [ Failure ] -crbug.com/591099 fast/reflections/inline-crash.html [ Failure ] -crbug.com/591099 fast/reflections/opacity-reflection-transform.html [ Failure ] -crbug.com/591099 fast/reflections/reflection-overflow-hidden.html [ Failure ] +crbug.com/591099 fast/parser/nofoo-tags-inside-paragraph.html [ Failure Pass ] +crbug.com/591099 fast/reflections/opacity-reflection-transform.html [ Failure Pass ] crbug.com/591099 fast/replaced/absolute-position-percentage-height.html [ Failure ] crbug.com/591099 fast/replaced/border-radius-clip.html [ Failure ] crbug.com/591099 fast/replaced/computed-image-width-with-percent-height-and-fixed-ancestor-vertical-lr.html [ Failure ] -crbug.com/591099 fast/replaced/max-width-percent.html [ Failure ] -crbug.com/591099 fast/replaced/percent-height-in-anonymous-block-in-table.html [ Failure ] +crbug.com/591099 fast/replaced/max-width-percent.html [ Failure Pass ] +crbug.com/591099 fast/replaced/percent-height-in-anonymous-block-in-table.html [ Failure Pass ] crbug.com/591099 fast/replaced/percent-height-in-anonymous-block.html [ Failure ] crbug.com/591099 fast/replaced/preferred-widths.html [ Failure ] crbug.com/591099 fast/replaced/replaced-element-with-percentage-height-anonymous-block-parent.html [ Failure ] @@ -2717,12 +2675,10 @@ crbug.com/591099 fast/scrolling/scrollbar-tickmarks-hittest.html [ Pass ] crbug.com/714962 fast/scrolling/scrollbar-tickmarks-styled-after-onload.html [ Failure ] crbug.com/714962 fast/scrolling/scrollbar-tickmarks-styled.html [ Failure ] -crbug.com/591099 fast/selectors/021.html [ Failure ] crbug.com/591099 fast/selectors/038.html [ Failure ] -crbug.com/591099 fast/selectors/040.html [ Failure ] -crbug.com/591099 fast/selectors/041.html [ Failure ] -crbug.com/591099 fast/selectors/042.html [ Failure ] -crbug.com/591099 fast/selectors/066.html [ Failure ] +crbug.com/591099 fast/selectors/040.html [ Failure Pass ] +crbug.com/591099 fast/selectors/041.html [ Failure Pass ] +crbug.com/591099 fast/selectors/042.html [ Failure Pass ] crbug.com/591099 fast/selectors/166.html [ Failure ] crbug.com/591099 fast/selectors/167.html [ Failure ] crbug.com/591099 fast/selectors/167a.html [ Failure ] @@ -2812,77 +2768,75 @@ crbug.com/591099 fast/spatial-navigation/snav-use-visual-viewport.html [ Failure ] crbug.com/591099 fast/sub-pixel/computedstylemargin.html [ Failure ] crbug.com/591099 fast/sub-pixel/inline-block-with-padding.html [ Failure ] -crbug.com/714962 fast/sub-pixel/size-of-span-with-different-positions.html [ Failure ] +crbug.com/714962 fast/sub-pixel/size-of-span-with-different-positions.html [ Failure Pass ] crbug.com/591099 fast/sub-pixel/sub-pixel-border-2.html [ Failure ] -crbug.com/591099 fast/sub-pixel/table-cells-with-padding-do-not-wrap.html [ Failure Pass ] -crbug.com/591099 fast/sub-pixel/table-rtl-padding.html [ Failure Pass ] crbug.com/591099 fast/table/018.html [ Failure ] crbug.com/591099 fast/table/032.html [ Failure ] crbug.com/714962 fast/table/035-vertical.html [ Failure ] crbug.com/714962 fast/table/040-vertical.html [ Failure ] crbug.com/714962 fast/table/040.html [ Failure ] -crbug.com/714962 fast/table/041.html [ Failure ] +crbug.com/714962 fast/table/041.html [ Failure Pass ] crbug.com/714962 fast/table/absolute-table-at-bottom.html [ Failure ] crbug.com/714962 fast/table/auto-with-percent-height-vertical.html [ Failure ] -crbug.com/714962 fast/table/auto-with-percent-height.html [ Failure ] -crbug.com/714962 fast/table/backgr_border-table-cell-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/auto-with-percent-height.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_border-table-cell-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_border-table-cell.html [ Failure ] -crbug.com/714962 fast/table/backgr_border-table-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_border-table-column-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_border-table-column-group-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_border-table-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_border-table-column-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_border-table-column-group-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_border-table-column-group.html [ Failure ] crbug.com/714962 fast/table/backgr_border-table-column.html [ Failure ] -crbug.com/714962 fast/table/backgr_border-table-quirks-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_border-table-quirks-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_border-table-quirks.html [ Failure ] -crbug.com/714962 fast/table/backgr_border-table-row-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_border-table-row-group-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_border-table-row-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_border-table-row-group-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_border-table-row-group.html [ Failure ] crbug.com/714962 fast/table/backgr_border-table-row.html [ Failure ] crbug.com/714962 fast/table/backgr_border-table.html [ Failure ] -crbug.com/714962 fast/table/backgr_layers-hide-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_layers-hide-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_layers-hide.html [ Failure ] crbug.com/591099 fast/table/backgr_layers-opacity-collapsed-border.html [ Failure ] crbug.com/591099 fast/table/backgr_layers-opacity.html [ Failure ] crbug.com/591099 fast/table/backgr_layers-show-collapsed-border.html [ Failure ] crbug.com/591099 fast/table/backgr_layers-show.html [ Failure ] -crbug.com/714962 fast/table/backgr_position-table-cell-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_position-table-cell-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_position-table-cell.html [ Failure ] -crbug.com/714962 fast/table/backgr_position-table-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_position-table-column-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_position-table-column-group-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_position-table-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_position-table-column-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_position-table-column-group-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_position-table-column-group.html [ Failure ] crbug.com/714962 fast/table/backgr_position-table-column.html [ Failure ] -crbug.com/714962 fast/table/backgr_position-table-row-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_position-table-row-group-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_position-table-row-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_position-table-row-group-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_position-table-row-group.html [ Failure ] crbug.com/714962 fast/table/backgr_position-table-row.html [ Failure ] crbug.com/714962 fast/table/backgr_position-table.html [ Failure ] -crbug.com/714962 fast/table/backgr_simple-table-cell-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_simple-table-cell-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_simple-table-cell.html [ Failure ] -crbug.com/714962 fast/table/backgr_simple-table-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_simple-table-column-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_simple-table-column-group-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_simple-table-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_simple-table-column-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_simple-table-column-group-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_simple-table-column-group.html [ Failure ] crbug.com/714962 fast/table/backgr_simple-table-column.html [ Failure ] -crbug.com/714962 fast/table/backgr_simple-table-row-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/backgr_simple-table-row-group-collapsed-border.html [ Failure ] +crbug.com/714962 fast/table/backgr_simple-table-row-collapsed-border.html [ Failure Pass ] +crbug.com/714962 fast/table/backgr_simple-table-row-group-collapsed-border.html [ Failure Pass ] crbug.com/714962 fast/table/backgr_simple-table-row-group.html [ Failure ] crbug.com/714962 fast/table/backgr_simple-table-row.html [ Failure ] crbug.com/714962 fast/table/backgr_simple-table.html [ Failure ] crbug.com/591099 fast/table/border-collapsing/001-vertical.html [ Failure ] crbug.com/591099 fast/table/border-collapsing/003-vertical.html [ Failure ] crbug.com/591099 fast/table/border-collapsing/004-vertical.html [ Failure ] -crbug.com/591099 fast/table/border-collapsing/004.html [ Failure ] +crbug.com/591099 fast/table/border-collapsing/004.html [ Failure Pass ] crbug.com/591099 fast/table/border-collapsing/border-collapsing-head-foot-vertical.html [ Failure ] crbug.com/714962 fast/table/border-collapsing/border-collapsing-head-foot.html [ Failure ] crbug.com/591099 fast/table/border-collapsing/composited-cell-collapsed-border.html [ Failure ] -crbug.com/714962 fast/table/border-collapsing/rtl-border-collapsing-vertical.html [ Failure ] -crbug.com/714962 fast/table/border-collapsing/rtl-border-collapsing.html [ Failure ] +crbug.com/714962 fast/table/border-collapsing/rtl-border-collapsing-vertical.html [ Failure Pass ] +crbug.com/714962 fast/table/border-collapsing/rtl-border-collapsing.html [ Failure Pass ] crbug.com/591099 fast/table/column-in-inline.html [ Failure ] crbug.com/591099 fast/table/dynamic-descendant-percentage-height.html [ Failure ] crbug.com/591099 fast/table/empty-table-percent-height.html [ Failure ] crbug.com/591099 fast/table/fixed-table-layout/table-with-percent-width.html [ Failure ] -crbug.com/591099 fast/table/form-with-table-style.html [ Failure ] +crbug.com/591099 fast/table/form-with-table-style.html [ Failure Pass ] crbug.com/591099 fast/table/height-percent-test-vertical.html [ Failure ] crbug.com/714962 fast/table/hittest-tablecell-bottom-edge.html [ Failure ] crbug.com/714962 fast/table/hittest-tablecell-right-edge.html [ Failure ] @@ -2895,9 +2849,9 @@ crbug.com/591099 fast/table/percent-height-content-in-fixed-height-border-box-sized-cell-with-collapsed-border.html [ Failure ] crbug.com/591099 fast/table/percent-height-content-in-fixed-height-content-box-sized-cell.html [ Failure ] crbug.com/591099 fast/table/percent-height-overflow-auto-content-in-cell.html [ Failure Pass ] -crbug.com/591099 fast/table/percent-height-overflow-scroll-content-in-cell.html [ Failure Pass ] +crbug.com/591099 fast/table/percent-height-overflow-scroll-content-in-cell.html [ Failure ] crbug.com/591099 fast/table/percent-widths-stretch-vertical.html [ Failure ] -crbug.com/714962 fast/table/rtl-cell-display-none-assert.html [ Failure ] +crbug.com/714962 fast/table/rtl-cell-display-none-assert.html [ Failure Pass ] crbug.com/714962 fast/table/split-table-section-before-anonymous-block-2.html [ Failure ] crbug.com/714962 fast/table/split-table-section-before-anonymous-block-3.html [ Failure ] crbug.com/714962 fast/table/split-table-section-before-anonymous-block-4.html [ Failure ] @@ -2914,9 +2868,9 @@ crbug.com/714962 fast/table/table-row-after-child-in-block.html [ Failure ] crbug.com/714962 fast/table/table-row-before-after-content-around-block.html [ Failure ] crbug.com/714962 fast/table/table-row-before-child-in-block.html [ Failure ] -crbug.com/714962 fast/table/text-field-baseline.html [ Failure ] +crbug.com/714962 fast/table/text-field-baseline.html [ Failure Pass ] crbug.com/591099 fast/table/unbreakable-images-quirk.html [ Failure ] -crbug.com/591099 fast/table/unused-percent-heights.html [ Failure ] +crbug.com/591099 fast/table/unused-percent-heights.html [ Failure Pass ] crbug.com/591099 fast/table/vertical-align-baseline-readjust.html [ Failure ] crbug.com/591099 fast/text-autosizing/cluster-inline-block-or-table.html [ Failure ] crbug.com/591099 fast/text-autosizing/cluster-inline-grid-flex-box.html [ Failure ] @@ -2949,7 +2903,7 @@ crbug.com/591099 fast/text-autosizing/form-controls-autosizing-select-element.html [ Failure ] crbug.com/591099 fast/text-autosizing/form-controls-autosizing-textfield-input-elements.html [ Failure ] crbug.com/591099 fast/text-autosizing/form-controls-textfield-in-span.html [ Failure ] -crbug.com/591099 fast/text-autosizing/hackernews-comments.html [ Failure ] +crbug.com/591099 fast/text-autosizing/hackernews-comments.html [ Failure Pass ] crbug.com/591099 fast/text-autosizing/header-li-links-autosizing.html [ Failure ] crbug.com/591099 fast/text-autosizing/header-links-autosizing-different-fontsize.html [ Failure ] crbug.com/591099 fast/text-autosizing/header-links-autosizing.html [ Failure ] @@ -2980,7 +2934,7 @@ crbug.com/591099 fast/text-autosizing/wide-child.html [ Failure ] crbug.com/591099 fast/text-autosizing/wide-in-narrow-overflow-scroll.html [ Failure ] crbug.com/591099 fast/text/break-word-with-floats.html [ Failure ] -crbug.com/591099 fast/text/chromium-linux-fontconfig-renderstyle.html [ Failure ] +crbug.com/591099 fast/text/chromium-linux-fontconfig-renderstyle.html [ Failure Pass ] crbug.com/591099 fast/text/complex-text-opacity.html [ Failure ] crbug.com/591099 fast/text/container-align-with-inlines.html [ Failure ] crbug.com/591099 fast/text/decorations-transformed.html [ Failure ] @@ -3003,7 +2957,7 @@ crbug.com/714962 fast/text/get-client-rects-grapheme.html [ Failure ] crbug.com/714962 fast/text/glyph-reordering.html [ Failure ] crbug.com/591099 fast/text/hide-atomic-inlines-after-ellipsis.html [ Failure ] -crbug.com/714962 fast/text/international/bidi-layout-across-linebreak.html [ Failure ] +crbug.com/714962 fast/text/international/bidi-layout-across-linebreak.html [ Failure Pass ] crbug.com/591099 fast/text/international/bidi-linebreak-002.html [ Failure ] crbug.com/591099 fast/text/international/bidi-linebreak-003.html [ Failure ] crbug.com/714962 fast/text/international/cjk-segmentation.html [ Failure ] @@ -3102,13 +3056,12 @@ crbug.com/591099 fast/writing-mode/text-combine-justify.html [ Failure ] crbug.com/591099 fast/writing-mode/text-combine-line-break.html [ Failure ] crbug.com/591099 fast/writing-mode/text-combine-various-fonts.html [ Failure ] -crbug.com/714962 fast/writing-mode/text-orientation-basic.html [ Failure ] +crbug.com/714962 fast/writing-mode/text-orientation-basic.html [ Failure Pass ] crbug.com/591099 fast/writing-mode/vertical-baseline-alignment.html [ Failure ] crbug.com/714962 fast/writing-mode/vertical-font-fallback.html [ Failure ] crbug.com/591099 fast/writing-mode/vertical-lr-replaced-selection.html [ Failure ] -crbug.com/591099 fast/xsl/xslt-entity.xml [ Failure ] -crbug.com/591099 fast/xsl/xslt-extra-content-at-end.xml [ Failure ] -crbug.com/591099 fast/xsl/xslt-relative-path.xml [ Failure ] +crbug.com/591099 fast/xsl/xslt-entity.xml [ Failure Pass ] +crbug.com/591099 fast/xsl/xslt-extra-content-at-end.xml [ Failure Pass ] crbug.com/591099 fonts/monospace.html [ Failure ] crbug.com/591099 fonts/sans-serif.html [ Failure ] crbug.com/591099 fonts/serif.html [ Failure ] @@ -3228,15 +3181,11 @@ crbug.com/591099 html/dialog/modal-dialog-in-table-column.html [ Failure ] crbug.com/591099 html/dialog/modal-dialog-scroll-height.html [ Failure ] crbug.com/591099 html/dialog/multiple-centered-dialogs.html [ Failure ] -crbug.com/591099 html/dialog/top-layer-containing-block.html [ Crash ] -crbug.com/591099 html/document_metadata/head-link-style-href-check.html [ Failure ] +crbug.com/591099 html/dialog/top-layer-containing-block.html [ Crash Pass ] crbug.com/591099 html/marquee/marquee-scroll.html [ Failure ] crbug.com/591099 html/marquee/marquee-scrollamount.html [ Failure ] -crbug.com/591099 html/tabular_data/table_createcaption.html [ Failure ] -crbug.com/591099 html/tabular_data/td_colspan_rendering.html [ Failure ] crbug.com/591099 http/tests/css/css-image-valued-shape.html [ Failure ] crbug.com/714962 http/tests/css/css-resources-referrer-srcdoc.html [ Failure Pass ] -crbug.com/591099 http/tests/css/css-resources-referrer.html [ Failure Pass ] crbug.com/591099 http/tests/css/shape-image-file.html [ Failure ] crbug.com/591099 http/tests/csspaint/invalidation-background-image.html [ Timeout ] crbug.com/591099 http/tests/csspaint/invalidation-border-image.html [ Timeout ] @@ -3281,7 +3230,7 @@ crbug.com/591099 http/tests/feature-policy/payment-disabled.php [ Pass ] crbug.com/591099 http/tests/feature-policy/payment-enabledforall.php [ Pass ] crbug.com/591099 http/tests/images/restyle-decode-error.html [ Failure ] -crbug.com/783102 http/tests/incremental/frame-focus-before-load.html [ Pass Timeout ] +crbug.com/783102 http/tests/incremental/frame-focus-before-load.html [ Timeout ] crbug.com/591099 http/tests/incremental/slow-utf8-text.pl [ Pass Timeout ] crbug.com/591099 http/tests/inspector-protocol/network/response-interception-no-change-content-not-ready.js [ Pass ] crbug.com/591099 http/tests/inspector-protocol/network/response-interception-request-completes-network-closes.js [ Pass ] @@ -3295,10 +3244,9 @@ crbug.com/591099 http/tests/misc/acid2-pixel.html [ Failure ] crbug.com/591099 http/tests/misc/acid2.html [ Failure ] crbug.com/591099 http/tests/misc/acid3.html [ Crash ] -crbug.com/591099 http/tests/misc/iframe404.html [ Failure ] -crbug.com/591099 http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm [ Failure ] +crbug.com/591099 http/tests/misc/object-embedding-svg-delayed-size-negotiation-2.htm [ Failure Pass ] crbug.com/591099 http/tests/misc/object-embedding-svg-delayed-size-negotiation.xhtml [ Failure ] -crbug.com/591099 http/tests/misc/slow-loading-mask.html [ Failure ] +crbug.com/591099 http/tests/misc/slow-loading-mask.html [ Failure Pass ] crbug.com/591099 http/tests/origin_trials/sample-api-workers.html [ Pass ] crbug.com/591099 http/tests/permissions/test-api-surface.html [ Pass ] crbug.com/591099 http/tests/security/contentSecurityPolicy/directive-parsing-03.html [ Failure ] @@ -3314,7 +3262,6 @@ crbug.com/591099 http/tests/shapes/shape-outside-svg-image-shape-margin.html [ Failure ] crbug.com/591099 http/tests/text-autosizing/narrow-iframe.html [ Failure ] crbug.com/591099 http/tests/text-autosizing/wide-iframe.html [ Failure ] -crbug.com/591099 http/tests/uri/css-href.php [ Failure ] crbug.com/714962 http/tests/webfont/font-display-intervention.html [ Failure Pass ] crbug.com/591099 http/tests/websocket/invalid-subprotocol-characters.html [ Timeout ] crbug.com/591099 http/tests/workers/shared-worker-performance-timeline.html [ Pass ] @@ -3352,7 +3299,7 @@ crbug.com/591099 images/rendering-broken-block-flow-images.html [ Failure ] crbug.com/591099 images/rendering-broken-images-empty-alt.html [ Failure ] crbug.com/591099 images/rendering-broken-images.html [ Failure ] -crbug.com/591099 inspector-protocol/accessibility/accessibility-ignoredNodes.js [ Failure Timeout ] +crbug.com/591099 inspector-protocol/accessibility/accessibility-ignoredNodes.js [ Timeout ] crbug.com/714962 inspector-protocol/accessibility/accessibility-ignoredNodesModal.js [ Failure ] crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-img-figure.js [ Timeout ] crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-input-buttons.js [ Timeout ] @@ -3388,11 +3335,10 @@ crbug.com/591099 media/autoplay/document-user-activation.html [ Failure ] crbug.com/591099 media/controls/volumechange-muted-attribute.html [ Failure Pass ] crbug.com/591099 media/controls/volumechange-stopimmediatepropagation.html [ Failure Pass ] -crbug.com/591099 media/video-aspect-ratio.html [ Failure ] -crbug.com/591099 media/video-colorspace-yuv420.html [ Failure ] -crbug.com/591099 media/video-colorspace-yuv422.html [ Failure ] +crbug.com/591099 media/video-aspect-ratio.html [ Failure Pass ] +crbug.com/591099 media/video-colorspace-yuv420.html [ Failure Pass ] +crbug.com/591099 media/video-colorspace-yuv422.html [ Failure Pass ] crbug.com/591099 media/video-persistence.html [ Crash ] -crbug.com/591099 media/video-replaces-poster.html [ Failure ] crbug.com/591099 media/video-transformed.html [ Failure ] crbug.com/591099 netinfo/estimate-multiple-frames.html [ Failure Pass ] crbug.com/591099 overflow/overflow-basic-002.html [ Pass ] @@ -3430,8 +3376,8 @@ crbug.com/591099 paint/invalidation/compositing/fixed-pos-with-abs-pos-child-scroll.html [ Failure ] crbug.com/591099 paint/invalidation/compositing/iframe-clip-removed.html [ Failure ] crbug.com/591099 paint/invalidation/compositing/iframe-inside-squashed-layer.html [ Failure ] -crbug.com/591099 paint/invalidation/compositing/layer-repaint-rects.html [ Failure ] -crbug.com/591099 paint/invalidation/compositing/layer-repaint.html [ Failure ] +crbug.com/591099 paint/invalidation/compositing/layer-repaint-rects.html [ Failure Pass ] +crbug.com/591099 paint/invalidation/compositing/layer-repaint.html [ Failure Pass ] crbug.com/591099 paint/invalidation/compositing/remove-squashed-layer-plus-move.html [ Failure ] crbug.com/714962 paint/invalidation/compositing/repaint-via-layout-offset.html [ Failure ] crbug.com/591099 paint/invalidation/compositing/should-invoke-deferred-compositing.html [ Failure ] @@ -3636,7 +3582,7 @@ crbug.com/591099 paint/invalidation/svg/deep-nested-embedded-svg-size-changes-no-layout-triggers-1.html [ Failure ] crbug.com/591099 paint/invalidation/svg/deep-nested-embedded-svg-size-changes-no-layout-triggers-2.html [ Failure ] crbug.com/591099 paint/invalidation/svg/embedded-svg-size-changes-no-layout-triggers.html [ Failure ] -crbug.com/714962 paint/invalidation/svg/hit-test-with-br.xhtml [ Failure ] +crbug.com/714962 paint/invalidation/svg/hit-test-with-br.xhtml [ Failure Pass ] crbug.com/591099 paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-1.html [ Failure ] crbug.com/591099 paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2.html [ Failure ] crbug.com/591099 paint/invalidation/svg/object-sizing-no-width-height-change-content-box-size.xhtml [ Failure ] @@ -3743,7 +3689,7 @@ crbug.com/591099 paint/markers/first-letter.html [ Failure ] crbug.com/591099 paint/markers/inline-spelling-markers-hidpi-composited.html [ Failure ] crbug.com/591099 paint/markers/inline-spelling-markers-hidpi.html [ Failure ] -crbug.com/591099 paint/markers/inline_spelling_markers.html [ Failure ] +crbug.com/591099 paint/markers/inline_spelling_markers.html [ Failure Pass ] crbug.com/591099 paint/markers/marker-early-break-bug.html [ Failure ] crbug.com/591099 paint/overflow/background-mask-should-be-recorded-full.html [ Failure ] crbug.com/591099 paint/overflow/composited-scroll-vertical-rl.html [ Failure ] @@ -3772,7 +3718,6 @@ crbug.com/714962 paint/text/text-match-highlights-big-line-height.html [ Failure ] crbug.com/591099 payments/payment-request-in-iframe-nested-not-allowed.html [ Failure ] crbug.com/591099 payments/payment-request-in-iframe.html [ Failure ] -crbug.com/591099 plugins/embed-attributes-style.html [ Failure ] crbug.com/591099 plugins/mouse-click-plugin-clears-selection.html [ Failure ] crbug.com/591099 plugins/webview-plugin-nested-iframe-scroll.html [ Failure ] crbug.com/591099 printing/absolute-position-headers-and-footers.html [ Failure ] @@ -3849,18 +3794,14 @@ crbug.com/591099 svg/as-background-image/svg-as-background-6.html [ Failure Pass ] crbug.com/714962 svg/as-background-image/svg-as-background-body.html [ Failure ] crbug.com/591099 svg/as-background-image/svg-as-background-with-relative-size.html [ Failure Pass ] -crbug.com/591099 svg/as-background-image/svg-as-background-with-viewBox.html [ Failure Pass ] -crbug.com/591099 svg/as-background-image/svg-as-background.html [ Failure Pass ] crbug.com/591099 svg/as-background-image/svg-as-tiled-background.html [ Failure Pass ] crbug.com/591099 svg/as-border-image/svg-as-border-image-2.html [ Failure ] crbug.com/591099 svg/as-border-image/svg-as-border-image.html [ Failure ] -crbug.com/714962 svg/canvas/canvas-pattern-svg.html [ Failure ] -crbug.com/591099 svg/custom/absolute-sized-svg-in-xhtml.xhtml [ Failure ] -crbug.com/591099 svg/custom/clone-element-with-animated-svg-properties.html [ Failure ] +crbug.com/714962 svg/canvas/canvas-pattern-svg.html [ Failure Pass ] +crbug.com/591099 svg/custom/clone-element-with-animated-svg-properties.html [ Failure Pass ] crbug.com/591099 svg/custom/getscreenctm-in-scrollable-div-area-nested.xhtml [ Failure ] crbug.com/591099 svg/custom/getscreenctm-in-scrollable-div-area.xhtml [ Failure ] -crbug.com/591099 svg/custom/getsvgdocument.html [ Failure ] -crbug.com/591099 svg/custom/inline-svg-in-xhtml.xml [ Failure ] +crbug.com/591099 svg/custom/inline-svg-in-xhtml.xml [ Failure Pass ] crbug.com/591099 svg/custom/inline-svg-use-available-width-in-stf.html [ Failure ] crbug.com/591099 svg/custom/invisible-text-after-scrolling.xhtml [ Failure ] crbug.com/591099 svg/custom/junk-data.svg [ Failure ] @@ -3870,18 +3811,17 @@ crbug.com/591099 svg/custom/object-sizing-no-width-height.xhtml [ Failure ] crbug.com/591099 svg/custom/object-sizing.xhtml [ Failure ] crbug.com/591099 svg/custom/path-bad-data.svg [ Failure ] -crbug.com/591099 svg/custom/rootmost-svg-xy-attrs.xhtml [ Failure ] -crbug.com/591099 svg/custom/svg-float-border-padding.xml [ Failure ] +crbug.com/591099 svg/custom/rootmost-svg-xy-attrs.xhtml [ Failure Pass ] crbug.com/591099 svg/custom/svg-fonts-in-html.html [ Failure ] crbug.com/591099 svg/custom/text-match-highlight.html [ Failure ] crbug.com/591099 svg/custom/transformed-text-pattern.html [ Failure ] crbug.com/591099 svg/custom/use-event-retargeting.html [ Failure ] crbug.com/591099 svg/custom/use-font-face-crash.svg [ Failure ] -crbug.com/714962 svg/dom/SVGStringList-basics.xhtml [ Failure ] +crbug.com/714962 svg/dom/SVGStringList-basics.xhtml [ Failure Pass ] crbug.com/591099 svg/dom/svgangle-units.html [ Pass Timeout ] crbug.com/591099 svg/filters/feTurbulence-bad-seeds.html [ Failure ] crbug.com/591099 svg/foreign-object-under-shadow-root-under-hidden.html [ Failure ] -crbug.com/591099 svg/foreignObject/svg-document-in-html-document.svg [ Failure ] +crbug.com/591099 svg/foreignObject/svg-document-in-html-document.svg [ Failure Pass ] crbug.com/591099 svg/hixie/error/012.xml [ Failure ] crbug.com/591099 svg/hixie/error/013.xml [ Failure ] crbug.com/591099 svg/in-html/sizing/svg-inline.html [ Timeout ] @@ -3900,187 +3840,181 @@ crbug.com/591099 svg/transforms/text-with-pattern-inside-transformed-html.xhtml [ Failure ] crbug.com/591099 svg/transforms/transformed-text-fill-pattern.html [ Failure ] crbug.com/591099 svg/wicd/test-scalable-background-image1.xhtml [ Crash Failure ] -crbug.com/591099 svg/zoom/page/zoom-hixie-mixed-009.xml [ Failure ] -crbug.com/591099 svg/zoom/page/zoom-hixie-rendering-model-004.xhtml [ Failure ] -crbug.com/591099 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ] +crbug.com/591099 svg/zoom/page/zoom-hixie-mixed-009.xml [ Failure Pass ] +crbug.com/591099 svg/zoom/page/zoom-hixie-rendering-model-004.xhtml [ Failure Pass ] crbug.com/591099 svg/zoom/page/zoom-replaced-intrinsic-ratio-001.htm [ Failure ] crbug.com/591099 svg/zoom/page/zoom-svg-as-background-with-relative-size-and-viewBox.html [ Crash Pass ] crbug.com/591099 svg/zoom/page/zoom-svg-as-background-with-relative-size.html [ Crash Pass ] -crbug.com/591099 svg/zoom/page/zoom-svg-float-border-padding.xml [ Failure ] -crbug.com/591099 svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml [ Failure Pass ] -crbug.com/591099 svg/zoom/page/zoom-svg-through-object-with-absolute-size.xhtml [ Failure Pass ] -crbug.com/591099 svg/zoom/page/zoom-svg-through-object-with-override-size.html [ Failure ] -crbug.com/591099 svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml [ Failure ] -crbug.com/591099 svg/zoom/text/zoom-hixie-mixed-009.xml [ Failure ] -crbug.com/591099 svg/zoom/text/zoom-svg-float-border-padding.xml [ Failure ] +crbug.com/591099 svg/zoom/page/zoom-svg-through-object-with-percentage-size.xhtml [ Failure Pass ] +crbug.com/591099 svg/zoom/text/zoom-hixie-mixed-009.xml [ Failure Pass ] crbug.com/591099 tables/layering/paint-test-layering-1.html [ Failure ] crbug.com/591099 tables/layering/paint-test-layering-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug101674.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug106158-1.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug106158-2.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug109043.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug106158-1.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug106158-2.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug109043.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug110566.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug113235-1.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug113235-1.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug11384q.html [ Failure ] crbug.com/714962 tables/mozilla/bugs/bug11384s.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug1188.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug11944.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug1188.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug11944.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug12008.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug126742.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug1271.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug1302.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug1302.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug131020-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug131020.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug131020_iframe.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug13118.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug13118.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug1318.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug13196.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug13196.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug133948.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug137388-1.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug137388-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug137388-3.html [ Failure ] crbug.com/714962 tables/mozilla/bugs/bug139524-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug14159-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug1430.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug1430.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug149275-1.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug149275-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug16252.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug16252.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug17130-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug18359.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug18359.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug18440.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug18664.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug18955.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug19599.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug20579.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug18664.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug18955.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug19599.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug20579.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug219693-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug2267.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug2267.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug23235.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug2479-1.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug2479-1.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug2479-3.html [ Failure ] crbug.com/714962 tables/mozilla/bugs/bug2479-4.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug2509.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug2509.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug26553.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug27038-1.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug27038-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug2757.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug27038-2.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug2757.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug2886-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug2947.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug2947.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug2962.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug2973.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug2981-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug2981-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug2997.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug2981-1.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug2981-2.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug2997.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug30692.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug3191.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug32205-3.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug3454.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug3454.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug38916.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug3977.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug43039.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug4427.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug44523.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug4501.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug3977.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug43039.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug4427.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug44523.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug4501.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug4576.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug46268-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug46268-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug46268-5.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug46268.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug46368-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug46368-2.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug46268-1.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug46268-2.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug46268-5.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug46268.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug46368-1.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug46368-2.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug46480-1.html [ Failure ] crbug.com/714962 tables/mozilla/bugs/bug46480-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug46623-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug46623-2.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug46623-2.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug46924.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug48028-1.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug48028-1.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug4803.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug4849-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug48827.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug4849-2.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug48827.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug50695-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug5188.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug5188.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug53690-2.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug5538.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug5538.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug55694.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug57828-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug57828.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug5798.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug58402-1.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug59354.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug6304.html [ Failure ] +crbug.com/591099 tables/mozilla/bugs/bug59354.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug6304.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug641-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug650.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug69382-2.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug7112-1.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug7112-2.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug727.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug7342.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug78162.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug80762-1.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug650.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug69382-2.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug7112-1.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug7112-2.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug727.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug7342.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug78162.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug80762-1.html [ Failure Pass ] crbug.com/714962 tables/mozilla/bugs/bug82946-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug82946-2.html [ Failure ] -crbug.com/591099 tables/mozilla/bugs/bug8381.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug82946-2.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/bugs/bug8381.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug88035-1.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug88035-2.html [ Failure ] crbug.com/591099 tables/mozilla/bugs/bug88524.html [ Failure ] crbug.com/714962 tables/mozilla/bugs/bug9123-1.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug93363.html [ Failure ] -crbug.com/714962 tables/mozilla/bugs/bug96334.html [ Failure ] +crbug.com/714962 tables/mozilla/bugs/bug93363.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/bugs/bug96334.html [ Failure Pass ] crbug.com/591099 tables/mozilla/bugs/bug98196.html [ Failure ] -crbug.com/591099 tables/mozilla/collapsing_borders/bug41262-3.html [ Failure ] +crbug.com/591099 tables/mozilla/collapsing_borders/bug41262-3.html [ Failure Pass ] crbug.com/591099 tables/mozilla/core/bloomberg.html [ Failure ] crbug.com/591099 tables/mozilla/core/table_heights.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/col_span.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/colgroup_span.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/colgroup_width_pct.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/colgroup_width_px.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_cellpadding.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_cellpadding_pct.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_cellspacing.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_class.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_style.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_td_colspan.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_td_height.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_td_rowspan.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_td_width.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_th_colspan.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_th_height.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_th_rowspan.html [ Failure ] -crbug.com/591099 tables/mozilla/marvin/tables_th_width.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_width_percent.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tables_width_px.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/tbody_char.html [ Failure ] -crbug.com/591099 tables/mozilla/marvin/tfoot_char.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/thead_char.html [ Failure ] -crbug.com/714962 tables/mozilla/marvin/x_col_width_pct.xml [ Failure ] -crbug.com/714962 tables/mozilla/marvin/x_col_width_px.xml [ Failure ] -crbug.com/714962 tables/mozilla/marvin/x_col_width_rel.xml [ Failure ] -crbug.com/714962 tables/mozilla/marvin/x_colgroup_width_pct.xml [ Failure ] -crbug.com/714962 tables/mozilla/marvin/x_colgroup_width_rel.xml [ Failure ] -crbug.com/714962 tables/mozilla/marvin/x_table.xml [ Failure ] -crbug.com/714962 tables/mozilla/marvin/x_table_style.xml [ Failure ] -crbug.com/714962 tables/mozilla/other/cellspacing.html [ Failure ] +crbug.com/714962 tables/mozilla/marvin/col_span.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/colgroup_span.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/colgroup_width_pct.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/colgroup_width_px.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_cellpadding.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_cellpadding_pct.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_cellspacing.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_class.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_style.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_td_colspan.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_td_height.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_td_rowspan.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_td_width.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_th_colspan.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_th_height.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_th_rowspan.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/marvin/tables_th_width.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_width_percent.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tables_width_px.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/tbody_char.html [ Failure Pass ] +crbug.com/591099 tables/mozilla/marvin/tfoot_char.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/thead_char.html [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/x_col_width_pct.xml [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/x_col_width_px.xml [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/x_col_width_rel.xml [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/x_colgroup_width_pct.xml [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/x_colgroup_width_rel.xml [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/x_table.xml [ Failure Pass ] +crbug.com/714962 tables/mozilla/marvin/x_table_style.xml [ Failure Pass ] +crbug.com/714962 tables/mozilla/other/cellspacing.html [ Failure Pass ] crbug.com/714962 tables/mozilla/other/test3.html [ Failure ] crbug.com/714962 tables/mozilla/other/test6.html [ Failure ] crbug.com/591099 tables/mozilla/other/wa_table_thtd_rowspan.html [ Failure ] crbug.com/591099 tables/mozilla_expected_failures/bugs/bug1010.html [ Failure ] crbug.com/714962 tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ] crbug.com/714962 tables/mozilla_expected_failures/bugs/bug1128.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug14007-1.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug21518.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug22122.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug2479-5.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug25707.html [ Failure ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug14007-1.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug21518.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug22122.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug2479-5.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug25707.html [ Failure Pass ] crbug.com/714962 tables/mozilla_expected_failures/bugs/bug32205-4.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug42043.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug4294.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug51000.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug56024.html [ Failure ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug42043.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug4294.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug51000.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug56024.html [ Failure Pass ] crbug.com/591099 tables/mozilla_expected_failures/bugs/bug7113.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug72393.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/bugs/bug80762-2.html [ Failure ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug72393.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/bugs/bug80762-2.html [ Failure Pass ] crbug.com/591099 tables/mozilla_expected_failures/bugs/bug85016.html [ Failure ] crbug.com/714962 tables/mozilla_expected_failures/bugs/bug91057.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/core/standards1.html [ Failure ] +crbug.com/714962 tables/mozilla_expected_failures/core/standards1.html [ Failure Pass ] crbug.com/591099 tables/mozilla_expected_failures/marvin/backgr_fixed-bg.html [ Failure ] crbug.com/591099 tables/mozilla_expected_failures/marvin/table_overflow_caption.html [ Failure ] crbug.com/591099 tables/mozilla_expected_failures/marvin/table_overflow_caption_bottom.html [ Failure ] @@ -4089,26 +4023,23 @@ crbug.com/591099 tables/mozilla_expected_failures/marvin/table_overflow_caption_left.html [ Failure ] crbug.com/591099 tables/mozilla_expected_failures/marvin/table_overflow_caption_right.html [ Failure ] crbug.com/591099 tables/mozilla_expected_failures/marvin/table_overflow_caption_top.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/marvin/tables_cellspacing_pct.html [ Failure ] -crbug.com/714962 tables/mozilla_expected_failures/marvin/x_colgroup_width_px.xml [ Failure ] +crbug.com/714962 tables/mozilla_expected_failures/marvin/tables_cellspacing_pct.html [ Failure Pass ] +crbug.com/714962 tables/mozilla_expected_failures/marvin/x_colgroup_width_px.xml [ Failure Pass ] crbug.com/714962 touchadjustment/context-menu-select-text.html [ Failure ] crbug.com/714962 touchadjustment/context-menu-text-subtargets.html [ Failure ] crbug.com/714962 touchadjustment/touch-links-longpress.html [ Failure ] crbug.com/591099 transforms/2d/compound-transforms-vs-containers.html [ Failure ] crbug.com/591099 transforms/2d/hindi-rotated.html [ Failure ] crbug.com/591099 transforms/2d/transform-2d.html [ Timeout ] -crbug.com/591099 transforms/2d/transform-fixed-container.html [ Failure ] +crbug.com/591099 transforms/2d/transform-fixed-container.html [ Failure Pass ] crbug.com/591099 transforms/3d/general/perspective-non-layer.html [ Failure ] -crbug.com/591099 transforms/3d/general/perspective-units.html [ Failure ] crbug.com/591099 transforms/3d/hit-testing/backface-hit-test.html [ Failure ] crbug.com/591099 transforms/3d/hit-testing/backface-no-transform-hit-test.html [ Failure ] -crbug.com/591099 transforms/bounding-rect-zoom.html [ Failure ] crbug.com/714962 transforms/inline-in-transformed-multicol.html [ Failure ] crbug.com/714962 transforms/selection-bounds-in-transformed-view.html [ Failure ] crbug.com/591099 transforms/shadows.html [ Failure ] -crbug.com/591099 transforms/transform-positioned-ancestor.html [ Failure ] -crbug.com/591099 transforms/transformed-caret.html [ Failure ] -crbug.com/591099 transforms/transforms-with-zoom.html [ Failure ] +crbug.com/591099 transforms/transform-positioned-ancestor.html [ Failure Pass ] +crbug.com/591099 transforms/transforms-with-zoom.html [ Failure Pass ] crbug.com/591099 virtual/android/ [ Skip ] crbug.com/591099 virtual/color_space/fast/canvas/color-space/canvas-createImageBitmap-linear-rgb.html [ Pass ] crbug.com/591099 virtual/color_space/fast/canvas/color-space/canvas-createImageBitmap-p3.html [ Pass ] @@ -4145,10 +4076,10 @@ crbug.com/714962 virtual/gpu/fast/canvas/canvas-css-clip-path.html [ Failure ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-drawImage-video-imageSmoothingEnabled.html [ Pass ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-imageSmoothingQuality.html [ Pass ] -crbug.com/714962 virtual/gpu/fast/canvas/canvas-textMetrics-width.html [ Failure ] -crbug.com/714962 virtual/gpu/fast/canvas/image-object-in-canvas.html [ Failure ] -crbug.com/591099 virtual/gpu/fast/canvas/patternfill-repeat.html [ Failure ] -crbug.com/714962 virtual/gpu/fast/canvas/setWidthResetAfterForcedRender.html [ Failure ] +crbug.com/714962 virtual/gpu/fast/canvas/canvas-textMetrics-width.html [ Failure Pass ] +crbug.com/714962 virtual/gpu/fast/canvas/image-object-in-canvas.html [ Failure Pass ] +crbug.com/591099 virtual/gpu/fast/canvas/patternfill-repeat.html [ Failure Pass ] +crbug.com/714962 virtual/gpu/fast/canvas/setWidthResetAfterForcedRender.html [ Failure Pass ] crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/DocumentOrShadowRoot-prototype-elementFromPoint.html [ Failure ] crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-002.html [ Pass ] crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/shadow-trees/reprojection/reprojection-001.html [ Pass ] @@ -4220,11 +4151,11 @@ crbug.com/591099 virtual/prefer_compositing_to_lcd_text/ [ Skip ] crbug.com/714962 virtual/pwa-full-code-cache/http/tests/devtools/service-workers/service-workers-view.js [ Failure ] crbug.com/591099 virtual/reporting-api/external/wpt/content-security-policy/reporting-api/reporting-api-doesnt-send-reports-without-violation.https.sub.html [ Pass ] -crbug.com/591099 virtual/scalefactor150/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure ] +crbug.com/591099 virtual/scalefactor150/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure Pass ] crbug.com/591099 virtual/scalefactor150/fast/hidpi/static/popup-menu-with-scrollbar-appearance.html [ Failure ] -crbug.com/714962 virtual/scalefactor200/fast/hidpi/static/popup-menu-appearance.html [ Failure ] +crbug.com/714962 virtual/scalefactor200/fast/hidpi/static/popup-menu-appearance.html [ Failure Pass ] crbug.com/591099 virtual/scalefactor200/fast/hidpi/static/popup-menu-with-scrollbar-appearance.html [ Failure ] -crbug.com/714962 virtual/scalefactor200withzoom/fast/hidpi/static/popup-menu-appearance.html [ Failure ] +crbug.com/714962 virtual/scalefactor200withzoom/fast/hidpi/static/popup-menu-appearance.html [ Failure Pass ] crbug.com/591099 virtual/scalefactor200withzoom/fast/hidpi/static/popup-menu-with-scrollbar-appearance.html [ Failure ] crbug.com/591099 virtual/scroll_customization/ [ Skip ] crbug.com/591099 virtual/scroll_customization/fast/events/touch/compositor-touch-hit-rects-animation.html [ Pass ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process b/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process index 958b3f7..064b67b 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process +++ b/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process
@@ -104,6 +104,12 @@ # https://crbug.com/778372: Unique name conflict with old entries? crbug.com/778372 external/wpt/html/browsers/origin/cross-origin-objects/cross-origin-objects.html [ Crash ] +# https://crbug.com/788390: Autoplay feature policy tests failing on the Windows FYI bot. +crbug.com/788390 [ Win ] http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-disabled.html [ Timeout ] +crbug.com/788390 [ Win ] http/tests/media/autoplay/document-user-activation-cross-origin-feature-policy-header.html [ Timeout ] +crbug.com/788390 [ Win ] http/tests/media/autoplay/document-user-activation-feature-policy-alternating.html [ Timeout ] +crbug.com/788390 [ Win ] http/tests/media/autoplay/document-user-activation-feature-policy-iframe-no-gesture.html [ Timeout ] + # The tests below set document.domain. Such tests are skipped, because they # cannot work when same-site WPT origins are isolated from each other via # --isolate-origins cmdline flag (which is how bots run the
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index d835476..57f1e7e 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -852,8 +852,6 @@ crbug.com/766135 fast/dom/Window/redirect-with-timer.html [ Timeout Pass ] -crbug.com/798121 fast/history/history-back-twice-with-subframes-assert.html [ Timeout Pass ] - # Ref tests that needs investigation. crbug.com/404597 [ Mac ] fast/css3-text/css3-text-justify/text-justify-crash.html [ Failure ] crbug.com/404597 fast/forms/long-text-in-input.html [ Skip ] @@ -1431,6 +1429,10 @@ crbug.com/548765 http/tests/devtools/console-fetch-logging.js [ Failure Pass ] +# When BigInts are on by default, these should pass and be removed along with their FlagExpectations. +crbug.com/v8/7486 http/tests/devtools/startup/console/console-format-startup-bigint.js [ Skip ] +crbug.com/v8/7486 http/tests/devtools/console/console-format-bigint.js [ Skip ] + crbug.com/564109 [ Win ] http/tests/webfont/font-display-intervention.html [ Pass Failure Timeout ] crbug.com/399951 http/tests/mime/javascript-mimetype-usecounters.html [ Pass Failure ] @@ -3407,3 +3409,6 @@ crbug.com/819851 [ Mac ] paint/invalidation/forms/checkbox-focus-by-mouse-then-keydown.html [ Skip ] crbug.com/819851 [ Mac ] paint/invalidation/forms/radio-focus-by-mouse-then-keydown.html [ Skip ] crbug.com/819778 [ Linux ] external/wpt/css/cssom-view/interfaces.html [ Pass Timeout ] + +# Sheriff 2018-03-08 +crbug.com/731518 [ Win Linux Mac ] webaudio/DynamicsCompressor/dynamicscompressor-clear-internal-state.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-state-expected.txt b/third_party/WebKit/LayoutTests/editing/execCommand/query-command-state-expected.txt deleted file mode 100644 index fdd1ec2..0000000 --- a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-state-expected.txt +++ /dev/null
@@ -1,124 +0,0 @@ -Test to make sure queryCommandState returns correct values. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -Tests for win -PASS queryCommandState("bold") returns false when selecting all of "hello" -PASS queryCommandState("bold") returns false when selecting all of "<i>hello</i>" -PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b>" -PASS queryCommandState("bold") returns false when selecting all of "hello <b>world</b>" -PASS queryCommandState("bold") returns false when selecting all of "<b>hello</b> world" -PASS queryCommandState("bold") returns false when selecting second word of "hello <b>world</b> WebKit" -PASS queryCommandState("bold") returns false when selecting second word of "<b>hello</b> world <b>WebKit</b>" -PASS queryCommandState("bold") returns false when selecting second word of "<i>hello <b>hello</b> WebKit</i>" -PASS queryCommandState("bold") returns true when selecting second word of "<b>hello <i>hello</i> WebKit</b>" -PASS queryCommandState("bold") returns true when selecting second word of "<b><div>hello <i>hello</i> WebKit</div></b>" -PASS queryCommandState("bold") returns false when selecting all of "<b style="font-weight: normal;">hello</b>" -PASS queryCommandState("bold") returns true when selecting all of "<i style="font-weight: bold;">hello</i>" -PASS queryCommandState("bold") returns false when selecting all of "<b>hello</b> world <b>WebKit</b>" -PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b><b> world</b>" -PASS queryCommandState("bold") returns true when selecting all of "<div><b>hello</b></div><p><b> WebKit</b></p>" -PASS queryCommandState("italic") returns false when selecting all of "hello" -PASS queryCommandState("italic") returns false when selecting all of "<b>hello</b>" -PASS queryCommandState("italic") returns true when selecting all of "<i>hello</i>" -PASS queryCommandState("italic") returns false when selecting all of "<i>hello</i> world" -PASS queryCommandState("italic") returns false when selecting all of "hello <i>world</i>" -PASS queryCommandState("italic") returns true when selecting all of "<i><div>hello world</div></i>" -PASS queryCommandState("italic") returns false when selecting all of "<div style="font-style: italic">hello <span style="font-style: normal;">hello</span></div>" -PASS queryCommandState("subscript") returns false when selecting all of "hello" -PASS queryCommandState("subscript") returns false when selecting all of "<sup>hello</sup>" -PASS queryCommandState("subscript") returns true when selecting all of "<sub>hello</sub>" -PASS queryCommandState("subscript") returns false when selecting all of "<sub>hello</sub> world" -PASS queryCommandState("subscript") returns false when selecting all of "hello <sub>world</sub>" -PASS queryCommandState("subscript") returns true when selecting all of "<div style="vertical-align: sub;">hello world</div>" -PASS queryCommandState("subscript") returns false when selecting second word of "hello <span style="vertical-align: sub;">world</span> WebKit" -PASS queryCommandState("superscript") returns false when selecting all of "hello" -PASS queryCommandState("superscript") returns false when selecting all of "<sub>hello</sub>" -PASS queryCommandState("superscript") returns true when selecting all of "<sup>hello</sup>" -PASS queryCommandState("superscript") returns false when selecting all of "<sup>hello</sup> world" -PASS queryCommandState("superscript") returns false when selecting all of "hello <sup>world</sup>" -PASS queryCommandState("superscript") returns false when selecting all of "<span style="vertical-align: super;">hello</span><span style="vertical-align: sub;">world</span>" -PASS queryCommandState("superscript") returns false when selecting all of "hello<span style="vertical-align: super;">world</span>" -PASS queryCommandState("underline") returns false when selecting all of "hello" -PASS queryCommandState("underline") returns false when selecting all of "<s>hello</s>" -PASS queryCommandState("underline") returns true when selecting all of "<u>hello</u>" -PASS queryCommandState("underline") returns false when selecting all of "<u>hello</u> world" -PASS queryCommandState("underline") returns false when selecting all of "hello <u>world</u>" -PASS queryCommandState("underline") returns true when selecting all of "<u><div>hello world</div></u>" -PASS queryCommandState("underline") returns true when selecting second word of "<u><s><div>hello world WebKit</div></s></u>" -PASS queryCommandState("underline") returns false when selecting second word of "<s><u>hello</u> world</s> WebKit" -PASS queryCommandState("underline") returns false when selecting second word of "<u><s>hello</s> world</u> WebKit" -PASS queryCommandState("underline") returns true when selecting second word of "<s>hello <u>world</s> WebKit</u>" -PASS queryCommandState("strikeThrough") returns false when selecting all of "hello" -PASS queryCommandState("strikeThrough") returns false when selecting all of "<u>hello</u>" -PASS queryCommandState("strikeThrough") returns true when selecting all of "<s>hello</s>" -PASS queryCommandState("strikeThrough") returns false when selecting all of "<s>hello</s> world" -PASS queryCommandState("strikeThrough") returns false when selecting all of "hello <s>world</s>" -PASS queryCommandState("strikeThrough") returns true when selecting all of "<s><div>hello world</div></s>" -PASS queryCommandState("strikeThrough") returns true when selecting second word of "<s><u><div>hello world WebKit</div></u></s>" -PASS queryCommandState("strikeThrough") returns false when selecting second word of "<u><s>hello</s> world</u> WebKit" -PASS queryCommandState("strikeThrough") returns true when selecting second word of "hello <s>world WebKit</s>" -PASS queryCommandState("strikeThrough") returns true when selecting first two words of "hello <s>world WebKit</s>" - -Tests for mac -PASS queryCommandState("bold") returns false when selecting all of "hello" -PASS queryCommandState("bold") returns false when selecting all of "<i>hello</i>" -PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b>" -PASS queryCommandState("bold") returns false when selecting all of "hello <b>world</b>" -PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b> world" -PASS queryCommandState("bold") returns true when selecting second word of "hello <b>world</b> WebKit" -PASS queryCommandState("bold") returns false when selecting second word of "<b>hello</b> world <b>WebKit</b>" -PASS queryCommandState("bold") returns true when selecting second word of "<i>hello <b>hello</b> WebKit</i>" -PASS queryCommandState("bold") returns true when selecting second word of "<b>hello <i>hello</i> WebKit</b>" -PASS queryCommandState("bold") returns true when selecting second word of "<b><div>hello <i>hello</i> WebKit</div></b>" -PASS queryCommandState("bold") returns false when selecting all of "<b style="font-weight: normal;">hello</b>" -PASS queryCommandState("bold") returns true when selecting all of "<i style="font-weight: bold;">hello</i>" -PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b> world <b>WebKit</b>" -PASS queryCommandState("bold") returns true when selecting all of "<b>hello</b><b> world</b>" -PASS queryCommandState("bold") returns true when selecting all of "<div><b>hello</b></div><p><b> WebKit</b></p>" -PASS queryCommandState("italic") returns false when selecting all of "hello" -PASS queryCommandState("italic") returns false when selecting all of "<b>hello</b>" -PASS queryCommandState("italic") returns true when selecting all of "<i>hello</i>" -PASS queryCommandState("italic") returns true when selecting all of "<i>hello</i> world" -PASS queryCommandState("italic") returns false when selecting all of "hello <i>world</i>" -PASS queryCommandState("italic") returns true when selecting all of "<i><div>hello world</div></i>" -PASS queryCommandState("italic") returns true when selecting all of "<div style="font-style: italic">hello <span style="font-style: normal;">hello</span></div>" -PASS queryCommandState("subscript") returns false when selecting all of "hello" -PASS queryCommandState("subscript") returns false when selecting all of "<sup>hello</sup>" -PASS queryCommandState("subscript") returns true when selecting all of "<sub>hello</sub>" -PASS queryCommandState("subscript") returns true when selecting all of "<sub>hello</sub> world" -PASS queryCommandState("subscript") returns false when selecting all of "hello <sub>world</sub>" -PASS queryCommandState("subscript") returns true when selecting all of "<div style="vertical-align: sub;">hello world</div>" -PASS queryCommandState("subscript") returns true when selecting second word of "hello <span style="vertical-align: sub;">world</span> WebKit" -PASS queryCommandState("superscript") returns false when selecting all of "hello" -PASS queryCommandState("superscript") returns false when selecting all of "<sub>hello</sub>" -PASS queryCommandState("superscript") returns true when selecting all of "<sup>hello</sup>" -PASS queryCommandState("superscript") returns true when selecting all of "<sup>hello</sup> world" -PASS queryCommandState("superscript") returns false when selecting all of "hello <sup>world</sup>" -PASS queryCommandState("superscript") returns true when selecting all of "<span style="vertical-align: super;">hello</span><span style="vertical-align: sub;">world</span>" -PASS queryCommandState("superscript") returns false when selecting all of "hello<span style="vertical-align: super;">world</span>" -PASS queryCommandState("underline") returns false when selecting all of "hello" -PASS queryCommandState("underline") returns false when selecting all of "<s>hello</s>" -PASS queryCommandState("underline") returns true when selecting all of "<u>hello</u>" -PASS queryCommandState("underline") returns true when selecting all of "<u>hello</u> world" -PASS queryCommandState("underline") returns false when selecting all of "hello <u>world</u>" -PASS queryCommandState("underline") returns true when selecting all of "<u><div>hello world</div></u>" -PASS queryCommandState("underline") returns true when selecting second word of "<u><s><div>hello world WebKit</div></s></u>" -PASS queryCommandState("underline") returns false when selecting second word of "<s><u>hello</u> world</s> WebKit" -PASS queryCommandState("underline") returns true when selecting second word of "<u><s>hello</s> world</u> WebKit" -PASS queryCommandState("underline") returns true when selecting second word of "<s>hello <u>world</s> WebKit</u>" -PASS queryCommandState("strikeThrough") returns false when selecting all of "hello" -PASS queryCommandState("strikeThrough") returns false when selecting all of "<u>hello</u>" -PASS queryCommandState("strikeThrough") returns true when selecting all of "<s>hello</s>" -PASS queryCommandState("strikeThrough") returns true when selecting all of "<s>hello</s> world" -PASS queryCommandState("strikeThrough") returns false when selecting all of "hello <s>world</s>" -PASS queryCommandState("strikeThrough") returns true when selecting all of "<s><div>hello world</div></s>" -PASS queryCommandState("strikeThrough") returns true when selecting second word of "<s><u><div>hello world WebKit</div></u></s>" -PASS queryCommandState("strikeThrough") returns false when selecting second word of "<u><s>hello</s> world</u> WebKit" -PASS queryCommandState("strikeThrough") returns true when selecting second word of "hello <s>world WebKit</s>" -PASS queryCommandState("strikeThrough") returns false when selecting first two words of "hello <s>world WebKit</s>" -PASS successfullyParsed is true - -TEST COMPLETE -hello world WebKit
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-state.html b/third_party/WebKit/LayoutTests/editing/execCommand/query-command-state.html index 185400f..9792215 100644 --- a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-state.html +++ b/third_party/WebKit/LayoutTests/editing/execCommand/query-command-state.html
@@ -1,11 +1,195 @@ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> -<html> -<head> -<script src="../../resources/js-test.js"></script> -</head> -<body> -<p id="description"></p> -<div id="console"></div> -<script src="script-tests/query-command-state.js"></script> -</body> -</html> +<!doctype html> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +<script src="../assert_selection.js"></script> +<script> +const isMac = navigator.platform.indexOf('Mac') === 0; +function query_command_test(command, contents, expectedStates) { + const expectedState = expectedStates[isMac ? 'mac' : 'other']; + selection_test( + `<div contenteditable>${contents}</div>`, + selection => { + assert_equals( + selection.document.queryCommandState(command), + expectedState, + "State"); + assert_equals( + selection.document.queryCommandValue(command), + expectedState.toString(), + "Value"); + }, + `<div contenteditable>${contents}</div>`, + `queryCommandState(${command}) returns ${expectedState} when selecting ${contents}`); +} + +query_command_test( + 'bold', '^hello|', + {mac: false, other: false}); +query_command_test( + 'bold', '^<i>hello</i>|', + {mac: false, other: false}); +query_command_test( + 'bold', '^<b>hello</b>|', + {mac: true, other: true}); +query_command_test( + 'bold', '^hello <b>world</b>|', + {mac: false, other: false}); +query_command_test( + 'bold', '^<b>hello</b> world|', + {mac: true, other: false}); +query_command_test( + 'bold', 'hello <b>^world</b> |Webkit', + {mac: true, other: false}); +query_command_test( + 'bold', '<b>hello</b> ^world| <b>WebKit</b>', + {mac: false, other: false}); +query_command_test( + 'bold', '<i>hello <b>^world</b> |WebKit</i>', + {mac: true, other: false}); +query_command_test( + 'bold', '<b>hello <i>^hello|</i> WebKit</b>', + {mac: true, other: true}); +query_command_test( + 'bold', '<b><div>hello <i>^hello|</i> WebKit</div></b>', + {mac: true, other: true}); +query_command_test( + 'bold', '^<b style="font-weight: normal;">hello</b>|', + {mac: false, other: false}); +query_command_test( + 'bold', '^<i style="font-weight: bold;">hello</i>|', + {mac: true, other: true}); +query_command_test( + 'bold', '^<b>hello</b> world <b>WebKit</b>|', + {mac: true, other: false}); +query_command_test( + 'bold', '^<b>hello</b><b> world</b>|', + {mac: true, other: true}); +query_command_test( + 'bold', '^<div><b>hello</b></div><p><b> WebKit</b></p>|', + {mac: true, other: true}); +query_command_test( + 'italic', '^hello|', + {mac: false, other: false}); +query_command_test( + 'italic', '^<b>hello</b>|', + {mac: false, other: false}); +query_command_test( + 'italic', '^<i>hello</i>|', + {mac: true, other: true}); +query_command_test( + 'italic', '^<i>hello</i> world|', + {mac: true, other: false}); +query_command_test( + 'italic', '^hello <i>world</i>|', + {mac: false, other: false}); +query_command_test( + 'italic', '^<i><div>hello world</div></i>|', + {mac: true, other: true}); +query_command_test( + 'italic', + '^<div style="font-style: italic">hello <span style="font-style: normal;">hello</span></div>|', + {mac: true, other: false}); +query_command_test( + 'subscript', '^hello|', + {mac: false, other: false}); +query_command_test( + 'subscript', '^<sup>hello</sup>|', + {mac: false, other: false}); +query_command_test( + 'subscript', '^<sub>hello</sub>|', + {mac: true, other: true}); +query_command_test( + 'subscript', '^<sub>hello</sub> world|', + {mac: true, other: false}); +query_command_test( + 'subscript', '^hello <sub>world</sub>|', + {mac: false, other: false}); +query_command_test( + 'subscript', '^<div style="vertical-align: sub;">hello world</div>|', + {mac: true, other: true}); +query_command_test( + 'subscript', 'hello <span style="vertical-align: sub;">^world</span> |WebKit', + {mac: true, other: false}); +query_command_test( + 'superscript', '^hello|', + {mac: false, other: false}); +query_command_test( + 'superscript', '^<sub>hello</sub>|', + {mac: false, other: false}); +query_command_test( + 'superscript', '^<sup>hello</sup>|', + {mac: true, other: true}); +query_command_test( + 'superscript', '^<sup>hello</sup> world|', + {mac: true, other: false}); +query_command_test( + 'superscript', '^hello <sup>world</sup>|', + {mac: false, other: false}); +query_command_test( + 'superscript', + '^<span style="vertical-align: super;">hello</span><span style="vertical-align: sub;">world</span>|', + {mac: true, other: false}); +query_command_test( + 'superscript', '^hello<span style="vertical-align: super;">world</span>|', + {mac: false, other: false}); +query_command_test( + 'underline', '^hello|', + {mac: false, other: false}); +query_command_test( + 'underline', '^<s>hello</s>|', + {mac: false, other: false}); +query_command_test( + 'underline', '^<u>hello</u>|', + {mac: true, other: true}); +query_command_test( + 'underline', '^<u>hello</u> world|', + {mac: true, other: false}); +query_command_test( + 'underline', '^hello <u>world</u>|', + {mac: false, other: false}); +query_command_test( + 'underline', '^<u><div>hello world</div></u>|', + {mac: true, other: true}); +query_command_test( + 'underline', '<u><s><div>hello ^world |WebKit</div></s></u>', + {mac: true, other: true}); +query_command_test( + 'underline', '<s><u>hello</u> ^world</s> |WebKit', + {mac: false, other: false}); +query_command_test( + 'underline', '<u><s>hello</s> ^world</u> |WebKit', + {mac: true, other: false}); +query_command_test( + 'underline', '<s>hello <u>^world|</u></s><u> WebKit</u>', + {mac: true, other: true}); +query_command_test( + 'strikeThrough', '^hello|', + {mac: false, other: false}); +query_command_test( + 'strikeThrough', '^<u>hello</u>|', + {mac: false, other: false}); +query_command_test( + 'strikeThrough', '^<s>hello</s>|', + {mac: true, other: true}); +query_command_test( + 'strikeThrough', '^<s>hello</s> world|', + {mac: true, other: false}); +query_command_test( + 'strikeThrough', '^hello <s>world</s>|', + {mac: false, other: false}); +query_command_test( + 'strikeThrough', '^<s><div>hello world</div></s>|', + {mac: true, other: true}); +query_command_test( + 'strikeThrough', '<s><u><div>hello ^world |WebKit</div></u></s>', + {mac: true, other: true}); +query_command_test( + 'strikeThrough', '<u><s>hello</s> ^world</u> |WebKit', + {mac: false, other: false}); +query_command_test( + 'strikeThrough', 'hello <s>^world |WebKit</s>', + {mac: true, other: true}); +query_command_test( + 'strikeThrough', 'hello^ <s>world |WebKit</s>', + {mac: false, other: false}); +</script>
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/script-tests/query-command-state.js b/third_party/WebKit/LayoutTests/editing/execCommand/script-tests/query-command-state.js deleted file mode 100644 index e3e4147..0000000 --- a/third_party/WebKit/LayoutTests/editing/execCommand/script-tests/query-command-state.js +++ /dev/null
@@ -1,117 +0,0 @@ -description("Test to make sure queryCommandState returns correct values.") - -var testContainer = document.createElement("div"); -testContainer.contentEditable = true; -document.body.appendChild(testContainer); - -function testQueryCommandState(command, contents, selector, expectedState) -{ - testContainer.innerHTML = contents; - var selected = selector(testContainer); - var actualState = document.queryCommandState(command); - var actualValue = document.queryCommandValue(command); - var action = 'queryCommandState("' + command + '") returns ' + actualState + ' when selecting ' + selected + ' of "' + contents + '"'; - if (actualState != expectedState) - testFailed(action + ', expected ' + expectedState + ''); - else if (actualValue != actualState.toString()) - testFailed(action + ' but queryCommandValue returned ' + actualValue); - else - testPassed(action); -} - -function selectAll(container) { - window.getSelection().selectAllChildren(container); - return 'all'; -} - -function selectSecondWord(container) { - window.getSelection().collapse(container, 0); - window.getSelection().modify('move', 'forward', 'word'); - window.getSelection().modify('move', 'forward', 'word'); - window.getSelection().modify('move', 'backward', 'word'); - window.getSelection().modify('extend', 'forward', 'word'); - return 'second word'; -} - -function selectFirstTwoWords(container) { - window.getSelection().collapse(container, 0); - window.getSelection().modify('move', 'forward', 'word'); - window.getSelection().modify('extend', 'forward', 'word'); - window.getSelection().modify('extend', 'forward', 'word'); - return 'first two words'; -} - -function runTests(editingBehavior) { - if (window.internals) - internals.settings.setEditingBehavior(editingBehavior); - debug('Tests for ' + editingBehavior) - - testQueryCommandState("bold", 'hello', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<i>hello</i>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<b>hello</b>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("bold", 'hello <b>world</b>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<b>hello</b> world', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("bold", 'hello <b>world</b> WebKit', selectSecondWord, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<b>hello</b> world <b>WebKit</b>', selectSecondWord, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<i>hello <b>hello</b> WebKit</i>', selectSecondWord, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<b>hello <i>hello</i> WebKit</b>', selectSecondWord, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("bold", '<b><div>hello <i>hello</i> WebKit</div></b>', selectSecondWord, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("bold", '<b style="font-weight: normal;">hello</b>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<i style="font-weight: bold;">hello</i>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("bold", '<b>hello</b> world <b>WebKit</b>', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("bold", '<b>hello</b><b> world</b>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("bold", '<div><b>hello</b></div><p><b> WebKit</b></p>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - - testQueryCommandState("italic", 'hello', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("italic", '<b>hello</b>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("italic", '<i>hello</i>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("italic", '<i>hello</i> world', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("italic", 'hello <i>world</i>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("italic", '<i><div>hello world</div></i>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("italic", '<div style="font-style: italic">hello <span style="font-style: normal;">hello</span></div>', selectAll, {'mac': true, 'win': false}[editingBehavior]); - - testQueryCommandState("subscript", 'hello', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("subscript", '<sup>hello</sup>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("subscript", '<sub>hello</sub>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("subscript", '<sub>hello</sub> world', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("subscript", 'hello <sub>world</sub>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("subscript", '<div style="vertical-align: sub;">hello world</div>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("subscript", 'hello <span style="vertical-align: sub;">world</span> WebKit', selectSecondWord, {'mac': true, 'win': false}[editingBehavior]); - - testQueryCommandState("superscript", 'hello', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("superscript", '<sub>hello</sub>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("superscript", '<sup>hello</sup>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("superscript", '<sup>hello</sup> world', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("superscript", 'hello <sup>world</sup>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("superscript", '<span style="vertical-align: super;">hello</span><span style="vertical-align: sub;">world</span>', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("superscript", 'hello<span style="vertical-align: super;">world</span>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - - testQueryCommandState("underline", 'hello', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("underline", '<s>hello</s>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("underline", '<u>hello</u>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("underline", '<u>hello</u> world', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("underline", 'hello <u>world</u>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("underline", '<u><div>hello world</div></u>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("underline", '<u><s><div>hello world WebKit</div></s></u>', selectSecondWord, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("underline", '<s><u>hello</u> world</s> WebKit', selectSecondWord, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("underline", '<u><s>hello</s> world</u> WebKit', selectSecondWord, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("underline", '<s>hello <u>world</s> WebKit</u>', selectSecondWord, {'mac': true, 'win': true}[editingBehavior]); - - testQueryCommandState("strikeThrough", 'hello', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("strikeThrough", '<u>hello</u>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("strikeThrough", '<s>hello</s>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("strikeThrough", '<s>hello</s> world', selectAll, {'mac': true, 'win': false}[editingBehavior]); - testQueryCommandState("strikeThrough", 'hello <s>world</s>', selectAll, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("strikeThrough", '<s><div>hello world</div></s>', selectAll, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("strikeThrough", '<s><u><div>hello world WebKit</div></u></s>', selectSecondWord, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("strikeThrough", '<u><s>hello</s> world</u> WebKit', selectSecondWord, {'mac': false, 'win': false}[editingBehavior]); - testQueryCommandState("strikeThrough", 'hello <s>world WebKit</s>', selectSecondWord, {'mac': true, 'win': true}[editingBehavior]); - testQueryCommandState("strikeThrough", 'hello <s>world WebKit</s>', selectFirstTwoWords, {'mac': false, 'win': true}[editingBehavior]); -} - -runTests('win'); -debug('') -runTests('mac'); - -//document.body.removeChild(testContainer); -var successfullyParsed = true;
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 0a19f98..cd1a5e53 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -99267,6 +99267,171 @@ {} ] ], + "content-security-policy/navigate-to/anchor-navigation-always-allowed.html.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/child-navigates-parent-allowed.html.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/child-navigates-parent-blocked-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/child-navigates-parent-blocked.html.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/form-blocked-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/form-cross-origin-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/form-redirected-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/href-location-blocked-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/href-location-cross-origin-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/href-location-redirected-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/link-click-blocked-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/link-click-cross-origin-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/link-click-redirected-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-blocked-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-cross-origin-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-redirected-blocked.sub-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/parent-navigates-child-allowed.html.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/parent-navigates-child-blocked-expected.txt": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/parent-navigates-child-blocked.html.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/form_action_navigation.sub.html": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/form_action_navigation.sub.html.sub.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/href_location_navigation.sub.html": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/href_location_navigation.sub.html.sub.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/link_click_navigation.sub.html": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/link_click_navigation.sub.html.sub.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/meta_refresh_navigation.sub.html": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/meta_refresh_navigation.sub.html.sub.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/navigate_parent.sub.html": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/navigate_parent.sub.html.sub.headers": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/post_message_to_frame_owner.html": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/redirect_to_post_message_to_frame_owner.py": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/wait_for_navigation.html": [ + [ + {} + ] + ], + "content-security-policy/navigate-to/support/wait_for_navigation.html.sub.headers": [ + [ + {} + ] + ], "content-security-policy/navigation/support/test_csp_self_window.sub.html": [ [ {} @@ -100217,16 +100382,6 @@ {} ] ], - "css/CSS2/cascade-import/support/cascade-import-002g.css": [ - [ - {} - ] - ], - "css/CSS2/cascade-import/support/cascade-import-002h.css": [ - [ - {} - ] - ], "css/CSS2/cascade-import/support/cascade-import-002i.css": [ [ {} @@ -100262,16 +100417,6 @@ {} ] ], - "css/CSS2/cascade-import/support/cascade-import-002q.css": [ - [ - {} - ] - ], - "css/CSS2/cascade-import/support/cascade-import-002r.css": [ - [ - {} - ] - ], "css/CSS2/cascade-import/support/import-green.css": [ [ {} @@ -149807,6 +149952,11 @@ {} ] ], + "interfaces/url.idl": [ + [ + {} + ] + ], "interfaces/wake-lock.idl": [ [ {} @@ -151662,6 +151812,11 @@ {} ] ], + "payment-request/interfaces.https-expected.txt": [ + [ + {} + ] + ], "payment-request/payment-request-abort-method.https-expected.txt": [ [ {} @@ -157922,11 +158077,31 @@ {} ] ], + "streams/piping/error-propagation-backward-expected.txt": [ + [ + {} + ] + ], + "streams/piping/error-propagation-backward.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/piping/error-propagation-backward.js": [ [ {} ] ], + "streams/piping/error-propagation-backward.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/piping/error-propagation-backward.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/piping/error-propagation-forward-expected.txt": [ [ {} @@ -157962,11 +158137,31 @@ {} ] ], + "streams/piping/multiple-propagation-expected.txt": [ + [ + {} + ] + ], + "streams/piping/multiple-propagation.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/piping/multiple-propagation.js": [ [ {} ] ], + "streams/piping/multiple-propagation.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/piping/multiple-propagation.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/piping/pipe-through.js": [ [ {} @@ -158247,11 +158442,31 @@ {} ] ], + "streams/transform-streams/errors-expected.txt": [ + [ + {} + ] + ], + "streams/transform-streams/errors.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/transform-streams/errors.js": [ [ {} ] ], + "streams/transform-streams/errors.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/transform-streams/errors.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/transform-streams/flush.js": [ [ {} @@ -158297,11 +158512,31 @@ {} ] ], + "streams/transform-streams/reentrant-strategies-expected.txt": [ + [ + {} + ] + ], + "streams/transform-streams/reentrant-strategies.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/transform-streams/reentrant-strategies.js": [ [ {} ] ], + "streams/transform-streams/reentrant-strategies.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/transform-streams/reentrant-strategies.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/transform-streams/strategies.js": [ [ {} @@ -158312,11 +158547,31 @@ {} ] ], + "streams/writable-streams/aborting-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/aborting.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/aborting.js": [ [ {} ] ], + "streams/writable-streams/aborting.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/aborting.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/bad-strategies.js": [ [ {} @@ -158357,11 +158612,31 @@ {} ] ], + "streams/writable-streams/close-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/close.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/close.js": [ [ {} ] ], + "streams/writable-streams/close.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/close.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/constructor.js": [ [ {} @@ -158382,11 +158657,31 @@ {} ] ], + "streams/writable-streams/general-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/general.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/general.js": [ [ {} ] ], + "streams/writable-streams/general.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/general.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/properties-expected.txt": [ [ {} @@ -158412,11 +158707,31 @@ {} ] ], + "streams/writable-streams/reentrant-strategy-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/reentrant-strategy.dedicatedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/reentrant-strategy.js": [ [ {} ] ], + "streams/writable-streams/reentrant-strategy.serviceworker.https-expected.txt": [ + [ + {} + ] + ], + "streams/writable-streams/reentrant-strategy.sharedworker-expected.txt": [ + [ + {} + ] + ], "streams/writable-streams/start.js": [ [ {} @@ -175113,6 +175428,204 @@ {} ] ], + "content-security-policy/navigate-to/anchor-navigation-always-allowed.html": [ + [ + "/content-security-policy/navigate-to/anchor-navigation-always-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/child-navigates-parent-allowed.html": [ + [ + "/content-security-policy/navigate-to/child-navigates-parent-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/child-navigates-parent-blocked.html": [ + [ + "/content-security-policy/navigate-to/child-navigates-parent-blocked.html", + {} + ] + ], + "content-security-policy/navigate-to/form-action/form-action-allows-navigate-to-allows.html": [ + [ + "/content-security-policy/navigate-to/form-action/form-action-allows-navigate-to-allows.html", + {} + ] + ], + "content-security-policy/navigate-to/form-action/form-action-allows-navigate-to-blocks.html": [ + [ + "/content-security-policy/navigate-to/form-action/form-action-allows-navigate-to-blocks.html", + {} + ] + ], + "content-security-policy/navigate-to/form-action/form-action-blocks-navigate-to-allows.html": [ + [ + "/content-security-policy/navigate-to/form-action/form-action-blocks-navigate-to-allows.html", + {} + ] + ], + "content-security-policy/navigate-to/form-action/form-action-blocks-navigate-to-blocks.html": [ + [ + "/content-security-policy/navigate-to/form-action/form-action-blocks-navigate-to-blocks.html", + {} + ] + ], + "content-security-policy/navigate-to/form-allowed.html": [ + [ + "/content-security-policy/navigate-to/form-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/form-blocked.html": [ + [ + "/content-security-policy/navigate-to/form-blocked.html", + {} + ] + ], + "content-security-policy/navigate-to/form-cross-origin-allowed.sub.html": [ + [ + "/content-security-policy/navigate-to/form-cross-origin-allowed.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/form-cross-origin-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/form-cross-origin-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/form-redirected-allowed.html": [ + [ + "/content-security-policy/navigate-to/form-redirected-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/form-redirected-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/form-redirected-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/href-location-allowed.html": [ + [ + "/content-security-policy/navigate-to/href-location-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/href-location-blocked.html": [ + [ + "/content-security-policy/navigate-to/href-location-blocked.html", + {} + ] + ], + "content-security-policy/navigate-to/href-location-cross-origin-allowed.sub.html": [ + [ + "/content-security-policy/navigate-to/href-location-cross-origin-allowed.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/href-location-cross-origin-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/href-location-cross-origin-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/href-location-redirected-allowed.html": [ + [ + "/content-security-policy/navigate-to/href-location-redirected-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/href-location-redirected-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/href-location-redirected-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/link-click-allowed.html": [ + [ + "/content-security-policy/navigate-to/link-click-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/link-click-blocked.html": [ + [ + "/content-security-policy/navigate-to/link-click-blocked.html", + {} + ] + ], + "content-security-policy/navigate-to/link-click-cross-origin-allowed.sub.html": [ + [ + "/content-security-policy/navigate-to/link-click-cross-origin-allowed.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/link-click-cross-origin-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/link-click-cross-origin-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/link-click-redirected-allowed.html": [ + [ + "/content-security-policy/navigate-to/link-click-redirected-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/link-click-redirected-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/link-click-redirected-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-allowed.html": [ + [ + "/content-security-policy/navigate-to/meta-refresh-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-blocked.html": [ + [ + "/content-security-policy/navigate-to/meta-refresh-blocked.html", + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-cross-origin-allowed.sub.html": [ + [ + "/content-security-policy/navigate-to/meta-refresh-cross-origin-allowed.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-cross-origin-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/meta-refresh-cross-origin-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-redirected-allowed.html": [ + [ + "/content-security-policy/navigate-to/meta-refresh-redirected-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/meta-refresh-redirected-blocked.sub.html": [ + [ + "/content-security-policy/navigate-to/meta-refresh-redirected-blocked.sub.html", + {} + ] + ], + "content-security-policy/navigate-to/parent-navigates-child-allowed.html": [ + [ + "/content-security-policy/navigate-to/parent-navigates-child-allowed.html", + {} + ] + ], + "content-security-policy/navigate-to/parent-navigates-child-blocked.html": [ + [ + "/content-security-policy/navigate-to/parent-navigates-child-blocked.html", + {} + ] + ], "content-security-policy/navigation/javascript-url-navigation-inherits-csp.html": [ [ "/content-security-policy/navigation/javascript-url-navigation-inherits-csp.html", @@ -182045,6 +182558,24 @@ {} ] ], + "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-indexed-getter-setter.html": [ + [ + "/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-indexed-getter-setter.html", + {} + ] + ], + "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-iterable.html": [ + [ + "/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-iterable.html", + {} + ] + ], + "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-length.html": [ + [ + "/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-length.html", + {} + ] + ], "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.html": [ [ "/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.html", @@ -182057,6 +182588,12 @@ {} ] ], + "css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-variable.html": [ + [ + "/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-variable.html", + {} + ] + ], "css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.html": [ [ "/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.html", @@ -184349,6 +184886,12 @@ {} ] ], + "css/selectors/anplusb-selector-parsing.html": [ + [ + "/css/selectors/anplusb-selector-parsing.html", + {} + ] + ], "css/selectors/attribute-selectors/attribute-case/cssom.html": [ [ "/css/selectors/attribute-selectors/attribute-case/cssom.html", @@ -241525,7 +242068,7 @@ "support" ], "./lint.whitelist": [ - "a1eb236548d5575af5bb623615175586218dc594", + "f99ce1b3cf312caac08a8a8bb6a970ba00e28160", "support" ], "./update-built-tests.sh": [ @@ -251288,6 +251831,270 @@ "ff614bd9c4e37c02c8027c6b38fc615c0ade6883", "support" ], + "content-security-policy/navigate-to/anchor-navigation-always-allowed.html": [ + "5e69d718b2fcc02a23467ecea5ef8dc1efa78a7c", + "testharness" + ], + "content-security-policy/navigate-to/anchor-navigation-always-allowed.html.headers": [ + "cdacbe00b8d84133edcb1f7d79d1249e7c30b6a5", + "support" + ], + "content-security-policy/navigate-to/child-navigates-parent-allowed.html": [ + "bacb9cd495aa4309349a4f80b3f886ee94542027", + "testharness" + ], + "content-security-policy/navigate-to/child-navigates-parent-allowed.html.headers": [ + "89a55ff370ebf5af63e25642013073bddc823030", + "support" + ], + "content-security-policy/navigate-to/child-navigates-parent-blocked-expected.txt": [ + "0c7651432fe1d0cbd05c7287f2fe0f737893223b", + "support" + ], + "content-security-policy/navigate-to/child-navigates-parent-blocked.html": [ + "fceb74d2ed4e5279da6455bff9abafb00c4f97cb", + "testharness" + ], + "content-security-policy/navigate-to/child-navigates-parent-blocked.html.headers": [ + "b4d3209bd03a060ea90f85f7444717359c77d4d2", + "support" + ], + "content-security-policy/navigate-to/form-action/form-action-allows-navigate-to-allows.html": [ + "4f687e8b8f30669f96497667ea3039f46ec49ad0", + "testharness" + ], + "content-security-policy/navigate-to/form-action/form-action-allows-navigate-to-blocks.html": [ + "cea7726c595c45b84fc58ed7e1e25743ae56a2ba", + "testharness" + ], + "content-security-policy/navigate-to/form-action/form-action-blocks-navigate-to-allows.html": [ + "8ad470a841ded29f148d6a11453b9359a1b65fcd", + "testharness" + ], + "content-security-policy/navigate-to/form-action/form-action-blocks-navigate-to-blocks.html": [ + "2549cf6fc7635f86b0186fc896ccd4d8ad58a980", + "testharness" + ], + "content-security-policy/navigate-to/form-allowed.html": [ + "704012813d3fd1c6bbba1ccbdb462d21ba77a077", + "testharness" + ], + "content-security-policy/navigate-to/form-blocked-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/form-blocked.html": [ + "c0029c0a4912758fdfa7ed1c53072f170793a074", + "testharness" + ], + "content-security-policy/navigate-to/form-cross-origin-allowed.sub.html": [ + "2d9ae0fd58f4e061af9879c30374ea47c2249a1c", + "testharness" + ], + "content-security-policy/navigate-to/form-cross-origin-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/form-cross-origin-blocked.sub.html": [ + "049cf83b4b496b58aeacb01282ac44613954222f", + "testharness" + ], + "content-security-policy/navigate-to/form-redirected-allowed.html": [ + "1e4949c41732687d694eb9e6a9d3319bf3be706c", + "testharness" + ], + "content-security-policy/navigate-to/form-redirected-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/form-redirected-blocked.sub.html": [ + "13620e71df04ee9af10401e5b6accb24b0c33335", + "testharness" + ], + "content-security-policy/navigate-to/href-location-allowed.html": [ + "bbde25e8270429fde22989c4667a1fb58d6c4eb4", + "testharness" + ], + "content-security-policy/navigate-to/href-location-blocked-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/href-location-blocked.html": [ + "3fb68398ef412922a8816096b9441f785fc437c5", + "testharness" + ], + "content-security-policy/navigate-to/href-location-cross-origin-allowed.sub.html": [ + "31db79be8399ebf8ab2408693085b3a711d7abbe", + "testharness" + ], + "content-security-policy/navigate-to/href-location-cross-origin-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/href-location-cross-origin-blocked.sub.html": [ + "1f0c4fa5c25c36be8a44346fc209ca990703859b", + "testharness" + ], + "content-security-policy/navigate-to/href-location-redirected-allowed.html": [ + "fe5480cb306d83951a68b25ab0ea56f0468f0fca", + "testharness" + ], + "content-security-policy/navigate-to/href-location-redirected-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/href-location-redirected-blocked.sub.html": [ + "7447d77621e9c18ce829ddfbfde008fa80719d7e", + "testharness" + ], + "content-security-policy/navigate-to/link-click-allowed.html": [ + "a4200a991a2e6d93ccf9f6dfedcaa5e5d75ead9e", + "testharness" + ], + "content-security-policy/navigate-to/link-click-blocked-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/link-click-blocked.html": [ + "04fafa60b6934d119997c37058605007cc8f2632", + "testharness" + ], + "content-security-policy/navigate-to/link-click-cross-origin-allowed.sub.html": [ + "b1805390dada0f11c4dc45adf647133237934c45", + "testharness" + ], + "content-security-policy/navigate-to/link-click-cross-origin-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/link-click-cross-origin-blocked.sub.html": [ + "1f1def5a103caf71d8cd5ddc870f3050d98ec9f2", + "testharness" + ], + "content-security-policy/navigate-to/link-click-redirected-allowed.html": [ + "d89312685c3022438a2e55a025d330bb73eeedc0", + "testharness" + ], + "content-security-policy/navigate-to/link-click-redirected-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/link-click-redirected-blocked.sub.html": [ + "0b0c2c02fde1ea8aad7c25db210ea5fdd6f391e5", + "testharness" + ], + "content-security-policy/navigate-to/meta-refresh-allowed.html": [ + "bf0f7db58c085f117034f9c5287373ad0db49f8a", + "testharness" + ], + "content-security-policy/navigate-to/meta-refresh-blocked-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/meta-refresh-blocked.html": [ + "6ea6e7109d76e351fd81a6985cdde22fdef5910b", + "testharness" + ], + "content-security-policy/navigate-to/meta-refresh-cross-origin-allowed.sub.html": [ + "6800ffef1c56af272095246ba5d5985981f1a596", + "testharness" + ], + "content-security-policy/navigate-to/meta-refresh-cross-origin-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/meta-refresh-cross-origin-blocked.sub.html": [ + "3d80f42ab97508f4f61f6596f0f2b9025f512195", + "testharness" + ], + "content-security-policy/navigate-to/meta-refresh-redirected-allowed.html": [ + "87d03c36c14269eacfdf75393c5d6057f4fdbe5b", + "testharness" + ], + "content-security-policy/navigate-to/meta-refresh-redirected-blocked.sub-expected.txt": [ + "b9eb919b5af0723d5a0b27a3c99cb5bb0f1189a7", + "support" + ], + "content-security-policy/navigate-to/meta-refresh-redirected-blocked.sub.html": [ + "e6bb5c882ecb846c365ecd42b299198fcaf7b474", + "testharness" + ], + "content-security-policy/navigate-to/parent-navigates-child-allowed.html": [ + "583a43b1087a47bd260965ecf1b0d05176270bed", + "testharness" + ], + "content-security-policy/navigate-to/parent-navigates-child-allowed.html.headers": [ + "b4d3209bd03a060ea90f85f7444717359c77d4d2", + "support" + ], + "content-security-policy/navigate-to/parent-navigates-child-blocked-expected.txt": [ + "396022c8308d87acc1ec39300bc2822c1285db43", + "support" + ], + "content-security-policy/navigate-to/parent-navigates-child-blocked.html": [ + "10ff181365149bf04de2da16e2d1d24c509996e2", + "testharness" + ], + "content-security-policy/navigate-to/parent-navigates-child-blocked.html.headers": [ + "5b6cf971a05b8e5dd54bd1540362e0123373f9d6", + "support" + ], + "content-security-policy/navigate-to/support/form_action_navigation.sub.html": [ + "ec7830a73ab5fe1cba901398cce869aa840c7752", + "support" + ], + "content-security-policy/navigate-to/support/form_action_navigation.sub.html.sub.headers": [ + "de63281b6e44caaebe995d4dd44b138244287957", + "support" + ], + "content-security-policy/navigate-to/support/href_location_navigation.sub.html": [ + "7f295972d48ba585e1321f73a84a25650b1359f2", + "support" + ], + "content-security-policy/navigate-to/support/href_location_navigation.sub.html.sub.headers": [ + "de63281b6e44caaebe995d4dd44b138244287957", + "support" + ], + "content-security-policy/navigate-to/support/link_click_navigation.sub.html": [ + "d5ff18750d8a3e35c06bff47a9c51c674688d7b5", + "support" + ], + "content-security-policy/navigate-to/support/link_click_navigation.sub.html.sub.headers": [ + "de63281b6e44caaebe995d4dd44b138244287957", + "support" + ], + "content-security-policy/navigate-to/support/meta_refresh_navigation.sub.html": [ + "6ae25bd646042543174c73a967ed62090c787c56", + "support" + ], + "content-security-policy/navigate-to/support/meta_refresh_navigation.sub.html.sub.headers": [ + "de63281b6e44caaebe995d4dd44b138244287957", + "support" + ], + "content-security-policy/navigate-to/support/navigate_parent.sub.html": [ + "e9013a5cb15ee856ceabaafe15acd46a29e72a95", + "support" + ], + "content-security-policy/navigate-to/support/navigate_parent.sub.html.sub.headers": [ + "de63281b6e44caaebe995d4dd44b138244287957", + "support" + ], + "content-security-policy/navigate-to/support/post_message_to_frame_owner.html": [ + "cb69a73059ad77731a66321b0b7e2815245fd41c", + "support" + ], + "content-security-policy/navigate-to/support/redirect_to_post_message_to_frame_owner.py": [ + "cd705d78669aa77eca191a86d74c2eecdf1513fc", + "support" + ], + "content-security-policy/navigate-to/support/wait_for_navigation.html": [ + "e2d4124b39a506c8dd3848d118974961b072140d", + "support" + ], + "content-security-policy/navigate-to/support/wait_for_navigation.html.sub.headers": [ + "de63281b6e44caaebe995d4dd44b138244287957", + "support" + ], "content-security-policy/navigation/javascript-url-navigation-inherits-csp.html": [ "bb01b98b633fe5ffb79b1b4e0943a77b85a11057", "testharness" @@ -253293,7 +254100,7 @@ "visual" ], "css/CSS2/cascade-import/cascade-import-002.xht": [ - "21af08d33a535ac504c6dded1bb700d586856013", + "686ddf5ae6c7f2c931bae35fa426ec678201dd51", "visual" ], "css/CSS2/cascade-import/cascade-import-002.xht.headers": [ @@ -253396,14 +254203,6 @@ "7590fc46da3a0e9d82e6abb2fb3b93c71c3288d1", "support" ], - "css/CSS2/cascade-import/support/cascade-import-002g.css": [ - "e7a05f863abd9bb07fd07543daebfdae9e1f72d3", - "support" - ], - "css/CSS2/cascade-import/support/cascade-import-002h.css": [ - "2bb868d4b4eae261bbe663363bd593429ca3a2e6", - "support" - ], "css/CSS2/cascade-import/support/cascade-import-002i.css": [ "fbad7ce8a9ba22830724799e2d7756d386a1b258", "support" @@ -253432,14 +254231,6 @@ "a9109cf29fd476c26747005affad3af94e58b054", "support" ], - "css/CSS2/cascade-import/support/cascade-import-002q.css": [ - "3cf70ec47234ee7ae68aae823b03a1a9c76b9e31", - "support" - ], - "css/CSS2/cascade-import/support/cascade-import-002r.css": [ - "7d991bf96b37f6444b61027f3b59f7224088d370", - "support" - ], "css/CSS2/cascade-import/support/import-green.css": [ "db4f420efdb292d6520be1a3bf052ed3f6f9e7e3", "support" @@ -301388,16 +302179,32 @@ "700fae462f258404f3d0b8fad290613fc1929e1d", "testharness" ], + "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-indexed-getter-setter.html": [ + "49fe1442d98ad498f3e0e6ce497a6f1ee6e62c31", + "testharness" + ], + "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-iterable.html": [ + "d91a7d0e8ee2cc40fa1b2747bee392a2cc2deae2", + "testharness" + ], + "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-length.html": [ + "592897dad11ef8c6aa6ad42b9d779421cdda1a5c", + "testharness" + ], "css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.html": [ - "46d36ae2dc68f3f3f1cee5d85cb5f496b7c3fa67", + "c6dc634947afd7b84a6feda270ebac6ac2fa29c7", "testharness" ], "css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html": [ - "ba012ace40e63718694a8cd91ba74039787ff666", + "89a261a071b9719cb44a03d9cdbf2e8f869b2c23", + "testharness" + ], + "css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-variable.html": [ + "b089be0bb5186c545f432b48c38abed458437129", "testharness" ], "css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.html": [ - "25b5d1108e4030ad8420a271bfaa85ce68d8bf59", + "dbf9e28846ef3246dabc72ef2266871393f6187a", "testharness" ], "css/css-typed-om/stylevalue-subclasses/numeric-objects/add-two-types.tentative.html": [ @@ -307373,19 +308180,19 @@ "reftest" ], "css/css-writing-modes/form-controls-slr-004.xht": [ - "efba29b2412dceccd9d80b864c3083dc0ca3bab4", + "5913b5c624e76dd88b60c4483a7508d9ee1acdfd", "visual" ], "css/css-writing-modes/form-controls-slr-005.xht": [ - "f3879665cf517981289235d53183f865e7edc96d", + "f8580b2937e0723953124a5d3ad5211d193b98a8", "visual" ], "css/css-writing-modes/form-controls-srl-004.xht": [ - "33e6c1685b8e7050b0177eaf289587a370a22788", + "4add739342cfad21e3c8181f4879b0ef81969823", "visual" ], "css/css-writing-modes/form-controls-srl-005.xht": [ - "ad7e8fa2e34412a97f993bdf500bf1ab92468618", + "610192f804eaf3e8aa8ec6ffe32e373f5121182f", "visual" ], "css/css-writing-modes/form-controls-vlr-004.xht": [ @@ -307977,11 +308784,11 @@ "reftest" ], "css/css-writing-modes/outline-inline-slr-005.xht": [ - "288265613525071c968c1dcdf5321a316e6c7e3a", + "16186c35b27f203ebc933dd709616485ee9d9c20", "visual" ], "css/css-writing-modes/outline-inline-srl-004.xht": [ - "edd7d159627dfa8f0dd4a7f8495ad9337ab340c9", + "133ce7d9f80f6348c3b31371bca5411e059da107", "visual" ], "css/css-writing-modes/outline-inline-vlr-003.xht": [ @@ -308089,11 +308896,11 @@ "manual" ], "css/css-writing-modes/page-flow-direction-slr-005.xht": [ - "403dc532d7767e83bb95901dcb52e0f76e430c7f", + "8201313e778d8e5131309e0c9754a62bb7bcf894", "manual" ], "css/css-writing-modes/page-flow-direction-srl-004.xht": [ - "b9d1556c197d048482c80232527c837e2e4a4cf8", + "b7079a0dd1cc46e8252deff8a3b08e0915ea5a31", "manual" ], "css/css-writing-modes/percent-margin-vlr-003.xht": [ @@ -308701,7 +309508,7 @@ "reftest" ], "css/css-writing-modes/row-progression-vlr-009.xht": [ - "8afc2dba356e13db199c7ad74c2e3feeb0fc71db", + "f64e3c38517f2ed06ef2aceb54271ebb816dde1e", "reftest" ], "css/css-writing-modes/row-progression-vrl-002.xht": [ @@ -310389,11 +311196,11 @@ "reftest" ], "css/css-writing-modes/text-combine-upright-parsing-invalid-001.html": [ - "ceb1e3678cc6d520bbfadae029e9c3cc06e453e4", + "399800cdad8850d9ae841fa467c73f05b2fd3b30", "testharness" ], "css/css-writing-modes/text-combine-upright-parsing-invalid-002.html": [ - "8cb9289e79cd60aec1115c086118a4d3c9834265", + "318ac1d26b5b4dfd5bf2ab8362c8ae365aea7f34", "testharness" ], "css/css-writing-modes/text-combine-upright-parsing-valid-001.html": [ @@ -310585,7 +311392,7 @@ "reftest" ], "css/css-writing-modes/text-orientation-mixed-slr-015.xht": [ - "c43092d37cb60b744d80cddae4a9b274a0073e5a", + "5b03427b13a9586f7891acc84b4481e7be5d9ab4", "visual" ], "css/css-writing-modes/text-orientation-mixed-srl-016-ref.xht": [ @@ -310697,7 +311504,7 @@ "visual" ], "css/css-writing-modes/text-orientation-sideways-slr-019.xht": [ - "a044836b817181faea607eb8e776db82a70982f2", + "6402e262986377f75a9734b2ad39c89462f1e4be", "visual" ], "css/css-writing-modes/text-orientation-sideways-vlr-100-ref.html": [ @@ -310717,7 +311524,7 @@ "reftest" ], "css/css-writing-modes/text-orientation-upright-slr-017.xht": [ - "a7e63e94d73c9df28d7eaf38f7760e3c49442529", + "37048959d42607f908d704950860a82c605eae29", "visual" ], "css/css-writing-modes/text-orientation-upright-vlr-100-ref.html": [ @@ -310897,11 +311704,11 @@ "reftest" ], "css/css-writing-modes/vertical-alignment-slr-037.xht": [ - "078eddfc006c52a62557cf6f4b386a9a449a4084", + "a47e91d8d292ab9521b3d2319b3032fb090778f8", "visual" ], "css/css-writing-modes/vertical-alignment-slr-039.xht": [ - "d83cf22f8ff17330a4ac17bf3f3edbd00d5de407", + "355c4cf541617219a6afdcfd0ec35df37e8f9faa", "visual" ], "css/css-writing-modes/vertical-alignment-slr-049-ref.xht": [ @@ -310909,11 +311716,11 @@ "support" ], "css/css-writing-modes/vertical-alignment-srl-036.xht": [ - "2da544bd13f70a1c3fa82373ae03f63a81a701ad", + "accf5217f77f550153cf3943f53884064f5c68b6", "visual" ], "css/css-writing-modes/vertical-alignment-srl-038.xht": [ - "6a0837aded8404f898d7730521dca7af62f06858", + "c6ccd92ac36fc7981d06ec2ab44449051bc8ad79", "visual" ], "css/css-writing-modes/vertical-alignment-vlr-011.xht": [ @@ -311005,7 +311812,7 @@ "reftest" ], "css/css-writing-modes/wm-propagation-body-008.xht": [ - "200b7875de084cae5d9657b123b33f3464557f6a", + "a58999e55ac7968974cca7ad14d0a218ec140458", "reftest" ], "css/css-writing-modes/wm-propagation-body-010.xht": [ @@ -312556,6 +313363,10 @@ "b45da5560d0eb821b5552f1b67fab5cead4508b1", "support" ], + "css/selectors/anplusb-selector-parsing.html": [ + "f510ea09367f2219c9c7cab55e010018b893604e", + "testharness" + ], "css/selectors/any-link-dynamic-001-ref.html": [ "342d89969da0ca3782efacee0ecbf882c718d6c6", "support" @@ -321637,7 +322448,7 @@ "manual" ], "entries-api/interfaces-expected.txt": [ - "6aff279c939a7e69c43307ef48b01936c9d5d2e6", + "23f3fe2f29cc9f4458c65101c93f2edbf664ad7a", "support" ], "entries-api/interfaces-manual.html": [ @@ -344277,7 +345088,7 @@ "support" ], "interfaces/entries-api.idl": [ - "7fc7361fd635d7377169a756c3369c082f41d5d2", + "6bb93df3e14e49931f54eead37a009649e035bd1", "support" ], "interfaces/fullscreen.idl": [ @@ -344313,7 +345124,7 @@ "support" ], "interfaces/mediacapture-main.idl": [ - "bb672e3ffcc73f1a58cd15b232f15062c3513763", + "3400c775504ebf32af3f8e1165a53ca60f258495", "support" ], "interfaces/orientation-sensor.idl": [ @@ -344325,7 +345136,7 @@ "support" ], "interfaces/payment-request.idl": [ - "3a5f9a4e768409532916c751e7169c35ec0e23a8", + "b61ab0da4aa0f89f4af1b7d8c5f32f2bde90fd35", "support" ], "interfaces/proximity.idl": [ @@ -344357,7 +345168,11 @@ "support" ], "interfaces/uievents.idl": [ - "de07cb2600834f13c49e00d6d77df5108244b3ce", + "9e107e1ac2ed7195f802291f1d3827c53468a002", + "support" + ], + "interfaces/url.idl": [ + "416ee65b3ba9e438a3178c6c04a414f42d759fc8", "support" ], "interfaces/wake-lock.idl": [ @@ -345393,7 +346208,7 @@ "testharness" ], "mediacapture-streams/MediaDevices-IDL-all-expected.txt": [ - "6d41d56a65c9d7088e66da6d1aa344e555e36d62", + "1e4453398efb9372ae072f3a5b87758133e47292", "support" ], "mediacapture-streams/MediaDevices-IDL-all.html": [ @@ -345401,15 +346216,15 @@ "testharness" ], "mediacapture-streams/MediaDevices-IDL-enumerateDevices-expected.txt": [ - "470e9d6ef3fa1575e816931d6be862529237e767", + "9fe53c110fb03d6dadff00577d5082f221666d4b", "support" ], "mediacapture-streams/MediaDevices-IDL-enumerateDevices.html": [ - "6f35e6cfb8409803c64ed7511f9f1dd5c1c538ac", + "8382c7e6be38bad808be950b14d80fe59513ff0d", "testharness" ], "mediacapture-streams/MediaDevices-enumerateDevices.https.html": [ - "487ce67220fdefbb70d507c86d34711a315521fa", + "98de0987027ceccd4e6164ea6afbc08d5d70c35d", "testharness" ], "mediacapture-streams/MediaDevices-getUserMedia.https.html": [ @@ -353717,7 +354532,7 @@ "support" ], "payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html": [ - "e1aefd7497d3d5005df88d034fbde4e6b26823d6", + "1a2bf6b62a5021eec649c0919a35574779e30d09", "manual" ], "payment-request/PaymentCurrencyAmount/currencySystem-member.https-expected.txt": [ @@ -353828,6 +354643,10 @@ "6695acdcd1647fdd37702a7f63658dcd50f25596", "testharness" ], + "payment-request/interfaces.https-expected.txt": [ + "e5cae3299be102cc7e9722307bf9ac8f9dbebfdf", + "support" + ], "payment-request/interfaces.https.html": [ "d269e8378f2a84ba96c981536667817e0db9e2d1", "testharness" @@ -364709,11 +365528,11 @@ "testharness" ], "service-workers/service-worker/navigate-window.https-expected.txt": [ - "577a4fb4ab8695806f19dd72c6683cd1b3f04c0b", + "25c7d12018d247a4de44b8a889be6b41c88ba6b2", "support" ], "service-workers/service-worker/navigate-window.https.html": [ - "0499d4489276c2a933b79e47f1de591f467f42aa", + "4b481c60520981f5f5791344cd78d638412b4ecb", "testharness" ], "service-workers/service-worker/navigation-preload/broken-chunked-encoding.https.html": [ @@ -366996,6 +367815,14 @@ "277a94372fc8359b631b46ea79778ce2ec0e928c", "testharness" ], + "streams/piping/error-propagation-backward-expected.txt": [ + "b4baf4a5a15dfc90ee64514fc66f6d42c1925244", + "support" + ], + "streams/piping/error-propagation-backward.dedicatedworker-expected.txt": [ + "b4baf4a5a15dfc90ee64514fc66f6d42c1925244", + "support" + ], "streams/piping/error-propagation-backward.dedicatedworker.html": [ "2f7ad2bf616e612f8cae9c61264d1ea012be2561", "testharness" @@ -367005,13 +367832,21 @@ "testharness" ], "streams/piping/error-propagation-backward.js": [ - "e7f1bdd524056017264ba1f0d2f569c5a5bbece5", + "a9ed4065bf5512937a60f85e18ee0b4312994506", + "support" + ], + "streams/piping/error-propagation-backward.serviceworker.https-expected.txt": [ + "62860e3eff83009cc89c7bd40f6a55889a21c540", "support" ], "streams/piping/error-propagation-backward.serviceworker.https.html": [ "3502f6514992dab5662a5088c518d3a775863770", "testharness" ], + "streams/piping/error-propagation-backward.sharedworker-expected.txt": [ + "b4baf4a5a15dfc90ee64514fc66f6d42c1925244", + "support" + ], "streams/piping/error-propagation-backward.sharedworker.html": [ "464dbfc87804e207057de70b2dcbb0aacf03b92e", "testharness" @@ -367092,6 +367927,14 @@ "44f9ceaa3bfc9d8b92885997d322486bd0f237a6", "testharness" ], + "streams/piping/multiple-propagation-expected.txt": [ + "7268cb2b8cf18bc230c612acd617627fb5f14eaf", + "support" + ], + "streams/piping/multiple-propagation.dedicatedworker-expected.txt": [ + "7268cb2b8cf18bc230c612acd617627fb5f14eaf", + "support" + ], "streams/piping/multiple-propagation.dedicatedworker.html": [ "ef3d8a0ab031c3e25c6fcd083e7361a449ed671d", "testharness" @@ -367101,13 +367944,21 @@ "testharness" ], "streams/piping/multiple-propagation.js": [ - "8d00cd13d84d421a297bff499511d96f7b72c98c", + "a4f9df6a5da581c14aae0d489bc73972873f2b7d", + "support" + ], + "streams/piping/multiple-propagation.serviceworker.https-expected.txt": [ + "6c910a0b45fd2812a7ae60dfe4cf475d8208d091", "support" ], "streams/piping/multiple-propagation.serviceworker.https.html": [ "b1ec8a36de6b683fcfc9b3af35f7544d4806bdb6", "testharness" ], + "streams/piping/multiple-propagation.sharedworker-expected.txt": [ + "7268cb2b8cf18bc230c612acd617627fb5f14eaf", + "support" + ], "streams/piping/multiple-propagation.sharedworker.html": [ "a2aaf43f0d2eb831bd9f8e379fbf0076eee76633", "testharness" @@ -367672,6 +368523,14 @@ "6f3911baf77e26af2d7e7d7472caae4df6d5a27e", "testharness" ], + "streams/transform-streams/errors-expected.txt": [ + "04242cf6f4be6cad6f37641138dc7613066e99c8", + "support" + ], + "streams/transform-streams/errors.dedicatedworker-expected.txt": [ + "04242cf6f4be6cad6f37641138dc7613066e99c8", + "support" + ], "streams/transform-streams/errors.dedicatedworker.html": [ "ea56c89e303ed85d5f6acd423600b1d4ad73ac13", "testharness" @@ -367681,13 +368540,21 @@ "testharness" ], "streams/transform-streams/errors.js": [ - "5dcd3245e4518ff59d1297e900118cf04c6cd2d8", + "607bf12f225025a006e3b898776553fa23d38597", + "support" + ], + "streams/transform-streams/errors.serviceworker.https-expected.txt": [ + "c83621c9c2f0ebf2a1f4a156b762d35dcf71acb3", "support" ], "streams/transform-streams/errors.serviceworker.https.html": [ "85dc0c4639761359a19c1eed51692688c0a5fb7c", "testharness" ], + "streams/transform-streams/errors.sharedworker-expected.txt": [ + "04242cf6f4be6cad6f37641138dc7613066e99c8", + "support" + ], "streams/transform-streams/errors.sharedworker.html": [ "479366dd2a194281aba6138aa10fd2bc788ea44c", "testharness" @@ -367808,6 +368675,14 @@ "5c855e897d1143092ecc10b58268e6a576882184", "testharness" ], + "streams/transform-streams/reentrant-strategies-expected.txt": [ + "9db3b8540b4bc30489eb73208c4cec67f8b52347", + "support" + ], + "streams/transform-streams/reentrant-strategies.dedicatedworker-expected.txt": [ + "9db3b8540b4bc30489eb73208c4cec67f8b52347", + "support" + ], "streams/transform-streams/reentrant-strategies.dedicatedworker.html": [ "6f9350ce1caf4fa9e6239693ec91b2249c2adab5", "testharness" @@ -367817,13 +368692,21 @@ "testharness" ], "streams/transform-streams/reentrant-strategies.js": [ - "caf6c2d53b211fdfd001858a8656dc0f0f92ce74", + "1ddadc53f6b69bda7cf015ca44e6c78f74f11111", + "support" + ], + "streams/transform-streams/reentrant-strategies.serviceworker.https-expected.txt": [ + "fb43ed0f406693e285c61f9752c1b25bef98b4fb", "support" ], "streams/transform-streams/reentrant-strategies.serviceworker.https.html": [ "f3000f522b6e1b7f1db839b85ff71aed36c29b8d", "testharness" ], + "streams/transform-streams/reentrant-strategies.sharedworker-expected.txt": [ + "9db3b8540b4bc30489eb73208c4cec67f8b52347", + "support" + ], "streams/transform-streams/reentrant-strategies.sharedworker.html": [ "cdbd3f2cfc307cf007eabfb324dc107d5baa86a0", "testharness" @@ -367868,6 +368751,14 @@ "9f545c6d51b877e399fd5e484a5ce5052c607346", "testharness" ], + "streams/writable-streams/aborting-expected.txt": [ + "d834d98d91e7df4447bd65380d2170b5719560ab", + "support" + ], + "streams/writable-streams/aborting.dedicatedworker-expected.txt": [ + "d834d98d91e7df4447bd65380d2170b5719560ab", + "support" + ], "streams/writable-streams/aborting.dedicatedworker.html": [ "89cfc3ba5cfbb426b6ac60c32aa5cfe9dd0ad8b4", "testharness" @@ -367877,13 +368768,21 @@ "testharness" ], "streams/writable-streams/aborting.js": [ - "73be2b0af40871af1e2cd65d99f4591d45cee3aa", + "f10c4d9ffb59d4480fd069a9ea70ec41f5b71754", + "support" + ], + "streams/writable-streams/aborting.serviceworker.https-expected.txt": [ + "af9a09cb2e04b453c6c7ffe79b4afd03d062cb85", "support" ], "streams/writable-streams/aborting.serviceworker.https.html": [ "b69530ebf51ccaf781ff78172be2f4607ee22c86", "testharness" ], + "streams/writable-streams/aborting.sharedworker-expected.txt": [ + "d834d98d91e7df4447bd65380d2170b5719560ab", + "support" + ], "streams/writable-streams/aborting.sharedworker.html": [ "9e792fad19cd10a96440478cb7e0486f41b70bf4", "testharness" @@ -367909,11 +368808,11 @@ "testharness" ], "streams/writable-streams/bad-underlying-sinks-expected.txt": [ - "b317c8841af0f6cdd379615745b5d432e2ccb08e", + "82b2db30ed3d823d52e2150b1a4e0849d2ed292f", "support" ], "streams/writable-streams/bad-underlying-sinks.dedicatedworker-expected.txt": [ - "b317c8841af0f6cdd379615745b5d432e2ccb08e", + "82b2db30ed3d823d52e2150b1a4e0849d2ed292f", "support" ], "streams/writable-streams/bad-underlying-sinks.dedicatedworker.html": [ @@ -367925,11 +368824,11 @@ "testharness" ], "streams/writable-streams/bad-underlying-sinks.js": [ - "f09d495d577ff9904adbcfc4746acfd5f70860ff", + "9a9f0b9eb7a93e9809c549e983c4052648157592", "support" ], "streams/writable-streams/bad-underlying-sinks.serviceworker.https-expected.txt": [ - "a1fc58fb9ffa3716a15b2a56a4030cc31b24c479", + "2d1d50e62e29c73d3e39c583106c7b8972e46928", "support" ], "streams/writable-streams/bad-underlying-sinks.serviceworker.https.html": [ @@ -367937,7 +368836,7 @@ "testharness" ], "streams/writable-streams/bad-underlying-sinks.sharedworker-expected.txt": [ - "b317c8841af0f6cdd379615745b5d432e2ccb08e", + "82b2db30ed3d823d52e2150b1a4e0849d2ed292f", "support" ], "streams/writable-streams/bad-underlying-sinks.sharedworker.html": [ @@ -367984,6 +368883,14 @@ "3c576d902e34976313357126d3688a4639a4e5a7", "testharness" ], + "streams/writable-streams/close-expected.txt": [ + "fab6269fe331fc6334513e035734beba590727b7", + "support" + ], + "streams/writable-streams/close.dedicatedworker-expected.txt": [ + "fab6269fe331fc6334513e035734beba590727b7", + "support" + ], "streams/writable-streams/close.dedicatedworker.html": [ "cccf37e3bcc4be858fb41be465c38e7785db4508", "testharness" @@ -367993,13 +368900,21 @@ "testharness" ], "streams/writable-streams/close.js": [ - "a0f0183652427bdcd049eac90eb52d1ba5e09110", + "45a448b31a40388f277ecf064339f6858f032cc1", + "support" + ], + "streams/writable-streams/close.serviceworker.https-expected.txt": [ + "9fc6e420ecb221f1dcb62405e299450d921c0028", "support" ], "streams/writable-streams/close.serviceworker.https.html": [ "5461a766e8047c6d50b7943d99f8ebb4c140a547", "testharness" ], + "streams/writable-streams/close.sharedworker-expected.txt": [ + "fab6269fe331fc6334513e035734beba590727b7", + "support" + ], "streams/writable-streams/close.sharedworker.html": [ "b2aeb127d5ae7087b42e3fc08faaa113c84e6fd8", "testharness" @@ -368084,6 +368999,14 @@ "00af09f46d126d6d2944d13831896e648094d1a8", "testharness" ], + "streams/writable-streams/general-expected.txt": [ + "09aa178c5f9caef1a7ea93e5a5ae93f70c2e3e3c", + "support" + ], + "streams/writable-streams/general.dedicatedworker-expected.txt": [ + "09aa178c5f9caef1a7ea93e5a5ae93f70c2e3e3c", + "support" + ], "streams/writable-streams/general.dedicatedworker.html": [ "8583d80450b090c16ed0795170340d040449bbc1", "testharness" @@ -368093,13 +369016,21 @@ "testharness" ], "streams/writable-streams/general.js": [ - "4f07b059c3b2d90ca0c08ffe014e3e77ade70be0", + "af1848e49d119ba4e57b8354052e161ac8e80632", + "support" + ], + "streams/writable-streams/general.serviceworker.https-expected.txt": [ + "b48d49828246a8e000f6687006188d136add06b3", "support" ], "streams/writable-streams/general.serviceworker.https.html": [ "1792d6c45a5687777291a4dab031a954aa053752", "testharness" ], + "streams/writable-streams/general.sharedworker-expected.txt": [ + "09aa178c5f9caef1a7ea93e5a5ae93f70c2e3e3c", + "support" + ], "streams/writable-streams/general.sharedworker.html": [ "44f9ceaa3bfc9d8b92885997d322486bd0f237a6", "testharness" @@ -368140,6 +369071,14 @@ "5c855e897d1143092ecc10b58268e6a576882184", "testharness" ], + "streams/writable-streams/reentrant-strategy-expected.txt": [ + "f94c1d8432e8295d70cd175691ec831baecab4d6", + "support" + ], + "streams/writable-streams/reentrant-strategy.dedicatedworker-expected.txt": [ + "f94c1d8432e8295d70cd175691ec831baecab4d6", + "support" + ], "streams/writable-streams/reentrant-strategy.dedicatedworker.html": [ "5d9e5a6b69fbe79183ac6e0d2c8559f13be6e386", "testharness" @@ -368149,13 +369088,21 @@ "testharness" ], "streams/writable-streams/reentrant-strategy.js": [ - "e0fea3678e9441483cda043bff02595836a20de4", + "87a02a0d0b66c3fe571ca106379da254a4e2869f", + "support" + ], + "streams/writable-streams/reentrant-strategy.serviceworker.https-expected.txt": [ + "3af8efee5c70450d4950e3026603714c69f7e67f", "support" ], "streams/writable-streams/reentrant-strategy.serviceworker.https.html": [ "663075ee687ea54010f76d0e37191e46f37b9a49", "testharness" ], + "streams/writable-streams/reentrant-strategy.sharedworker-expected.txt": [ + "f94c1d8432e8295d70cd175691ec831baecab4d6", + "support" + ], "streams/writable-streams/reentrant-strategy.sharedworker.html": [ "5dabe1367481c57c58fe208ba66d8c13d4e2b796", "testharness" @@ -369469,15 +370416,15 @@ "support" ], "url/interfaces.any-expected.txt": [ - "8712b0a945f9e321c2231094d5d3bd7fecf4c91b", + "6688da9074e0eee954db17d1c330e985cca02e6e", "support" ], "url/interfaces.any.js": [ - "85a047537943e6ca22536bc70d11aaebadd7cd3d", + "a83c44354ce5f1e558d5f09fa0e5589582149f0c", "testharness" ], "url/interfaces.any.worker-expected.txt": [ - "8712b0a945f9e321c2231094d5d3bd7fecf4c91b", + "6688da9074e0eee954db17d1c330e985cca02e6e", "support" ], "url/setters_tests.json": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/all-tests-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/all-tests-expected.txt new file mode 100644 index 0000000..3b9b88c7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/all-tests-expected.txt
@@ -0,0 +1,31 @@ +This is a testharness.js-based test. +PASS 0001 - Set cookie. +PASS 0002 - Set cookie with future expiration. +PASS 0003 - Set expired cookie along with valid cookie. +FAIL 0004 - Ignore cookie without key. assert_equals: expected "" but got "foo" +PASS 0005 - Set cookie with age. +PASS 0006 - Set no cookie with max-age=0. +PASS 0007 - Set cookie with version=1. +PASS 0008 - Set cookie with version=1000. +PASS 0009 - Set cookie with custom value. +PASS 0010 - Dont accept 'secure' cookies over http. +PASS 0011 - Ignore separators in cookie values. +PASS 0012 - Ignore values with separators and without ';'. +PASS 0013 - Use last value for cookies with identical keys. +PASS 0014 - Keep alphabetic key order. +PASS 0015 - Keep alphabetic single-char key order. +PASS 0016 - Keep non-alphabetic key order. +PASS 0017 - Keep order if comma-separated. +PASS 0018 - Ignore keys after semicolon. +PASS 0019 - Ignore attributes after semicolon. +FAIL 0020 - Ignore cookies without key and value. assert_equals: expected "a=b; c=d" but got "a=b; ; c=d" +FAIL 0021 - Ignore cookie without key in all 'Set-Cookie'. assert_equals: expected "a=b; c=d" but got "a=b; x; c=d" +PASS 0022 - Set cookie without value in all 'Set-Cookie'. +PASS 0023 - Ignore cookies without '=' in all 'Set-Cookie'. +PASS 0024 - Ignore malformed cookies in all 'Set-Cookie'. +PASS 0025 - Ignore cookies with ';' in all 'Set-Cookie'. +PASS 0026 - Ignore malformed cookies in all 'Set-Cookie' v2. +FAIL 0027 - Ignore malformed cookies in all 'Set-Cookie' v3. assert_equals: expected "" but got "bar" +FAIL 0028 - [INVALID EXPECTATION] Ignore malformed cookies in all 'Set-Cookie' v4. assert_equals: expected "Set-Cookie: foo Set-Cookie:" but got "" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/all-tests.html b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/all-tests.html new file mode 100644 index 0000000..169984d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/all-tests.html
@@ -0,0 +1,59 @@ +<!doctype html> +<html> + <head> + <meta charset=utf-8> + <title>Tests basic cookie setting functionality</title> + <meta name=help href="https://tools.ietf.org/html/rfc6265#page-8"> + + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="resources/cookie-http-state-template.js"></script> + </head> + <body> + <div id="log"></div> + <script> + setup({ explicit_timeout: true }); + + const TEST_CASES = [ + {file: "0001", name: "Set cookie."}, + {file: "0002", name: "Set cookie with future expiration."}, + {file: "0003", name: "Set expired cookie along with valid cookie."}, + {file: "0004", name: "Ignore cookie without key."}, + {file: "0005", name: "Set cookie with age."}, + {file: "0006", name: "Set no cookie with max-age=0."}, + {file: "0007", name: "Set cookie with version=1."}, + {file: "0008", name: "Set cookie with version=1000."}, + {file: "0009", name: "Set cookie with custom value."}, + // TODO(fhorschig): Could 0010 break when run on a HTTPS try server? + {file: "0010", name: "Dont accept 'secure' cookies over http."}, + {file: "0011", name: "Ignore separators in cookie values."}, + {file: "0012", name: "Ignore values with separators and without ';'."}, + {file: "0013", name: "Use last value for cookies with identical keys."}, + {file: "0014", name: "Keep alphabetic key order."}, + {file: "0015", name: "Keep alphabetic single-char key order."}, + {file: "0016", name: "Keep non-alphabetic key order."}, + {file: "0017", name: "Keep order if comma-separated."}, + {file: "0018", name: "Ignore keys after semicolon."}, + {file: "0019", name: "Ignore attributes after semicolon."}, + {file: "0020", name: "Ignore cookies without key and value."}, + {file: "0021", name: "Ignore cookie without key in all 'Set-Cookie'."}, + {file: "0022", name: "Set cookie without value in all 'Set-Cookie'."}, + {file: "0023", name: "Ignore cookies without '=' in all 'Set-Cookie'."}, + {file: "0024", name: "Ignore malformed cookies in all 'Set-Cookie'."}, + {file: "0025", name: "Ignore cookies with ';' in all 'Set-Cookie'."}, + {file: "0026", name: "Ignore malformed cookies in all 'Set-Cookie' v2."}, + {file: "0027", name: "Ignore malformed cookies in all 'Set-Cookie' v3."}, + // TODO(fhorschig): Ask about 0028's expectations ... should be empty? + {file: "0028", name: "[INVALID EXPECTATION] Ignore malformed cookies in all 'Set-Cookie' v4."}, + ]; + + for (const i in TEST_CASES) { + const t = TEST_CASES[i]; + promise_test(createCookieTest(t.file), + t.file + " - " + t.name, + { timeout: 3000 }); + } + + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/cookie-http-state-template.js b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/cookie-http-state-template.js new file mode 100644 index 0000000..68c5212f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/cookie-http-state-template.js
@@ -0,0 +1,80 @@ +const SERVER_LOCATION = "resources"; +const SERVER_SCRIPT = SERVER_LOCATION + "/cookie-setter.py"; + +function stripPrefixAndWhitespace(cookie_text) { + return cookie_text.replace(/^Cookie: /, '').replace(/^\s+|\s+$/g, ''); +} + +function getLocalResourcesPath() { + return location.pathname.replace(/[^\/]*$/, "") + SERVER_LOCATION; +} + +function getAbsoluteServerLocation() { + return getLocalResourcesPath().replace(/resources.*$/,'')+ SERVER_SCRIPT; +} + +function expireCookie(name, expiry_date, path) { + name = name || ""; + expiry_date = expiry_date || "Thu, 01 Jan 1970 00:00:00 UTC"; + path = path || getLocalResourcesPath(); + document.cookie = name + "=; expires=" + expiry_date + "; path=" + path + ";"; +} + +function CookieManager() { + this.initial_cookies = []; +} + +CookieManager.prototype.parse = document_cookies => { + this.initial_cookies = []; + document_cookies = document_cookies.replace(/^Cookie: /, ''); + if (document_cookies != "") { + this.initial_cookies = document_cookies.split(/\s*;\s*/); + } +} + +CookieManager.prototype.diffWith = document_cookies => { + this.actual_cookies = document_cookies; + for (let i in initial_cookies) { + let no_spaces_cookie_regex = + new RegExp(/\s*[\;]*\s/.source + initial_cookies[i]); + this.actual_cookies = actual_cookies.replace(no_spaces_cookie_regex, ''); + } + return this.actual_cookies; +} + +CookieManager.prototype.resetCookies = () => { + expireCookie(/*name=*/""); // If a cookie without keys was accepted, drop it. + if (this.actual_cookies == "") { + return; // There is nothing to reset here. + } + let cookies_to_delete = this.actual_cookies.split(/\s*;\s*/) + for (let i in cookies_to_delete){ + expireCookie(cookies_to_delete[i].replace(/=.*$/, "")); + // Drop cookies with same name that were set to the root path which happens + // for example due to "0010" still failing. + expireCookie(cookies_to_delete[i].replace(/=.*$/, ""), + /*expiry_date=*/null, + /*path=*/'/'); + } +} + +function createCookieTest(file) { + return t => { + const iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + let diff_tool = new CookieManager(); + t.add_cleanup(diff_tool.resetCookies); + return new Promise((resolve, reject) => { + diff_tool.parse(document.cookie); + window.addEventListener("message", t.step_func(e => { + assert_true(!!e.data, "Message contains data") + resolve(e.data); + })); + iframe.src = getAbsoluteServerLocation() + "?file=" + file; + }).then((response) => { + let actual_cookies = diff_tool.diffWith(response.cookies); + let expected_cookies = stripPrefixAndWhitespace(response.expectation); + assert_equals(actual_cookies, expected_cookies); + }); + } +};
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/cookie-setter.py b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/cookie-setter.py new file mode 100644 index 0000000..0418f4b7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/cookie-setter.py
@@ -0,0 +1,54 @@ +from os import path; + + +SETUP_FILE_TEMPLATE = "{}-test" +EXPECTATION_FILE_TEMPLATE = "{}-expected" +EXPECTATION_HTML_SCAFFOLD = "iframe-expectation-doc.html.py-str" +DEBUGGING_HTML_SCAFFOLD = "debugging-single-test.html.py-str" +DEFAULT_RESOURCE_DIR = path.join("cookies", "http-state", "resources") +DEFAULT_TEST_DIR = "test-files" + + +def dump_file(directory, filename): + return open(path.join(directory, filename), "r").read() + + +class CookieTestResponse(object): + def __init__(self, file, root): + super(CookieTestResponse, self).__init__() + self.__test_file = SETUP_FILE_TEMPLATE.format(file) + self.__expectation_file = EXPECTATION_FILE_TEMPLATE.format(file) + self.__resources_dir = path.join(root, DEFAULT_RESOURCE_DIR) + self.__test_files_dir = path.join(self.__resources_dir, DEFAULT_TEST_DIR) + + def cookie_setting_header(self): + return dump_file(self.__test_files_dir, self.__test_file) + + def body_with_expectation(self): + html_frame = dump_file(self.__resources_dir, EXPECTATION_HTML_SCAFFOLD) + expected_data = dump_file(self.__test_files_dir, self.__expectation_file); + return html_frame.format(**{'data' : expected_data}) + + +def main(request, response): + if "debug" in request.GET: + response.writer.write_status(200) + response.writer.end_headers() + html_frame = dump_file(path.join(request.doc_root, DEFAULT_RESOURCE_DIR), + DEBUGGING_HTML_SCAFFOLD) + test_file = html_frame % (request.GET['debug']) + response.writer.write_content(test_file) + return; + + if not "file" in request.GET: + response.writer.write_status(404) + response.writer.end_headers() + response.writer.write_content("The 'file' parameter is missing!") + return; + + cookie_response = CookieTestResponse(request.GET['file'], request.doc_root) + + response.writer.write_status(200) + response.writer.write(cookie_response.cookie_setting_header()) + response.writer.end_headers() + response.writer.write_content(cookie_response.body_with_expectation())
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/debugging-single-test.html.py-str b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/debugging-single-test.html.py-str new file mode 100644 index 0000000..d34ff87 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/debugging-single-test.html.py-str
@@ -0,0 +1,21 @@ +<!doctype html> +<html> + <head> + <meta charset=utf-8> + <title>Debug single test</title> + <meta name=help href="https://tools.ietf.org/html/rfc6265#page-8"> + + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="cookie-http-state-template.js"></script> + </head> + <body> + <div id="log"></div> + <script> + setup({ explicit_timeout: true }); + + promise_test(createCookieTest("%s"), "DEBUG", { timeout: 3000 }); + + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/iframe-content-pushing.js b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/iframe-content-pushing.js new file mode 100644 index 0000000..99ede2a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/iframe-content-pushing.js
@@ -0,0 +1,4 @@ +window.top.postMessage({ + "cookies": document.cookie, + "expectation": document.querySelector('#data').innerText +}, "*");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/iframe-expectation-doc.html.py-str b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/iframe-expectation-doc.html.py-str new file mode 100644 index 0000000..f2cf313 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/iframe-expectation-doc.html.py-str
@@ -0,0 +1,11 @@ +<!doctype html> +<html> + <head> + <meta charset=utf-8> + <title>Cookie Test Expectation Document</title> + </head> + <body> + <div id="data">{data}</div> + <script src="iframe-content-pushing.js"></script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0001-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0001-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0001-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0001-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0001-test new file mode 100644 index 0000000..bbeb77a0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0001-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0002-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0002-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0002-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0002-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0002-test new file mode 100644 index 0000000..a3eaff0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0002-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; Expires=Fri, 07 Aug 2019 08:04:19 GMT
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0003-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0003-expected new file mode 100644 index 0000000..78e79c2c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0003-expected
@@ -0,0 +1 @@ +Cookie: foo2=bar2
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0003-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0003-test new file mode 100644 index 0000000..62fa172 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0003-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo=bar; Expires=Fri, 07 Aug 2007 08:04:19 GMT +Set-Cookie: foo2=bar2; Expires=Fri, 07 Aug 2027 08:04:19 GMT
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0004-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0004-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0004-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0004-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0004-test new file mode 100644 index 0000000..190260d7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0004-test
@@ -0,0 +1 @@ +Set-Cookie: foo
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0005-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0005-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0005-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0005-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0005-test new file mode 100644 index 0000000..4de576a0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0005-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; max-age=10000;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0006-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0006-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0006-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0006-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0006-test new file mode 100644 index 0000000..83e41ec9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0006-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; max-age=0;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0007-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0007-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0007-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0007-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0007-test new file mode 100644 index 0000000..af7b672 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0007-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; version=1;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0008-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0008-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0008-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0008-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0008-test new file mode 100644 index 0000000..02baa00 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0008-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; version=1000;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0009-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0009-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0009-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0009-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0009-test new file mode 100644 index 0000000..83c83fe1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0009-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; customvalue=1000;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0010-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0010-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0010-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0010-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0010-test new file mode 100644 index 0000000..1408056a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0010-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; secure;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0011-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0011-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0011-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0011-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0011-test new file mode 100644 index 0000000..ad11eab --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0011-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; customvalue="1000 or more";
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0012-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0012-expected new file mode 100644 index 0000000..b14d4f69 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0012-expected
@@ -0,0 +1 @@ +Cookie: foo=bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0012-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0012-test new file mode 100644 index 0000000..cf9e712 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0012-test
@@ -0,0 +1 @@ +Set-Cookie: foo=bar; customvalue="no trailing semicolon"
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0013-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0013-expected new file mode 100644 index 0000000..266392c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0013-expected
@@ -0,0 +1 @@ +Cookie: foo=qux
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0013-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0013-test new file mode 100644 index 0000000..f3c30ab --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0013-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo=bar +Set-Cookie: foo=qux
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0014-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0014-expected new file mode 100644 index 0000000..4b162fe --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0014-expected
@@ -0,0 +1 @@ +Cookie: foo1=bar; foo2=qux
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0014-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0014-test new file mode 100644 index 0000000..6bacc673 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0014-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo1=bar +Set-Cookie: foo2=qux
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0015-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0015-expected new file mode 100644 index 0000000..036ac4a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0015-expected
@@ -0,0 +1 @@ +Cookie: a=b; z=y
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0015-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0015-test new file mode 100644 index 0000000..b9a3125 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0015-test
@@ -0,0 +1,2 @@ +Set-Cookie: a=b +Set-Cookie: z=y
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0016-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0016-expected new file mode 100644 index 0000000..5f1a6fd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0016-expected
@@ -0,0 +1 @@ +Cookie: z=y; a=b
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0016-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0016-test new file mode 100644 index 0000000..5565928 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0016-test
@@ -0,0 +1,2 @@ +Set-Cookie: z=y +Set-Cookie: a=b
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0017-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0017-expected new file mode 100644 index 0000000..f3c269c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0017-expected
@@ -0,0 +1,2 @@ +Cookie: z=y, a=b +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0017-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0017-test new file mode 100644 index 0000000..b8984fe --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0017-test
@@ -0,0 +1 @@ +Set-Cookie: z=y, a=b
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0018-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0018-expected new file mode 100644 index 0000000..0b54935 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0018-expected
@@ -0,0 +1,2 @@ +Cookie: z=y +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0018-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0018-test new file mode 100644 index 0000000..630bf9b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0018-test
@@ -0,0 +1 @@ +Set-Cookie: z=y; foo=bar, a=b
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0019-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0019-expected new file mode 100644 index 0000000..ecc9526 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0019-expected
@@ -0,0 +1 @@ +Cookie: foo=b
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0019-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0019-test new file mode 100644 index 0000000..352123e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0019-test
@@ -0,0 +1 @@ +Set-Cookie: foo=b;max-age=3600, c=d;path=/
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0020-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0020-expected new file mode 100644 index 0000000..a43cb00 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0020-expected
@@ -0,0 +1 @@ +Cookie: a=b; c=d
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0020-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0020-test new file mode 100644 index 0000000..9b35947f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0020-test
@@ -0,0 +1,3 @@ +Set-Cookie: a=b +Set-Cookie: = +Set-Cookie: c=d
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0021-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0021-expected new file mode 100644 index 0000000..a43cb00 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0021-expected
@@ -0,0 +1 @@ +Cookie: a=b; c=d
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0021-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0021-test new file mode 100644 index 0000000..5781fe3b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0021-test
@@ -0,0 +1,3 @@ +Set-Cookie: a=b +Set-Cookie: =x +Set-Cookie: c=d
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0022-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0022-expected new file mode 100644 index 0000000..5632bec --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0022-expected
@@ -0,0 +1 @@ +Cookie: a=b; x=; c=d
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0022-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0022-test new file mode 100644 index 0000000..70b9abf --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0022-test
@@ -0,0 +1,3 @@ +Set-Cookie: a=b +Set-Cookie: x= +Set-Cookie: c=d
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0023-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0023-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0023-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0023-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0023-test new file mode 100644 index 0000000..609c668 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0023-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo +Set-Cookie:
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0024-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0024-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0024-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0024-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0024-test new file mode 100644 index 0000000..31dd69f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0024-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo +Set-Cookie: =
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0025-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0025-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0025-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0025-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0025-test new file mode 100644 index 0000000..09f51a8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0025-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo +Set-Cookie: ; bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0026-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0026-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0026-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0026-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0026-test new file mode 100644 index 0000000..609c668 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0026-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo +Set-Cookie:
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0027-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0027-expected new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0027-expected
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0027-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0027-test new file mode 100644 index 0000000..f7f6d26 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0027-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo +Set-Cookie: bar
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0028-expected b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0028-expected new file mode 100644 index 0000000..609c668 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0028-expected
@@ -0,0 +1,2 @@ +Set-Cookie: foo +Set-Cookie:
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0028-test b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0028-test new file mode 100644 index 0000000..609c668 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/http-state/resources/test-files/0028-test
@@ -0,0 +1,2 @@ +Set-Cookie: foo +Set-Cookie:
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/cascade-import-002.xht b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/cascade-import-002.xht index 6a2c70f..14e7156 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/cascade-import-002.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/cascade-import-002.xht
@@ -15,7 +15,6 @@ <link rel="help" href="http://www.w3.org/TR/css-cascade-4/#cascading"/> <meta name="flags" content="http" /> - <meta http-equiv="Link" content='<support/cascade-import-002h.css>; rel="stylesheet"'/> <link rel="stylesheet" href="support/cascade-import-002j.css"/> <style type="text/css"> @import url(support/cascade-import-002k.css); @@ -28,7 +27,6 @@ .r { color: red; } </style> <link rel="stylesheet" href="support/cascade-import-002p.css"/> - <meta http-equiv="Link" content='<support/cascade-import-002r.css>; rel="stylesheet"'/> </head> <body> <div class="a"> This line should be green. (a) </div> @@ -37,8 +35,6 @@ <div class="d"> This line should be green. (d) </div> <div class="e"> This line should be green. (e) </div> <div class="f"> This line should be green. (f) </div> - <div class="g"> This line should be green. (g) </div> - <div class="h"> This line should be green. (h) </div> <div class="i"> This line should be green. (i) </div> <div class="j"> This line should be green. (j) </div> <div class="k"> This line should be green. (k) </div> @@ -47,8 +43,6 @@ <div class="n"> This line should be green. (n) </div> <div class="o"> This line should be green. (o) </div> <div class="p"> This line should be green. (p) </div> - <div class="q"> This line should be green. (q) </div> - <div class="r"> This line should be green. (r) </div> <!-- The cascade is as follows: HTTP Link: header @@ -63,10 +57,6 @@ @import e Rule f Rule - <meta http-equiv="Link"> - @import - g Rule - h Rule <link rel="stylesheet"> @import i Rule @@ -84,10 +74,6 @@ n Rule o Rule p Rule - <meta http-equiv="Link"> - @import - q Rule - r Rule -->
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002g.css b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002g.css deleted file mode 100644 index 3f8203e..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002g.css +++ /dev/null
@@ -1,12 +0,0 @@ -.g { color: green; } -.h { color: red; } -.i { color: red; } -.j { color: red; } -.k { color: red; } -.l { color: red; } -.m { color: red; } -.n { color: red; } -.o { color: red; } -.p { color: red; } -.q { color: red; } -.r { color: red; }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002h.css b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002h.css deleted file mode 100644 index 7dabe99..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002h.css +++ /dev/null
@@ -1,12 +0,0 @@ -@import url('cascade-import-002g.css'); -.h { color: green; } -.i { color: red; } -.j { color: red; } -.k { color: red; } -.l { color: red; } -.m { color: red; } -.n { color: red; } -.o { color: red; } -.p { color: red; } -.q { color: red; } -.r { color: red; }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002q.css b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002q.css deleted file mode 100644 index a778423..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002q.css +++ /dev/null
@@ -1,2 +0,0 @@ -.q { color: green; } -.r { color: red; }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002r.css b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002r.css deleted file mode 100644 index a3faacf..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/cascade-import/support/cascade-import-002r.css +++ /dev/null
@@ -1,2 +0,0 @@ -@import url(cascade-import-002q.css); -.r { color: green; }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/fractional-line-height.html b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/fractional-line-height.html new file mode 100644 index 0000000..0b748072 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/fractional-line-height.html
@@ -0,0 +1,30 @@ +<!DOCTYPE html> +<title>Container height calculation with fractional line height and fractional child height</title> +<link rel="author" title="Morten Stenshorne" href="mstensho@chromium.org"> +<link rel="help" href="https://www.w3.org/TR/CSS22/visudet.html#line-height" title="10.8 Line height calculations: the 'line-height' and 'vertical-align' properties"> +<link rel="match" href="../../reference/nothing.html"> +<style> + .container { float:left; overflow:auto; width:50px; } + .container > span { display:inline-block; width:10px; } +</style> +<p>There should be nothing below.</p> + +<!-- None of these should not trigger a vertical scrollbar, because the height + of the overflow:auto container is auto, so it should make room for + whatever's inside. --> + +<div class="container" style="line-height:19.75px;"> + <span style="height:100.25px;"></span> +</div> + +<div class="container" style="line-height:19.75px;"> + <span style="height:100.75px;"></span> +</div> + +<div class="container" style="line-height:19.25px;"> + <span style="height:100.25px;"></span> +</div> + +<div class="container" style="line-height:19.25px;"> + <span style="height:100.75px;"></span> +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-indexed-getter-setter.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-indexed-getter-setter.html new file mode 100644 index 0000000..9f0403f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-indexed-getter-setter.html
@@ -0,0 +1,54 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSUnparsedValue Indexed Getter and Setter</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-__getter__-index-index"> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-__setter__-index-val-val"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../resources/testhelper.js"></script> +<body> +<div id="log"></div> +<script> +'use strict'; + +test(() => { + const result = new CSSUnparsedValue(['foo', 'bar']); + assert_equals(result[3], undefined, 'result from out of range index'); + assert_equals(result[-1], undefined, 'result from negative index'); +}, 'Getting invalid index in CSSUnparsedValue returns undefined'); + +test(() => { + let result = new CSSUnparsedValue([new CSSVariableReferenceValue('--foo')]); + result[0] = 'A'; + assert_equals(result[0], 'A', 'fragment reflects new value'); +}, 'Can update fragment in CSSUnparsedValue to a String'); + +test(() => { + let result = new CSSUnparsedValue(['foo']); + result[0] = new CSSVariableReferenceValue('--A'); + assert_style_value_equals(result[0], new CSSVariableReferenceValue('--A'), + 'fragment reflects new value'); +}, 'Can update fragment in CSSUnparsedValue to a CSSVariableReference'); + +test(() => { + let result = new CSSUnparsedValue([]); + result[0] = 'foo'; + assert_equals(result[0], 'foo', 'new fragment is appended'); +}, 'Setting one past the last fragment in a CSSUnparsedValue to a String ' + + 'appends the new fragment'); + +test(() => { + let result = new CSSUnparsedValue([' ']); + result[1] = new CSSVariableReferenceValue('--A'); + assert_style_value_equals(result[1], new CSSVariableReferenceValue('--A'), + 'new fragment is appended'); +}, 'Setting one past the last fragment in a CSSUnparsedValue to a ' + + 'CSSVariableReferenceValue appends the new fragment'); + +test(() => { + let result = new CSSUnparsedValue(['foo', 'bar']); + assert_throws(new RangeError(), () => result[3] = 'foo'); + assert_equals(result[3], undefined, 'fragment does not change'); +}, 'Setting out of range index in CSSUnparsedValue throws RangeError'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-iterable.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-iterable.html new file mode 100644 index 0000000..186ba73 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-iterable.html
@@ -0,0 +1,24 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSUnparsedValue Iterable Declaration</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssunparsedvalue"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="../resources/testhelper.js"></script> +<body> +<div id="log"></div> +<script> +'use strict'; + +test(() => { + const result = new CSSUnparsedValue([]); + assert_array_equals([...result], [], 'result of iterating'); +}, 'Iterating over an empty CSSUnparsedValue produces nothing'); + +test(() => { + const args = [' ', new CSSVariableReferenceValue('--A')]; + const result = new CSSUnparsedValue(args); + assert_style_value_array_equals([...result], args, 'result of iterating'); +}, 'Iterating over a CSSUnparsedValue produces all fragments'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-length.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-length.html new file mode 100644 index 0000000..cb2b9c9b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-length.html
@@ -0,0 +1,47 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSUnparsedValue.length</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-length"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<div id="log"></div> +<script> +'use strict'; + +test(() => { + const result = new CSSUnparsedValue([]); + assert_equals(result.length, 0, 'length'); +}, 'Length of CSSUnparsedValue with no fragments is zero'); + +test(() => { + const result = new CSSUnparsedValue([ + ' ', new CSSVariableReferenceValue('--A') + ]); + assert_equals(result.length, 2, 'length'); +}, 'Length of CSSUnparsedValue with multiple fragments is the number of ' + + 'fragments'); + +test(() => { + let result = new CSSUnparsedValue([' ']); + assert_equals(result.length, 1, 'initial length'); + + result[1] = new CSSVariableReferenceValue('--A'); + assert_equals(result.length, 2, 'length after appending once'); + + result[2] = 'lemon'; + assert_equals(result.length, 3, 'length after appending twice'); +}, 'Length of CSSUnparsedValue updates when fragments are appended'); + +test(() => { + let result = new CSSUnparsedValue([' ']); + assert_equals(result.length, 1, 'initial length'); + + result[0] = new CSSVariableReferenceValue('--A'); + assert_equals(result.length, 1, 'length after modification'); + + result[0] = 'lemon'; + assert_equals(result.length, 1, 'length after modification'); +}, 'Length of CSSUnparsedValue does not change when fragments are modified'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.html index f337032..db43fd7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue.html
@@ -1,32 +1,31 @@ <!doctype html> <meta charset="utf-8"> -<title>CSSUnparsedValue</title> -<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#unparsedvalue-objects"> -<meta name="assert" content="Test CSSUnparsedValue constructor and members"> +<title>CSSUnparsedValue Constructor</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssunparsedvalue-cssunparsedvalue"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> <body> -<div id="log"> +<div id="log"></div> <script> 'use strict'; const gTestArguments = [ { description: 'no arguments', - args: [], + fragments: [], }, { - description: 'an empty string', - args: [''], + description: 'a single empty string', + fragments: [''], }, { - description: 'a CSSVariableReferenceValue', - args: [new CSSVariableReferenceValue('--foo')], + description: 'a single CSSVariableReferenceValue', + fragments: [new CSSVariableReferenceValue('--foo')], }, { - description: 'mix of strings and CSSVariableReferenceValues', - args: [ + description: 'a mix of strings and CSSVariableReferenceValues', + fragments: [ 'foo', 'bar', new CSSVariableReferenceValue('--A'), @@ -36,56 +35,13 @@ }, ]; -for (const {args, description} of gTestArguments) { +for (const args of gTestArguments) { test(() => { - const result = new CSSUnparsedValue(args); - - assert_not_equals(result, null, - 'A CSSUnparsedValue should be created'); - assert_array_equals(result, args, - 'Content of CSSUnparsedValue should be same as the arguments ' + - 'passed in the constructor'); - }, 'CSSUnparsedValue can be constructed from ' + description); + const result = new CSSUnparsedValue(args.fragments); + assert_not_equals(result, null, 'a CSSUnparsedValue is created'); + assert_style_value_array_equals(result, args.fragments, + 'fragments are same as given by constructor'); + }, `CSSUnparsedValue can be constructed from ${args.description}`); } -test(() => { - let result = new CSSUnparsedValue([new CSSVariableReferenceValue('--foo')]); - - result[0] = 'A'; - assert_equals(result[0], 'A', 'Item should be updated to new value'); -}, 'Can update item in CSSUnparsedValue to a string'); - -test(() => { - let result = new CSSUnparsedValue(['foo']); - - result[0] = new CSSVariableReferenceValue('--A'); - assert_style_value_equals(result[0], new CSSVariableReferenceValue('--A'), - 'Item should be updated to new value'); -}, 'Can update item in CSSUnparsedValue to a variable reference'); - -test(() => { - let result = new CSSUnparsedValue([]); - - result[0] = new CSSVariableReferenceValue('--A'); - assert_equals(result.length, 1, - 'Length of CSSUnparsedValue should have increased'); - assert_style_value_equals(result[0], new CSSVariableReferenceValue('--A'), - 'New item should be appended'); - - result[1] = 'foo'; - assert_equals(result.length, 2, - 'Length of CSSUnparsedValue should have increased'); - assert_equals(result[1], 'foo', 'New item should be appended'); -}, 'Can append items to CSSUnparsedValue'); - -test(() => { - const result = new CSSUnparsedValue(['foo', 'bar']); - assert_equals(result[3], undefined); -}, 'Getting invalid index in CSSUnparsedValue returns undefined'); - -test(() => { - let result = new CSSUnparsedValue(['foo', 'bar']); - assert_throws(new RangeError(), () => result[3] = 'foo'); -}, 'Setting invalid index in CSSUnparsedValue throws RangeError'); - </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html index c58bf76..3696e99 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html
@@ -20,22 +20,4 @@ }, 'Constructing a CSSVariableReferenceValue with an invalid variable name ' + 'throws SyntaxError'); -test(() => { - let result = new CSSVariableReferenceValue('--foo'); - assert_throws(new TypeError(), () => result.variable = ''); - - assert_equals(result.variable, '--foo', - 'Variable member should not have changed'); -}, 'Updating CSSVariableReferenceValue.variable to an empty variable name ' + - 'throws TypeError'); - -test(() => { - let result = new CSSVariableReferenceValue('--foo'); - assert_throws(new TypeError(), () => result.variable = 'bar'); - - assert_equals(result.variable, '--foo', - 'Variable member should not have changed'); -}, 'Updating CSSVariableReferenceValue.variable to an invalid variable name ' + - 'throws TypeError'); - </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-variable.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-variable.html new file mode 100644 index 0000000..236758b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-variable.html
@@ -0,0 +1,33 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSVariableReferenceValue.variable</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssvariablereferencevalue-variable"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<div id="log"></div> +<script> +'use strict'; + +test(() => { + let result = new CSSVariableReferenceValue('--foo'); + result.variable = '--bar'; + assert_equals(result.variable, '--bar', 'variable reflects new value'); +}, 'CSSVariableReferenceValue.variable can updated to a valid custom ' + + 'property name'); + +test(() => { + let result = new CSSVariableReferenceValue('--foo'); + assert_throws(new TypeError(), () => result.variable = ''); + assert_equals(result.variable, '--foo', 'variable does not change'); +}, 'Updating CSSVariableReferenceValue.variable to the empty string ' + + 'throws TypeError'); + +test(() => { + let result = new CSSVariableReferenceValue('--foo'); + assert_throws(new TypeError(), () => result.variable = 'bar'); + assert_equals(result.variable, '--foo', 'variable does not change'); +}, 'Updating CSSVariableReferenceValue.variable to an invalid custom ' + + 'property name throws TypeError'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.html index 7e981567..9899b210 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue.html
@@ -1,55 +1,40 @@ <!doctype html> <meta charset="utf-8"> -<title>CSSVariableReferenceValue tests</title> -<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssvariablereferencevalue"> -<meta name="assert" content="Test CSSVariableReferenceValue constructor and attributes" /> +<title>CSSVariableReferenceValue Constructor</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssvariablereferencevalue-cssvariablereferencevalue"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../resources/testhelper.js"></script> +<body> +<div id="log"></div> <script> 'use strict'; test(() => { const result = new CSSVariableReferenceValue('--foo'); - - assert_not_equals(result, null, - 'A CSSVariableReferenceValue should be created'); + assert_not_equals(result, null, 'a CSSVariableReferenceValue is created'); assert_equals(result.variable, '--foo', - 'Variable member should be same as passed in the constructor'); - assert_equals(result.fallback, null, - 'Fallback member should be null'); + 'variable is same as passed by constructor'); + assert_equals(result.fallback, null, 'fallback'); }, 'CSSVariableReferenceValue can be constructed with no fallback'); test(() => { const result = new CSSVariableReferenceValue('--foo', null); - - assert_not_equals(result, null, - 'A CSSVariableReferenceValue should be created'); + assert_not_equals(result, null, 'a CSSVariableReferenceValue is created'); assert_equals(result.variable, '--foo', - 'Variable member should be same as passed in the constructor'); - assert_equals(result.fallback, null, 'Fallback member should be null'); + 'variable is same as passed by constructor'); + assert_equals(result.fallback, null, 'fallback'); }, 'CSSVariableReferenceValue can be constructed with null fallback'); test(() => { const result = new CSSVariableReferenceValue('--foo', new CSSUnparsedValue(['lemon'])); - - assert_not_equals(result, null, - 'A CSSVariableReferenceValue should be created'); + assert_not_equals(result, null, 'a CSSVariableReferenceValue is created'); assert_equals(result.variable, '--foo', - 'Variable member should be same as passed in the constructor'); - assert_not_equals(result.fallback, null, - 'Fallback member should not be null'); + 'variable is same as passed by constructor'); + assert_not_equals(result.fallback, null, 'fallback'); assert_style_value_equals(result.fallback, new CSSUnparsedValue(['lemon']), - 'Fallback member should be as same as passed in the constructor'); + 'fallback is same as passed by constructor'); }, 'CSSVariableReferenceValue can be constructed with valid fallback'); -test(() => { - let result = new CSSVariableReferenceValue('--foo'); - result.variable = '--bar'; - - assert_equals(result.variable, '--bar', - 'Variable member should be updated to new value'); -}, 'CSSVariableReferenceValue.variable can updated to a valid variable name'); - </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-004.xht index e5409900..7774f4b6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-004.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-004.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: order, orientation and layout of form controls in 'sideways-lr' writing-mode</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> + <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> <meta content="image should" name="flags" /> <meta content="This test checks the order, the flow, the orientation and layout of form controls used in Example 4 of section 3.1 when the 'writing-mode' of the whole form element is set to 'sideways-lr'." name="assert" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-005.xht index 75370af..35b4ace 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-005.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-slr-005.xht
@@ -8,7 +8,7 @@ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> + <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> <meta content="should" name="flags" /> <meta content="This test checks the rendering of various form controls (select, optgroup, options, various types of input and buttons) written with latin text in 'sideways-lr' writing mode. The text of replaced content should match the replaced element's writing mode and line orientation; therefore, in this test, a) the text's inline base direction must be from bottom to top, b) the glyphs must be rotated 90° counter-clockwise and c) the block flow direction must be from left to right." name="assert" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-004.xht index 919c3de..37f4bb4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-004.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-004.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: order, orientation and layout of form controls in 'sideways-rl' writing-mode</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> + <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> <meta content="image should" name="flags" /> <meta content="This test checks the order, the flow, the orientation and layout of form controls used in Example 4 of section 3.1 when the 'writing-mode' of the whole form element is set to 'sideways-rl'." name="assert" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-005.xht index 5fe188e..f092ecc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-005.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/form-controls-srl-005.xht
@@ -8,7 +8,7 @@ <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> + <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> <meta content="should" name="flags" /> <meta content="This test checks the rendering of various form controls (select, optgroup, options, various types of input and buttons) written with latin text in 'sideways-rl' writing mode. The text of replaced content should match the replaced element's writing mode and line orientation; therefore, in this test, a) the text's inline base direction must be from top to bottom, b) the glyphs must be rotated 90° clockwise and c) the block flow direction must be from right to left." name="assert" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-slr-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-slr-005.xht index 95267852..42adb38 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-slr-005.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-slr-005.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: outline layout and non-replaced inline in sideways-lr writing-mode</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" title="7.1. Principles of Layout in Vertical Writing Modes" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" /> + <link rel="help" title="7.1. Principles of Layout in Vertical Writing Modes" href="http://www.w3.org/TR/css-writing-modes-4/#vertical-layout" /> <link rel="help" title="18.4 Dynamic outlines: the 'outline' property" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/ui.html#dynamic-outlines" /> <meta content="" name="flags" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-srl-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-srl-004.xht index 4b077c4..e9fc32a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-srl-004.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/outline-inline-srl-004.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: outline layout and non-replaced inline and sideways-rl writing-mode</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" title="7.1. Principles of Layout in Vertical Writing Modes" href="http://www.w3.org/TR/css-writing-modes-3/#vertical-layout" /> + <link rel="help" title="7.1. Principles of Layout in Vertical Writing Modes" href="http://www.w3.org/TR/css-writing-modes-4/#vertical-layout" /> <link rel="help" title="18.4 Dynamic outlines: the 'outline' property" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/ui.html#dynamic-outlines" /> <meta content="" name="flags" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-slr-005.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-slr-005.xht index afc68cc..30d045d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-slr-005.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-slr-005.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: 'writing-mode: sideways-lr' - default page flow (progression) direction</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> + <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> <meta content="image paged" name="flags" /> <meta content="This test checks that when 'writing-mode' is set on the root element, then it determines the default page flow (or progression) direction. In this test, the page flow (or progression) direction is left-to-right." name="assert" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-srl-004.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-srl-004.xht index b12e9c18..d1d1aa6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-srl-004.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/page-flow-direction-srl-004.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: 'writing-mode: sideways-rl' - default page flow (progression) direction</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> + <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> <meta content="image paged" name="flags" /> <meta content="This test checks that when 'writing-mode' is set on the root element, then it determines the default page flow (or progression) direction. In this test, the page flow (or progression) direction is right-to-left." name="assert" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/row-progression-vlr-009.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/row-progression-vlr-009.xht index dbe1613..64ec1cd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/row-progression-vlr-009.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/row-progression-vlr-009.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: vertical-lr - table rows progression (thead, 2 tbodies, tfoot)</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> + <link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#writing-mode" title="3.1 Block Flow Direction: the writing-mode property" /> <link rel="match" href="block-flow-direction-001-ref.xht" /> <meta content="ahem" name="flags" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-001.html index aabe7a70..beb5410 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-001.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-001.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Writing Modes: parsing text-combine-upright with invalid values</title> <link rel="author" title="Masataka Yakura" href="http://google.com/+MasatakaYakura"> -<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#text-combine-upright"> +<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#text-combine-upright"> <meta name="assert" content="text-combine-upright doesn't support undefined keywords and out-of-range integer, and numbers."> <meta name="flags" content="dom invalid"> <script src="/resources/testharness.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-002.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-002.html index ed5ce4e..08a0978 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-002.html +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-combine-upright-parsing-invalid-002.html
@@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>CSS Writing Modes: parsing text-combine-upright with digits plus calc() computing to invalid digits</title> <link rel="author" title="Masataka Yakura" href="http://google.com/+MasatakaYakura"> -<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#text-combine-upright"> +<link rel="help" href="http://www.w3.org/TR/css-writing-modes-4/#text-combine-upright"> <link rel="help" href="http://www.w3.org/TR/css-values-3/#calc-notation"> <meta name="assert" content="User Agents ignore text-combine-upright with values `digits calc(...)` if the expression inside `calc()` computes to either numbers or out-of-range integers."> <meta name="flags" content="dom invalid">
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-mixed-slr-015.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-mixed-slr-015.xht index daa1705..c1d57ef 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-mixed-slr-015.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-mixed-slr-015.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: 'writing-mode: sideways-lr' - 'text-orientation: mixed' has no effect</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" title="5.1. Orienting Text: the 'text-orientation' property" href="http://www.w3.org/TR/css-writing-modes-3/#text-orientation" /> + <link rel="help" title="5.1. Orienting Text: the 'text-orientation' property" href="http://www.w3.org/TR/css-writing-modes-4/#text-orientation" /> <meta name="flags" content="image" /> <meta name="assert" content="This test checks that when 'writing-mode' is set to 'sideways-lr', then a 'text-orientation: mixed' declaration has no effect: the alphabetical baseline is used as the dominant baseline and all the glyphs remain rotated 90 degrees counter-clockwise. The typographic mode for 'sideways-lr' is horizontal and 'text-orientation' has no effect on boxes in horizontal typographic modes." />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-sideways-slr-019.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-sideways-slr-019.xht index edaefc7..9751a85 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-sideways-slr-019.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-sideways-slr-019.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: 'writing-mode: sideways-lr' - 'text-orientation: sideways' has no effect</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" title="5.1. Orienting Text: the 'text-orientation' property" href="http://www.w3.org/TR/css-writing-modes-3/#text-orientation" /> + <link rel="help" title="5.1. Orienting Text: the 'text-orientation' property" href="http://www.w3.org/TR/css-writing-modes-4/#text-orientation" /> <meta name="flags" content="image" /> <meta name="assert" content="This test checks that when 'writing-mode' is set to 'sideways-lr', then a 'text-orientation: sideways' declaration has no effect: the alphabetical baseline is used as the dominant baseline and all the glyphs remain rotated 90 degrees counter-clockwise. The typographic mode for 'sideways-lr' is horizontal and 'text-orientation' has no effect on boxes in horizontal typographic modes." />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-upright-slr-017.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-upright-slr-017.xht index a668d13d..eb67dde 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-upright-slr-017.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/text-orientation-upright-slr-017.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: 'writing-mode: sideways-lr' - 'text-orientation: upright' has no effect</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" title="5.1. Orienting Text: the 'text-orientation' property" href="http://www.w3.org/TR/css-writing-modes-3/#text-orientation" /> + <link rel="help" title="5.1. Orienting Text: the 'text-orientation' property" href="http://www.w3.org/TR/css-writing-modes-4/#text-orientation" /> <meta name="flags" content="image" /> <meta name="assert" content="This test checks that when 'writing-mode' is set to 'sideways-lr', then a 'text-orientation: upright' declaration has no effect: the alphabetical baseline is used as the dominant baseline and all the glyphs remain rotated 90 degrees counter-clockwise. The typographic mode for 'sideways-lr' is horizontal and 'text-orientation' has no effect on boxes in horizontal typographic modes." />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-037.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-037.xht index 2fa71091..2ce7a16 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-037.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-037.xht
@@ -4,7 +4,7 @@ <title>CSS Writing Modes Test: vertical-align - 'super' and sideways-lr writing-mode</title> <link rel="author" title="Hajime Shiozawa" href="mailto:hajime.shiozawa@gmail.com" /> <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2015-12-11 --> - <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-3/#line-mappings" /> + <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-4/#line-mappings" /> <link rel="help" title="10.8.1 Leading and half-leading" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#leading" /> <meta name="assert" content="This test checks the position of inline non-replaced box with vertical align property. When 'writing-mode' is 'sideways-lr' and 'vertical-align' is 'super', the baseline of the box is shifted to the left." /> <meta name="flags" content="ahem" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-039.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-039.xht index 87a76f3..4421bf4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-039.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-slr-039.xht
@@ -4,7 +4,7 @@ <title>CSS Writing Modes Test: vertical-align - 'sub' and sideways-lr writing-mode</title> <link rel="author" title="Hajime Shiozawa" href="mailto:hajime.shiozawa@gmail.com" /> <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2015-12-11 --> - <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-3/#line-mappings" /> + <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-4/#line-mappings" /> <link rel="help" title="10.8.1 Leading and half-leading" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#leading" /> <meta name="assert" content="This test checks the position of inline non-replaced box with vertical align property. When 'writing-mode' is 'sideways-lr' and 'vertical-align' is 'sub', the baseline of the box is shifted to the right." /> <meta name="flags" content="ahem" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-036.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-036.xht index af38d90a..59d49496 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-036.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-036.xht
@@ -4,7 +4,7 @@ <title>CSS Writing Modes Test: vertical-align - 'super' and sideways-rl writing-mode</title> <link rel="author" title="Hajime Shiozawa" href="mailto:hajime.shiozawa@gmail.com" /> <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2015-12-11 --> - <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-3/#line-mappings" /> + <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-4/#line-mappings" /> <link rel="help" title="10.8.1 Leading and half-leading" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#leading" /> <meta name="assert" content="This test checks the position of inline non-replaced box with vertical align property. When 'writing-mode' is 'sideways-rl' and 'vertical-align' is 'super', the baseline of the box is shifted to the right." /> <meta name="flags" content="ahem" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-038.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-038.xht index 941149a..c8aa9756 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-038.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/vertical-alignment-srl-038.xht
@@ -4,7 +4,7 @@ <title>CSS Writing Modes Test: vertical-align - 'sub' and sideways-rl writing-mode</title> <link rel="author" title="Hajime Shiozawa" href="mailto:hajime.shiozawa@gmail.com" /> <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2015-12-11 --> - <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-3/#line-mappings" /> + <link rel="help" title="7.5 Line-Relative Mappings" href="http://www.w3.org/TR/css-writing-modes-4/#line-mappings" /> <link rel="help" title="10.8.1 Leading and half-leading" href="http://www.w3.org/TR/2011/REC-CSS2-20110607/visudet.html#leading" /> <meta name="assert" content="This test checks the position of inline non-replaced box with vertical align property. When 'writing-mode' is 'sideways-rl' and 'vertical-align' is 'sub', the baseline of the box is shifted to the left." /> <meta name="flags" content="ahem" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/wm-propagation-body-008.xht b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/wm-propagation-body-008.xht index 788afb70..feeb857 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/wm-propagation-body-008.xht +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-writing-modes/wm-propagation-body-008.xht
@@ -7,7 +7,7 @@ <title>CSS Writing Modes Test: 'writing-mode: sideways-rl' set to body element propagates to viewport</title> <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> - <link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow" title="8. The Principal Writing Mode" /> + <link rel="help" href="https://www.w3.org/TR/css-writing-modes-4/#principal-flow" title="8. The Principal Writing Mode" /> <link rel="match" href="block-flow-direction-025-ref.xht" /> <meta name="flags" content="image" />
diff --git a/third_party/WebKit/LayoutTests/external/wpt/entries-api/interfaces-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/entries-api/interfaces-expected.txt index 275fe697..1d7771b5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/entries-api/interfaces-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/entries-api/interfaces-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 92 tests; 49 PASS, 43 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 68 tests; 25 PASS, 43 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS Entries API: IDL PASS File interface: attribute webkitRelativePath PASS Unscopable handled correctly for webkitRelativePath property on File @@ -12,12 +12,6 @@ PASS HTMLInputElement interface: document.createElement("input") must inherit property "webkitEntries" with the proper type PASS DataTransferItem interface: operation webkitGetAsEntry() PASS Unscopable handled correctly for webkitGetAsEntry() on DataTransferItem -PASS ErrorCallback interface: existence and properties of interface object -PASS ErrorCallback interface: existence and properties of interface prototype object -PASS ErrorCallback interface: existence and properties of interface prototype object's "constructor" property -PASS ErrorCallback interface: existence and properties of interface prototype object's @@unscopables property -PASS ErrorCallback interface: operation handleEvent(DOMException) -PASS Unscopable handled correctly for handleEvent(DOMException) on ErrorCallback FAIL FileSystemEntry interface: existence and properties of interface object assert_own_property: self does not have own property "FileSystemEntry" expected property "FileSystemEntry" missing FAIL FileSystemEntry interface object length assert_own_property: self does not have own property "FileSystemEntry" expected property "FileSystemEntry" missing FAIL FileSystemEntry interface object name assert_own_property: self does not have own property "FileSystemEntry" expected property "FileSystemEntry" missing @@ -48,12 +42,6 @@ PASS Unscopable handled correctly for getFile(USVString, FileSystemFlags, FileSystemEntryCallback, ErrorCallback) on FileSystemDirectoryEntry FAIL FileSystemDirectoryEntry interface: operation getDirectory(USVString, FileSystemFlags, FileSystemEntryCallback, ErrorCallback) assert_own_property: self does not have own property "FileSystemDirectoryEntry" expected property "FileSystemDirectoryEntry" missing PASS Unscopable handled correctly for getDirectory(USVString, FileSystemFlags, FileSystemEntryCallback, ErrorCallback) on FileSystemDirectoryEntry -PASS FileSystemEntryCallback interface: existence and properties of interface object -PASS FileSystemEntryCallback interface: existence and properties of interface prototype object -PASS FileSystemEntryCallback interface: existence and properties of interface prototype object's "constructor" property -PASS FileSystemEntryCallback interface: existence and properties of interface prototype object's @@unscopables property -PASS FileSystemEntryCallback interface: operation handleEvent(FileSystemEntry) -PASS Unscopable handled correctly for handleEvent(FileSystemEntry) on FileSystemEntryCallback FAIL FileSystemDirectoryReader interface: existence and properties of interface object assert_own_property: self does not have own property "FileSystemDirectoryReader" expected property "FileSystemDirectoryReader" missing FAIL FileSystemDirectoryReader interface object length assert_own_property: self does not have own property "FileSystemDirectoryReader" expected property "FileSystemDirectoryReader" missing FAIL FileSystemDirectoryReader interface object name assert_own_property: self does not have own property "FileSystemDirectoryReader" expected property "FileSystemDirectoryReader" missing @@ -62,12 +50,6 @@ FAIL FileSystemDirectoryReader interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "FileSystemDirectoryReader" expected property "FileSystemDirectoryReader" missing FAIL FileSystemDirectoryReader interface: operation readEntries(FileSystemEntriesCallback, ErrorCallback) assert_own_property: self does not have own property "FileSystemDirectoryReader" expected property "FileSystemDirectoryReader" missing PASS Unscopable handled correctly for readEntries(FileSystemEntriesCallback, ErrorCallback) on FileSystemDirectoryReader -PASS FileSystemEntriesCallback interface: existence and properties of interface object -PASS FileSystemEntriesCallback interface: existence and properties of interface prototype object -PASS FileSystemEntriesCallback interface: existence and properties of interface prototype object's "constructor" property -PASS FileSystemEntriesCallback interface: existence and properties of interface prototype object's @@unscopables property -PASS FileSystemEntriesCallback interface: operation handleEvent([object Object]) -PASS Unscopable handled correctly for handleEvent([object Object]) on FileSystemEntriesCallback FAIL FileSystemFileEntry interface: existence and properties of interface object assert_own_property: self does not have own property "FileSystemFileEntry" expected property "FileSystemFileEntry" missing FAIL FileSystemFileEntry interface object length assert_own_property: self does not have own property "FileSystemFileEntry" expected property "FileSystemFileEntry" missing FAIL FileSystemFileEntry interface object name assert_own_property: self does not have own property "FileSystemFileEntry" expected property "FileSystemFileEntry" missing @@ -76,12 +58,6 @@ FAIL FileSystemFileEntry interface: existence and properties of interface prototype object's @@unscopables property assert_own_property: self does not have own property "FileSystemFileEntry" expected property "FileSystemFileEntry" missing FAIL FileSystemFileEntry interface: operation file(FileCallback, ErrorCallback) assert_own_property: self does not have own property "FileSystemFileEntry" expected property "FileSystemFileEntry" missing PASS Unscopable handled correctly for file(FileCallback, ErrorCallback) on FileSystemFileEntry -PASS FileCallback interface: existence and properties of interface object -PASS FileCallback interface: existence and properties of interface prototype object -PASS FileCallback interface: existence and properties of interface prototype object's "constructor" property -PASS FileCallback interface: existence and properties of interface prototype object's @@unscopables property -PASS FileCallback interface: operation handleEvent(File) -PASS Unscopable handled correctly for handleEvent(File) on FileCallback FAIL FileSystem interface: existence and properties of interface object assert_own_property: self does not have own property "FileSystem" expected property "FileSystem" missing FAIL FileSystem interface object length assert_own_property: self does not have own property "FileSystem" expected property "FileSystem" missing FAIL FileSystem interface object name assert_own_property: self does not have own property "FileSystem" expected property "FileSystem" missing
diff --git a/third_party/WebKit/LayoutTests/external/wpt/interfaces/entries-api.idl b/third_party/WebKit/LayoutTests/external/wpt/interfaces/entries-api.idl index bef08ab..8e177e1d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/interfaces/entries-api.idl +++ b/third_party/WebKit/LayoutTests/external/wpt/interfaces/entries-api.idl
@@ -1,3 +1,6 @@ +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the File and Directory Entries API spec. +// See https://wicg.github.io/entries-api/ partial interface File { readonly attribute USVString webkitRelativePath; @@ -12,9 +15,7 @@ FileSystemEntry? webkitGetAsEntry(); }; -callback interface ErrorCallback { - void handleEvent(DOMException err); -}; +callback ErrorCallback = void (DOMException err); interface FileSystemEntry { readonly attribute boolean isFile; @@ -44,25 +45,19 @@ boolean exclusive = false; }; -callback interface FileSystemEntryCallback { - void handleEvent(FileSystemEntry entry); -}; +callback FileSystemEntryCallback = void (FileSystemEntry entry); interface FileSystemDirectoryReader { void readEntries(FileSystemEntriesCallback successCallback, optional ErrorCallback errorCallback); }; -callback interface FileSystemEntriesCallback { - void handleEvent(sequence<FileSystemEntry> entries); -}; +callback FileSystemEntriesCallback = void (sequence<FileSystemEntry> entries); interface FileSystemFileEntry : FileSystemEntry { void file(FileCallback successCallback, optional ErrorCallback errorCallback); }; -callback interface FileCallback { - void handleEvent(File file); -}; +callback FileCallback = void (File file); interface FileSystem { readonly attribute USVString name;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/interfaces/payment-request.idl b/third_party/WebKit/LayoutTests/external/wpt/interfaces/payment-request.idl index beb6d5f..4568fd8c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/interfaces/payment-request.idl +++ b/third_party/WebKit/LayoutTests/external/wpt/interfaces/payment-request.idl
@@ -68,6 +68,7 @@ readonly attribute DOMString country; readonly attribute FrozenArray<DOMString> addressLine; readonly attribute DOMString region; + readonly attribute DOMString regionCode; readonly attribute DOMString city; readonly attribute DOMString dependentLocality; readonly attribute DOMString postalCode;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/interfaces/uievents.idl b/third_party/WebKit/LayoutTests/external/wpt/interfaces/uievents.idl index 5964ee8..a2738878 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/interfaces/uievents.idl +++ b/third_party/WebKit/LayoutTests/external/wpt/interfaces/uievents.idl
@@ -1,4 +1,8 @@ -[Constructor(DOMString type, optional UIEventInit eventInitDict)] +// GENERATED CONTENT - DO NOT EDIT +// Content of this file was automatically extracted from the UI Events spec. +// See https://w3c.github.io/uievents/ + +[Constructor(DOMString type, optional UIEventInit eventInitDict), Exposed=Window] interface UIEvent : Event { readonly attribute Window? view; readonly attribute long detail; @@ -9,7 +13,7 @@ long detail = 0; }; -[Constructor(DOMString type, optional FocusEventInit eventInitDict)] +[Constructor(DOMString type, optional FocusEventInit eventInitDict), Exposed=Window] interface FocusEvent : UIEvent { readonly attribute EventTarget? relatedTarget; }; @@ -18,7 +22,7 @@ EventTarget? relatedTarget = null; }; -[Constructor(DOMString type, optional MouseEventInit eventInitDict)] +[Constructor(DOMString type, optional MouseEventInit eventInitDict), Exposed=Window] interface MouseEvent : UIEvent { readonly attribute long screenX; readonly attribute long screenY; @@ -67,7 +71,7 @@ boolean modifierSymbolLock = false; }; -[Constructor(DOMString type, optional WheelEventInit eventInitDict)] +[Constructor(DOMString type, optional WheelEventInit eventInitDict), Exposed=Window] interface WheelEvent : MouseEvent { // DeltaModeCode const unsigned long DOM_DELTA_PIXEL = 0x00; @@ -87,19 +91,18 @@ unsigned long deltaMode = 0; }; -[Constructor(DOMString type, optional InputEventInit eventInitDict)] +[Constructor(DOMString type, optional InputEventInit eventInitDict), Exposed=Window] interface InputEvent : UIEvent { readonly attribute DOMString? data; readonly attribute boolean isComposing; }; - dictionary InputEventInit : UIEventInit { DOMString? data = ""; boolean isComposing = false; }; -[Constructor(DOMString type, optional KeyboardEventInit eventInitDict)] +[Constructor(DOMString type, optional KeyboardEventInit eventInitDict), Exposed=Window] interface KeyboardEvent : UIEvent { // KeyLocationCode const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; @@ -130,7 +133,7 @@ boolean isComposing = false; }; -[Constructor(DOMString type, optional CompositionEventInit eventInitDict)] +[Constructor(DOMString type, optional CompositionEventInit eventInitDict), Exposed=Window] interface CompositionEvent : UIEvent { readonly attribute DOMString data; };
diff --git a/third_party/WebKit/LayoutTests/external/wpt/interfaces/url.idl b/third_party/WebKit/LayoutTests/external/wpt/interfaces/url.idl new file mode 100644 index 0000000..aefaa56c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/interfaces/url.idl
@@ -0,0 +1,35 @@ +[Constructor(USVString url, optional USVString base), + Exposed=(Window,Worker), + LegacyWindowAlias=webkitURL] +interface URL { + stringifier attribute USVString href; + readonly attribute USVString origin; + attribute USVString protocol; + attribute USVString username; + attribute USVString password; + attribute USVString host; + attribute USVString hostname; + attribute USVString port; + attribute USVString pathname; + attribute USVString search; + [SameObject] readonly attribute URLSearchParams searchParams; + attribute USVString hash; + + USVString toJSON(); +}; + +[Constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""), + Exposed=(Window,Worker)] +interface URLSearchParams { + void append(USVString name, USVString value); + void delete(USVString name); + USVString? get(USVString name); + sequence<USVString> getAll(USVString name); + boolean has(USVString name); + void set(USVString name, USVString value); + + void sort(); + + iterable<USVString, USVString>; + stringifier; +};
diff --git a/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist b/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist index 7ed377a..032303a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist +++ b/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist
@@ -110,9 +110,10 @@ # Intentional use of tabs INDENT TABS: html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html -# Test generation files containing print statements +# Intentional use of print statements PRINT STATEMENT: dom/nodes/Document-createElement-namespace-tests/generate.py PRINT STATEMENT: encrypted-media/polyfill/make-polyfill-tests.py +PRINT STATEMENT: webdriver/tests/support/fixtures.py # semi-legitimate use of console.* CONSOLE: console/*
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html b/third_party/WebKit/LayoutTests/external/wpt/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html index 6f14e8a..3925cdd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html
@@ -67,23 +67,38 @@ <li> <button onclick=" const expectedAddress = { - country: 'AF', - addressLine: '1 wpt street', - region: '', - city: 'Kabul', + country: 'AU', + regionCode: 'AU-QLD', + addressLine: '55 test st', + city: 'Chapel Hill', dependentLocality: '', - postalCode: '1001', + postalCode: '6095', sortingCode: '', - languageCode: 'fa', + languageCode: 'en', organization: 'w3c', recipient: 'web platform test', - phone: '+93555555555', + phone: '+61733780000', }; runManualTest(this, expectedAddress);"> If the requestShipping member is true, then shippingAddress's PaymentAddress must match the expected values. </button> - "web platform test" as recipient, at address "1 wpt street" in "Kabul, Afghanistan", zip/postal code 1001. - Set the organization to "w3c". Set the phone number to "+93 55 555 5555" + Please use: + <dl> + <dt>Recipient:</dt> + <dd>web platform test</dd> + <dt>Address line:</dt> + <dd>55 test st</dd> + <dt>Country</dt> + <dd>Australia</dd> + <dt>Suburb</dt> + <dd>Chapel Hill</dd> + <dt>postal code </dt> + <dd>6095</dd> + <dt>organization</dt> + <dd>w3c</dd> + <dt>Phone number</dt> + <dd>+61 7 3378 0000</dd> + </dl> </li> </ol> <small>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/interfaces.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/payment-request/interfaces.https-expected.txt new file mode 100644 index 0000000..1ee2f49 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/interfaces.https-expected.txt
@@ -0,0 +1,105 @@ +This is a testharness.js-based test. +PASS Setup for Payment Request API IDL tests. +PASS PaymentRequest interface: existence and properties of interface object +PASS PaymentRequest interface object length +PASS PaymentRequest interface object name +PASS PaymentRequest interface: existence and properties of interface prototype object +PASS PaymentRequest interface: existence and properties of interface prototype object's "constructor" property +PASS PaymentRequest interface: existence and properties of interface prototype object's @@unscopables property +PASS PaymentRequest interface: operation show() +PASS Unscopable handled correctly for show() on PaymentRequest +PASS PaymentRequest interface: operation abort() +PASS Unscopable handled correctly for abort() on PaymentRequest +PASS PaymentRequest interface: operation canMakePayment() +PASS Unscopable handled correctly for canMakePayment() on PaymentRequest +PASS PaymentRequest interface: attribute id +PASS Unscopable handled correctly for id property on PaymentRequest +PASS PaymentRequest interface: attribute shippingAddress +PASS Unscopable handled correctly for shippingAddress property on PaymentRequest +PASS PaymentRequest interface: attribute shippingOption +PASS Unscopable handled correctly for shippingOption property on PaymentRequest +PASS PaymentRequest interface: attribute shippingType +PASS Unscopable handled correctly for shippingType property on PaymentRequest +PASS PaymentRequest interface: attribute onshippingaddresschange +PASS Unscopable handled correctly for onshippingaddresschange property on PaymentRequest +PASS PaymentRequest interface: attribute onshippingoptionchange +PASS Unscopable handled correctly for onshippingoptionchange property on PaymentRequest +PASS PaymentRequest must be primary interface of new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) +PASS Stringification of new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "show()" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "abort()" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "canMakePayment()" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "id" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "shippingAddress" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "shippingOption" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "shippingType" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "onshippingaddresschange" with the proper type +PASS PaymentRequest interface: new PaymentRequest([{supportedMethods: 'foo'}], {total: {label: 'bar', amount: {currency: 'USD', value: '0'}} }) must inherit property "onshippingoptionchange" with the proper type +PASS PaymentAddress interface: existence and properties of interface object +PASS PaymentAddress interface object length +PASS PaymentAddress interface object name +PASS PaymentAddress interface: existence and properties of interface prototype object +PASS PaymentAddress interface: existence and properties of interface prototype object's "constructor" property +PASS PaymentAddress interface: existence and properties of interface prototype object's @@unscopables property +PASS PaymentAddress interface: operation toJSON() +PASS Unscopable handled correctly for toJSON() on PaymentAddress +PASS PaymentAddress interface: attribute country +PASS Unscopable handled correctly for country property on PaymentAddress +PASS PaymentAddress interface: attribute addressLine +PASS Unscopable handled correctly for addressLine property on PaymentAddress +PASS PaymentAddress interface: attribute region +PASS Unscopable handled correctly for region property on PaymentAddress +FAIL PaymentAddress interface: attribute regionCode assert_true: The prototype object must have a property "regionCode" expected true got false +PASS Unscopable handled correctly for regionCode property on PaymentAddress +PASS PaymentAddress interface: attribute city +PASS Unscopable handled correctly for city property on PaymentAddress +PASS PaymentAddress interface: attribute dependentLocality +PASS Unscopable handled correctly for dependentLocality property on PaymentAddress +PASS PaymentAddress interface: attribute postalCode +PASS Unscopable handled correctly for postalCode property on PaymentAddress +PASS PaymentAddress interface: attribute sortingCode +PASS Unscopable handled correctly for sortingCode property on PaymentAddress +PASS PaymentAddress interface: attribute languageCode +PASS Unscopable handled correctly for languageCode property on PaymentAddress +PASS PaymentAddress interface: attribute organization +PASS Unscopable handled correctly for organization property on PaymentAddress +PASS PaymentAddress interface: attribute recipient +PASS Unscopable handled correctly for recipient property on PaymentAddress +PASS PaymentAddress interface: attribute phone +PASS Unscopable handled correctly for phone property on PaymentAddress +PASS PaymentResponse interface: existence and properties of interface object +PASS PaymentResponse interface object length +PASS PaymentResponse interface object name +PASS PaymentResponse interface: existence and properties of interface prototype object +PASS PaymentResponse interface: existence and properties of interface prototype object's "constructor" property +PASS PaymentResponse interface: existence and properties of interface prototype object's @@unscopables property +PASS PaymentResponse interface: operation toJSON() +PASS Unscopable handled correctly for toJSON() on PaymentResponse +PASS PaymentResponse interface: attribute requestId +PASS Unscopable handled correctly for requestId property on PaymentResponse +PASS PaymentResponse interface: attribute methodName +PASS Unscopable handled correctly for methodName property on PaymentResponse +PASS PaymentResponse interface: attribute details +PASS Unscopable handled correctly for details property on PaymentResponse +PASS PaymentResponse interface: attribute shippingAddress +PASS Unscopable handled correctly for shippingAddress property on PaymentResponse +PASS PaymentResponse interface: attribute shippingOption +PASS Unscopable handled correctly for shippingOption property on PaymentResponse +PASS PaymentResponse interface: attribute payerName +PASS Unscopable handled correctly for payerName property on PaymentResponse +PASS PaymentResponse interface: attribute payerEmail +PASS Unscopable handled correctly for payerEmail property on PaymentResponse +PASS PaymentResponse interface: attribute payerPhone +PASS Unscopable handled correctly for payerPhone property on PaymentResponse +PASS PaymentResponse interface: operation complete(PaymentComplete) +PASS Unscopable handled correctly for complete(PaymentComplete) on PaymentResponse +PASS PaymentRequestUpdateEvent interface: existence and properties of interface object +PASS PaymentRequestUpdateEvent interface object length +PASS PaymentRequestUpdateEvent interface object name +PASS PaymentRequestUpdateEvent interface: existence and properties of interface prototype object +PASS PaymentRequestUpdateEvent interface: existence and properties of interface prototype object's "constructor" property +PASS PaymentRequestUpdateEvent interface: existence and properties of interface prototype object's @@unscopables property +PASS PaymentRequestUpdateEvent interface: operation updateWith([object Object]) +PASS Unscopable handled correctly for updateWith([object Object]) on PaymentRequestUpdateEvent +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https-expected.txt index 59459ec..d70dc69 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -FAIL Clients.matchAll() should not show an old window as controlled after it navigates. assert_unreached: unexpected rejection: assert_equals: client should have expected frame type expected "top-level" but got "auxiliary" Reached unreachable code -FAIL Clients.matchAll() should not show an old window after it navigates. assert_unreached: unexpected rejection: assert_equals: client should have expected frame type expected "top-level" but got "auxiliary" Reached unreachable code +FAIL Clients.matchAll() should not show an old window as controlled after it navigates. assert_unreached: unexpected rejection: assert_equals: client should have expected frame type expected "auxiliary" but got "top-level" Reached unreachable code +FAIL Clients.matchAll() should not show an old window after it navigates. assert_unreached: unexpected rejection: assert_equals: client should have expected frame type expected "auxiliary" but got "top-level" Reached unreachable code Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html index 3c8533a8..46d32a48 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigate-window.https.html
@@ -94,9 +94,9 @@ resultList.sort(compare_urls); for (var i = 0; i < resultList.length; ++i) { - assert_equals(expected[i].url, resultList[i].url, + assert_equals(resultList[i].url, expected[i].url, 'client should have expected url'); - assert_equals(expected[i].frameType, resultList[i].frameType, + assert_equals(resultList[i].frameType, expected[i].frameType, 'client should have expected frame type'); } return win;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward-expected.txt new file mode 100644 index 0000000..0366315 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object] (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called) +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true assert_throws: function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Errors must be propagated backward: erroring via the controller errors once pending write completes +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.dedicatedworker-expected.txt new file mode 100644 index 0000000..0366315 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.dedicatedworker-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object] (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called) +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true assert_throws: function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Errors must be propagated backward: erroring via the controller errors once pending write completes +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.js b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.js index 5dd9fea..dda5774e1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.js
@@ -548,7 +548,7 @@ return rs.pipeTo(ws).then( () => assert_unreached('the promise must not fulfill'), err => { - assert_equals(err.name, 'TypeError', 'the promise must reject with a TypeError (_not_ with error1)'); + assert_equals(err, error1, 'the promise must reject with error1'); assert_array_equals(rs.eventsWithoutPulls, ['cancel', err]); assert_array_equals(ws.events, ['abort', error1]); @@ -575,7 +575,7 @@ return ws.getWriter().closed.then( () => assert_unreached('the promise must not fulfill'), err => { - assert_equals(err.name, 'TypeError', 'the promise must reject with a TypeError (_not_ with error1)'); + assert_equals(err, error1, 'the promise must reject with error1'); assert_array_equals(rs.eventsWithoutPulls, ['cancel', err]); assert_array_equals(ws.events, ['abort', error1]); @@ -594,7 +594,7 @@ ws.abort(error1); - return promise_rejects(t, new TypeError(), rs.pipeTo(ws, { preventCancel: true })).then(() => { + return promise_rejects(t, error1, rs.pipeTo(ws, { preventCancel: true })).then(() => { assert_array_equals(rs.eventsWithoutPulls, []); assert_array_equals(ws.events, ['abort', error1]); });
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.serviceworker.https-expected.txt new file mode 100644 index 0000000..276b168 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.serviceworker.https-expected.txt
@@ -0,0 +1,39 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object] (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called) +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true assert_throws: function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Errors must be propagated backward: erroring via the controller errors once pending write completes +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.sharedworker-expected.txt new file mode 100644 index 0000000..0366315 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/error-propagation-backward.sharedworker-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Errors must be propagated backward: starts errored; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = undefined (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = null (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = false (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = -0 (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = NaN (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = (falsy); fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = a (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = 1 (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = Symbol() (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = [object Object] (truthy) +PASS Errors must be propagated backward: becomes errored before piping due to write, preventCancel = true; preventAbort = true +PASS Errors must be propagated backward: becomes errored before piping due to write; preventCancel = true, preventAbort = true, preventClose = true +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write; preventCancel = true +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored during piping due to write, but async; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel omitted; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel omitted (but cancel is never called) +PASS Errors must be propagated backward: becomes errored after piping due to last write; source is closed; preventCancel = true +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; fulfilled cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = false; rejected cancel promise +PASS Errors must be propagated backward: becomes errored after piping; dest never desires chunks; preventCancel = true +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; fulfilled cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel omitted; rejected cancel promise assert_equals: the promise must reject with error1 expected object "error1: error1!" but got object "TypeError: The stream is in the process of being aborted" +FAIL Errors must be propagated backward: becomes errored before piping via abort; preventCancel = true assert_throws: function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Errors must be propagated backward: erroring via the controller errors once pending write completes +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation-expected.txt new file mode 100644 index 0000000..d11cac8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +PASS Piping from an errored readable stream to an errored writable stream +PASS Piping from an errored readable stream to an errored writable stream; preventAbort = true +FAIL Piping from an errored readable stream to a closing writable stream assert_throws: closed must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Piping from an errored readable stream to a closed writable stream +PASS Piping from a closed readable stream to an errored writable stream +PASS Piping from a closed readable stream to a closed writable stream +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.dedicatedworker-expected.txt new file mode 100644 index 0000000..d11cac8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.dedicatedworker-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +PASS Piping from an errored readable stream to an errored writable stream +PASS Piping from an errored readable stream to an errored writable stream; preventAbort = true +FAIL Piping from an errored readable stream to a closing writable stream assert_throws: closed must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Piping from an errored readable stream to a closed writable stream +PASS Piping from a closed readable stream to an errored writable stream +PASS Piping from a closed readable stream to a closed writable stream +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.js b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.js index 447433f..4edc7c1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.js
@@ -80,10 +80,10 @@ return Promise.all([ promise_rejects(t, error1, rs.getReader().closed, 'the readable stream must be errored with error1'), - promise_rejects(t, new TypeError(), ws.getWriter().closed, - 'closed must reject with a TypeError indicating the writable stream was aborted'), - promise_rejects(t, new TypeError(), closePromise, - 'close() must reject with a TypeError indicating the writable stream was aborted'), + promise_rejects(t, error1, ws.getWriter().closed, + 'closed must reject with error1'), + promise_rejects(t, error1, closePromise, + 'close() must reject with error1') ]); });
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.serviceworker.https-expected.txt new file mode 100644 index 0000000..80566ad --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.serviceworker.https-expected.txt
@@ -0,0 +1,10 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS Piping from an errored readable stream to an errored writable stream +PASS Piping from an errored readable stream to an errored writable stream; preventAbort = true +FAIL Piping from an errored readable stream to a closing writable stream assert_throws: closed must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Piping from an errored readable stream to a closed writable stream +PASS Piping from a closed readable stream to an errored writable stream +PASS Piping from a closed readable stream to a closed writable stream +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.sharedworker-expected.txt new file mode 100644 index 0000000..d11cac8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/piping/multiple-propagation.sharedworker-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +PASS Piping from an errored readable stream to an errored writable stream +PASS Piping from an errored readable stream to an errored writable stream; preventAbort = true +FAIL Piping from an errored readable stream to a closing writable stream assert_throws: closed must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1!" ("error1") +PASS Piping from an errored readable stream to a closed writable stream +PASS Piping from a closed readable stream to an errored writable stream +PASS Piping from a closed readable stream to a closed writable stream +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors-expected.txt new file mode 100644 index 0000000..48f2afa1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS TransformStream errors thrown in transform put the writable and readable in an errored state +PASS TransformStream errors thrown in flush put the writable and readable in an errored state +PASS errored TransformStream should not enqueue new chunks +PASS TransformStream transformer.start() rejected promise should error the stream +PASS when controller.error is followed by a rejection, the error reason should come from controller.error +PASS TransformStream constructor should throw when start does +PASS when strategy.size throws inside start(), the constructor should throw the same error +PASS when strategy.size calls controller.error() then throws, the constructor should throw the first error +PASS cancelling the readable side should error the writable +PASS it should be possible to error the readable between close requested and complete +PASS an exception from transform() should error the stream if terminate has been requested but not completed +FAIL abort should set the close reason for the writable when it happens before cancel during start, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL abort should set the close reason for the writable when it happens before cancel during underlying sink write, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing the second time it is called +PASS controller.error() should do nothing after readable.cancel() +FAIL controller.error() should do nothing after writable.abort() has completed assert_throws: closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing after a transformer method has thrown an exception +PASS erroring during write with backpressure should result in the write failing +FAIL a write() that was waiting for backpressure should reject if the writable is aborted assert_throws: write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL the readable should be errored with the reason passed to the writable abort() method assert_throws: read() should reject with thrownError function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.dedicatedworker-expected.txt new file mode 100644 index 0000000..48f2afa1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.dedicatedworker-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS TransformStream errors thrown in transform put the writable and readable in an errored state +PASS TransformStream errors thrown in flush put the writable and readable in an errored state +PASS errored TransformStream should not enqueue new chunks +PASS TransformStream transformer.start() rejected promise should error the stream +PASS when controller.error is followed by a rejection, the error reason should come from controller.error +PASS TransformStream constructor should throw when start does +PASS when strategy.size throws inside start(), the constructor should throw the same error +PASS when strategy.size calls controller.error() then throws, the constructor should throw the first error +PASS cancelling the readable side should error the writable +PASS it should be possible to error the readable between close requested and complete +PASS an exception from transform() should error the stream if terminate has been requested but not completed +FAIL abort should set the close reason for the writable when it happens before cancel during start, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL abort should set the close reason for the writable when it happens before cancel during underlying sink write, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing the second time it is called +PASS controller.error() should do nothing after readable.cancel() +FAIL controller.error() should do nothing after writable.abort() has completed assert_throws: closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing after a transformer method has thrown an exception +PASS erroring during write with backpressure should result in the write failing +FAIL a write() that was waiting for backpressure should reject if the writable is aborted assert_throws: write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL the readable should be errored with the reason passed to the writable abort() method assert_throws: read() should reject with thrownError function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.js b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.js index 83f4984..fdb21545 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.js
@@ -205,7 +205,7 @@ return Promise.all([ abortPromise, cancelPromise, - promise_rejects(t, new TypeError(), writer.closed, 'writer.closed should reject with a TypeError')]); + promise_rejects(t, thrownError, writer.closed, 'writer.closed should reject with thrownError')]); }, 'abort should set the close reason for the writable when it happens before cancel during start, but cancel should ' + 'still succeed'); @@ -229,7 +229,7 @@ writePromise, abortPromise, cancelPromise, - promise_rejects(t, new TypeError(), writer.closed, 'writer.closed should reject with a TypeError')]); + promise_rejects(t, thrownError, writer.closed, 'writer.closed should reject with thrownError')]); }); }, 'abort should set the close reason for the writable when it happens before cancel during underlying sink write, ' + 'but cancel should still succeed'); @@ -269,9 +269,9 @@ controller = c; } }); - return ts.writable.abort().then(() => { + return ts.writable.abort(thrownError).then(() => { controller.error(ignoredError); - return promise_rejects(t, new TypeError(), ts.writable.getWriter().closed, 'closed should reject with a TypeError'); + return promise_rejects(t, thrownError, ts.writable.getWriter().closed, 'closed should reject with thrownError'); }); }, 'controller.error() should do nothing after writable.abort() has completed'); @@ -325,15 +325,22 @@ // write should start synchronously const writePromise = writer.write(0); // The underlying sink's abort() is not called until the write() completes. - const abortPromise = writer.abort(); + const abortPromise = writer.abort(thrownError); // Perform a read to relieve backpressure and permit the write() to complete. const readPromise = ts.readable.getReader().read(); return Promise.all([ - promise_rejects(t, new TypeError(), readPromise, 'read() should reject'), - promise_rejects(t, new TypeError(), writePromise, 'write() should reject'), + promise_rejects(t, thrownError, readPromise, 'read() should reject'), + promise_rejects(t, thrownError, writePromise, 'write() should reject'), abortPromise ]); }); }, 'a write() that was waiting for backpressure should reject if the writable is aborted'); +promise_test(t => { + const ts = new TransformStream(); + ts.writable.abort(thrownError); + const reader = ts.readable.getReader(); + return promise_rejects(t, thrownError, reader.read(), 'read() should reject with thrownError'); +}, 'the readable should be errored with the reason passed to the writable abort() method'); + done();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.serviceworker.https-expected.txt new file mode 100644 index 0000000..b18a87b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.serviceworker.https-expected.txt
@@ -0,0 +1,24 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS TransformStream errors thrown in transform put the writable and readable in an errored state +PASS TransformStream errors thrown in flush put the writable and readable in an errored state +PASS errored TransformStream should not enqueue new chunks +PASS TransformStream transformer.start() rejected promise should error the stream +PASS when controller.error is followed by a rejection, the error reason should come from controller.error +PASS TransformStream constructor should throw when start does +PASS when strategy.size throws inside start(), the constructor should throw the same error +PASS when strategy.size calls controller.error() then throws, the constructor should throw the first error +PASS cancelling the readable side should error the writable +PASS it should be possible to error the readable between close requested and complete +PASS an exception from transform() should error the stream if terminate has been requested but not completed +FAIL abort should set the close reason for the writable when it happens before cancel during start, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL abort should set the close reason for the writable when it happens before cancel during underlying sink write, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing the second time it is called +PASS controller.error() should do nothing after readable.cancel() +FAIL controller.error() should do nothing after writable.abort() has completed assert_throws: closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing after a transformer method has thrown an exception +PASS erroring during write with backpressure should result in the write failing +FAIL a write() that was waiting for backpressure should reject if the writable is aborted assert_throws: write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL the readable should be errored with the reason passed to the writable abort() method assert_throws: read() should reject with thrownError function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.sharedworker-expected.txt new file mode 100644 index 0000000..48f2afa1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/errors.sharedworker-expected.txt
@@ -0,0 +1,23 @@ +This is a testharness.js-based test. +PASS TransformStream errors thrown in transform put the writable and readable in an errored state +PASS TransformStream errors thrown in flush put the writable and readable in an errored state +PASS errored TransformStream should not enqueue new chunks +PASS TransformStream transformer.start() rejected promise should error the stream +PASS when controller.error is followed by a rejection, the error reason should come from controller.error +PASS TransformStream constructor should throw when start does +PASS when strategy.size throws inside start(), the constructor should throw the same error +PASS when strategy.size calls controller.error() then throws, the constructor should throw the first error +PASS cancelling the readable side should error the writable +PASS it should be possible to error the readable between close requested and complete +PASS an exception from transform() should error the stream if terminate has been requested but not completed +FAIL abort should set the close reason for the writable when it happens before cancel during start, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL abort should set the close reason for the writable when it happens before cancel during underlying sink write, but cancel should still succeed assert_throws: writer.closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing the second time it is called +PASS controller.error() should do nothing after readable.cancel() +FAIL controller.error() should do nothing after writable.abort() has completed assert_throws: closed should reject with thrownError function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +PASS controller.error() should do nothing after a transformer method has thrown an exception +PASS erroring during write with backpressure should result in the write failing +FAIL a write() that was waiting for backpressure should reject if the writable is aborted assert_throws: write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +FAIL the readable should be errored with the reason passed to the writable abort() method assert_throws: read() should reject with thrownError function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: bad things are happening!" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies-expected.txt new file mode 100644 index 0000000..b6ed0d8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies-expected.txt
@@ -0,0 +1,14 @@ +This is a testharness.js-based test. +PASS enqueue() inside size() should work +PASS terminate() inside size() should work +PASS error() inside size() should work +PASS desiredSize inside size() should work +PASS readable cancel() inside size() should work +PASS pipeTo() inside size() should work +PASS read() inside of size() should work +PASS writer.write() inside size() should work +PASS synchronous writer.write() inside size() should work +PASS writer.close() inside size() should work +FAIL writer.abort() inside size() should work assert_throws: read() should reject function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: error1" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.dedicatedworker-expected.txt new file mode 100644 index 0000000..b6ed0d8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.dedicatedworker-expected.txt
@@ -0,0 +1,14 @@ +This is a testharness.js-based test. +PASS enqueue() inside size() should work +PASS terminate() inside size() should work +PASS error() inside size() should work +PASS desiredSize inside size() should work +PASS readable cancel() inside size() should work +PASS pipeTo() inside size() should work +PASS read() inside of size() should work +PASS writer.write() inside size() should work +PASS synchronous writer.write() inside size() should work +PASS writer.close() inside size() should work +FAIL writer.abort() inside size() should work assert_throws: read() should reject function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: error1" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.js b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.js index 436552b..50285bb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.js
@@ -317,7 +317,7 @@ // call to TransformStreamDefaultSink. return delay(0).then(() => { controller.enqueue('a'); - return Promise.all([promise_rejects(t, new TypeError(), reader.read(), 'read() should reject'), abortPromise]); + return Promise.all([promise_rejects(t, error1, reader.read(), 'read() should reject'), abortPromise]); }); }, 'writer.abort() inside size() should work');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.serviceworker.https-expected.txt new file mode 100644 index 0000000..4f2b44a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.serviceworker.https-expected.txt
@@ -0,0 +1,15 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS enqueue() inside size() should work +PASS terminate() inside size() should work +PASS error() inside size() should work +PASS desiredSize inside size() should work +PASS readable cancel() inside size() should work +PASS pipeTo() inside size() should work +PASS read() inside of size() should work +PASS writer.write() inside size() should work +PASS synchronous writer.write() inside size() should work +PASS writer.close() inside size() should work +FAIL writer.abort() inside size() should work assert_throws: read() should reject function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: error1" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.sharedworker-expected.txt new file mode 100644 index 0000000..b6ed0d8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/transform-streams/reentrant-strategies.sharedworker-expected.txt
@@ -0,0 +1,14 @@ +This is a testharness.js-based test. +PASS enqueue() inside size() should work +PASS terminate() inside size() should work +PASS error() inside size() should work +PASS desiredSize inside size() should work +PASS readable cancel() inside size() should work +PASS pipeTo() inside size() should work +PASS read() inside of size() should work +PASS writer.write() inside size() should work +PASS synchronous writer.write() inside size() should work +PASS writer.close() inside size() should work +FAIL writer.abort() inside size() should work assert_throws: read() should reject function "function() { throw e }" threw object "TypeError: The writable stream has been aborted" ("TypeError") expected object "error1: error1" ("error1") +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting-expected.txt new file mode 100644 index 0000000..28dfc5c2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting-expected.txt
@@ -0,0 +1,56 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = error1 +Found 51 tests; 26 PASS, 25 FAIL, 0 TIMEOUT, 0 NOTRUN. +FAIL Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() on a released writer rejects +FAIL Aborting a WritableStream immediately prevents future writes assert_throws: write(1) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream prevents further writes after any that are in progress assert_throws: write(2) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +FAIL WritableStream if sink's abort throws, the promise returned by multiple writer.abort()s is the same and rejects assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +FAIL Aborting a WritableStream puts it in an errored state with the error passed to abort() assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Closing but then immediately aborting a WritableStream causes the stream to error assert_throws: close() should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Closing a WritableStream and aborting it while it closes causes the stream to ignore the abort attempt +PASS Aborting a WritableStream after it is closed is a no-op +FAIL WritableStream should NOT call underlying sink's close if no abort is supplied (historical) assert_throws: closed should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS returning a thenable from abort() should work +FAIL .closed should not resolve before fulfilled write() assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL .closed should not resolve before rejected write(); write() error should not overwrite abort() error assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL writes should be satisfied in order when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writes should be satisfied in order after rejected write when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL close() should reject with abort reason why abort() is first error assert_throws: writer.close() should reject with error from underlying write() function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +FAIL an abort() that happens during a write() should trigger the underlying abort() even with a close() queued assert_throws: promise returned by close() should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error assert_throws: ready of the second writer should be rejected with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_throws: writer.ready must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS controller.error(), writer.abort() while there is an in-flight write, and then finish the write +PASS controller.error(), writer.abort() while there is an in-flight close, and then finish the close +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should reject the writer.closed promise +PASS sink abort() should not be called until sink start() is done +PASS if start attempts to error the controller after abort() has been called, then it should lose +PASS stream abort() promise should still resolve if sink start() rejects +FAIL writer abort() during sink start() should replace the writer.ready promise synchronously assert_throws: writerReady2 should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL promises returned from other writer methods should be rejected when writer abort() happens during sink start() assert_throws: second write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() should succeed despite rejection from write +PASS abort() should be rejected with the rejection returned from close() +FAIL a rejecting sink.write() should not prevent sink.abort() from being called assert_throws: closed should reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS when start errors after stream abort(), underlying sink abort() should be called anyway +FAIL when calling abort() twice on the same stream, both should give the same promise that fulfills with undefined assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +FAIL when calling abort() twice on the same stream, but sequentially so so there's no pending abort the second time, both should fulfill with undefined promise_test: Unhandled rejection with value: object "TypeError: The stream is in the process of being aborted" +FAIL calling abort() on an errored stream should fulfill with undefined promise_test: Unhandled rejection with value: object "error1: error1" +PASS sink abort() should not be called if stream was erroring due to controller.error() before abort() was called +PASS sink abort() should not be called if stream was erroring due to bad strategy before abort() was called +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.dedicatedworker-expected.txt new file mode 100644 index 0000000..28dfc5c2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.dedicatedworker-expected.txt
@@ -0,0 +1,56 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = error1 +Found 51 tests; 26 PASS, 25 FAIL, 0 TIMEOUT, 0 NOTRUN. +FAIL Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() on a released writer rejects +FAIL Aborting a WritableStream immediately prevents future writes assert_throws: write(1) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream prevents further writes after any that are in progress assert_throws: write(2) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +FAIL WritableStream if sink's abort throws, the promise returned by multiple writer.abort()s is the same and rejects assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +FAIL Aborting a WritableStream puts it in an errored state with the error passed to abort() assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Closing but then immediately aborting a WritableStream causes the stream to error assert_throws: close() should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Closing a WritableStream and aborting it while it closes causes the stream to ignore the abort attempt +PASS Aborting a WritableStream after it is closed is a no-op +FAIL WritableStream should NOT call underlying sink's close if no abort is supplied (historical) assert_throws: closed should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS returning a thenable from abort() should work +FAIL .closed should not resolve before fulfilled write() assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL .closed should not resolve before rejected write(); write() error should not overwrite abort() error assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL writes should be satisfied in order when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writes should be satisfied in order after rejected write when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL close() should reject with abort reason why abort() is first error assert_throws: writer.close() should reject with error from underlying write() function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +FAIL an abort() that happens during a write() should trigger the underlying abort() even with a close() queued assert_throws: promise returned by close() should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error assert_throws: ready of the second writer should be rejected with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_throws: writer.ready must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS controller.error(), writer.abort() while there is an in-flight write, and then finish the write +PASS controller.error(), writer.abort() while there is an in-flight close, and then finish the close +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should reject the writer.closed promise +PASS sink abort() should not be called until sink start() is done +PASS if start attempts to error the controller after abort() has been called, then it should lose +PASS stream abort() promise should still resolve if sink start() rejects +FAIL writer abort() during sink start() should replace the writer.ready promise synchronously assert_throws: writerReady2 should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL promises returned from other writer methods should be rejected when writer abort() happens during sink start() assert_throws: second write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() should succeed despite rejection from write +PASS abort() should be rejected with the rejection returned from close() +FAIL a rejecting sink.write() should not prevent sink.abort() from being called assert_throws: closed should reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS when start errors after stream abort(), underlying sink abort() should be called anyway +FAIL when calling abort() twice on the same stream, both should give the same promise that fulfills with undefined assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +FAIL when calling abort() twice on the same stream, but sequentially so so there's no pending abort the second time, both should fulfill with undefined promise_test: Unhandled rejection with value: object "TypeError: The stream is in the process of being aborted" +FAIL calling abort() on an errored stream should fulfill with undefined promise_test: Unhandled rejection with value: object "error1: error1" +PASS sink abort() should not be called if stream was erroring due to controller.error() before abort() was called +PASS sink abort() should not be called if stream was erroring due to bad strategy before abort() was called +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js index a04befd..b6be0a7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.js
@@ -27,8 +27,8 @@ assert_equals(writer.ready, readyPromise, 'the ready promise property should not change'); return Promise.all([ - promise_rejects(t, new TypeError(), readyPromise, 'the ready promise should reject with a TypeError'), - promise_rejects(t, new TypeError(), writePromise, 'the write() promise should reject with a TypeError') + promise_rejects(t, error1, readyPromise, 'the ready promise should reject with error1'), + promise_rejects(t, error1, writePromise, 'the write() promise should reject with error1') ]); }, 'Aborting a WritableStream before it starts should cause the writer\'s unsettled ready promise to reject'); @@ -44,7 +44,7 @@ writer.abort(error1); assert_not_equals(writer.ready, readyPromise, 'the ready promise property should change'); - return promise_rejects(t, new TypeError(), writer.ready, 'the ready promise should reject with a TypeError'); + return promise_rejects(t, error1, writer.ready, 'the ready promise should reject with error1'); }); }, 'Aborting a WritableStream should cause the writer\'s fulfilled ready promise to reset to a rejected one'); @@ -64,16 +64,16 @@ .then(() => { const writer = ws.getWriter(); - const abortPromise = writer.abort(); + const abortPromise = writer.abort(error1); return Promise.all([ - promise_rejects(t, new TypeError(), writer.write(1), 'write(1) must reject with a TypeError'), - promise_rejects(t, new TypeError(), writer.write(2), 'write(2) must reject with a TypeError'), + promise_rejects(t, error1, writer.write(1), 'write(1) must reject with error1'), + promise_rejects(t, error1, writer.write(2), 'write(2) must reject with error1'), abortPromise ]); }) .then(() => { - assert_array_equals(ws.events, ['abort', undefined]); + assert_array_equals(ws.events, ['abort', error1]); }); }, 'Aborting a WritableStream immediately prevents future writes'); @@ -87,20 +87,20 @@ results.push( writer.write(1), - promise_rejects(t, new TypeError(), writer.write(2), 'write(2) must reject with a TypeError'), - promise_rejects(t, new TypeError(), writer.write(3), 'write(3) must reject with a TypeError') + promise_rejects(t, error1, writer.write(2), 'write(2) must reject with error1'), + promise_rejects(t, error1, writer.write(3), 'write(3) must reject with error1') ); - const abortPromise = writer.abort(); + const abortPromise = writer.abort(error1); results.push( - promise_rejects(t, new TypeError(), writer.write(4), 'write(4) must reject with a TypeError'), - promise_rejects(t, new TypeError(), writer.write(5), 'write(5) must reject with a TypeError') + promise_rejects(t, error1, writer.write(4), 'write(4) must reject with error1'), + promise_rejects(t, error1, writer.write(5), 'write(5) must reject with error1') ); return abortPromise; }).then(() => { - assert_array_equals(ws.events, ['write', 1, 'abort', undefined]); + assert_array_equals(ws.events, ['write', 1, 'abort', error1]); return Promise.all(results); }); @@ -137,6 +137,22 @@ throw error1; } }); + const writer = ws.getWriter(); + + const abortPromise1 = writer.abort(undefined); + const abortPromise2 = writer.abort(undefined); + + assert_equals(abortPromise1, abortPromise2, 'the promises must be the same'); + + return promise_rejects(t, error1, abortPromise1, 'promise must have matching rejection'); +}, 'WritableStream if sink\'s abort throws, the promise returned by multiple writer.abort()s is the same and rejects'); + +promise_test(t => { + const ws = new WritableStream({ + abort() { + throw error1; + } + }); return promise_rejects(t, error1, ws.abort(undefined), 'rejection reason of abortPromise must be the error thrown by abort'); @@ -193,27 +209,26 @@ return Promise.all([ abortPromise, - promise_rejects(t, new TypeError(), writer.write(), 'writing should reject with a TypeError'), - promise_rejects(t, new TypeError(), writer.close(), 'closing should reject with a TypeError'), - promise_rejects(t, new TypeError(), writer.abort(), 'aborting should reject with a TypeError'), - promise_rejects(t, new TypeError(), writer.ready, 'ready should reject with a TypeError'), - promise_rejects(t, new TypeError(), writer.closed, 'closed should reject with a TypeError') + promise_rejects(t, error1, writer.write(), 'writing should reject with error1'), + promise_rejects(t, error1, writer.close(), 'closing should reject with error1'), + promise_rejects(t, error1, writer.ready, 'ready should reject with error1'), + promise_rejects(t, error1, writer.closed, 'closed should reject with error1') ]).then(() => { assert_array_equals(['ready', 'closed'], events, 'ready should reject before closed'); }); -}, 'Aborting a WritableStream puts it in an errored state, with a TypeError as the stored error'); +}, 'Aborting a WritableStream puts it in an errored state with the error passed to abort()'); promise_test(t => { const ws = new WritableStream(); const writer = ws.getWriter(); - const writePromise = promise_rejects(t, new TypeError(), writer.write('a'), - 'writing should reject with a TypeError'); + const writePromise = promise_rejects(t, error1, writer.write('a'), + 'writing should reject with error1'); writer.abort(error1); return writePromise; -}, 'Aborting a WritableStream causes any outstanding write() promises to be rejected with a TypeError'); +}, 'Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied'); promise_test(t => { const ws = recordingWritableStream(); @@ -223,8 +238,8 @@ const abortPromise = writer.abort(error1); return Promise.all([ - promise_rejects(t, new TypeError(), writer.closed, 'closed should reject with a TypeError'), - promise_rejects(t, new TypeError(), closePromise, 'close() should reject with a TypeError'), + promise_rejects(t, error1, writer.closed, 'closed should reject with error1'), + promise_rejects(t, error1, closePromise, 'close() should reject with error1'), abortPromise ]).then(() => { assert_array_equals(ws.events, ['abort', error1]); @@ -278,9 +293,9 @@ const writer = ws.getWriter(); - writer.abort(); + writer.abort(error1); - return promise_rejects(t, new TypeError(), writer.closed, 'closed should reject with a TypeError').then(() => { + return promise_rejects(t, error1, writer.closed, 'closed should reject with error1').then(() => { assert_false(closeCalled, 'close must not have been called'); }); }, 'WritableStream should NOT call underlying sink\'s close if no abort is supplied (historical)'); @@ -314,7 +329,7 @@ let closedRejected = false; return Promise.all([ writePromise.then(() => assert_false(closedRejected, '.closed should not resolve before write()')), - promise_rejects(t, new TypeError(), writer.closed, '.closed should reject').then(() => { + promise_rejects(t, error1, writer.closed, '.closed should reject').then(() => { closedRejected = true; }) ]); @@ -335,7 +350,7 @@ return Promise.all([ promise_rejects(t, error1, writePromise, 'write() should reject') .then(() => assert_false(closedRejected, '.closed should not resolve before write()')), - promise_rejects(t, new TypeError(), writer.closed, '.closed should reject') + promise_rejects(t, error2, writer.closed, '.closed should reject') .then(() => { closedRejected = true; }), @@ -355,9 +370,9 @@ const settlementOrder = []; return Promise.all([ writer.write('1').then(() => settlementOrder.push(1)), - promise_rejects(t, new TypeError(), writer.write('2'), 'first queued write should be rejected') + promise_rejects(t, error1, writer.write('2'), 'first queued write should be rejected') .then(() => settlementOrder.push(2)), - promise_rejects(t, new TypeError(), writer.write('3'), 'second queued write should be rejected') + promise_rejects(t, error1, writer.write('3'), 'second queued write should be rejected') .then(() => settlementOrder.push(3)), writer.abort(error1) ]).then(() => assert_array_equals([1, 2, 3], settlementOrder, 'writes should be satisfied in order')); @@ -376,9 +391,9 @@ return Promise.all([ promise_rejects(t, error1, writer.write('1'), 'in-flight write should be rejected') .then(() => settlementOrder.push(1)), - promise_rejects(t, new TypeError(), writer.write('2'), 'first queued write should be rejected') + promise_rejects(t, error2, writer.write('2'), 'first queued write should be rejected') .then(() => settlementOrder.push(2)), - promise_rejects(t, new TypeError(), writer.write('3'), 'second queued write should be rejected') + promise_rejects(t, error2, writer.write('3'), 'second queued write should be rejected') .then(() => settlementOrder.push(3)), writer.abort(error2) ]).then(() => assert_array_equals([1, 2, 3], settlementOrder, 'writes should be satisfied in order')); @@ -395,12 +410,12 @@ return writer.ready.then(() => { return Promise.all([ promise_rejects(t, error1, writer.write('a'), 'writer.write() should reject with error from underlying write()'), - promise_rejects(t, new TypeError(), writer.close(), + promise_rejects(t, error2, writer.close(), 'writer.close() should reject with error from underlying write()'), - writer.abort() + writer.abort(error2) ]); }); -}, 'close() should reject with TypeError when abort() is first error'); +}, 'close() should reject with abort reason why abort() is first error'); promise_test(() => { let resolveWrite; @@ -495,14 +510,14 @@ return writer.ready.then(() => { writer.write('a'); const closePromise = writer.close(); - const abortPromise = writer.abort('b'); + const abortPromise = writer.abort(error1); return flushAsyncEvents().then(() => { assert_array_equals(ws.events, ['write', 'a'], 'abort should not be called while write is in-flight'); resolveWrite(); return abortPromise.then(() => { - assert_array_equals(ws.events, ['write', 'a', 'abort', 'b'], 'abort should be called after write completes'); - return promise_rejects(t, new TypeError(), closePromise, 'promise returned by close() should be rejected'); + assert_array_equals(ws.events, ['write', 'a', 'abort', error1], 'abort should be called after write completes'); + return promise_rejects(t, error1, closePromise, 'promise returned by close() should be rejected'); }); }); }); @@ -518,13 +533,13 @@ const writer = ws.getWriter(); return writer.ready.then(() => { writer.write('a'); - writer.abort(); + writer.abort(error1); writer.releaseLock(); const writer2 = ws.getWriter(); - return promise_rejects(t, new TypeError(), writer2.ready, - 'ready of the second writer should be rejected with a TypeError'); + return promise_rejects(t, error1, writer2.ready, + 'ready of the second writer should be rejected with error1'); }); -}, 'if a writer is created for a stream with a pending abort, its ready should be rejected with a TypeError'); +}, 'if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error'); promise_test(() => { const ws = new WritableStream(); @@ -592,8 +607,8 @@ const writePromise2 = writer.write('a'); return Promise.all([ - promise_rejects(t, new TypeError(), writePromise2, 'writePromise2 must reject with an error indicating abort'), - promise_rejects(t, new TypeError(), writer.ready, 'writer.ready must reject with an error indicating abort'), + promise_rejects(t, error1, writePromise2, 'writePromise2 must reject with the error from abort'), + promise_rejects(t, error1, writer.ready, 'writer.ready must reject with the error from abort'), flushAsyncEvents() ]); }).then(() => { @@ -605,8 +620,8 @@ promise_rejects(t, error2, writePromise, 'writePromise must reject with the error returned from the sink\'s write method'), abortPromise, - promise_rejects(t, new TypeError(), writer.closed, - 'writer.closed must reject with an error indicating abort'), + promise_rejects(t, error1, writer.closed, + 'writer.closed must reject with the error from abort'), flushAsyncEvents() ]); }).then(() => { @@ -616,9 +631,9 @@ const writePromise3 = writer.write('a'); return Promise.all([ - promise_rejects(t, new TypeError(), writePromise3, - 'writePromise3 must reject with an error indicating abort'), - promise_rejects(t, new TypeError(), writer.ready, + promise_rejects(t, error1, writePromise3, + 'writePromise3 must reject with the error from abort'), + promise_rejects(t, error1, writer.ready, 'writer.ready must be still rejected with the error indicating abort') ]); }).then(() => { @@ -671,8 +686,8 @@ const writePromise2 = writer.write('a'); return Promise.all([ - promise_rejects(t, new TypeError(), writePromise2, 'writePromise2 must reject with an error indicating abort'), - promise_rejects(t, new TypeError(), writer.ready, 'writer.ready must reject with an error indicating abort'), + promise_rejects(t, error1, writePromise2, 'writePromise2 must reject with the error from abort'), + promise_rejects(t, error1, writer.ready, 'writer.ready must reject with the error from abort'), flushAsyncEvents() ]); }).then(() => { @@ -684,9 +699,9 @@ const writePromise3 = writer.write('a'); return Promise.all([ - promise_rejects(t, new TypeError(), writePromise3, - 'writePromise3 must reject with an error indicating abort'), - promise_rejects(t, new TypeError(), writer.ready, + promise_rejects(t, error1, writePromise3, + 'writePromise3 must reject with the error from abort'), + promise_rejects(t, error1, writer.ready, 'writer.ready must be still rejected with the error indicating abort'), flushAsyncEvents() ]); @@ -701,8 +716,8 @@ return Promise.all([ writePromise, abortPromise, - promise_rejects(t, new TypeError(), writer.closed, - 'writer.closed must reject with an error indicating abort'), + promise_rejects(t, error1, writer.closed, + 'writer.closed must reject with the error from abort'), flushAsyncEvents() ]); }).then(() => { @@ -713,9 +728,9 @@ return Promise.all([ writePromise, - promise_rejects(t, new TypeError(), writePromise4, - 'writePromise4 must reject with an error indicating abort'), - promise_rejects(t, new TypeError(), writer.ready, + promise_rejects(t, error1, writePromise4, + 'writePromise4 must reject with the error from abort'), + promise_rejects(t, error1, writer.ready, 'writer.ready must be still rejected with the error indicating abort') ]); }).then(() => { @@ -770,7 +785,7 @@ return Promise.all([ promise_rejects(t, new TypeError(), writer.close(), 'writer.close() must reject with an error indicating already closing'), - promise_rejects(t, new TypeError(), writer.ready, 'writer.ready must reject with an error indicating abort'), + promise_rejects(t, error1, writer.ready, 'writer.ready must reject with the error from abort'), flushAsyncEvents() ]); }).then(() => { @@ -781,7 +796,7 @@ return Promise.all([ promise_rejects(t, new TypeError(), writer.close(), 'writer.close() must reject with an error indicating already closing'), - promise_rejects(t, new TypeError(), writer.ready, + promise_rejects(t, error1, writer.ready, 'writer.ready must be still rejected with the error indicating abort'), flushAsyncEvents() ]); @@ -806,7 +821,7 @@ return Promise.all([ promise_rejects(t, new TypeError(), writer.close(), 'writer.close() must reject with an error indicating already closing'), - promise_rejects(t, new TypeError(), writer.ready, + promise_rejects(t, error1, writer.ready, 'writer.ready must be still rejected with the error indicating abort') ]); }).then(() => { @@ -1110,11 +1125,11 @@ const ws = new WritableStream(); const writer = ws.getWriter(); const writerReady1 = writer.ready; - writer.abort('a'); + writer.abort(error1); const writerReady2 = writer.ready; assert_not_equals(writerReady1, writerReady2, 'abort() should replace the ready promise with a rejected one'); return Promise.all([writerReady1, - promise_rejects(t, new TypeError(), writerReady2, 'writerReady2 should reject')]); + promise_rejects(t, error1, writerReady2, 'writerReady2 should reject')]); }, 'writer abort() during sink start() should replace the writer.ready promise synchronously'); promise_test(t => { @@ -1122,7 +1137,7 @@ const ws = recordingWritableStream(); const writer = ws.getWriter(); const writePromise1 = writer.write(1); - const abortPromise = writer.abort('a'); + const abortPromise = writer.abort(error1); const writePromise2 = writer.write(2); const closePromise = writer.close(); writePromise1.catch(() => events.push('write1')); @@ -1130,15 +1145,15 @@ writePromise2.catch(() => events.push('write2')); closePromise.catch(() => events.push('close')); return Promise.all([ - promise_rejects(t, new TypeError(), writePromise1, 'first write() should reject'), + promise_rejects(t, error1, writePromise1, 'first write() should reject'), abortPromise, - promise_rejects(t, new TypeError(), writePromise2, 'second write() should reject'), - promise_rejects(t, new TypeError(), closePromise, 'close() should reject') + promise_rejects(t, error1, writePromise2, 'second write() should reject'), + promise_rejects(t, error1, closePromise, 'close() should reject') ]) .then(() => { assert_array_equals(events, ['write2', 'write1', 'abort', 'close'], 'promises should resolve in the standard order'); - assert_array_equals(ws.events, ['abort', 'a'], 'underlying sink write() should not be called'); + assert_array_equals(ws.events, ['abort', error1], 'underlying sink write() should not be called'); }); }, 'promises returned from other writer methods should be rejected when writer abort() happens during sink start()'); @@ -1209,7 +1224,7 @@ return Promise.all([ promise_rejects(t, error1, writePromise, 'write should reject'), abortPromise, - promise_rejects(t, new TypeError(), writer.closed, 'closed should reject with TypeError') + promise_rejects(t, error2, writer.closed, 'closed should reject with error2') ]); }).then(() => { assert_array_equals(ws.events, ['write', '1', 'abort', error2], 'abort sink method should be called'); @@ -1228,15 +1243,47 @@ }); }, 'when start errors after stream abort(), underlying sink abort() should be called anyway'); -promise_test(t => { +promise_test(() => { const ws = new WritableStream(); const abortPromise1 = ws.abort(); const abortPromise2 = ws.abort(); - return Promise.all([ - abortPromise1, - promise_rejects(t, new TypeError(), abortPromise2, 'second abort() should reject') - ]); -}, 'when calling abort() twice on the same stream, the second call should reject'); + assert_equals(abortPromise1, abortPromise2, 'the promises must be the same'); + + return abortPromise1.then( + v => assert_equals(v, undefined, 'abort() should fulfill with undefined')); +}, 'when calling abort() twice on the same stream, both should give the same promise that fulfills with undefined'); + +promise_test(() => { + const ws = new WritableStream(); + const abortPromise1 = ws.abort(); + + return abortPromise1.then(v1 => { + assert_equals(v1, undefined, 'first abort() should fulfill with undefined'); + + const abortPromise2 = ws.abort(); + assert_not_equals(abortPromise2, abortPromise1, 'because we waited, the second promise should be a new promise'); + + return abortPromise2.then(v2 => { + assert_equals(v2, undefined, 'second abort() should fulfill with undefined'); + }); + }); +}, 'when calling abort() twice on the same stream, but sequentially so so there\'s no pending abort the second time, ' + + 'both should fulfill with undefined'); + +promise_test(t => { + const ws = new WritableStream({ + start(c) { + c.error(error1); + } + }); + + const writer = ws.getWriter(); + + return promise_rejects(t, error1, writer.closed, 'writer.closed should reject').then(() => { + return writer.abort().then( + v => assert_equals(v, undefined, 'abort() should fulfill with undefined')); + }); +}, 'calling abort() on an errored stream should fulfill with undefined'); promise_test(t => { let controller;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.serviceworker.https-expected.txt new file mode 100644 index 0000000..37ab229 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.serviceworker.https-expected.txt
@@ -0,0 +1,56 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = error1 +PASS Service worker test setup +FAIL Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() on a released writer rejects +FAIL Aborting a WritableStream immediately prevents future writes assert_throws: write(1) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream prevents further writes after any that are in progress assert_throws: write(2) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +FAIL WritableStream if sink's abort throws, the promise returned by multiple writer.abort()s is the same and rejects assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +FAIL Aborting a WritableStream puts it in an errored state with the error passed to abort() assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Closing but then immediately aborting a WritableStream causes the stream to error assert_throws: close() should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Closing a WritableStream and aborting it while it closes causes the stream to ignore the abort attempt +PASS Aborting a WritableStream after it is closed is a no-op +FAIL WritableStream should NOT call underlying sink's close if no abort is supplied (historical) assert_throws: closed should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS returning a thenable from abort() should work +FAIL .closed should not resolve before fulfilled write() assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL .closed should not resolve before rejected write(); write() error should not overwrite abort() error assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL writes should be satisfied in order when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writes should be satisfied in order after rejected write when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL close() should reject with abort reason why abort() is first error assert_throws: writer.close() should reject with error from underlying write() function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +FAIL an abort() that happens during a write() should trigger the underlying abort() even with a close() queued assert_throws: promise returned by close() should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error assert_throws: ready of the second writer should be rejected with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_throws: writer.ready must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS controller.error(), writer.abort() while there is an in-flight write, and then finish the write +PASS controller.error(), writer.abort() while there is an in-flight close, and then finish the close +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should reject the writer.closed promise +PASS sink abort() should not be called until sink start() is done +PASS if start attempts to error the controller after abort() has been called, then it should lose +PASS stream abort() promise should still resolve if sink start() rejects +FAIL writer abort() during sink start() should replace the writer.ready promise synchronously assert_throws: writerReady2 should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL promises returned from other writer methods should be rejected when writer abort() happens during sink start() assert_throws: second write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() should succeed despite rejection from write +PASS abort() should be rejected with the rejection returned from close() +FAIL a rejecting sink.write() should not prevent sink.abort() from being called assert_throws: closed should reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS when start errors after stream abort(), underlying sink abort() should be called anyway +FAIL when calling abort() twice on the same stream, both should give the same promise that fulfills with undefined assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +FAIL when calling abort() twice on the same stream, but sequentially so so there's no pending abort the second time, both should fulfill with undefined promise_test: Unhandled rejection with value: object "TypeError: The stream is in the process of being aborted" +FAIL calling abort() on an errored stream should fulfill with undefined promise_test: Unhandled rejection with value: object "error1: error1" +PASS sink abort() should not be called if stream was erroring due to controller.error() before abort() was called +PASS sink abort() should not be called if stream was erroring due to bad strategy before abort() was called +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.sharedworker-expected.txt new file mode 100644 index 0000000..28dfc5c2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/aborting.sharedworker-expected.txt
@@ -0,0 +1,56 @@ +This is a testharness.js-based test. +Harness Error. harness_status.status = 1 , harness_status.message = error1 +Found 51 tests; 26 PASS, 25 FAIL, 0 TIMEOUT, 0 NOTRUN. +FAIL Aborting a WritableStream before it starts should cause the writer's unsettled ready promise to reject assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream should cause the writer's fulfilled ready promise to reset to a rejected one assert_throws: the ready promise should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() on a released writer rejects +FAIL Aborting a WritableStream immediately prevents future writes assert_throws: write(1) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream prevents further writes after any that are in progress assert_throws: write(2) must reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Fulfillment value of ws.abort() call must be undefined even if the underlying sink returns a non-undefined value +PASS WritableStream if sink's abort throws, the promise returned by writer.abort() rejects +FAIL WritableStream if sink's abort throws, the promise returned by multiple writer.abort()s is the same and rejects assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +PASS WritableStream if sink's abort throws, the promise returned by ws.abort() rejects +PASS WritableStream if sink's abort throws, for an abort performed during a write, the promise returned by ws.abort() rejects +PASS Aborting a WritableStream passes through the given reason +FAIL Aborting a WritableStream puts it in an errored state with the error passed to abort() assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Aborting a WritableStream causes any outstanding write() promises to be rejected with the reason supplied assert_throws: writing should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL Closing but then immediately aborting a WritableStream causes the stream to error assert_throws: close() should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS Closing a WritableStream and aborting it while it closes causes the stream to ignore the abort attempt +PASS Aborting a WritableStream after it is closed is a no-op +FAIL WritableStream should NOT call underlying sink's close if no abort is supplied (historical) assert_throws: closed should reject with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS returning a thenable from abort() should work +FAIL .closed should not resolve before fulfilled write() assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL .closed should not resolve before rejected write(); write() error should not overwrite abort() error assert_throws: .closed should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL writes should be satisfied in order when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writes should be satisfied in order after rejected write when aborting assert_throws: first queued write should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +FAIL close() should reject with abort reason why abort() is first error assert_throws: writer.close() should reject with error from underlying write() function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS underlying abort() should not be called until underlying write() completes +PASS underlying abort() should not be called if underlying close() has started +PASS if underlying close() has started and then rejects, the abort() and close() promises should reject with the underlying close rejection reason +FAIL an abort() that happens during a write() should trigger the underlying abort() even with a close() queued assert_throws: promise returned by close() should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL if a writer is created for a stream with a pending abort, its ready should be rejected with the abort error assert_throws: ready of the second writer should be rejected with error1 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS writer close() promise should resolve before abort() promise +PASS writer.ready should reject on controller error without waiting for underlying write +FAIL writer.abort() while there is an in-flight write, and then finish the write with rejection assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight write, and then finish the write assert_throws: writePromise2 must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL writer.abort(), controller.error() while there is an in-flight close, and then finish the close assert_throws: writer.ready must reject with the error from abort function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS controller.error(), writer.abort() while there is an in-flight write, and then finish the write +PASS controller.error(), writer.abort() while there is an in-flight close, and then finish the close +PASS releaseLock() while aborting should reject the original closed promise +PASS releaseLock() during delayed async abort() should reject the writer.closed promise +PASS sink abort() should not be called until sink start() is done +PASS if start attempts to error the controller after abort() has been called, then it should lose +PASS stream abort() promise should still resolve if sink start() rejects +FAIL writer abort() during sink start() should replace the writer.ready promise synchronously assert_throws: writerReady2 should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +FAIL promises returned from other writer methods should be rejected when writer abort() happens during sink start() assert_throws: second write() should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error1: error1" ("error1") +PASS abort() should succeed despite rejection from write +PASS abort() should be rejected with the rejection returned from close() +FAIL a rejecting sink.write() should not prevent sink.abort() from being called assert_throws: closed should reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS when start errors after stream abort(), underlying sink abort() should be called anyway +FAIL when calling abort() twice on the same stream, both should give the same promise that fulfills with undefined assert_equals: the promises must be the same expected object "[object Promise]" but got object "[object Promise]" +FAIL when calling abort() twice on the same stream, but sequentially so so there's no pending abort the second time, both should fulfill with undefined promise_test: Unhandled rejection with value: object "TypeError: The stream is in the process of being aborted" +FAIL calling abort() on an errored stream should fulfill with undefined promise_test: Unhandled rejection with value: object "error1: error1" +PASS sink abort() should not be called if stream was erroring due to controller.error() before abort() was called +PASS sink abort() should not be called if stream was erroring due to bad strategy before abort() was called +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks-expected.txt index 0412338..8fc28dc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks-expected.txt
@@ -23,6 +23,6 @@ throw error1; } })" did not throw -PASS abort: throwing method should cause abort() and closed to reject +FAIL abort: throwing method should cause abort() and closed to reject assert_throws: closed should reject with abortReason function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "Error: different string" ("Error") Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.dedicatedworker-expected.txt index 0412338..8fc28dc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.dedicatedworker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.dedicatedworker-expected.txt
@@ -23,6 +23,6 @@ throw error1; } })" did not throw -PASS abort: throwing method should cause abort() and closed to reject +FAIL abort: throwing method should cause abort() and closed to reject assert_throws: closed should reject with abortReason function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "Error: different string" ("Error") Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.js index 6cc1b0cc..2c7c448 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.js
@@ -189,7 +189,7 @@ const writer = ws.getWriter(); return promise_rejects(t, error1, writer.abort(abortReason), 'abort should reject with the thrown error') - .then(() => promise_rejects(t, new TypeError(), writer.closed, 'closed should reject with a TypeError')); + .then(() => promise_rejects(t, abortReason, writer.closed, 'closed should reject with abortReason')); }, 'abort: throwing method should cause abort() and closed to reject'); done();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.serviceworker.https-expected.txt index 1da0796e..42fd80d0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.serviceworker.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.serviceworker.https-expected.txt
@@ -24,6 +24,6 @@ throw error1; } })" did not throw -PASS abort: throwing method should cause abort() and closed to reject +FAIL abort: throwing method should cause abort() and closed to reject assert_throws: closed should reject with abortReason function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "Error: different string" ("Error") Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.sharedworker-expected.txt index 0412338..8fc28dc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.sharedworker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/bad-underlying-sinks.sharedworker-expected.txt
@@ -23,6 +23,6 @@ throw error1; } })" did not throw -PASS abort: throwing method should cause abort() and closed to reject +FAIL abort: throwing method should cause abort() and closed to reject assert_throws: closed should reject with abortReason function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "Error: different string" ("Error") Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close-expected.txt new file mode 100644 index 0000000..62148fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +PASS fulfillment value of ws.close() call must be undefined even if the underlying sink returns a non-undefined value +PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored +PASS when sink calls error synchronously while closing, the stream should not become errored +PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close +PASS releaseLock on a stream with a pending write in which the stream has been errored +PASS releaseLock on a stream with a pending close in which controller.error() was called +PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise +PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled +PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time +PASS returning a thenable from close() should work +PASS releaseLock() should not change the result of sync close() +PASS releaseLock() should not change the result of async close() +PASS close() should set state to CLOSED even if writer has detached +PASS the promise returned by async abort during close should resolve +PASS promises must fulfill/reject in the expected order on closure +PASS promises must fulfill/reject in the expected order on aborted closure +FAIL promises must fulfill/reject in the expected order on aborted and errored closure assert_throws: writer.closed must reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS close() should not reject until no sink methods are in flight +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.dedicatedworker-expected.txt new file mode 100644 index 0000000..62148fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.dedicatedworker-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +PASS fulfillment value of ws.close() call must be undefined even if the underlying sink returns a non-undefined value +PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored +PASS when sink calls error synchronously while closing, the stream should not become errored +PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close +PASS releaseLock on a stream with a pending write in which the stream has been errored +PASS releaseLock on a stream with a pending close in which controller.error() was called +PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise +PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled +PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time +PASS returning a thenable from close() should work +PASS releaseLock() should not change the result of sync close() +PASS releaseLock() should not change the result of async close() +PASS close() should set state to CLOSED even if writer has detached +PASS the promise returned by async abort during close should resolve +PASS promises must fulfill/reject in the expected order on closure +PASS promises must fulfill/reject in the expected order on aborted closure +FAIL promises must fulfill/reject in the expected order on aborted and errored closure assert_throws: writer.closed must reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS close() should not reject until no sink methods are in flight +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js index bf9472e..5cbe570 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.js
@@ -361,8 +361,8 @@ 'closePromise must reject with the error returned from the sink\'s close method'), promise_rejects(t, error1, abortPromise, 'abortPromise must reject with the error returned from the sink\'s close method'), - promise_rejects(t, new TypeError(), writer.closed, - 'writer.closed must reject with a TypeError indicating the stream was aborted') + promise_rejects(t, error2, writer.closed, + 'writer.closed must reject with error2') ]).then(() => { assert_array_equals(events, ['closePromise', 'abortPromise', 'closed'], 'promises must fulfill/reject in the expected order');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.serviceworker.https-expected.txt new file mode 100644 index 0000000..c605ee1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.serviceworker.https-expected.txt
@@ -0,0 +1,22 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS fulfillment value of ws.close() call must be undefined even if the underlying sink returns a non-undefined value +PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored +PASS when sink calls error synchronously while closing, the stream should not become errored +PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close +PASS releaseLock on a stream with a pending write in which the stream has been errored +PASS releaseLock on a stream with a pending close in which controller.error() was called +PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise +PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled +PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time +PASS returning a thenable from close() should work +PASS releaseLock() should not change the result of sync close() +PASS releaseLock() should not change the result of async close() +PASS close() should set state to CLOSED even if writer has detached +PASS the promise returned by async abort during close should resolve +PASS promises must fulfill/reject in the expected order on closure +PASS promises must fulfill/reject in the expected order on aborted closure +FAIL promises must fulfill/reject in the expected order on aborted and errored closure assert_throws: writer.closed must reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS close() should not reject until no sink methods are in flight +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.sharedworker-expected.txt new file mode 100644 index 0000000..62148fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/close.sharedworker-expected.txt
@@ -0,0 +1,21 @@ +This is a testharness.js-based test. +PASS fulfillment value of ws.close() call must be undefined even if the underlying sink returns a non-undefined value +PASS when sink calls error asynchronously while sink close is in-flight, the stream should not become errored +PASS when sink calls error synchronously while closing, the stream should not become errored +PASS when the sink throws during close, and the close is requested while a write is still in-flight, the stream should become errored during the close +PASS releaseLock on a stream with a pending write in which the stream has been errored +PASS releaseLock on a stream with a pending close in which controller.error() was called +PASS when close is called on a WritableStream in writable state, ready should return a fulfilled promise +PASS when close is called on a WritableStream in waiting state, ready promise should be fulfilled +PASS when close is called on a WritableStream in waiting state, ready should be fulfilled immediately even if close takes a long time +PASS returning a thenable from close() should work +PASS releaseLock() should not change the result of sync close() +PASS releaseLock() should not change the result of async close() +PASS close() should set state to CLOSED even if writer has detached +PASS the promise returned by async abort during close should resolve +PASS promises must fulfill/reject in the expected order on closure +PASS promises must fulfill/reject in the expected order on aborted closure +FAIL promises must fulfill/reject in the expected order on aborted and errored closure assert_throws: writer.closed must reject with error2 function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "error2: error2" ("error2") +PASS close() should not reject until no sink methods are in flight +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general-expected.txt new file mode 100644 index 0000000..c8df07b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general-expected.txt
@@ -0,0 +1,17 @@ +This is a testharness.js-based test. +PASS desiredSize on a released writer +PASS desiredSize initial value +PASS desiredSize on a writer for a closed stream +PASS desiredSize on a writer for an errored stream +PASS ws.getWriter() on a closing WritableStream +PASS ws.getWriter() on a closed WritableStream +PASS ws.getWriter() on an aborted WritableStream +PASS ws.getWriter() on an errored WritableStream +PASS closed and ready on a released writer +PASS WritableStream should call underlying sink methods as methods +FAIL methods should not not have .apply() or .call() called assert_throws: writer2.closed should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "abort error" ("abort error") +PASS WritableStream's strategy.size should not be called as a method +PASS redundant releaseLock() is no-op +PASS ready promise should fire before closed on releaseLock +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.dedicatedworker-expected.txt new file mode 100644 index 0000000..c8df07b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.dedicatedworker-expected.txt
@@ -0,0 +1,17 @@ +This is a testharness.js-based test. +PASS desiredSize on a released writer +PASS desiredSize initial value +PASS desiredSize on a writer for a closed stream +PASS desiredSize on a writer for an errored stream +PASS ws.getWriter() on a closing WritableStream +PASS ws.getWriter() on a closed WritableStream +PASS ws.getWriter() on an aborted WritableStream +PASS ws.getWriter() on an errored WritableStream +PASS closed and ready on a released writer +PASS WritableStream should call underlying sink methods as methods +FAIL methods should not not have .apply() or .call() called assert_throws: writer2.closed should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "abort error" ("abort error") +PASS WritableStream's strategy.size should not be called as a method +PASS redundant releaseLock() is no-op +PASS ready promise should fire before closed on releaseLock +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.js index 1702479..7187572f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.js
@@ -165,8 +165,8 @@ promise_test(t => { function functionWithOverloads() {} - functionWithOverloads.apply = () => assert_unreached('apply() should not be called'); - functionWithOverloads.call = () => assert_unreached('call() should not be called'); + functionWithOverloads.apply = t.unreached_func('apply() should not be called'); + functionWithOverloads.call = t.unreached_func('call() should not be called'); const underlyingSink = { start: functionWithOverloads, write: functionWithOverloads, @@ -180,9 +180,12 @@ writer1.close(); // Test abort(). + const abortError = new Error(); + abortError.name = 'abort error'; + const ws2 = new WritableStream(underlyingSink); const writer2 = ws2.getWriter(); - writer2.abort(); + writer2.abort(abortError); // Test abort() with a close underlying sink method present. (Historical; see // https://github.com/whatwg/streams/issues/620#issuecomment-263483953 for what used to be @@ -193,11 +196,11 @@ close: functionWithOverloads }); const writer3 = ws3.getWriter(); - writer3.abort(); + writer3.abort(abortError); return writer1.closed - .then(() => promise_rejects(t, new TypeError(), writer2.closed, 'writer2.closed should be rejected')) - .then(() => promise_rejects(t, new TypeError(), writer3.closed, 'writer3.closed should be rejected')); + .then(() => promise_rejects(t, abortError, writer2.closed, 'writer2.closed should be rejected')) + .then(() => promise_rejects(t, abortError, writer3.closed, 'writer3.closed should be rejected')); }, 'methods should not not have .apply() or .call() called'); promise_test(() => {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.serviceworker.https-expected.txt new file mode 100644 index 0000000..b7cb475 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.serviceworker.https-expected.txt
@@ -0,0 +1,18 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS desiredSize on a released writer +PASS desiredSize initial value +PASS desiredSize on a writer for a closed stream +PASS desiredSize on a writer for an errored stream +PASS ws.getWriter() on a closing WritableStream +PASS ws.getWriter() on a closed WritableStream +PASS ws.getWriter() on an aborted WritableStream +PASS ws.getWriter() on an errored WritableStream +PASS closed and ready on a released writer +PASS WritableStream should call underlying sink methods as methods +FAIL methods should not not have .apply() or .call() called assert_throws: writer2.closed should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "abort error" ("abort error") +PASS WritableStream's strategy.size should not be called as a method +PASS redundant releaseLock() is no-op +PASS ready promise should fire before closed on releaseLock +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.sharedworker-expected.txt new file mode 100644 index 0000000..c8df07b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/general.sharedworker-expected.txt
@@ -0,0 +1,17 @@ +This is a testharness.js-based test. +PASS desiredSize on a released writer +PASS desiredSize initial value +PASS desiredSize on a writer for a closed stream +PASS desiredSize on a writer for an errored stream +PASS ws.getWriter() on a closing WritableStream +PASS ws.getWriter() on a closed WritableStream +PASS ws.getWriter() on an aborted WritableStream +PASS ws.getWriter() on an errored WritableStream +PASS closed and ready on a released writer +PASS WritableStream should call underlying sink methods as methods +FAIL methods should not not have .apply() or .call() called assert_throws: writer2.closed should be rejected function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "abort error" ("abort error") +PASS WritableStream's strategy.size should not be called as a method +PASS redundant releaseLock() is no-op +PASS ready promise should fire before closed on releaseLock +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy-expected.txt new file mode 100644 index 0000000..ff1f35fba --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy-expected.txt
@@ -0,0 +1,10 @@ +This is a testharness.js-based test. +PASS writes should be written in the standard order +PASS writer.write() promises should resolve in the standard order +PASS controller.error() should work when called from within strategy.size() +PASS close() should work when called from within strategy.size() +FAIL abort() should work when called from within strategy.size() assert_throws: write() promise should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "[object Object]" ("error1") +PASS releaseLock() should abort the write() when called within strategy.size() +PASS original reader should error when new reader is created within strategy.size() +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.dedicatedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.dedicatedworker-expected.txt new file mode 100644 index 0000000..ff1f35fba --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.dedicatedworker-expected.txt
@@ -0,0 +1,10 @@ +This is a testharness.js-based test. +PASS writes should be written in the standard order +PASS writer.write() promises should resolve in the standard order +PASS controller.error() should work when called from within strategy.size() +PASS close() should work when called from within strategy.size() +FAIL abort() should work when called from within strategy.size() assert_throws: write() promise should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "[object Object]" ("error1") +PASS releaseLock() should abort the write() when called within strategy.size() +PASS original reader should error when new reader is created within strategy.size() +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.js b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.js index 0dc9786..6e1b52c9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.js +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.js
@@ -114,16 +114,16 @@ let writer; const strategy = { size() { - writer.abort('nice'); + writer.abort(error1); return 1; } }; const ws = recordingWritableStream({}, strategy); writer = ws.getWriter(); - return promise_rejects(t, new TypeError(), writer.write('a'), 'write() promise should reject') + return promise_rejects(t, error1, writer.write('a'), 'write() promise should reject') .then(() => { - assert_array_equals(ws.events, ['abort', 'nice'], 'sink.write() should not be called'); + assert_array_equals(ws.events, ['abort', error1], 'sink.write() should not be called'); }); }, 'abort() should work when called from within strategy.size()');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.serviceworker.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.serviceworker.https-expected.txt new file mode 100644 index 0000000..255404e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.serviceworker.https-expected.txt
@@ -0,0 +1,11 @@ +This is a testharness.js-based test. +PASS Service worker test setup +PASS writes should be written in the standard order +PASS writer.write() promises should resolve in the standard order +PASS controller.error() should work when called from within strategy.size() +PASS close() should work when called from within strategy.size() +FAIL abort() should work when called from within strategy.size() assert_throws: write() promise should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "[object Object]" ("error1") +PASS releaseLock() should abort the write() when called within strategy.size() +PASS original reader should error when new reader is created within strategy.size() +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.sharedworker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.sharedworker-expected.txt new file mode 100644 index 0000000..ff1f35fba --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/streams/writable-streams/reentrant-strategy.sharedworker-expected.txt
@@ -0,0 +1,10 @@ +This is a testharness.js-based test. +PASS writes should be written in the standard order +PASS writer.write() promises should resolve in the standard order +PASS controller.error() should work when called from within strategy.size() +PASS close() should work when called from within strategy.size() +FAIL abort() should work when called from within strategy.size() assert_throws: write() promise should reject function "function() { throw e }" threw object "TypeError: The stream is in the process of being aborted" ("TypeError") expected object "[object Object]" ("error1") +PASS releaseLock() should abort the write() when called within strategy.size() +PASS original reader should error when new reader is created within strategy.size() +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any-expected.txt index 4bd8ffd2..c1b2eea62 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any-expected.txt
@@ -1,5 +1,6 @@ This is a testharness.js-based test. -Found 101 tests; 98 PASS, 3 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 102 tests; 99 PASS, 3 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Test driver PASS URL interface: existence and properties of interface object PASS URL interface object length PASS URL interface object name
diff --git a/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.js b/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.js index aa5d5c8..dbbbca41 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.js +++ b/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.js
@@ -1,51 +1,15 @@ // META: script=/resources/WebIDLParser.js // META: script=/resources/idlharness.js -let idlArray, - idl = `[Constructor(USVString url, optional USVString base), - Exposed=(Window,Worker), - LegacyWindowAlias=webkitURL] -interface URL { - stringifier attribute USVString href; - readonly attribute USVString origin; - attribute USVString protocol; - attribute USVString username; - attribute USVString password; - attribute USVString host; - attribute USVString hostname; - attribute USVString port; - attribute USVString pathname; - attribute USVString search; - [SameObject] readonly attribute URLSearchParams searchParams; - attribute USVString hash; - - USVString toJSON(); -}; - -[Constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""), - Exposed=(Window,Worker)] -interface URLSearchParams { - void append(USVString name, USVString value); - void delete(USVString name); - USVString? get(USVString name); - sequence<USVString> getAll(USVString name); - boolean has(USVString name); - void set(USVString name, USVString value); - - void sort(); - - iterable<USVString, USVString>; - stringifier; -};`; -setup(function() { - idlArray = new IdlArray(); - idlArray.add_idls(idl); -}, {explicit_done:true}); - -idlArray.add_objects({ - URL: ['new URL("http://foo")'], - URLSearchParams: ['new URLSearchParams("hi=there&thank=you")'] -}); -idlArray.test(); - -done(); +promise_test(async() => { + const text = await fetch('/interfaces/url.idl') + .then(response => response.text()); + const idlArray = new IdlArray(); + idlArray.add_idls(text); + idlArray.add_objects({ + URL: ['new URL("http://foo")'], + URLSearchParams: ['new URLSearchParams("hi=there&thank=you")'] + }); + idlArray.test(); + done(); +}, 'Test driver');
diff --git a/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.worker-expected.txt index 4bd8ffd2..c1b2eea62 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.worker-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/url/interfaces.any.worker-expected.txt
@@ -1,5 +1,6 @@ This is a testharness.js-based test. -Found 101 tests; 98 PASS, 3 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 102 tests; 99 PASS, 3 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS Test driver PASS URL interface: existence and properties of interface object PASS URL interface object length PASS URL interface object name
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/interfaces.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webrtc/interfaces.https-expected.txt index 566708d..bfe77a0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/webrtc/interfaces.https-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/webrtc/interfaces.https-expected.txt
@@ -334,9 +334,9 @@ PASS Unscopable handled correctly for rtcpTransport property on RTCRtpSender FAIL RTCRtpSender interface: operation getCapabilities(DOMString) assert_own_property: interface object missing static operation expected property "getCapabilities" missing PASS Unscopable handled correctly for getCapabilities(DOMString) on RTCRtpSender -FAIL RTCRtpSender interface: operation setParameters(RTCRtpParameters) assert_own_property: interface prototype object missing non-static operation expected property "setParameters" missing +PASS RTCRtpSender interface: operation setParameters(RTCRtpParameters) PASS Unscopable handled correctly for setParameters(RTCRtpParameters) on RTCRtpSender -FAIL RTCRtpSender interface: operation getParameters() assert_own_property: interface prototype object missing non-static operation expected property "getParameters" missing +PASS RTCRtpSender interface: operation getParameters() PASS Unscopable handled correctly for getParameters() on RTCRtpSender PASS RTCRtpSender interface: operation replaceTrack(MediaStreamTrack) PASS Unscopable handled correctly for replaceTrack(MediaStreamTrack) on RTCRtpSender
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-outside-image.html b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-outside-image.html new file mode 100644 index 0000000..35bcc9c --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-outside-image.html
@@ -0,0 +1,86 @@ +<!DOCTYPE html> +<script src="../../../../resources/testharness.js"></script> +<script src="../../../../resources/testharnessreport.js"></script> + +<div id='horizontal-container'> + <img id='img-h1' style='width: 100px; height: 50px'><img id='img-h2' style='width: 100px; height: 100px'> +</div> + +<div id='vertical-container' style='writing-mode: vertical-lr'> + <img id='img-v1' style='width: 50px; height: 100px'><img id='img-v2' style='width: 100px; height: 100px'> +</div> +<script> +// This file tests hit-testing outside image while inside containing line box. + +test(() => { + // Hit test location indicated by '*': + // * 2222 + // 2222 + // 11112222 + // 11112222 + const container = document.getElementById('horizontal-container'); + const target = document.getElementById('img-h1'); + const x = container.offsetLeft + 25; + const y = container.offsetTop + 25; + const result = document.caretRangeFromPoint(x, y); + + assert_true(result instanceof Range); + assert_equals(result.startContainer, container); + assert_equals(container.childNodes[result.startOffset], target); + assert_true(result.collapsed); +}, 'Hit test before half-width of image in horizontal writing mode'); + +test(() => { + // Hit test location indicated by '*': + // *2222 + // 2222 + // 11112222 + // 11112222 + const container = document.getElementById('horizontal-container'); + const target = document.getElementById('img-h2'); + const x = container.offsetLeft + 75; + const y = container.offsetTop + 25; + const result = document.caretRangeFromPoint(x, y); + + assert_true(result instanceof Range); + assert_equals(result.startContainer, container); + assert_equals(container.childNodes[result.startOffset], target); + assert_true(result.collapsed); +}, 'Hit test after half-width of image in horizontal writing mode'); + +test(() => { + // Hit test location indicated by '*': + // * 1111 + // 1111 + // 22222222 + // 22222222 + const container = document.getElementById('vertical-container'); + const target = document.getElementById('img-v1'); + const x = container.offsetLeft + 10; + const y = container.offsetTop + 25; + const result = document.caretRangeFromPoint(x, y); + + assert_true(result instanceof Range); + assert_equals(result.startContainer, container); + assert_equals(container.childNodes[result.startOffset], target); + assert_true(result.collapsed); +}, 'Hit test before half-width of image in vertical writing mode'); + +test(() => { + // Hit test location indicated by '*': + // 1111 + // * 1111 + // 22222222 + // 22222222 + const container = document.getElementById('vertical-container'); + const target = document.getElementById('img-v2'); + const x = container.offsetLeft + 10; + const y = container.offsetTop + 75; + const result = document.caretRangeFromPoint(x, y); + + assert_true(result instanceof Range); + assert_equals(result.startContainer, container); + assert_equals(container.childNodes[result.startOffset], target); + assert_true(result.collapsed); +}, 'Hit test after half-width of image in vertical writing mode'); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/frames/frame-set-rotation-hit-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/frame-set-rotation-hit-expected.txt index 54e5ab2..325d46c 100644 --- a/third_party/WebKit/LayoutTests/fast/frames/frame-set-rotation-hit-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/frames/frame-set-rotation-hit-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 1600x1200 scrollHeight 800 +layer at (0,0) size 1600x1200 scrollWidth 1600 scrollHeight 1200 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/fast/frames/frame-set-scaling-hit-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/frame-set-scaling-hit-expected.txt index dc731bd..557237d 100644 --- a/third_party/WebKit/LayoutTests/fast/frames/frame-set-scaling-hit-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/frames/frame-set-scaling-hit-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 1600x1200 +layer at (0,0) size 1600x1200 scrollWidth 1600 scrollHeight 1200 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getParameters.html b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getParameters.html new file mode 100644 index 0000000..b5bc333 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-getParameters.html
@@ -0,0 +1,96 @@ +<!DOCTYPE html> +<html> +<head> +<title>RTCPeerConnection.getParameters</title> +<script src="../../resources/testharness.js"></script> +<script src="../../resources/testharnessreport.js"></script> +</head> +<body> +<script> +promise_test(function() { + let pc1 = new RTCPeerConnection(); + let pc2 = new RTCPeerConnection(); + let video_sender, audio_sender; + + return createStreams({audio:true, video:true}, 1) + .then(function(streams) { + video_sender = pc1.addTrack(streams[0].getVideoTracks()[0], streams[0]); + audio_sender = pc1.addTrack(streams[0].getAudioTracks()[0], streams[0]); + }).then(() => connect_pcs(pc1, pc2)) + .then(() => { + video_parameters = video_sender.getParameters(); + verifySenderParameters(video_parameters, 'video'); + + audio_parameters = audio_sender.getParameters(); + verifySenderParameters(audio_parameters, 'audio'); + }); +}, 'getParameters()'); + +/** + * Helper functions to tests. + */ + +function createStreams(constraints, numStreams, streamsSoFar = []) { + if (numStreams == 0) { + return Promise.resolve(streamsSoFar); + } + return navigator.mediaDevices.getUserMedia(constraints) + .then(function(stream) { + return createStreams(constraints, + numStreams - 1, + streamsSoFar.concat([stream])); + }); +} + +function connect_pcs(localPc, remotePc) { + return localPc.createOffer() + .then(offer => Promise.all([ + localPc.setLocalDescription(offer), + remotePc.setRemoteDescription(offer)])) + .then(() => remotePc.createAnswer()) + .then(answer => Promise.all([ + remotePc.setLocalDescription(answer), + localPc.setRemoteDescription(answer)])) +} + +function verifySenderParameters(parameters, kind) { + assert_not_exists(parameters, "transactionId", "unimplemented transactionId"); + assert_not_exists(parameters, "rtcp", "unimplemented rtcp"); + + assert_greater_than(parameters.codecs.length, 0); + for(let codec of parameters.codecs) { + if(kind === 'video') { + assert_not_exists(codec, "channels", "no channels on video tracks"); + assert_equals(codec.clockRate, 90000); + } else { + assert_exists(codec, "channels", "channel count"); + assert_greater_than(codec.clockRate, 0); + } + + assert_exists(codec, "mimeType", "mime type"); + assert_true(codec.mimeType.startsWith(kind + "/")); + + assert_exists(codec, "payloadType", "payload type"); + assert_not_exists(codec, "sdpFmtpLine", "unimplemented sdp_fmtp_line"); + } + + assert_not_exists(parameters, "headerExtensions", "unimplemented headerExtension"); + + assert_greater_than(parameters.encodings.length, 0); + for(let encoding of parameters.encodings) { + assert_not_exists(encoding, "codecPayloadType", "unset codecPayloadType"); + assert_not_exists(encoding, "dtx", "unset dtx"); + assert_true(encoding.active); + assert_equals(encoding.priority, "low"); + assert_not_exists(encoding, "ptime", "unset ptime"); + assert_not_exists(encoding, "maxBitrate", "unset maxBitrate"); + assert_not_exists(encoding, "maxFramerate", "unset maxFramerate"); + assert_not_exists(encoding, "scaleResolutionDownBy", "unset scaleResolutionDownBy"); + assert_not_exists(encoding, "rid", "unset rid"); + } + + assert_not_exists(parameters, "degradationPreference", "unimplemented degradationPreference"); +} +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/direct-image-compositing-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/direct-image-compositing-expected.txt new file mode 100644 index 0000000..079ab43 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/direct-image-compositing-expected.txt
@@ -0,0 +1,71 @@ +layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 756 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 785x756 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 + LayoutNGBlockFlow {HTML} at (0,0) size 785x755.88 + LayoutNGBlockFlow {BODY} at (8,21.44) size 769x118.44 + LayoutNGBlockFlow {H1} at (0,0) size 769x37 + LayoutText {#text} at (0,0) size 389x36 + text run at (0,0) width 389: "Image optimisation in layers" + LayoutNGBlockFlow {P} at (0,58.44) size 769x60 + LayoutText {#text} at (0,0) size 747x59 + text run at (0,0) width 629: "This test exercises direct compositing of images with hardware acceleration. The visual results using" + text run at (0,20) width 747: "ACCELERATED_COMPOSITING and regular TOT should be identical. Running this test manually with the correct" + text run at (0,40) width 442: "debug options will show which elements are directly composited. See " + LayoutInline {A} at (0,0) size 305x19 [color=#0000EE] + LayoutText {#text} at (442,40) size 305x19 + text run at (442,40) width 305: "https://bugs.webkit.org/show_bug.cgi?id=23361" + LayoutText {#text} at (0,0) size 0x0 + LayoutNGBlockFlow (floating) {DIV} at (0,134.44) size 260x200 + LayoutNGBlockFlow (anonymous) at (0,0) size 260x80 + LayoutText {#text} at (150,0) size 106x79 + text run at (150,0) width 106: "Basic image - no" + text run at (150,20) width 83: "style - can be" + text run at (150,40) width 47: "directly" + text run at (150,60) width 72: "composited" + LayoutNGBlockFlow (floating) {DIV} at (260,134.44) size 260x200 + LayoutNGBlockFlow (anonymous) at (0,0) size 260x80 + LayoutText {#text} at (160,0) size 100x79 + text run at (160,0) width 100: "5px blue border" + text run at (160,20) width 88: "- can NOT be" + text run at (160,40) width 47: "directly" + text run at (160,60) width 72: "composited" + LayoutNGBlockFlow (floating) {DIV} at (0,334.44) size 260x200 + LayoutNGBlockFlow (anonymous) at (0,0) size 260x80 + LayoutText {#text} at (160,0) size 79x79 + text run at (160,0) width 79: "margin - can" + text run at (160,20) width 53: "NOT be" + text run at (160,40) width 47: "directly" + text run at (160,60) width 72: "composited" + LayoutNGBlockFlow (floating) {DIV} at (260,334.44) size 260x200 + LayoutNGBlockFlow (anonymous) at (0,0) size 260x60 + LayoutText {#text} at (150,0) size 109x59 + text run at (150,0) width 109: "solid background" + text run at (150,20) width 101: "- can be directly" + text run at (150,40) width 72: "composited" + LayoutNGBlockFlow (floating) {DIV} at (0,534.44) size 260x200 + LayoutNGBlockFlow (anonymous) at (0,0) size 260x80 + LayoutText {#text} at (150,0) size 104x79 + text run at (150,0) width 75: "background" + text run at (150,20) width 73: "image - can" + text run at (150,40) width 104: "NOT be directly" + text run at (150,60) width 72: "composited" + LayoutNGBlockFlow (floating) {DIV} at (260,534.44) size 260x200 + LayoutNGBlockFlow (anonymous) at (0,0) size 260x100 + LayoutText {#text} at (150,0) size 83x99 + text run at (150,0) width 67: "rotated but" + text run at (150,20) width 81: "otherwise no" + text run at (150,40) width 83: "style - can be" + text run at (150,60) width 47: "directly" + text run at (150,80) width 72: "composited" +layer at (8,156) size 150x150 + LayoutImage (floating) {IMG} at (0,0) size 150x150 +layer at (268,156) size 160x160 + LayoutImage (floating) {IMG} at (0,0) size 160x160 [border: (5px solid #0000FF)] +layer at (13,361) size 150x150 + LayoutImage (floating) {IMG} at (5,5) size 150x150 +layer at (268,356) size 150x150 + LayoutImage (floating) {IMG} at (0,0) size 150x150 [bgcolor=#808080] +layer at (8,556) size 150x150 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 + LayoutImage (floating) {IMG} at (0,0) size 150x150 [bgcolor=#FFA500] +layer at (268,556) size 150x150 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 + LayoutImage (floating) {IMG} at (0,0) size 150x150
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/geometry/root-layer-update-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/geometry/root-layer-update-expected.txt new file mode 100644 index 0000000..04cb2b2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/geometry/root-layer-update-expected.txt
@@ -0,0 +1,20 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x174 + LayoutNGBlockFlow {HTML} at (0,0) size 800x174 + LayoutNGBlockFlow {BODY} at (100,0) size 600x158 + LayoutNGBlockFlow {P} at (0,118) size 600x40 + LayoutInline {A} at (0,0) size 149x19 [color=#0000EE] + LayoutText {#text} at (0,0) size 149x19 + text run at (0,0) width 149: "rdar://problem/7026010" + LayoutBR {BR} at (149,0) size 0x0 + LayoutText {#text} at (0,20) size 461x19 + text run at (0,20) width 461: "Test for the root layer getting correctly positioned. You should see no red." +layer at (350,1) size 100x100 + LayoutNGBlockFlow (positioned) {DIV} at (350,1) size 100x100 [bgcolor=#FF0000] +layer at (-100,0) size 300x100 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 + LayoutNGBlockFlow (positioned) {DIV} at (-100,0) size 300x100 [bgcolor=#808080] +layer at (100,0) size 600x102 + LayoutNGBlockFlow (relative positioned) {DIV} at (0,0) size 600x102 [border: (1px solid #000000)] +layer at (350,1) size 100x100 + LayoutNGBlockFlow {DIV} at (250,1) size 100x100 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/iframes/composited-iframe-alignment-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/iframes/composited-iframe-alignment-expected.txt index f719046..7e077e9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/iframes/composited-iframe-alignment-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/iframes/composited-iframe-alignment-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x76 LayoutNGBlockFlow {HTML} at (0,0) size 800x76 LayoutNGBlockFlow {BODY} at (8,8) size 784x60 - LayoutText {#text} at (0,0) size 769x39 - text run at (0,0) width 769: "Simple test of composited iframe content. There should be a blue box with a gray background inside the black border. The" + LayoutText {#text} at (0,0) size 770x39 + text run at (0,0) width 770: "Simple test of composited iframe content. There should be a blue box with a gray background inside the black border. The" text run at (0,20) width 469: "gray background should fit perfectly within the block border with no gaps." LayoutBR {BR} at (469,20) size 0x0 LayoutBR {BR} at (0,40) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/ancestor-overflow-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/ancestor-overflow-expected.txt index 7d4b054..be7dc78 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/ancestor-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/ancestor-overflow-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x434 LayoutNGBlockFlow {BODY} at (8,16) size 784x410 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 458x19 - text run at (0,0) width 458: "Test overflow clipping of composited elements in various configurations." + LayoutText {#text} at (0,0) size 457x19 + text run at (0,0) width 457: "Test overflow clipping of composited elements in various configurations." LayoutNGBlockFlow (anonymous) at (0,36) size 784x374 LayoutText {#text} at (182,167) size 4x19 text run at (182,167) width 4: " "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/overflow-compositing-descendant-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/overflow-compositing-descendant-expected.txt index 822c014a..00dcd51c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/overflow-compositing-descendant-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/overflow-compositing-descendant-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x52 LayoutNGBlockFlow {BODY} at (8,16) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 466x19 - text run at (0,0) width 466: "You should see a green box under the video. If you see red, the test failed." + LayoutText {#text} at (0,0) size 465x19 + text run at (0,0) width 465: "You should see a green box under the video. If you see red, the test failed." layer at (8,52) size 132x222 clip at (9,53) size 130x220 LayoutNGBlockFlow (positioned) {DIV} at (8,52) size 132x222 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutNGBlockFlow (anonymous) at (11,11) size 110x105
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.png index 4c08d8e..1bcbba6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.txt index f0ff7bc..78d0842 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x52 LayoutNGBlockFlow {BODY} at (8,16) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 505x19 - text run at (0,0) width 505: "Position of reflected layer should update correctly. You should see no red below." + LayoutText {#text} at (0,0) size 503x19 + text run at (0,0) width 503: "Position of reflected layer should update correctly. You should see no red below." layer at (20,50) size 150x120 LayoutNGBlockFlow (positioned) {DIV} at (20,50) size 150x120 layer at (46,185) size 100x100
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.png index eebbf890..f64d191b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.txt index cee2dbe..ff6f45d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/reflections/reflection-positioning2-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x52 LayoutNGBlockFlow {BODY} at (8,16) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 505x19 - text run at (0,0) width 505: "Position of reflected layer should update correctly. You should see no red below." + LayoutText {#text} at (0,0) size 503x19 + text run at (0,0) width 503: "Position of reflected layer should update correctly. You should see no red below." layer at (50,50) size 150x120 LayoutNGBlockFlow (positioned) {DIV} at (50,50) size 150x120 layer at (76,185) size 100x100
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/self-painting-layers-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/self-painting-layers-expected.txt index ca2efd8..66d3c7d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/self-painting-layers-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/self-painting-layers-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x431 LayoutNGBlockFlow {BODY} at (8,16) size 784x405 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 325x19 - text run at (0,0) width 325: "You should not see double text when the div scrolls" + LayoutText {#text} at (0,0) size 324x19 + text run at (0,0) width 324: "You should not see double text when the div scrolls" LayoutNGBlockFlow {DIV} at (10,36) size 302x207 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 layer at (19,53) size 300x200
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/sibling-positioning-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/sibling-positioning-expected.png index 3f2f85e..a2f27013 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/sibling-positioning-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/sibling-positioning-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/text-on-large-layer-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/text-on-large-layer-expected.txt index ee0e596..c2b2d5ef 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/text-on-large-layer-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/text-on-large-layer-expected.txt
@@ -5,8 +5,8 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x0 layer at (3,1) size 2000x10000 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 LayoutNGBlockFlow (positioned) {DIV} at (3,1) size 2000x10000 - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This is some text inside a very large composited layer to test that it is rendered sharply." + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This is some text inside a very large composited layer to test that it is rendered sharply." LayoutBR {BR} at (541,0) size 0x0 LayoutText {#text} at (0,20) size 212x19 text run at (0,20) width 212: "The test passes if this text is crisp."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/comments-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/comments-expected.txt index aa11b21..ca2817e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/comments-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/comments-expected.txt
@@ -65,9 +65,9 @@ LayoutTableSection {TBODY} at (1,1) size 214x308 LayoutTableRow {TR} at (0,0) size 214x28 LayoutNGTableCell {TD} at (0,0) size 214x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 214x280 LayoutNGTableCell {TD} at (0,154) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,130) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/containment-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/containment-expected.txt index 51760c9..81719cc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/containment-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/containment-expected.txt
@@ -39,16 +39,16 @@ LayoutNGBlockFlow {P} at (0,263) size 769x40 LayoutText {#text} at (0,0) size 442x19 text run at (0,0) width 442: "This sentence should NOT be underlined due to the linked style sheet " - LayoutInline {CODE} at (0,0) size 105x16 - LayoutText {#text} at (441,3) size 105x16 - text run at (441,3) width 105: "linktest2.css" - LayoutText {#text} at (545,0) size 9x19 - text run at (545,0) width 9: ", " - LayoutInline {STRONG} at (0,0) size 42x19 - LayoutText {#text} at (553,0) size 42x19 - text run at (553,0) width 42: "unless" - LayoutText {#text} at (594,0) size 741x39 - text run at (594,0) width 147: " the external style sheet" + LayoutInline {CODE} at (0,0) size 104x16 + LayoutText {#text} at (442,3) size 104x16 + text run at (442,3) width 104: "linktest2.css" + LayoutText {#text} at (546,0) size 8x19 + text run at (546,0) width 8: ", " + LayoutInline {STRONG} at (0,0) size 41x19 + LayoutText {#text} at (554,0) size 41x19 + text run at (554,0) width 41: "unless" + LayoutText {#text} at (595,0) size 741x39 + text run at (595,0) width 146: " the external style sheet" text run at (0,20) width 325: "\"Alternate SS\" has been selected via the user agent." LayoutNGBlockFlow {UL} at (0,319) size 769x60 [color=#FF0000] LayoutNGListItem {LI} at (40,0) size 729x20 [color=#008000] @@ -126,9 +126,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x412 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x384 LayoutNGTableCell {TD} at (0,206) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,182) size 4x19 @@ -146,16 +146,16 @@ LayoutNGBlockFlow {P} at (4,60) size 747x40 LayoutText {#text} at (0,0) size 442x19 text run at (0,0) width 442: "This sentence should NOT be underlined due to the linked style sheet " - LayoutInline {CODE} at (0,0) size 105x16 - LayoutText {#text} at (441,3) size 105x16 - text run at (441,3) width 105: "linktest2.css" - LayoutText {#text} at (545,0) size 9x19 - text run at (545,0) width 9: ", " - LayoutInline {STRONG} at (0,0) size 42x19 - LayoutText {#text} at (553,0) size 42x19 - text run at (553,0) width 42: "unless" - LayoutText {#text} at (594,0) size 741x39 - text run at (594,0) width 147: " the external style sheet" + LayoutInline {CODE} at (0,0) size 104x16 + LayoutText {#text} at (442,3) size 104x16 + text run at (442,3) width 104: "linktest2.css" + LayoutText {#text} at (546,0) size 8x19 + text run at (546,0) width 8: ", " + LayoutInline {STRONG} at (0,0) size 41x19 + LayoutText {#text} at (554,0) size 41x19 + text run at (554,0) width 41: "unless" + LayoutText {#text} at (595,0) size 741x39 + text run at (595,0) width 146: " the external style sheet" text run at (0,20) width 325: "\"Alternate SS\" has been selected via the user agent." LayoutNGBlockFlow {UL} at (4,116) size 747x60 [color=#FF0000] LayoutNGListItem {LI} at (40,0) size 707x20 [color=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.png index dd7d39a..5f022aba 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.txt index 9fc7e9a9..ed82803 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/contextual_selectors-expected.txt
@@ -24,8 +24,8 @@ LayoutInline {EM} at (0,0) size 36x19 [color=#008000] LayoutText {#text} at (559,0) size 36x19 text run at (559,0) width 36: "green" - LayoutText {#text} at (594,0) size 5x19 - text run at (594,0) width 5: "." + LayoutText {#text} at (595,0) size 4x19 + text run at (595,0) width 4: "." LayoutNGBlockFlow {UL} at (0,203) size 784x40 LayoutNGListItem {LI} at (40,0) size 744x40 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 @@ -48,9 +48,9 @@ LayoutTableSection {TBODY} at (1,1) size 720x163 LayoutTableRow {TR} at (0,0) size 720x28 LayoutNGTableCell {TD} at (0,0) size 720x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 720x135 LayoutNGTableCell {TD} at (0,81) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,57) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/grouping-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/grouping-expected.txt index e55cde2b..89f9b1b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/grouping-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/grouping-expected.txt
@@ -24,9 +24,9 @@ LayoutTableSection {TBODY} at (1,1) size 214x128 LayoutTableRow {TR} at (0,0) size 214x28 LayoutNGTableCell {TD} at (0,0) size 214x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 214x100 LayoutNGTableCell {TD} at (0,64) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,40) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.png index 31711e2..d7220099 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.txt index c67e82a..96c8543 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/id_as_selector-expected.txt
@@ -56,9 +56,9 @@ LayoutTableSection {TBODY} at (1,1) size 420x241 LayoutTableRow {TR} at (0,0) size 420x28 LayoutNGTableCell {TD} at (0,0) size 420x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 420x213 LayoutNGTableCell {TD} at (0,120) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,96) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/inheritance-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/inheritance-expected.txt index e4740caf..cb91ff0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/inheritance-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/basic/inheritance-expected.txt
@@ -49,8 +49,8 @@ LayoutInline {EM} at (0,0) size 117x19 [color=#800080] LayoutText {#text} at (226,0) size 117x19 text run at (226,0) width 117: "emphasized words" - LayoutText {#text} at (342,0) size 161x19 - text run at (342,0) width 161: ", which should be purple." + LayoutText {#text} at (343,0) size 160x19 + text run at (343,0) width 160: ", which should be purple." LayoutNGBlockFlow {H3} at (0,305.88) size 784x23 [color=#0000FF] LayoutText {#text} at (0,0) size 296x22 text run at (0,0) width 296: "This should be blue and underlined." @@ -102,9 +102,9 @@ LayoutTableSection {TBODY} at (1,1) size 612x294 LayoutTableRow {TR} at (0,0) size 612x28 LayoutNGTableCell {TD} at (0,0) size 612x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 612x266 LayoutNGTableCell {TD} at (0,147) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,123) size 4x19 @@ -137,8 +137,8 @@ LayoutInline {EM} at (0,0) size 117x19 [color=#800080] LayoutText {#text} at (226,0) size 117x19 text run at (226,0) width 117: "emphasized words" - LayoutText {#text} at (342,0) size 161x19 - text run at (342,0) width 161: ", which should be purple." + LayoutText {#text} at (343,0) size 160x19 + text run at (343,0) width 160: ", which should be purple." LayoutNGBlockFlow {H3} at (4,128.16) size 592x23 [color=#0000FF] LayoutText {#text} at (0,0) size 296x22 text run at (0,0) width 296: "This should be blue and underlined."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.png index 546ffbf..9ae04e5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.txt index 6dccacc..4fb9942 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/acid_test-expected.txt
@@ -53,15 +53,15 @@ text run at (0,0) width 473: "This is a nonsensical document, but syntactically valid HTML 4.0. All 100%-conformant CSS1" text run at (0,13) width 480: "agents should be able to render the document elements above this paragraph indistinguishably" text run at (0,26) width 122: "(to the pixel) from this " - LayoutInline {A} at (0,0) size 103x12 [color=#0000EE] - LayoutText {#text} at (121,26) size 103x12 - text run at (121,26) width 103: "reference rendering," - LayoutText {#text} at (223,26) size 474x38 - text run at (223,26) width 251: " (except font rasterization and form widgets). All" + LayoutInline {A} at (0,0) size 102x12 [color=#0000EE] + LayoutText {#text} at (122,26) size 102x12 + text run at (122,26) width 102: "reference rendering," + LayoutText {#text} at (224,26) size 474x38 + text run at (224,26) width 250: " (except font rasterization and form widgets). All" text run at (0,39) width 449: "discrepancies should be traceable to CSS1 implementation shortcomings. Once you have" text run at (0,52) width 259: "finished evaluating this test, you can return to the " - LayoutInline {A} at (0,0) size 61x12 [color=#0000EE] - LayoutText {#text} at (258,52) size 61x12 - text run at (258,52) width 61: "parent page" - LayoutText {#text} at (318,52) size 5x12 - text run at (318,52) width 5: "." + LayoutInline {A} at (0,0) size 60x12 [color=#0000EE] + LayoutText {#text} at (259,52) size 60x12 + text run at (259,52) width 60: "parent page" + LayoutText {#text} at (319,52) size 4x12 + text run at (319,52) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border-expected.txt index d1874ab..e9b2b96 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border-expected.txt
@@ -48,8 +48,8 @@ LayoutInline {TT} at (0,0) size 96x16 LayoutText {#text} at (348,3) size 96x16 text run at (348,3) width 96: "border-style" - LayoutText {#text} at (444,0) size 322x19 - text run at (444,0) width 322: " was not set, and it should not be offset in any way." + LayoutText {#text} at (444,0) size 321x19 + text run at (444,0) width 321: " was not set, and it should not be offset in any way." LayoutNGBlockFlow {P} at (0,495) size 769x46 [border: (3px double #800000)] LayoutText {#text} at (3,3) size 535x19 text run at (3,3) width 535: "This paragraph should have a medium maroon double border around it, even though " @@ -68,16 +68,16 @@ text run at (0,0) width 25: "The" LayoutText {#text} at (25,0) size 715x19 text run at (25,0) width 715: " following image is also an anchor which points to a target on this page, but it should not have a border around it: " - LayoutInline {A} at (0,0) size 16x15 [color=#0000FF] - LayoutImage {IMG} at (739.72,0) size 15x15 - LayoutText {#text} at (754,0) size 5x19 - text run at (754,0) width 5: "." + LayoutInline {A} at (0,0) size 15x15 [color=#0000FF] + LayoutImage {IMG} at (740,0) size 15x15 + LayoutText {#text} at (755,0) size 4x19 + text run at (755,0) width 4: "." LayoutTable {TABLE} at (0,629) size 769x121 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 767x119 LayoutTableRow {TR} at (0,5) size 767x46 LayoutNGTableCell {TD} at (5,5) size 757x46 [border: (2px solid #008000)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (3,3) size 710x39 - text run at (3,3) width 710: "Every cell in this table should have a 2-pixel solid green border. This is also true of the table-testing section in the" + LayoutText {#text} at (3,3) size 711x39 + text run at (3,3) width 711: "Every cell in this table should have a 2-pixel solid green border. This is also true of the table-testing section in the" text run at (3,23) width 175: "second half of the test page." LayoutTableRow {TR} at (0,56) size 767x58 LayoutNGTableCell {TD} at (5,72) size 194x26 [border: (2px solid #008000)] [r=1 c=0 rs=1 cs=1] @@ -100,9 +100,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x655 LayoutTableRow {TR} at (0,0) size 767x30 LayoutNGTableCell {TD} at (0,0) size 767x30 [bgcolor=#C0C0C0] [border: (2px solid #008000)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (5,5) size 161x19 - text run at (5,5) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (5,5) size 159x19 + text run at (5,5) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,30) size 767x625 LayoutNGTableCell {TD} at (0,327) size 14x30 [bgcolor=#C0C0C0] [border: (2px solid #008000)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (5,302) size 4x19 @@ -132,7 +132,7 @@ text run at (348,3) width 96: "border-style" LayoutText {#text} at (444,0) size 732x39 text run at (444,0) width 288: " was not set, and it should not be offset in any" - text run at (0,20) width 30: "way." + text run at (0,20) width 29: "way." LayoutNGBlockFlow {P} at (5,309) size 743x46 [border: (3px double #800000)] LayoutText {#text} at (3,3) size 535x19 text run at (3,3) width 535: "This paragraph should have a medium maroon double border around it, even though " @@ -159,8 +159,8 @@ LayoutTableSection {TBODY} at (1,1) size 741x119 LayoutTableRow {TR} at (0,5) size 741x46 LayoutNGTableCell {TD} at (5,5) size 731x46 [border: (2px solid #008000)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (3,3) size 710x39 - text run at (3,3) width 710: "Every cell in this table should have a 2-pixel solid green border. This is also true of the table-testing section in the" + LayoutText {#text} at (3,3) size 711x39 + text run at (3,3) width 711: "Every cell in this table should have a 2-pixel solid green border. This is also true of the table-testing section in the" text run at (3,23) width 175: "second half of the test page." LayoutTableRow {TR} at (0,56) size 741x58 LayoutNGTableCell {TD} at (5,72) size 187x26 [border: (2px solid #008000)] [r=1 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.png index 11ff658..1fa1629 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.txt index c6fc26a3d..ea3a73d9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom-expected.txt
@@ -30,8 +30,8 @@ LayoutTableSection {TBODY} at (1,1) size 767x116 LayoutTableRow {TR} at (0,5) size 767x45 LayoutNGTableCell {TD} at (5,5) size 757x45 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (2,2) size 735x39 - text run at (2,2) width 735: "Every cell in this table should have a 2-pixel solid green bottom border. This is also true of the table-testing section in" + LayoutText {#text} at (2,2) size 736x39 + text run at (2,2) width 736: "Every cell in this table should have a 2-pixel solid green bottom border. This is also true of the table-testing section in" text run at (2,22) width 198: "the second half of the test page." LayoutTableRow {TR} at (0,55) size 767x56 LayoutNGTableCell {TD} at (5,70) size 192x25 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1] @@ -96,9 +96,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x476 LayoutTableRow {TR} at (0,0) size 767x29 LayoutNGTableCell {TD} at (0,0) size 767x29 [bgcolor=#C0C0C0] [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,29) size 767x447 LayoutNGTableCell {TD} at (0,238) size 12x29 [bgcolor=#C0C0C0] [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,213) size 4x19 @@ -118,8 +118,8 @@ LayoutTableSection {TBODY} at (1,1) size 745x116 LayoutTableRow {TR} at (0,5) size 745x45 LayoutNGTableCell {TD} at (5,5) size 735x45 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (2,2) size 719x39 - text run at (2,2) width 719: "Every cell in this table should have a 2-pixel solid green bottom border. This is also true of the table-testing section" + LayoutText {#text} at (2,2) size 720x39 + text run at (2,2) width 720: "Every cell in this table should have a 2-pixel solid green bottom border. This is also true of the table-testing section" text run at (2,22) width 214: "in the second half of the test page." LayoutTableRow {TR} at (0,55) size 745x56 LayoutNGTableCell {TD} at (5,70) size 186x25 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_inline-expected.txt index a7e1cce..e0dc1454 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_inline-expected.txt
@@ -16,11 +16,11 @@ LayoutNGBlockFlow {P} at (0,115) size 784x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 666x19 text run at (0,0) width 666: "This is an unstyled element, save for the background color, and containing inline elements with classes of " - LayoutInline {SPAN} at (0,0) size 58x29 [border: none (10px double #800080) none] - LayoutText {#text} at (665,0) size 58x19 - text run at (665,0) width 58: "class one" - LayoutText {#text} at (722,0) size 770x39 - text run at (722,0) width 48: ", which" + LayoutInline {SPAN} at (0,0) size 57x29 [border: none (10px double #800080) none] + LayoutText {#text} at (666,0) size 57x19 + text run at (666,0) width 57: "class one" + LayoutText {#text} at (723,0) size 770x39 + text run at (723,0) width 47: ", which" text run at (0,20) width 362: "should have a 10-pixel purple double bottom border; and " LayoutInline {SPAN} at (0,0) size 58x20 [border: none (1px solid #800080) none] LayoutText {#text} at (362,20) size 58x19 @@ -32,9 +32,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x96 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x68 LayoutNGTableCell {TD} at (0,48) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,24) size 4x19 @@ -43,17 +43,17 @@ LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 666x19 text run at (0,0) width 666: "This is an unstyled element, save for the background color, and containing inline elements with classes of " - LayoutInline {SPAN} at (0,0) size 58x29 [border: none (10px double #800080) none] - LayoutText {#text} at (665,0) size 58x19 - text run at (665,0) width 58: "class one" - LayoutText {#text} at (722,0) size 727x39 - text run at (722,0) width 5: "," + LayoutInline {SPAN} at (0,0) size 57x29 [border: none (10px double #800080) none] + LayoutText {#text} at (666,0) size 57x19 + text run at (666,0) width 57: "class one" + LayoutText {#text} at (723,0) size 727x39 + text run at (723,0) width 4: "," text run at (0,20) width 405: "which should have a 10-pixel purple double bottom border; and " LayoutInline {SPAN} at (0,0) size 58x20 [border: none (1px solid #800080) none] LayoutText {#text} at (405,20) size 58x19 text run at (405,20) width 58: "class two" LayoutText {#text} at (463,20) size 755x39 text run at (463,20) width 292: ", which should have a thin solid purple bottom" - text run at (0,40) width 477: "border. The line-height of the parent element should not change on any line." + text run at (0,40) width 478: "border. The line-height of the parent element should not change on any line." layer at (8,105) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,97) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width-expected.txt index 0da25a23..83284b5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width-expected.txt
@@ -58,9 +58,9 @@ LayoutTableSection {TBODY} at (1,1) size 707x379 LayoutTableRow {TR} at (0,0) size 707x28 LayoutNGTableCell {TD} at (0,0) size 707x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 707x351 LayoutNGTableCell {TD} at (0,189) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,165) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width_inline-expected.txt index e18c213..f15d530 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_bottom_width_inline-expected.txt
@@ -22,14 +22,14 @@ text run at (175,6) width 24: "one" LayoutText {#text} at (199,3) size 162x19 text run at (199,3) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 174x23 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] - LayoutText {#text} at (363,3) size 144x19 - text run at (363,3) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (506,6) size 25x16 - text run at (506,6) width 25: "two" - LayoutText {#text} at (533,3) size 767x59 - text run at (533,3) width 221: ", which should result in a thin solid" + LayoutInline {SPAN} at (0,0) size 173x23 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] + LayoutText {#text} at (364,3) size 143x19 + text run at (364,3) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (507,6) size 24x16 + text run at (507,6) width 24: "two" + LayoutText {#text} at (534,3) size 767x59 + text run at (534,3) width 220: ", which should result in a thin solid" text run at (3,23) width 767: "border on the bottom side of each box in the inline element (and the UA's default border on the other three sides). There is" text run at (3,43) width 48: "also an " LayoutInline {SPAN} at (0,0) size 183x19 @@ -45,9 +45,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x144 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x116 LayoutNGTableCell {TD} at (0,72) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,48) size 4x19 @@ -61,14 +61,14 @@ text run at (175,6) width 24: "one" LayoutText {#text} at (199,3) size 162x19 text run at (199,3) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 174x23 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] - LayoutText {#text} at (363,3) size 144x19 - text run at (363,3) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (506,6) size 25x16 - text run at (506,6) width 25: "two" - LayoutText {#text} at (533,3) size 753x59 - text run at (533,3) width 221: ", which should result in a thin solid" + LayoutInline {SPAN} at (0,0) size 173x23 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] + LayoutText {#text} at (364,3) size 143x19 + text run at (364,3) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (507,6) size 24x16 + text run at (507,6) width 24: "two" + LayoutText {#text} at (534,3) size 753x59 + text run at (534,3) width 220: ", which should result in a thin solid" text run at (3,23) width 753: "border on the bottom side of each box in the inline element (and the UA's default border on the other three sides). There" text run at (3,43) width 62: "is also an " LayoutInline {SPAN} at (0,0) size 183x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color-expected.txt index 081a0c2..f451936 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color-expected.txt
@@ -28,9 +28,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x166 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x138 LayoutNGTableCell {TD} at (0,83) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,59) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.png index 2ebb77f..e20d0ad 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.txt index 8b5943836..a3b9907 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_color_inline-expected.txt
@@ -17,14 +17,14 @@ LayoutNGBlockFlow {P} at (0,115) size 784x80 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 677x19 text run at (0,0) width 677: "This is an unstyled element, save for the background color, and containing inline elements with a classes of " - LayoutInline {SPAN} at (0,0) size 64x25 [border: (3px solid #800080)] - LayoutText {#text} at (679,0) size 58x19 - text run at (679,0) width 58: "class one" - LayoutText {#text} at (739,0) size 9x19 - text run at (739,0) width 9: ", " + LayoutInline {SPAN} at (0,0) size 63x25 [border: (3px solid #800080)] + LayoutText {#text} at (680,0) size 57x19 + text run at (680,0) width 57: "class one" + LayoutText {#text} at (740,0) size 8x19 + text run at (740,0) width 8: ", " LayoutInline {SPAN} at (0,0) size 781x45 [border: (3px solid #800080)] - LayoutText {#text} at (750,0) size 781x39 - text run at (750,0) width 31: "class" + LayoutText {#text} at (751,0) size 781x39 + text run at (751,0) width 30: "class" text run at (0,20) width 24: "two" LayoutText {#text} at (27,20) size 35x19 text run at (27,20) width 35: ", and " @@ -39,9 +39,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x116 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x88 LayoutNGTableCell {TD} at (0,58) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,34) size 4x19 @@ -50,11 +50,11 @@ LayoutNGBlockFlow {P} at (4,4) size 762x80 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 677x19 text run at (0,0) width 677: "This is an unstyled element, save for the background color, and containing inline elements with a classes of " - LayoutInline {SPAN} at (0,0) size 64x25 [border: (3px solid #800080)] - LayoutText {#text} at (679,0) size 58x19 - text run at (679,0) width 58: "class one" - LayoutText {#text} at (739,0) size 5x19 - text run at (739,0) width 5: "," + LayoutInline {SPAN} at (0,0) size 63x25 [border: (3px solid #800080)] + LayoutText {#text} at (680,0) size 57x19 + text run at (680,0) width 57: "class one" + LayoutText {#text} at (740,0) size 4x19 + text run at (740,0) width 4: "," LayoutInline {SPAN} at (0,0) size 64x25 [border: (3px solid #800080)] LayoutText {#text} at (3,20) size 58x19 text run at (3,20) width 58: "class two"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_inline-expected.txt index 30e1758..fcd3ae2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_inline-expected.txt
@@ -16,11 +16,11 @@ LayoutNGBlockFlow {P} at (0,115) size 784x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 677x19 text run at (0,0) width 677: "This is an unstyled element, save for the background color, and containing inline elements with a classes of " - LayoutInline {SPAN} at (0,0) size 78x39 [border: (10px outset #008080)] - LayoutText {#text} at (686,0) size 58x19 - text run at (686,0) width 58: "class one" - LayoutText {#text} at (753,0) size 758x39 - text run at (753,0) width 5: "," + LayoutInline {SPAN} at (0,0) size 77x39 [border: (10px outset #008080)] + LayoutText {#text} at (687,0) size 57x19 + text run at (687,0) width 57: "class one" + LayoutText {#text} at (754,0) size 758x39 + text run at (754,0) width 4: "," text run at (0,20) width 353: "which should result in a 10-pixel outset teal border; and " LayoutInline {SPAN} at (0,0) size 78x39 [border: (10px inset #808000)] LayoutText {#text} at (363,20) size 58x19 @@ -32,9 +32,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x96 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x68 LayoutNGTableCell {TD} at (0,48) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,24) size 4x19 @@ -43,11 +43,11 @@ LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 677x19 text run at (0,0) width 677: "This is an unstyled element, save for the background color, and containing inline elements with a classes of " - LayoutInline {SPAN} at (0,0) size 78x39 [border: (10px outset #008080)] - LayoutText {#text} at (686,0) size 58x19 - text run at (686,0) width 58: "class one" - LayoutText {#text} at (753,0) size 758x39 - text run at (753,0) width 5: "," + LayoutInline {SPAN} at (0,0) size 77x39 [border: (10px outset #008080)] + LayoutText {#text} at (687,0) size 57x19 + text run at (687,0) width 57: "class one" + LayoutText {#text} at (754,0) size 758x39 + text run at (754,0) width 4: "," text run at (0,20) width 353: "which should result in a 10-pixel outset teal border; and " LayoutInline {SPAN} at (0,0) size 78x39 [border: (10px inset #808000)] LayoutText {#text} at (363,20) size 58x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.png index a6b0c93..09a912c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.txt index b571a92..c8e7dd5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left-expected.txt
@@ -36,8 +36,8 @@ LayoutTableSection {TBODY} at (1,1) size 767x113 LayoutTableRow {TR} at (0,5) size 767x44 LayoutNGTableCell {TD} at (5,5) size 757x44 [border: (1px inset #808080) (2px solid #008000)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (3,2) size 734x39 - text run at (3,2) width 734: "Every cell in this table should have a 2-pixel solid green left border. This is also true of the table-testing section in the" + LayoutText {#text} at (3,2) size 735x39 + text run at (3,2) width 735: "Every cell in this table should have a 2-pixel solid green left border. This is also true of the table-testing section in the" text run at (3,22) width 175: "second half of the test page." LayoutTableRow {TR} at (0,54) size 767x54 LayoutNGTableCell {TD} at (5,69) size 193x24 [border: (1px inset #808080) (2px solid #008000)] [r=1 c=0 rs=1 cs=1] @@ -98,9 +98,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x471 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080) (2px solid #008000)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (5,4) size 161x19 - text run at (5,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (5,4) size 159x19 + text run at (5,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x443 LayoutNGTableCell {TD} at (0,235) size 13x28 [bgcolor=#C0C0C0] [border: (1px inset #808080) (2px solid #008000)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (5,211) size 4x19 @@ -120,8 +120,8 @@ LayoutTableSection {TBODY} at (1,1) size 743x113 LayoutTableRow {TR} at (0,5) size 743x44 LayoutNGTableCell {TD} at (5,5) size 733x44 [border: (1px inset #808080) (2px solid #008000)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (3,2) size 711x39 - text run at (3,2) width 711: "Every cell in this table should have a 2-pixel solid green left border. This is also true of the table-testing section in" + LayoutText {#text} at (3,2) size 712x39 + text run at (3,2) width 712: "Every cell in this table should have a 2-pixel solid green left border. This is also true of the table-testing section in" text run at (3,22) width 198: "the second half of the test page." LayoutTableRow {TR} at (0,54) size 743x54 LayoutNGTableCell {TD} at (5,69) size 187x24 [border: (1px inset #808080) (2px solid #008000)] [r=1 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_inline-expected.txt index e0b34024..3f12f6d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_inline-expected.txt
@@ -28,14 +28,14 @@ text run at (457,20) width 58: "class two" LayoutText {#text} at (515,20) size 759x39 text run at (515,20) width 244: ", which should have a thin solid purple" - text run at (0,40) width 501: "left border. The line-height of the parent element should not change on any line." + text run at (0,40) width 502: "left border. The line-height of the parent element should not change on any line." LayoutTable {TABLE} at (0,207) size 784x98 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x96 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x68 LayoutNGTableCell {TD} at (0,48) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,24) size 4x19 @@ -55,6 +55,6 @@ text run at (521,20) width 58: "class two" LayoutText {#text} at (579,20) size 717x39 text run at (579,20) width 138: ", which should have a" - text run at (0,40) width 607: "thin solid purple left border. The line-height of the parent element should not change on any line." + text run at (0,40) width 608: "thin solid purple left border. The line-height of the parent element should not change on any line." layer at (8,121) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,113) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width-expected.txt index 2629258..9cb96f8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width-expected.txt
@@ -57,9 +57,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x376 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x348 LayoutNGTableCell {TD} at (0,188) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,164) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width_inline-expected.txt index 71f020d..bfcf98f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_left_width_inline-expected.txt
@@ -22,14 +22,14 @@ text run at (197,6) width 24: "one" LayoutText {#text} at (221,3) size 162x19 text run at (221,3) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 172x25 [border: (3px solid #000000) (1px solid #000000)] - LayoutText {#text} at (383,3) size 144x19 - text run at (383,3) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (526,6) size 25x16 - text run at (526,6) width 25: "two" - LayoutText {#text} at (553,3) size 749x39 - text run at (553,3) width 221: ", which should result in a thin solid" + LayoutInline {SPAN} at (0,0) size 171x25 [border: (3px solid #000000) (1px solid #000000)] + LayoutText {#text} at (384,3) size 143x19 + text run at (384,3) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (527,6) size 24x16 + text run at (527,6) width 24: "two" + LayoutText {#text} at (554,3) size 749x39 + text run at (554,3) width 220: ", which should result in a thin solid" text run at (25,23) width 181: "border on the left side of the " LayoutInline {STRONG} at (0,0) size 27x19 LayoutText {#text} at (206,23) size 27x19 @@ -50,9 +50,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x122 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x94 LayoutNGTableCell {TD} at (0,61) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,37) size 4x19 @@ -66,14 +66,14 @@ text run at (197,6) width 24: "one" LayoutText {#text} at (221,3) size 162x19 text run at (221,3) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 172x25 [border: (3px solid #000000) (1px solid #000000)] - LayoutText {#text} at (383,3) size 144x19 - text run at (383,3) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (526,6) size 25x16 - text run at (526,6) width 25: "two" - LayoutText {#text} at (553,3) size 715x39 - text run at (553,3) width 187: ", which should result in a thin" + LayoutInline {SPAN} at (0,0) size 171x25 [border: (3px solid #000000) (1px solid #000000)] + LayoutText {#text} at (384,3) size 143x19 + text run at (384,3) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (527,6) size 24x16 + text run at (527,6) width 24: "two" + LayoutText {#text} at (554,3) size 715x39 + text run at (554,3) width 186: ", which should result in a thin" text run at (25,23) width 215: "solid border on the left side of the " LayoutInline {STRONG} at (0,0) size 27x19 LayoutText {#text} at (240,23) size 27x19 @@ -81,14 +81,14 @@ LayoutText {#text} at (267,23) size 699x39 text run at (267,23) width 457: " box in the inline element (and the UA's default border on the other three" text run at (25,43) width 147: "sides). There is also an " - LayoutInline {SPAN} at (0,0) size 184x19 - LayoutText {#text} at (171,43) size 144x19 - text run at (171,43) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 41x16 - LayoutText {#text} at (314,46) size 41x16 - text run at (314,46) width 41: "three" - LayoutText {#text} at (354,43) size 693x39 - text run at (354,43) width 364: ", which should have no left border width or visible border" + LayoutInline {SPAN} at (0,0) size 183x19 + LayoutText {#text} at (172,43) size 143x19 + text run at (172,43) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 40x16 + LayoutText {#text} at (315,46) size 40x16 + text run at (315,46) width 40: "three" + LayoutText {#text} at (355,43) size 693x39 + text run at (355,43) width 363: ", which should have no left border width or visible border" text run at (25,63) width 202: "because no border style was set." layer at (8,105) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,97) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right-expected.txt index 82371b3..0bf5288 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right-expected.txt
@@ -29,14 +29,14 @@ text run at (482,20) width 58: "class two" LayoutText {#text} at (541,20) size 741x39 text run at (541,20) width 200: ", which should have a thin solid" - text run at (0,40) width 554: "purple right border. The line-height of the parent element should not change on any line." + text run at (0,40) width 555: "purple right border. The line-height of the parent element should not change on any line." LayoutTable {TABLE} at (0,207) size 784x98 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x96 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x68 LayoutNGTableCell {TD} at (0,48) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,24) size 4x19 @@ -56,6 +56,6 @@ text run at (529,20) width 58: "class two" LayoutText {#text} at (588,20) size 726x39 text run at (588,20) width 138: ", which should have a" - text run at (0,40) width 616: "thin solid purple right border. The line-height of the parent element should not change on any line." + text run at (0,40) width 617: "thin solid purple right border. The line-height of the parent element should not change on any line." layer at (8,121) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,113) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.png index 388578a2..d1f8bf89 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.txt index 11bc8fc..3d3c52a9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_inline-expected.txt
@@ -36,8 +36,8 @@ LayoutTableSection {TBODY} at (1,1) size 767x113 LayoutTableRow {TR} at (0,5) size 767x44 LayoutNGTableCell {TD} at (5,5) size 757x44 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (2,2) size 743x39 - text run at (2,2) width 743: "Every cell in this table should have a 2-pixel solid green right border. This is also true of the table-testing section in the" + LayoutText {#text} at (2,2) size 744x39 + text run at (2,2) width 744: "Every cell in this table should have a 2-pixel solid green right border. This is also true of the table-testing section in the" text run at (2,22) width 175: "second half of the test page." LayoutTableRow {TR} at (0,54) size 767x54 LayoutNGTableCell {TD} at (5,69) size 193x24 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1] @@ -94,14 +94,14 @@ text run at (0,0) width 700: "Each list item in this 'parent' list should have a medium-width border along its right side, in each of three colors." text run at (0,20) width 704: "The first item's border should travel the entire height the nested list (to end near the baseline of the line \"...nested" text run at (0,40) width 707: "within the list item.\"), even though the nested list does not have any border styles set. The borders should line up" - text run at (0,60) width 620: "together at the right edge of the document's body, as each list element has a default width of 100%." + text run at (0,60) width 619: "together at the right edge of the document's body, as each list element has a default width of 100%." LayoutTable {TABLE} at (0,634) size 769x513 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 767x511 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x483 LayoutNGTableCell {TD} at (0,255) size 13x28 [bgcolor=#C0C0C0] [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,231) size 4x19 @@ -121,8 +121,8 @@ LayoutTableSection {TBODY} at (1,1) size 743x113 LayoutTableRow {TR} at (0,5) size 743x44 LayoutNGTableCell {TD} at (5,5) size 733x44 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (2,2) size 720x39 - text run at (2,2) width 720: "Every cell in this table should have a 2-pixel solid green right border. This is also true of the table-testing section in" + LayoutText {#text} at (2,2) size 721x39 + text run at (2,2) width 721: "Every cell in this table should have a 2-pixel solid green right border. This is also true of the table-testing section in" text run at (2,22) width 198: "the second half of the test page." LayoutTableRow {TR} at (0,54) size 743x54 LayoutNGTableCell {TD} at (5,69) size 186x24 [border: (1px inset #808080) (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1] @@ -179,7 +179,7 @@ text run at (0,0) width 700: "Each list item in this 'parent' list should have a medium-width border along its right side, in each of three colors." text run at (0,20) width 641: "The first item's border should travel the entire height the nested list (to end near the baseline of the line" text run at (0,40) width 677: "\"...nested within the list item.\"), even though the nested list does not have any border styles set. The borders" - text run at (0,60) width 668: "should line up together at the right edge of the document's body, as each list element has a default width of" + text run at (0,60) width 667: "should line up together at the right edge of the document's body, as each list element has a default width of" text run at (0,80) width 41: "100%." layer at (8,169) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,161) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width-expected.txt index 5a29182..3c9a3dbf 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width-expected.txt
@@ -58,9 +58,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x376 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x348 LayoutNGTableCell {TD} at (0,188) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,164) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width_inline-expected.txt index e400507..4a5b8431 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_right_width_inline-expected.txt
@@ -22,14 +22,14 @@ text run at (175,6) width 24: "one" LayoutText {#text} at (199,3) size 162x19 text run at (199,3) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 172x25 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] - LayoutText {#text} at (363,3) size 144x19 - text run at (363,3) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (506,6) size 25x16 - text run at (506,6) width 25: "two" - LayoutText {#text} at (531,3) size 749x39 - text run at (531,3) width 221: ", which should result in a thin solid" + LayoutInline {SPAN} at (0,0) size 171x25 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] + LayoutText {#text} at (364,3) size 143x19 + text run at (364,3) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (507,6) size 24x16 + text run at (507,6) width 24: "two" + LayoutText {#text} at (532,3) size 749x39 + text run at (532,3) width 220: ", which should result in a thin solid" text run at (3,23) width 190: "border on the right side of the " LayoutInline {STRONG} at (0,0) size 23x19 LayoutText {#text} at (193,23) size 23x19 @@ -50,9 +50,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x122 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x94 LayoutNGTableCell {TD} at (0,61) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,37) size 4x19 @@ -66,14 +66,14 @@ text run at (175,6) width 24: "one" LayoutText {#text} at (199,3) size 162x19 text run at (199,3) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 172x25 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] - LayoutText {#text} at (363,3) size 144x19 - text run at (363,3) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (506,6) size 25x16 - text run at (506,6) width 25: "two" - LayoutText {#text} at (531,3) size 715x39 - text run at (531,3) width 187: ", which should result in a thin" + LayoutInline {SPAN} at (0,0) size 171x25 [border: (3px solid #000000) (1px solid #000000) (3px solid #000000)] + LayoutText {#text} at (364,3) size 143x19 + text run at (364,3) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (507,6) size 24x16 + text run at (507,6) width 24: "two" + LayoutText {#text} at (532,3) size 715x39 + text run at (532,3) width 186: ", which should result in a thin" text run at (3,23) width 224: "solid border on the right side of the " LayoutInline {STRONG} at (0,0) size 23x19 LayoutText {#text} at (227,23) size 23x19 @@ -81,14 +81,14 @@ LayoutText {#text} at (250,23) size 705x39 text run at (250,23) width 458: " box of the inline element (and the UA's default border on the other three" text run at (3,43) width 147: "sides). There is also an " - LayoutInline {SPAN} at (0,0) size 184x19 - LayoutText {#text} at (149,43) size 144x19 - text run at (149,43) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 41x16 - LayoutText {#text} at (292,46) size 41x16 - text run at (292,46) width 41: "three" - LayoutText {#text} at (332,43) size 702x39 - text run at (332,43) width 373: ", which should have no right border width or visible border" + LayoutInline {SPAN} at (0,0) size 183x19 + LayoutText {#text} at (150,43) size 143x19 + text run at (150,43) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 40x16 + LayoutText {#text} at (293,46) size 40x16 + text run at (293,46) width 40: "three" + LayoutText {#text} at (333,43) size 702x39 + text run at (333,43) width 372: ", which should have no right border width or visible border" text run at (3,63) width 202: "because no border style was set." layer at (8,105) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,97) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style-expected.txt index c527ed5..a13ea714 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style-expected.txt
@@ -61,8 +61,8 @@ text run at (5,5) width 744: "This paragraph should have thick double top and bottom borders, and thick grooved side borders. The color of all four" text run at (5,25) width 204: "sides should be based on purple." LayoutNGBlockFlow {P} at (0,693) size 769x50 [border: (5px double #800080) (5px groove #800080) (5px ridge #800080) (5px inset #800080)] - LayoutText {#text} at (5,5) size 726x39 - text run at (5,5) width 726: "This paragraph should have, in clockwise order from the top, a double, grooved, ridged, and inset thick border. The" + LayoutText {#text} at (5,5) size 727x39 + text run at (5,5) width 727: "This paragraph should have, in clockwise order from the top, a double, grooved, ridged, and inset thick border. The" text run at (5,25) width 306: "color of all four sides should be based on purple." LayoutNGBlockFlow {P} at (0,759) size 769x20 LayoutText {#text} at (0,0) size 278x19 @@ -71,9 +71,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x556 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x528 LayoutNGTableCell {TD} at (0,278) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,254) size 4x19 @@ -108,8 +108,8 @@ text run at (5,5) width 714: "This paragraph should have thick double top and bottom borders, and thick grooved side borders. The color of all" text run at (5,25) width 234: "four sides should be based on purple." LayoutNGBlockFlow {P} at (4,438) size 747x50 [border: (5px double #800080) (5px groove #800080) (5px ridge #800080) (5px inset #800080)] - LayoutText {#text} at (5,5) size 726x39 - text run at (5,5) width 726: "This paragraph should have, in clockwise order from the top, a double, grooved, ridged, and inset thick border. The" + LayoutText {#text} at (5,5) size 727x39 + text run at (5,5) width 727: "This paragraph should have, in clockwise order from the top, a double, grooved, ridged, and inset thick border. The" text run at (5,25) width 306: "color of all four sides should be based on purple." LayoutNGBlockFlow {P} at (4,504) size 747x20 LayoutText {#text} at (0,0) size 278x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.png index ff7fa06..eb97148 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.txt index 198cdaad..d8916931 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_style_inline-expected.txt
@@ -17,30 +17,30 @@ LayoutNGBlockFlow {P} at (0,115) size 784x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 664x19 text run at (0,0) width 664: "This is an unstyled element, save for the background color, and it contains inline elements with classes of " - LayoutInline {SPAN} at (0,0) size 68x29 [border: (5px dashed #000000)] - LayoutText {#text} at (668,0) size 58x19 - text run at (668,0) width 58: "class one" - LayoutText {#text} at (730,0) size 778x39 - text run at (730,0) width 48: ", which" + LayoutInline {SPAN} at (0,0) size 67x29 [border: (5px dashed #000000)] + LayoutText {#text} at (669,0) size 57x19 + text run at (669,0) width 57: "class one" + LayoutText {#text} at (731,0) size 778x39 + text run at (731,0) width 47: ", which" text run at (0,20) width 263: "will result in a dashed thick black border; " LayoutInline {SPAN} at (0,0) size 68x29 [border: (5px groove #FF0000)] LayoutText {#text} at (268,20) size 58x19 text run at (268,20) width 58: "class two" LayoutText {#text} at (331,20) size 373x19 text run at (331,20) width 373: ", which should result in a grooved thick purple border, and " - LayoutInline {SPAN} at (0,0) size 66x19 - LayoutText {#text} at (703,20) size 66x19 - text run at (703,20) width 66: "class three" - LayoutText {#text} at (768,20) size 773x39 - text run at (768,20) width 5: "," + LayoutInline {SPAN} at (0,0) size 65x19 + LayoutText {#text} at (704,20) size 65x19 + text run at (704,20) width 65: "class three" + LayoutText {#text} at (769,20) size 773x39 + text run at (769,20) width 4: "," text run at (0,40) width 679: "which should result in no border at all. The line-height of the parent element should not change, on any line." LayoutTable {TABLE} at (0,191) size 784x98 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x96 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x68 LayoutNGTableCell {TD} at (0,48) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,24) size 4x19 @@ -49,11 +49,11 @@ LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 664x19 text run at (0,0) width 664: "This is an unstyled element, save for the background color, and it contains inline elements with classes of " - LayoutInline {SPAN} at (0,0) size 68x29 [border: (5px dashed #000000)] - LayoutText {#text} at (668,0) size 58x19 - text run at (668,0) width 58: "class one" - LayoutText {#text} at (730,0) size 735x39 - text run at (730,0) width 5: "," + LayoutInline {SPAN} at (0,0) size 67x29 [border: (5px dashed #000000)] + LayoutText {#text} at (669,0) size 57x19 + text run at (669,0) width 57: "class one" + LayoutText {#text} at (731,0) size 735x39 + text run at (731,0) width 4: "," text run at (0,20) width 306: "which will result in a dashed thick black border; " LayoutInline {SPAN} at (0,0) size 68x29 [border: (5px groove #FF0000)] LayoutText {#text} at (311,20) size 58x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.png index 0eb16e5..836f242 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.txt index b9a2693..9e25801 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top-expected.txt
@@ -30,8 +30,8 @@ LayoutTableSection {TBODY} at (1,1) size 767x116 LayoutTableRow {TR} at (0,5) size 767x45 LayoutNGTableCell {TD} at (5,5) size 757x45 [border: (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (2,3) size 734x39 - text run at (2,3) width 734: "Every cell in this table should have a 2-pixel solid green top border. This is also true of the table-testing section in the" + LayoutText {#text} at (2,3) size 735x39 + text run at (2,3) width 735: "Every cell in this table should have a 2-pixel solid green top border. This is also true of the table-testing section in the" text run at (2,23) width 175: "second half of the test page." LayoutTableRow {TR} at (0,55) size 767x56 LayoutNGTableCell {TD} at (5,70) size 192x25 [border: (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1] @@ -90,9 +90,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x456 LayoutTableRow {TR} at (0,0) size 767x29 LayoutNGTableCell {TD} at (0,0) size 767x29 [bgcolor=#C0C0C0] [border: (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,5) size 161x19 - text run at (4,5) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,5) size 159x19 + text run at (4,5) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,29) size 767x427 LayoutNGTableCell {TD} at (0,228) size 12x29 [bgcolor=#C0C0C0] [border: (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,204) size 4x19 @@ -112,8 +112,8 @@ LayoutTableSection {TBODY} at (1,1) size 745x116 LayoutTableRow {TR} at (0,5) size 745x45 LayoutNGTableCell {TD} at (5,5) size 735x45 [border: (2px solid #008000) (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutText {#text} at (2,3) size 711x39 - text run at (2,3) width 711: "Every cell in this table should have a 2-pixel solid green top border. This is also true of the table-testing section in" + LayoutText {#text} at (2,3) size 712x39 + text run at (2,3) width 712: "Every cell in this table should have a 2-pixel solid green top border. This is also true of the table-testing section in" text run at (2,23) width 198: "the second half of the test page." LayoutTableRow {TR} at (0,55) size 745x56 LayoutNGTableCell {TD} at (5,70) size 187x25 [border: (2px solid #008000) (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_inline-expected.txt index 3b74dc6..6c7837f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_inline-expected.txt
@@ -16,25 +16,25 @@ LayoutNGBlockFlow {P} at (0,115) size 784x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 666x19 text run at (0,0) width 666: "This is an unstyled element, save for the background color, and containing inline elements with classes of " - LayoutInline {SPAN} at (0,0) size 58x29 [border: (10px double #800080) none] - LayoutText {#text} at (665,0) size 58x19 - text run at (665,0) width 58: "class one" - LayoutText {#text} at (722,0) size 770x39 - text run at (722,0) width 48: ", which" + LayoutInline {SPAN} at (0,0) size 57x29 [border: (10px double #800080) none] + LayoutText {#text} at (666,0) size 57x19 + text run at (666,0) width 57: "class one" + LayoutText {#text} at (723,0) size 770x39 + text run at (723,0) width 47: ", which" text run at (0,20) width 338: "should have a 10-pixel purple double top border; and " LayoutInline {SPAN} at (0,0) size 58x20 [border: (1px solid #800080) none] LayoutText {#text} at (338,20) size 58x19 text run at (338,20) width 58: "class two" - LayoutText {#text} at (396,20) size 773x39 - text run at (396,20) width 377: ", which should have a thin solid purple top border. The line-" + LayoutText {#text} at (396,20) size 774x39 + text run at (396,20) width 378: ", which should have a thin solid purple top border. The line-" text run at (0,40) width 372: "height of the parent element should not change on any line." LayoutTable {TABLE} at (0,191) size 784x98 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x96 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x68 LayoutNGTableCell {TD} at (0,48) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,24) size 4x19 @@ -43,11 +43,11 @@ LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 666x19 text run at (0,0) width 666: "This is an unstyled element, save for the background color, and containing inline elements with classes of " - LayoutInline {SPAN} at (0,0) size 58x29 [border: (10px double #800080) none] - LayoutText {#text} at (665,0) size 58x19 - text run at (665,0) width 58: "class one" - LayoutText {#text} at (722,0) size 727x39 - text run at (722,0) width 5: "," + LayoutInline {SPAN} at (0,0) size 57x29 [border: (10px double #800080) none] + LayoutText {#text} at (666,0) size 57x19 + text run at (666,0) width 57: "class one" + LayoutText {#text} at (723,0) size 727x39 + text run at (723,0) width 4: "," text run at (0,20) width 381: "which should have a 10-pixel purple double top border; and " LayoutInline {SPAN} at (0,0) size 58x20 [border: (1px solid #800080) none] LayoutText {#text} at (381,20) size 58x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width-expected.txt index fe647bff..f670a8f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width-expected.txt
@@ -55,9 +55,9 @@ LayoutTableSection {TBODY} at (1,1) size 697x318 LayoutTableRow {TR} at (0,0) size 697x28 LayoutNGTableCell {TD} at (0,0) size 697x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 697x290 LayoutNGTableCell {TD} at (0,159) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,135) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width_inline-expected.txt index f88a426..5300a28d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_top_width_inline-expected.txt
@@ -22,14 +22,14 @@ text run at (175,28) width 24: "one" LayoutText {#text} at (199,25) size 162x19 text run at (199,25) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 174x23 [border: (1px solid #000000) (3px solid #000000)] - LayoutText {#text} at (363,25) size 144x19 - text run at (363,25) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (506,28) size 25x16 - text run at (506,28) width 25: "two" - LayoutText {#text} at (533,25) size 772x59 - text run at (533,25) width 221: ", which should result in a thin solid" + LayoutInline {SPAN} at (0,0) size 173x23 [border: (1px solid #000000) (3px solid #000000)] + LayoutText {#text} at (364,25) size 143x19 + text run at (364,25) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (507,28) size 24x16 + text run at (507,28) width 24: "two" + LayoutText {#text} at (534,25) size 772x59 + text run at (534,25) width 220: ", which should result in a thin solid" text run at (3,45) width 772: "border on the top side of each box in the inline element (and the UA's default border on the other three sides). There is also" text run at (3,65) width 19: "an " LayoutInline {SPAN} at (0,0) size 183x19 @@ -44,9 +44,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x144 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x116 LayoutNGTableCell {TD} at (0,72) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,48) size 4x19 @@ -60,14 +60,14 @@ text run at (175,28) width 24: "one" LayoutText {#text} at (199,25) size 162x19 text run at (199,25) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 174x23 [border: (1px solid #000000) (3px solid #000000)] - LayoutText {#text} at (363,25) size 144x19 - text run at (363,25) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (506,28) size 25x16 - text run at (506,28) width 25: "two" - LayoutText {#text} at (533,25) size 751x59 - text run at (533,25) width 221: ", which should result in a thin solid" + LayoutInline {SPAN} at (0,0) size 173x23 [border: (1px solid #000000) (3px solid #000000)] + LayoutText {#text} at (364,25) size 143x19 + text run at (364,25) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (507,28) size 24x16 + text run at (507,28) width 24: "two" + LayoutText {#text} at (534,25) size 751x59 + text run at (534,25) width 220: ", which should result in a thin solid" text run at (3,45) width 743: "border on the top side of each box in the inline element (and the UA's default border on the other three sides). There is" text run at (3,65) width 48: "also an " LayoutInline {SPAN} at (0,0) size 183x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width-expected.txt index 8ad5e773..5fa00d9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width-expected.txt
@@ -55,9 +55,9 @@ LayoutTableSection {TBODY} at (1,1) size 668x390 LayoutTableRow {TR} at (0,0) size 668x28 LayoutNGTableCell {TD} at (0,0) size 668x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 668x362 LayoutNGTableCell {TD} at (0,195) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,171) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width_inline-expected.txt index 392e71a..0668e1f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/border_width_inline-expected.txt
@@ -22,31 +22,31 @@ text run at (197,28) width 24: "one" LayoutText {#text} at (221,25) size 162x19 text run at (221,25) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 170x21 [border: (1px solid #000000)] - LayoutText {#text} at (383,25) size 144x19 - text run at (383,25) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (526,28) size 25x16 - text run at (526,28) width 25: "two" - LayoutText {#text} at (551,25) size 713x39 - text run at (551,25) width 187: ", which should result in a thin" + LayoutInline {SPAN} at (0,0) size 169x21 [border: (1px solid #000000)] + LayoutText {#text} at (384,25) size 143x19 + text run at (384,25) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (527,28) size 24x16 + text run at (527,28) width 24: "two" + LayoutText {#text} at (552,25) size 713x39 + text run at (552,25) width 186: ", which should result in a thin" text run at (25,45) width 477: "solid border on each side of each box in the inline element. There is also an " - LayoutInline {SPAN} at (0,0) size 184x19 - LayoutText {#text} at (501,45) size 144x19 - text run at (501,45) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 41x16 - LayoutText {#text} at (644,48) size 41x16 - text run at (644,48) width 41: "three" - LayoutText {#text} at (684,45) size 707x39 - text run at (684,45) width 48: ", which" + LayoutInline {SPAN} at (0,0) size 183x19 + LayoutText {#text} at (502,45) size 143x19 + text run at (502,45) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 40x16 + LayoutText {#text} at (645,48) size 40x16 + text run at (645,48) width 40: "three" + LayoutText {#text} at (685,45) size 707x39 + text run at (685,45) width 47: ", which" text run at (25,65) width 387: "should have no border width because no border style was set." LayoutTable {TABLE} at (0,241) size 784x148 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x146 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x118 LayoutNGTableCell {TD} at (0,73) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,49) size 4x19 @@ -60,23 +60,23 @@ text run at (197,28) width 24: "one" LayoutText {#text} at (221,25) size 162x19 text run at (221,25) width 162: ". However, it contains an " - LayoutInline {SPAN} at (0,0) size 170x21 [border: (1px solid #000000)] - LayoutText {#text} at (383,25) size 144x19 - text run at (383,25) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (526,28) size 25x16 - text run at (526,28) width 25: "two" - LayoutText {#text} at (551,25) size 685x39 - text run at (551,25) width 159: ", which should result in a" + LayoutInline {SPAN} at (0,0) size 169x21 [border: (1px solid #000000)] + LayoutText {#text} at (384,25) size 143x19 + text run at (384,25) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (527,28) size 24x16 + text run at (527,28) width 24: "two" + LayoutText {#text} at (552,25) size 685x39 + text run at (552,25) width 158: ", which should result in a" text run at (25,45) width 505: "thin solid border on each side of each box in the inline element. There is also an " - LayoutInline {SPAN} at (0,0) size 184x19 - LayoutText {#text} at (529,45) size 144x19 - text run at (529,45) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 41x16 - LayoutText {#text} at (672,48) size 41x16 - text run at (672,48) width 41: "three" - LayoutText {#text} at (712,45) size 692x39 - text run at (712,45) width 5: "," + LayoutInline {SPAN} at (0,0) size 183x19 + LayoutText {#text} at (530,45) size 143x19 + text run at (530,45) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 40x16 + LayoutText {#text} at (673,48) size 40x16 + text run at (673,48) width 40: "three" + LayoutText {#text} at (713,45) size 692x39 + text run at (713,45) width 4: "," text run at (25,65) width 430: "which should have no border width because no border style was set." layer at (8,105) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,97) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear-expected.txt index 8871a79..5a81a39a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear-expected.txt
@@ -18,8 +18,8 @@ text run at (160,48) width 0: " " LayoutImage (floating) {IMG} at (0,123) size 15x50 LayoutNGBlockFlow {P} at (0,131) size 769x20 - LayoutText {#text} at (18,0) size 594x19 - text run at (18,0) width 594: "This text should be flowing past a tall orange rectangle on the left side of the browser window." + LayoutText {#text} at (18,0) size 593x19 + text run at (18,0) width 593: "This text should be flowing past a tall orange rectangle on the left side of the browser window." LayoutNGBlockFlow (anonymous) at (0,167) size 769x20 LayoutBR {BR} at (18,0) size 0x0 LayoutImage (floating) {IMG} at (0,20) size 15x50 @@ -50,9 +50,9 @@ LayoutTableSection {TBODY} at (1,1) size 678x446 LayoutTableRow {TR} at (0,0) size 678x28 LayoutNGTableCell {TD} at (0,0) size 678x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 678x418 LayoutNGTableCell {TD} at (0,223) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,199) size 4x19 @@ -60,8 +60,8 @@ LayoutNGTableCell {TD} at (12,28) size 666x418 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutImage (floating) {IMG} at (4,4) size 15x50 LayoutNGBlockFlow {P} at (4,4) size 658x20 - LayoutText {#text} at (18,0) size 594x19 - text run at (18,0) width 594: "This text should be flowing past a tall orange rectangle on the left side of the browser window." + LayoutText {#text} at (18,0) size 593x19 + text run at (18,0) width 593: "This text should be flowing past a tall orange rectangle on the left side of the browser window." LayoutNGBlockFlow (anonymous) at (4,40) size 658x20 LayoutBR {BR} at (18,0) size 0x0 LayoutImage (floating) {IMG} at (0,20) size 15x50
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.png index 2392761..235b1c5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.txt index 7382cc0..4061711 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/clear_float-expected.txt
@@ -26,8 +26,8 @@ text run at (0,128) width 0: " " LayoutNGBlockFlow (floating) {DIV} at (0,200) size 192x125.38 [color=#FFFFFF] [bgcolor=#008000] LayoutNGBlockFlow {H1} at (8,8) size 176x23 - LayoutText {#text} at (0,0) size 84x22 - text run at (0,0) width 84: "Top menu" + LayoutText {#text} at (0,0) size 83x22 + text run at (0,0) width 83: "Top menu" LayoutNGBlockFlow {UL} at (24,34.19) size 155.20x80 LayoutNGListItem {LI} at (0,0) size 155.20x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 @@ -101,9 +101,9 @@ LayoutTableSection {TBODY} at (1,1) size 590x372 LayoutTableRow {TR} at (0,0) size 590x28 LayoutNGTableCell {TD} at (0,0) size 590x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 590x344 LayoutNGTableCell {TD} at (0,186) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,162) size 4x19 @@ -111,8 +111,8 @@ LayoutNGTableCell {TD} at (12,28) size 578x343.88 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow (floating) {DIV} at (4,4) size 192x125.38 [color=#FFFFFF] [bgcolor=#008000] LayoutNGBlockFlow {H1} at (8,8) size 176x23 - LayoutText {#text} at (0,0) size 84x22 - text run at (0,0) width 84: "Top menu" + LayoutText {#text} at (0,0) size 83x22 + text run at (0,0) width 83: "Top menu" LayoutNGBlockFlow {UL} at (24,34.19) size 155.20x80 LayoutNGListItem {LI} at (0,0) size 155.20x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float-expected.txt index 869cc71..16433ee 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float-expected.txt
@@ -15,23 +15,23 @@ text run at (0,32) width 0: " " LayoutImage (floating) {IMG} at (0,107) size 15x50 LayoutNGBlockFlow {P} at (0,115) size 784x40 - LayoutText {#text} at (15,0) size 763x39 - text run at (15,0) width 763: "This text should be flowing past a tall orange rectangle on the left side of the browser window. In this case, it is the image" + LayoutText {#text} at (15,0) size 762x39 + text run at (15,0) width 762: "This text should be flowing past a tall orange rectangle on the left side of the browser window. In this case, it is the image" text run at (15,20) width 212: "which has been floated to the left." LayoutNGBlockFlow (anonymous) at (0,171) size 784x20 LayoutBR {BR} at (0,0) size 0x0 LayoutImage (floating) {IMG} at (769,209) size 15x50 LayoutNGBlockFlow {P} at (0,217) size 784x40 - LayoutText {#text} at (0,0) size 730x39 - text run at (0,0) width 730: "This text should be flowing past a tall orange rectangle on the right side of the browser window. In this case, it is the" + LayoutText {#text} at (0,0) size 729x39 + text run at (0,0) width 729: "This text should be flowing past a tall orange rectangle on the right side of the browser window. In this case, it is the" text run at (0,20) width 263: "image which has been floated to the right." LayoutTable {TABLE} at (0,273) size 784x182 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x180 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x152 LayoutNGTableCell {TD} at (0,90) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,66) size 4x19 @@ -39,15 +39,15 @@ LayoutNGTableCell {TD} at (12,28) size 770x152 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutImage (floating) {IMG} at (4,4) size 15x50 LayoutNGBlockFlow {P} at (4,4) size 762x40 - LayoutText {#text} at (15,0) size 721x39 - text run at (15,0) width 721: "This text should be flowing past a tall orange rectangle on the left side of the browser window. In this case, it is the" + LayoutText {#text} at (15,0) size 720x39 + text run at (15,0) width 720: "This text should be flowing past a tall orange rectangle on the left side of the browser window. In this case, it is the" text run at (15,20) width 254: "image which has been floated to the left." LayoutNGBlockFlow (anonymous) at (4,60) size 762x20 LayoutBR {BR} at (0,0) size 0x0 LayoutImage (floating) {IMG} at (751,98) size 15x50 LayoutNGBlockFlow {P} at (4,106) size 762x40 - LayoutText {#text} at (0,0) size 730x39 - text run at (0,0) width 730: "This text should be flowing past a tall orange rectangle on the right side of the browser window. In this case, it is the" + LayoutText {#text} at (0,0) size 729x39 + text run at (0,0) width 729: "This text should be flowing past a tall orange rectangle on the right side of the browser window. In this case, it is the" text run at (0,20) width 263: "image which has been floated to the right." layer at (8,105) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,97) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.png index deb58f2..fc27df9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.txt index 0edf731a..73a3184 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/float_margin-expected.txt
@@ -26,9 +26,9 @@ text run at (400,112) width 0: " " text run at (0,128) width 0: " " LayoutNGBlockFlow {P} at (30,215) size 729x92 [bgcolor=#FFFFFF] - LayoutText {#text} at (0,0) size 729x91 + LayoutText {#text} at (0,0) size 728x91 text run at (0,0) width 663: "This paragraph should have a white background which extends to the edges of the" - text run at (0,23) width 729: "element's box. There is no padding set on this paragraph whatsoever. If the background of" + text run at (0,23) width 728: "element's box. There is no padding set on this paragraph whatsoever. If the background of" text run at (0,46) width 721: "the entire box is not white, this may cause problems with the following tests; at any rate," text run at (0,69) width 240: "it must be taken into account." LayoutNGBlockFlow {P} at (30,327) size 729x115 [bgcolor=#FFFFFF] @@ -39,16 +39,16 @@ text run at (60,23) width 659: "nothing more. The edges of the white background should line up with the top and" text run at (60,46) width 650: "left edges of the image. This paragraph should have a white background, first of" text run at (0,69) width 677: "all, which extends to the edges of the element's box. There is no padding set on this" - text run at (0,92) width 182: "paragraph whatsoever." + text run at (0,92) width 181: "paragraph whatsoever." LayoutNGBlockFlow {P} at (30,462) size 729x115 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (30,30) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 729x115 - LayoutText {#text} at (90,0) size 717x114 + LayoutText {#text} at (90,0) size 716x114 text run at (90,0) width 615: "The image in the upper left corner of this paragraph should be pushed down" text run at (90,23) width 611: "and to the right 30 pixels each from the upper left corner of the paragraph's" - text run at (90,46) width 627: "box, and displace the paragraph text accordingly. This paragraph should have" + text run at (90,46) width 626: "box, and displace the paragraph text accordingly. This paragraph should have" text run at (90,69) width 613: "a white background, first of all, which extends to the edges of the element's" - text run at (0,92) width 476: "box. There is no padding set on this paragraph whatsoever." + text run at (0,92) width 475: "box. There is no padding set on this paragraph whatsoever." LayoutNGBlockFlow {P} at (30,597) size 729x115 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (-30,-30) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 729x115 @@ -57,7 +57,7 @@ text run at (30,23) width 691: "left 30 pixels each from the upper left corner of the paragraph's box, thus causing the" text run at (0,46) width 669: "edges of the white background to align with the thick gray lines in the image. This" text run at (0,69) width 719: "paragraph should have a white background, first of all, which extends to the edges of the" - text run at (0,92) width 558: "element's box. There is no padding set on this paragraph whatsoever." + text run at (0,92) width 557: "element's box. There is no padding set on this paragraph whatsoever." LayoutNGBlockFlow {P} at (30,732) size 729x138 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (0,0) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 729x138 @@ -67,7 +67,7 @@ text run at (90,46) width 616: "of the image. However, there should be 30 pixels of space between the right" text run at (90,69) width 560: "and bottom edges of the image and the paragraph text around it. This" text run at (0,92) width 719: "paragraph should have a white background, first of all, which extends to the edges of the" - text run at (0,115) width 558: "element's box. There is no padding set on this paragraph whatsoever." + text run at (0,115) width 557: "element's box. There is no padding set on this paragraph whatsoever." LayoutNGBlockFlow {P} at (30,890) size 729x138 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (0,0) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 729x138 @@ -77,23 +77,23 @@ text run at (0,46) width 696: "image. However, the text should overlap the image's right and bottom sides, lining up" text run at (0,69) width 706: "with the thick gray lines in the image. This paragraph should have a white background," text run at (0,92) width 703: "first of all, which extends to the edges of the element's box. There is no padding set on" - text run at (0,115) width 217: "this paragraph whatsoever." + text run at (0,115) width 216: "this paragraph whatsoever." LayoutTable {TABLE} at (0,1048) size 769x851 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 767x849 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x821 LayoutNGTableCell {TD} at (0,424) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,400) size 4x19 text run at (4,400) width 4: " " LayoutNGTableCell {TD} at (12,28) size 755x821 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (34,4) size 707x92 [bgcolor=#FFFFFF] - LayoutText {#text} at (0,0) size 707x91 + LayoutText {#text} at (0,0) size 706x91 text run at (0,0) width 663: "This paragraph should have a white background which extends to the edges of the" - text run at (0,23) width 707: "element's box. There is no padding set on this paragraph whatsoever. If the background" + text run at (0,23) width 706: "element's box. There is no padding set on this paragraph whatsoever. If the background" text run at (0,46) width 702: "of the entire box is not white, this may cause problems with the following tests; at any" text run at (0,69) width 281: "rate, it must be taken into account." LayoutNGBlockFlow {P} at (34,116) size 707x115 [bgcolor=#FFFFFF] @@ -104,16 +104,16 @@ text run at (60,23) width 625: "nothing more. The edges of the white background should line up with the top" text run at (60,46) width 623: "and left edges of the image. This paragraph should have a white background," text run at (0,69) width 703: "first of all, which extends to the edges of the element's box. There is no padding set on" - text run at (0,92) width 217: "this paragraph whatsoever." + text run at (0,92) width 216: "this paragraph whatsoever." LayoutNGBlockFlow {P} at (34,251) size 707x115 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (30,30) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 707x115 LayoutText {#text} at (90,0) size 705x114 text run at (90,0) width 615: "The image in the upper left corner of this paragraph should be pushed down" text run at (90,23) width 611: "and to the right 30 pixels each from the upper left corner of the paragraph's" - text run at (90,46) width 584: "box, and displace the paragraph text accordingly. This paragraph should" + text run at (90,46) width 583: "box, and displace the paragraph text accordingly. This paragraph should" text run at (90,69) width 574: "have a white background, first of all, which extends to the edges of the" - text run at (0,92) width 558: "element's box. There is no padding set on this paragraph whatsoever." + text run at (0,92) width 557: "element's box. There is no padding set on this paragraph whatsoever." LayoutNGBlockFlow {P} at (34,386) size 707x115 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (-30,-30) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 707x115 @@ -122,7 +122,7 @@ text run at (30,23) width 661: "left 30 pixels each from the upper left corner of the paragraph's box, thus causing" text run at (0,46) width 699: "the edges of the white background to align with the thick gray lines in the image. This" text run at (0,69) width 689: "paragraph should have a white background, first of all, which extends to the edges of" - text run at (0,92) width 588: "the element's box. There is no padding set on this paragraph whatsoever." + text run at (0,92) width 587: "the element's box. There is no padding set on this paragraph whatsoever." LayoutNGBlockFlow {P} at (34,521) size 707x138 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (0,0) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 707x138 @@ -132,7 +132,7 @@ text run at (90,46) width 593: "edges of the image. However, there should be 30 pixels of space between" text run at (90,69) width 593: "the right and bottom edges of the image and the paragraph text around it." text run at (0,92) width 657: "This paragraph should have a white background, first of all, which extends to the" - text run at (0,115) width 661: "edges of the element's box. There is no padding set on this paragraph whatsoever." + text run at (0,115) width 660: "edges of the element's box. There is no padding set on this paragraph whatsoever." LayoutNGBlockFlow {P} at (34,679) size 707x138 [bgcolor=#FFFFFF] LayoutImage (floating) {IMG} at (0,0) size 60x60 LayoutNGBlockFlow (anonymous) at (0,0) size 707x138 @@ -142,6 +142,6 @@ text run at (0,46) width 696: "image. However, the text should overlap the image's right and bottom sides, lining up" text run at (0,69) width 706: "with the thick gray lines in the image. This paragraph should have a white background," text run at (0,92) width 703: "first of all, which extends to the edges of the element's box. There is no padding set on" - text run at (0,115) width 217: "this paragraph whatsoever." + text run at (0,115) width 216: "this paragraph whatsoever." layer at (8,201) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,193) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/height-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/height-expected.txt index eaeae8f..423ef8a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/height-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/height-expected.txt
@@ -41,9 +41,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x446 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x418 LayoutNGTableCell {TD} at (0,223) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,199) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.png index fce4bb1f..e517aa0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.txt index d1d4408..fb2c168b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin-expected.txt
@@ -87,7 +87,7 @@ LayoutText {#text} at (0,0) size 775x59 text run at (0,0) width 758: "This paragraph has an overall margin of -10px, which should make it wider than usual as well as shift it upward and pull" text run at (0,20) width 775: "subsequent text up toward it, and a light blue background. In all other respects, however, the element should be normal. No" - text run at (0,40) width 527: "styles have been applied to it besides the negative margin and the background color." + text run at (0,40) width 528: "styles have been applied to it besides the negative margin and the background color." LayoutNGBlockFlow {P} at (0,1393) size 784x20 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." @@ -95,9 +95,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x1279 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x1251 LayoutNGTableCell {TD} at (0,639) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,615) size 4x19 @@ -169,7 +169,7 @@ LayoutText {#text} at (0,0) size 775x59 text run at (0,0) width 758: "This paragraph has an overall margin of -10px, which should make it wider than usual as well as shift it upward and pull" text run at (0,20) width 775: "subsequent text up toward it, and a light blue background. In all other respects, however, the element should be normal. No" - text run at (0,40) width 527: "styles have been applied to it besides the negative margin and the background color." + text run at (0,40) width 528: "styles have been applied to it besides the negative margin and the background color." LayoutNGBlockFlow {P} at (4,1227) size 762x20 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom-expected.txt index b9a6cc3..ac7055f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom-expected.txt
@@ -76,9 +76,9 @@ LayoutText {#text} at (0,0) size 294x19 text run at (0,0) width 294: "This list item has no special styles applied to it." LayoutNGBlockFlow {P} at (0,898.25) size 769x60 [bgcolor=#00FFFF] - LayoutText {#text} at (0,0) size 759x59 + LayoutText {#text} at (0,0) size 760x59 text run at (0,0) width 748: "This paragraph has a bottom margin of -10px, which should cause elements after it to be shifted \"upward\" on the page," - text run at (0,20) width 759: "and no top margin. No other styles have been applied to it besides a light blue background color. In all other respects, the" + text run at (0,20) width 760: "and no top margin. No other styles have been applied to it besides a light blue background color. In all other respects, the" text run at (0,40) width 166: "element should be normal." LayoutNGBlockFlow {P} at (0,948.25) size 769x20 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 203x19 @@ -90,9 +90,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x816 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x788 LayoutNGTableCell {TD} at (0,408) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,384) size 4x19 @@ -149,9 +149,9 @@ LayoutText {#text} at (0,0) size 294x19 text run at (0,0) width 294: "This list item has no special styles applied to it." LayoutNGBlockFlow {P} at (4,693.75) size 747x60 [bgcolor=#00FFFF] - LayoutText {#text} at (0,0) size 716x59 + LayoutText {#text} at (0,0) size 717x59 text run at (0,0) width 710: "This paragraph has a bottom margin of -10px, which should cause elements after it to be shifted \"upward\" on the" - text run at (0,20) width 716: "page, and no top margin. No other styles have been applied to it besides a light blue background color. In all other" + text run at (0,20) width 717: "page, and no top margin. No other styles have been applied to it besides a light blue background color. In all other" text run at (0,40) width 247: "respects, the element should be normal." LayoutNGBlockFlow {P} at (4,743.75) size 747x20 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 203x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom_inline-expected.txt index f5a2509..d3eb0c9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_bottom_inline-expected.txt
@@ -13,76 +13,76 @@ text run at (0,16) width 416: ".two {margin-bottom: -10px; background-color: aqua;}" text run at (416,16) width 0: " " LayoutNGBlockFlow {P} at (0,99) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 760x39 [bgcolor=#00FFFF] - LayoutText {#text} at (479,0) size 144x19 - text run at (479,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (622,3) size 25x16 - text run at (622,3) width 25: "one" - LayoutText {#text} at (646,0) size 760x39 - text run at (646,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 759x39 [bgcolor=#00FFFF] + LayoutText {#text} at (479,0) size 143x19 + text run at (479,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (622,3) size 24x16 + text run at (622,3) width 24: "one" + LayoutText {#text} at (646,0) size 759x39 + text run at (646,0) width 113: ", giving it an aqua" text run at (0,20) width 245: "background and a 25px bottom margin" - LayoutText {#text} at (244,20) size 784x39 - text run at (244,20) width 540: ". Margins on inline elements does not affect line-height calculations, so all lines in this" + LayoutText {#text} at (245,20) size 784x39 + text run at (245,20) width 539: ". Margins on inline elements does not affect line-height calculations, so all lines in this" text run at (0,40) width 263: "element should have the same line-height." LayoutNGBlockFlow {P} at (0,175) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 760x39 [bgcolor=#00FFFF] - LayoutText {#text} at (479,0) size 144x19 - text run at (479,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (622,3) size 25x16 - text run at (622,3) width 25: "two" - LayoutText {#text} at (646,0) size 760x39 - text run at (646,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 759x39 [bgcolor=#00FFFF] + LayoutText {#text} at (479,0) size 143x19 + text run at (479,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (622,3) size 24x16 + text run at (622,3) width 24: "two" + LayoutText {#text} at (646,0) size 759x39 + text run at (646,0) width 113: ", giving it an aqua" text run at (0,20) width 250: "background and a -10px bottom margin" - LayoutText {#text} at (249,20) size 763x39 - text run at (249,20) width 514: ". Margins on inline elements does not affect line-height calculations, so all lines in" + LayoutText {#text} at (250,20) size 763x39 + text run at (250,20) width 513: ". Margins on inline elements does not affect line-height calculations, so all lines in" text run at (0,40) width 289: "this element should have the same line-height." LayoutTable {TABLE} at (0,251) size 784x174 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x172 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x144 LayoutNGTableCell {TD} at (0,86) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,62) size 4x19 text run at (4,62) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x144 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 760x39 [bgcolor=#00FFFF] - LayoutText {#text} at (479,0) size 144x19 - text run at (479,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (622,3) size 25x16 - text run at (622,3) width 25: "one" - LayoutText {#text} at (646,0) size 760x39 - text run at (646,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 759x39 [bgcolor=#00FFFF] + LayoutText {#text} at (479,0) size 143x19 + text run at (479,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (622,3) size 24x16 + text run at (622,3) width 24: "one" + LayoutText {#text} at (646,0) size 759x39 + text run at (646,0) width 113: ", giving it an aqua" text run at (0,20) width 245: "background and a 25px bottom margin" - LayoutText {#text} at (244,20) size 758x39 - text run at (244,20) width 514: ". Margins on inline elements does not affect line-height calculations, so all lines in" + LayoutText {#text} at (245,20) size 758x39 + text run at (245,20) width 513: ". Margins on inline elements does not affect line-height calculations, so all lines in" text run at (0,40) width 289: "this element should have the same line-height." LayoutNGBlockFlow {P} at (4,80) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 760x39 [bgcolor=#00FFFF] - LayoutText {#text} at (479,0) size 144x19 - text run at (479,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (622,3) size 25x16 - text run at (622,3) width 25: "two" - LayoutText {#text} at (646,0) size 760x39 - text run at (646,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 759x39 [bgcolor=#00FFFF] + LayoutText {#text} at (479,0) size 143x19 + text run at (479,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (622,3) size 24x16 + text run at (622,3) width 24: "two" + LayoutText {#text} at (646,0) size 759x39 + text run at (646,0) width 113: ", giving it an aqua" text run at (0,20) width 250: "background and a -10px bottom margin" - LayoutText {#text} at (249,20) size 747x39 - text run at (249,20) width 498: ". Margins on inline elements does not affect line-height calculations, so all lines" + LayoutText {#text} at (250,20) size 747x39 + text run at (250,20) width 497: ". Margins on inline elements does not affect line-height calculations, so all lines" text run at (0,40) width 305: "in this element should have the same line-height." layer at (8,89) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,81) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_inline-expected.txt index 822ed81..2deb086 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_inline-expected.txt
@@ -18,38 +18,38 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (0,143) size 784x80 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 751x39 [bgcolor=#00FFFF] - LayoutText {#text} at (504,0) size 144x19 - text run at (504,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (647,3) size 25x16 - text run at (647,3) width 25: "one" - LayoutText {#text} at (671,0) size 751x39 - text run at (671,0) width 80: ", giving it an" - text run at (0,20) width 231: "aqua background and a 25px margin" - LayoutText {#text} at (255,20) size 769x59 - text run at (255,20) width 514: ". Margins on inline elements does not affect line-height calculations, so all lines in" - text run at (0,40) width 766: "this element should have the same line-height. However, there should be a 25px margin to the left side of the inline box in" - text run at (0,60) width 727: "the first line it appears, and a 25px margin to the right side of the inline element box in the last line where it appears." + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 784x39 [bgcolor=#00FFFF] + LayoutText {#text} at (504,0) size 143x19 + text run at (504,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (647,3) size 24x16 + text run at (647,3) width 24: "one" + LayoutText {#text} at (671,0) size 784x39 + text run at (671,0) width 113: ", giving it an aqua" + text run at (0,20) width 197: "background and a 25px margin" + LayoutText {#text} at (222,20) size 763x59 + text run at (222,20) width 539: ". Margins on inline elements does not affect line-height calculations, so all lines in this" + text run at (0,40) width 763: "element should have the same line-height. However, there should be a 25px margin to the left side of the inline box in the" + text run at (0,60) width 704: "first line it appears, and a 25px margin to the right side of the inline element box in the last line where it appears." LayoutNGBlockFlow {P} at (0,239) size 784x20 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (0,275) size 784x80 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 750x39 [bgcolor=#00FFFF] - LayoutText {#text} at (469,0) size 144x19 - text run at (469,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (612,3) size 25x16 - text run at (612,3) width 25: "two" - LayoutText {#text} at (636,0) size 750x39 - text run at (636,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 749x39 [bgcolor=#00FFFF] + LayoutText {#text} at (469,0) size 143x19 + text run at (469,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (612,3) size 24x16 + text run at (612,3) width 24: "two" + LayoutText {#text} at (636,0) size 749x39 + text run at (636,0) width 113: ", giving it an aqua" text run at (0,20) width 202: "background and a -10px margin" - LayoutText {#text} at (191,20) size 784x59 - text run at (191,20) width 593: ". Margins on inline elements does not affect line-height calculations, so all lines in this element" + LayoutText {#text} at (192,20) size 784x59 + text run at (192,20) width 592: ". Margins on inline elements does not affect line-height calculations, so all lines in this element" text run at (0,40) width 782: "should have the same line-height. However, there should be a -10px margin to the left side of the inline box in the first line it" text run at (0,60) width 642: "appears, and a -10px margin to the right side of the inline element box in the last line where it appears." LayoutNGBlockFlow {P} at (0,371) size 784x20 [bgcolor=#C0C0C0] @@ -59,9 +59,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x340 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x312 LayoutNGTableCell {TD} at (0,170) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,146) size 4x19 @@ -71,19 +71,19 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (4,40) size 762x100 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 751x39 [bgcolor=#00FFFF] - LayoutText {#text} at (504,0) size 144x19 - text run at (504,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (647,3) size 25x16 - text run at (647,3) width 25: "one" - LayoutText {#text} at (671,0) size 751x39 - text run at (671,0) width 80: ", giving it an" + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 750x39 [bgcolor=#00FFFF] + LayoutText {#text} at (504,0) size 143x19 + text run at (504,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (647,3) size 24x16 + text run at (647,3) width 24: "one" + LayoutText {#text} at (671,0) size 750x39 + text run at (671,0) width 79: ", giving it an" text run at (0,20) width 231: "aqua background and a 25px margin" - LayoutText {#text} at (255,20) size 753x79 - text run at (255,20) width 498: ". Margins on inline elements does not affect line-height calculations, so all lines" + LayoutText {#text} at (256,20) size 753x79 + text run at (256,20) width 497: ". Margins on inline elements does not affect line-height calculations, so all lines" text run at (0,40) width 738: "in this element should have the same line-height. However, there should be a 25px margin to the left side of the inline" text run at (0,60) width 715: "box in the first line it appears, and a 25px margin to the right side of the inline element box in the last line where it" text run at (0,80) width 52: "appears." @@ -91,19 +91,19 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (4,192) size 762x80 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 480x19 - text run at (0,0) width 480: "This element is unstyled save for a background color of gray.. It contains an " - LayoutInline {SPAN} at (0,0) size 750x39 [bgcolor=#00FFFF] - LayoutText {#text} at (469,0) size 144x19 - text run at (469,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (612,3) size 25x16 - text run at (612,3) width 25: "two" - LayoutText {#text} at (636,0) size 750x39 - text run at (636,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 479x19 + text run at (0,0) width 479: "This element is unstyled save for a background color of gray.. It contains an " + LayoutInline {SPAN} at (0,0) size 749x39 [bgcolor=#00FFFF] + LayoutText {#text} at (469,0) size 143x19 + text run at (469,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (612,3) size 24x16 + text run at (612,3) width 24: "two" + LayoutText {#text} at (636,0) size 749x39 + text run at (636,0) width 113: ", giving it an aqua" text run at (0,20) width 202: "background and a -10px margin" - LayoutText {#text} at (191,20) size 745x59 - text run at (191,20) width 540: ". Margins on inline elements does not affect line-height calculations, so all lines in this" + LayoutText {#text} at (192,20) size 745x59 + text run at (192,20) width 539: ". Margins on inline elements does not affect line-height calculations, so all lines in this" text run at (0,40) width 745: "element should have the same line-height. However, there should be a -10px margin to the left side of the inline box in" text run at (0,60) width 732: "the first line it appears, and a -10px margin to the right side of the inline element box in the last line where it appears." LayoutNGBlockFlow {P} at (4,288) size 762x20 [bgcolor=#C0C0C0]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.png index 5f302f4..c22482c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.txt index e0a7669..16d09bb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left-expected.txt
@@ -41,8 +41,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (0,0) size 685x19 - text run at (0,0) width 685: "The left margin on this unordered list has been set to 25 pixels, and its background color has been set to gray." + LayoutText {#text} at (0,0) size 684x19 + text run at (0,0) width 684: "The left margin on this unordered list has been set to 25 pixels, and its background color has been set to gray." LayoutNGListItem {LI} at (65,20) size 679x60 [bgcolor=#FFFFFF] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 @@ -64,14 +64,14 @@ LayoutText {#text} at (0,0) size 778x59 text run at (0,0) width 758: "This paragraph has a left margin of -10px, which should cause it to be wider than it might otherwise be, and it has a light" text run at (0,20) width 778: "blue background. In all other respects, however, the element should be normal. No styles have been applied to it besides the" - text run at (0,40) width 293: "negative left margin and the background color." + text run at (0,40) width 294: "negative left margin and the background color." LayoutTable {TABLE} at (0,591) size 769x470 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 767x468 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x440 LayoutNGTableCell {TD} at (0,234) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,210) size 4x19 @@ -100,7 +100,7 @@ text run at (0,0) width 10: "\x{2022} " LayoutText {#text} at (0,0) size 650x39 text run at (0,0) width 650: "The left margin on this unordered list has been set to 25 pixels, and its background color has been set to" - text run at (0,20) width 31: "gray." + text run at (0,20) width 30: "gray." LayoutNGListItem {LI} at (65,40) size 657x60 [bgcolor=#FFFFFF] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 @@ -122,6 +122,6 @@ LayoutText {#text} at (0,0) size 737x59 text run at (0,0) width 726: "This paragraph has a left margin of -10px, which should cause it to be wider than it might otherwise be, and it has a" text run at (0,20) width 737: "light blue background. In all other respects, however, the element should be normal. No styles have been applied to it" - text run at (0,40) width 366: "besides the negative left margin and the background color." + text run at (0,40) width 367: "besides the negative left margin and the background color." layer at (8,153) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,145) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left_inline-expected.txt index 673caa2..d167af14 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_left_inline-expected.txt
@@ -13,84 +13,84 @@ text run at (0,16) width 400: ".two {margin-left: -10px; background-color: aqua;}" text run at (400,16) width 0: " " LayoutNGBlockFlow {P} at (0,99) size 784x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (566,0) size 144x19 - text run at (566,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (709,3) size 25x16 - text run at (709,3) width 25: "one" - LayoutText {#text} at (733,0) size 781x39 - text run at (733,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (566,0) size 143x19 + text run at (566,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (709,3) size 24x16 + text run at (709,3) width 24: "one" + LayoutText {#text} at (733,0) size 780x39 + text run at (733,0) width 47: ", which" text run at (0,20) width 299: "should result in 25-pixel left margin only in the " - LayoutInline {STRONG} at (0,0) size 28x19 - LayoutText {#text} at (298,20) size 28x19 - text run at (298,20) width 28: "first" - LayoutText {#text} at (325,20) size 233x19 - text run at (325,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 27x19 + LayoutText {#text} at (299,20) size 27x19 + text run at (299,20) width 27: "first" + LayoutText {#text} at (326,20) size 232x19 + text run at (326,20) width 232: " line in which the inline box appears." LayoutNGBlockFlow {P} at (0,155) size 784x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (531,0) size 144x19 - text run at (531,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (674,3) size 25x16 - text run at (674,3) width 25: "two" - LayoutText {#text} at (698,0) size 746x39 - text run at (698,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (531,0) size 143x19 + text run at (531,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (674,3) size 24x16 + text run at (674,3) width 24: "two" + LayoutText {#text} at (698,0) size 745x39 + text run at (698,0) width 47: ", which" text run at (0,20) width 284: "should result in -10px left margin only in the " - LayoutInline {STRONG} at (0,0) size 28x19 - LayoutText {#text} at (283,20) size 28x19 - text run at (283,20) width 28: "first" - LayoutText {#text} at (310,20) size 233x19 - text run at (310,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 27x19 + LayoutText {#text} at (284,20) size 27x19 + text run at (284,20) width 27: "first" + LayoutText {#text} at (311,20) size 232x19 + text run at (311,20) width 232: " line in which the inline box appears." LayoutTable {TABLE} at (0,211) size 784x134 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x132 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x104 LayoutNGTableCell {TD} at (0,66) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,42) size 4x19 text run at (4,42) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x104 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (566,0) size 144x19 - text run at (566,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (709,3) size 25x16 - text run at (709,3) width 25: "one" - LayoutText {#text} at (733,0) size 738x39 - text run at (733,0) width 5: "," + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (566,0) size 143x19 + text run at (566,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (709,3) size 24x16 + text run at (709,3) width 24: "one" + LayoutText {#text} at (733,0) size 737x39 + text run at (733,0) width 4: "," text run at (0,20) width 342: "which should result in 25-pixel left margin only in the " - LayoutInline {STRONG} at (0,0) size 28x19 - LayoutText {#text} at (341,20) size 28x19 - text run at (341,20) width 28: "first" - LayoutText {#text} at (368,20) size 233x19 - text run at (368,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 27x19 + LayoutText {#text} at (342,20) size 27x19 + text run at (342,20) width 27: "first" + LayoutText {#text} at (369,20) size 232x19 + text run at (369,20) width 232: " line in which the inline box appears." LayoutNGBlockFlow {P} at (4,60) size 762x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (531,0) size 144x19 - text run at (531,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (674,3) size 25x16 - text run at (674,3) width 25: "two" - LayoutText {#text} at (698,0) size 746x39 - text run at (698,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (531,0) size 143x19 + text run at (531,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (674,3) size 24x16 + text run at (674,3) width 24: "two" + LayoutText {#text} at (698,0) size 745x39 + text run at (698,0) width 47: ", which" text run at (0,20) width 284: "should result in -10px left margin only in the " - LayoutInline {STRONG} at (0,0) size 28x19 - LayoutText {#text} at (283,20) size 28x19 - text run at (283,20) width 28: "first" - LayoutText {#text} at (310,20) size 233x19 - text run at (310,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 27x19 + LayoutText {#text} at (284,20) size 27x19 + text run at (284,20) width 27: "first" + LayoutText {#text} at (311,20) size 232x19 + text run at (311,20) width 232: " line in which the inline box appears." layer at (8,89) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,81) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.png index 7fbde4da..27aabe2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.txt index 60160464..03be348 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right-expected.txt
@@ -41,8 +41,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (20,0) size 699x19 - text run at (20,0) width 699: "The right margin on this unordered list has been set to 25 pixels, and the background color has been set to gray." + LayoutText {#text} at (21,0) size 698x19 + text run at (21,0) width 698: "The right margin on this unordered list has been set to 25 pixels, and the background color has been set to gray." LayoutNGListItem {LI} at (40,20) size 694x60 [bgcolor=#FFFFFF] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 @@ -64,14 +64,14 @@ LayoutText {#text} at (0,0) size 778x59 text run at (0,0) width 767: "This paragraph has a right margin of -10px, which should cause it to be wider than it might otherwise be, and it has a light" text run at (0,20) width 778: "blue background. In all other respects, however, the element should be normal. No styles have been applied to it besides the" - text run at (0,40) width 302: "negative right margin and the background color." + text run at (0,40) width 303: "negative right margin and the background color." LayoutTable {TABLE} at (0,591) size 784x470 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x468 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x440 LayoutNGTableCell {TD} at (0,234) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,210) size 4x19 @@ -100,7 +100,7 @@ text run at (0,0) width 10: "\x{2022} " LayoutText {#text} at (33,0) size 664x39 text run at (33,0) width 664: "The right margin on this unordered list has been set to 25 pixels, and the background color has been set to" - text run at (666,20) width 31: "gray." + text run at (667,20) width 30: "gray." LayoutNGListItem {LI} at (40,40) size 672x60 [bgcolor=#FFFFFF] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 @@ -122,6 +122,6 @@ LayoutText {#text} at (0,0) size 767x59 text run at (0,0) width 767: "This paragraph has a right margin of -10px, which should cause it to be wider than it might otherwise be, and it has a light" text run at (0,20) width 755: "blue background. In all other respects, however, the element should be normal. No styles have been applied to it besides" - text run at (0,40) width 325: "the negative right margin and the background color." + text run at (0,40) width 326: "the negative right margin and the background color." layer at (8,153) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,145) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right_inline-expected.txt index 1ad1c91..330b157 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_right_inline-expected.txt
@@ -13,84 +13,84 @@ text run at (0,16) width 408: ".two {margin-right: -10px; background-color: aqua;}" text run at (408,16) width 0: " " LayoutNGBlockFlow {P} at (0,99) size 784x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "one" - LayoutText {#text} at (733,0) size 781x39 - text run at (733,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "one" + LayoutText {#text} at (733,0) size 780x39 + text run at (733,0) width 47: ", which" text run at (0,20) width 308: "should result in 25-pixel right margin only in the " - LayoutInline {STRONG} at (0,0) size 24x19 - LayoutText {#text} at (307,20) size 24x19 - text run at (307,20) width 24: "last" - LayoutText {#text} at (330,20) size 233x19 - text run at (330,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 23x19 + LayoutText {#text} at (308,20) size 23x19 + text run at (308,20) width 23: "last" + LayoutText {#text} at (331,20) size 232x19 + text run at (331,20) width 232: " line in which the inline box appears." LayoutNGBlockFlow {P} at (0,155) size 784x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "two" - LayoutText {#text} at (698,0) size 746x39 - text run at (698,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "two" + LayoutText {#text} at (698,0) size 745x39 + text run at (698,0) width 47: ", which" text run at (0,20) width 293: "should result in -10px right margin only in the " - LayoutInline {STRONG} at (0,0) size 24x19 - LayoutText {#text} at (292,20) size 24x19 - text run at (292,20) width 24: "last" - LayoutText {#text} at (315,20) size 233x19 - text run at (315,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 23x19 + LayoutText {#text} at (293,20) size 23x19 + text run at (293,20) width 23: "last" + LayoutText {#text} at (316,20) size 232x19 + text run at (316,20) width 232: " line in which the inline box appears." LayoutTable {TABLE} at (0,211) size 784x134 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x132 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x104 LayoutNGTableCell {TD} at (0,66) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,42) size 4x19 text run at (4,42) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x104 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "one" - LayoutText {#text} at (733,0) size 738x39 - text run at (733,0) width 5: "," + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "one" + LayoutText {#text} at (733,0) size 737x39 + text run at (733,0) width 4: "," text run at (0,20) width 351: "which should result in 25-pixel right margin only in the " - LayoutInline {STRONG} at (0,0) size 24x19 - LayoutText {#text} at (350,20) size 24x19 - text run at (350,20) width 24: "last" - LayoutText {#text} at (373,20) size 233x19 - text run at (373,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 23x19 + LayoutText {#text} at (351,20) size 23x19 + text run at (351,20) width 23: "last" + LayoutText {#text} at (374,20) size 232x19 + text run at (374,20) width 232: " line in which the inline box appears." LayoutNGBlockFlow {P} at (4,60) size 762x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "two" - LayoutText {#text} at (698,0) size 746x39 - text run at (698,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "two" + LayoutText {#text} at (698,0) size 745x39 + text run at (698,0) width 47: ", which" text run at (0,20) width 293: "should result in -10px right margin only in the " - LayoutInline {STRONG} at (0,0) size 24x19 - LayoutText {#text} at (292,20) size 24x19 - text run at (292,20) width 24: "last" - LayoutText {#text} at (315,20) size 233x19 - text run at (315,20) width 233: " line in which the inline box appears." + LayoutInline {STRONG} at (0,0) size 23x19 + LayoutText {#text} at (293,20) size 23x19 + text run at (293,20) width 23: "last" + LayoutText {#text} at (316,20) size 232x19 + text run at (316,20) width 232: " line in which the inline box appears." layer at (8,89) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,81) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top-expected.txt index eda2de9..b75b681 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top-expected.txt
@@ -83,9 +83,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x776 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x748 LayoutNGTableCell {TD} at (0,388) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,364) size 4x19 @@ -142,9 +142,9 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (4,683.75) size 747x60 [bgcolor=#00FFFF] - LayoutText {#text} at (0,0) size 741x59 + LayoutText {#text} at (0,0) size 742x59 text run at (0,0) width 714: "This element has a top margin of -10px, which should cause it to be shifted \"upward\" on the page, and no bottom" - text run at (0,20) width 741: "margin. No other styles have been applied to it besides a light blue background color. In all other respects, the element" + text run at (0,20) width 742: "margin. No other styles have been applied to it besides a light blue background color. In all other respects, the element" text run at (0,40) width 113: "should be normal." layer at (8,182) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,174) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top_inline-expected.txt index ccc14a6..61c3857 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/margin_top_inline-expected.txt
@@ -16,76 +16,76 @@ text run at (392,32) width 0: " " text run at (0,48) width 0: " " LayoutNGBlockFlow {P} at (0,131) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "one" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "one" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 221: "background and a 25px top margin" - LayoutText {#text} at (220,20) size 747x39 - text run at (220,20) width 527: ". Margins on inline elements do not affect line-height calculations, so all lines in this" + LayoutText {#text} at (221,20) size 747x39 + text run at (221,20) width 526: ". Margins on inline elements do not affect line-height calculations, so all lines in this" text run at (0,40) width 263: "element should have the same line-height." LayoutNGBlockFlow {P} at (0,207) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 753x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 753x39 - text run at (642,0) width 111: ", giving the inline" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 752x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 752x39 + text run at (642,0) width 110: ", giving the inline" text run at (0,20) width 332: "element an aqua background and a -10px top margin" - LayoutText {#text} at (331,20) size 783x39 - text run at (331,20) width 452: ". Margins on inline elements do not affect line-height calculations, so all" + LayoutText {#text} at (332,20) size 783x39 + text run at (332,20) width 451: ". Margins on inline elements do not affect line-height calculations, so all" text run at (0,40) width 338: "lines in this element should have the same line-height." LayoutTable {TABLE} at (0,283) size 784x174 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x172 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x144 LayoutNGTableCell {TD} at (0,86) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,62) size 4x19 text run at (4,62) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x144 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "one" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "one" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 221: "background and a 25px top margin" - LayoutText {#text} at (220,20) size 747x39 - text run at (220,20) width 527: ". Margins on inline elements do not affect line-height calculations, so all lines in this" + LayoutText {#text} at (221,20) size 747x39 + text run at (221,20) width 526: ". Margins on inline elements do not affect line-height calculations, so all lines in this" text run at (0,40) width 263: "element should have the same line-height." LayoutNGBlockFlow {P} at (4,80) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 753x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 753x39 - text run at (642,0) width 111: ", giving the inline" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 752x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 752x39 + text run at (642,0) width 110: ", giving the inline" text run at (0,20) width 332: "element an aqua background and a -10px top margin" - LayoutText {#text} at (331,20) size 746x39 - text run at (331,20) width 415: ". Margins on inline elements do not affect line-height calculations," + LayoutText {#text} at (332,20) size 746x39 + text run at (332,20) width 414: ". Margins on inline elements do not affect line-height calculations," text run at (0,40) width 375: "so all lines in this element should have the same line-height." layer at (8,121) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,113) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding-expected.txt index c2d32b8..0a82544 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding-expected.txt
@@ -49,9 +49,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x1056 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x1028 LayoutNGTableCell {TD} at (0,528) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,504) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom-expected.txt index 81fa836..698dda22 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom-expected.txt
@@ -50,9 +50,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x732 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x704 LayoutNGTableCell {TD} at (0,366) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,342) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom_inline-expected.txt index 284005f..f38aad6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_bottom_inline-expected.txt
@@ -14,32 +14,32 @@ text run at (424,16) width 0: " " text run at (0,32) width 0: " " LayoutNGBlockFlow {P} at (0,115) size 784x80 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x64 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "one" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x64 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "one" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 252: "background and a 25px bottom padding" LayoutText {#text} at (252,20) size 781x59 text run at (252,20) width 513: ". Padding on inline elements does not affect line-height calculations, so all lines in" text run at (0,40) width 781: "this element should have the same line-height. There may be implementation-specific limits on how much of the padding the" - text run at (0,60) width 176: "user agent is able to display." + text run at (0,60) width 175: "user agent is able to display." LayoutNGBlockFlow {P} at (0,211) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 522: "background and no bottom padding, since negative padding values are not allowed" LayoutText {#text} at (522,20) size 757x39 text run at (522,20) width 235: ". Padding on inline elements does not" @@ -48,41 +48,41 @@ LayoutTableSection {TBODY} at (1,1) size 782x192 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x164 LayoutNGTableCell {TD} at (0,96) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,72) size 4x19 text run at (4,72) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x164 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x80 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x64 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "one" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x64 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "one" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 252: "background and a 25px bottom padding" LayoutText {#text} at (252,20) size 749x59 text run at (252,20) width 497: ". Padding on inline elements does not affect line-height calculations, so all lines" text run at (0,40) width 719: "in this element should have the same line-height. There may be implementation-specific limits on how much of the" - text run at (0,60) width 254: "padding the user agent is able to display." + text run at (0,60) width 253: "padding the user agent is able to display." LayoutNGBlockFlow {P} at (4,100) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 522: "background and no bottom padding, since negative padding values are not allowed" LayoutText {#text} at (522,20) size 757x39 text run at (522,20) width 235: ". Padding on inline elements does not"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_inline-expected.txt index 2a3104d..049599b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_inline-expected.txt
@@ -19,16 +19,16 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (0,167) size 769x120 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 747x89 [bgcolor=#00FFFF] - LayoutText {#text} at (500,0) size 144x19 - text run at (500,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (643,3) size 25x16 - text run at (643,3) width 25: "one" - LayoutText {#text} at (667,0) size 747x39 - text run at (667,0) width 80: ", giving it an" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 746x89 [bgcolor=#00FFFF] + LayoutText {#text} at (500,0) size 143x19 + text run at (500,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (643,3) size 24x16 + text run at (643,3) width 24: "one" + LayoutText {#text} at (667,0) size 746x39 + text run at (667,0) width 79: ", giving it an" text run at (0,20) width 238: "aqua background and a 25px padding" LayoutText {#text} at (263,20) size 765x99 text run at (263,20) width 497: ". Padding on inline elements does not affect line-height calculations, so all lines" @@ -40,16 +40,16 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (0,339) size 769x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 474: "background and no padding, since negative padding values are not allowed" LayoutText {#text} at (474,20) size 748x39 text run at (474,20) width 274: ". Padding on inline elements does not affect" @@ -61,9 +61,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x340 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x312 LayoutNGTableCell {TD} at (0,170) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,146) size 4x19 @@ -73,16 +73,16 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (4,40) size 747x120 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 747x89 [bgcolor=#00FFFF] - LayoutText {#text} at (500,0) size 144x19 - text run at (500,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (643,3) size 25x16 - text run at (643,3) width 25: "one" - LayoutText {#text} at (667,0) size 747x39 - text run at (667,0) width 80: ", giving it an" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 746x89 [bgcolor=#00FFFF] + LayoutText {#text} at (500,0) size 143x19 + text run at (500,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (643,3) size 24x16 + text run at (643,3) width 24: "one" + LayoutText {#text} at (667,0) size 746x39 + text run at (667,0) width 79: ", giving it an" text run at (0,20) width 238: "aqua background and a 25px padding" LayoutText {#text} at (263,20) size 729x99 text run at (263,20) width 464: ". Padding on inline elements does not affect line-height calculations, so all" @@ -94,16 +94,16 @@ LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "This element has a class of zero." LayoutNGBlockFlow {P} at (4,212) size 747x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 722x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 722x39 - text run at (642,0) width 80: ", giving it an" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 721x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 721x39 + text run at (642,0) width 79: ", giving it an" text run at (0,20) width 508: "aqua background and no padding, since negative padding values are not allowed" LayoutText {#text} at (508,20) size 743x39 text run at (508,20) width 235: ". Padding on inline elements does not"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.png index 6e622b9..c7fffedd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.txt index 340203d..1bc4337 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left-expected.txt
@@ -63,9 +63,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x452 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x424 LayoutNGTableCell {TD} at (0,226) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,202) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left_inline-expected.txt index 9b1fd01..f7ef0f8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_left_inline-expected.txt
@@ -14,16 +14,16 @@ text run at (408,16) width 0: " " text run at (0,32) width 0: " " LayoutNGBlockFlow {P} at (0,115) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 193x19 [bgcolor=#00FFFF] - LayoutText {#text} at (566,0) size 144x19 - text run at (566,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (709,3) size 25x16 - text run at (709,3) width 25: "one" - LayoutText {#text} at (733,0) size 777x39 - text run at (733,0) width 44: " which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 192x19 [bgcolor=#00FFFF] + LayoutText {#text} at (566,0) size 143x19 + text run at (566,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (709,3) size 24x16 + text run at (709,3) width 24: "one" + LayoutText {#text} at (733,0) size 776x39 + text run at (733,0) width 43: " which" text run at (0,20) width 527: "should result in 25-pixel left padding (which should also be a light blue) only in the " LayoutInline {STRONG} at (0,0) size 27x19 LayoutText {#text} at (527,20) size 27x19 @@ -32,16 +32,16 @@ text run at (554,20) width 176: " line in which the inline box" text run at (0,40) width 52: "appears." LayoutNGBlockFlow {P} at (0,191) size 784x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "two" - LayoutText {#text} at (708,0) size 752x39 - text run at (708,0) width 44: " which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "two" + LayoutText {#text} at (708,0) size 751x39 + text run at (708,0) width 43: " which" text run at (0,20) width 512: "should result in -10px left padding (which should also be a light blue) only in the " LayoutInline {STRONG} at (0,0) size 27x19 LayoutText {#text} at (512,20) size 27x19 @@ -52,23 +52,23 @@ LayoutTableSection {TBODY} at (1,1) size 782x172 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x144 LayoutNGTableCell {TD} at (0,86) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,62) size 4x19 text run at (4,62) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x144 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 193x19 [bgcolor=#00FFFF] - LayoutText {#text} at (566,0) size 144x19 - text run at (566,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (709,3) size 25x16 - text run at (709,3) width 25: "one" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 192x19 [bgcolor=#00FFFF] + LayoutText {#text} at (566,0) size 143x19 + text run at (566,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (709,3) size 24x16 + text run at (709,3) width 24: "one" LayoutText {#text} at (0,20) size 570x19 text run at (0,20) width 570: "which should result in 25-pixel left padding (which should also be a light blue) only in the " LayoutInline {STRONG} at (0,0) size 27x19 @@ -78,16 +78,16 @@ text run at (597,20) width 148: " line in which the inline" text run at (0,40) width 80: "box appears." LayoutNGBlockFlow {P} at (4,80) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "two" - LayoutText {#text} at (708,0) size 752x39 - text run at (708,0) width 44: " which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "two" + LayoutText {#text} at (708,0) size 751x39 + text run at (708,0) width 43: " which" text run at (0,20) width 512: "should result in -10px left padding (which should also be a light blue) only in the " LayoutInline {STRONG} at (0,0) size 27x19 LayoutText {#text} at (512,20) size 27x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right-expected.txt index 95aaec6..264bada 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right-expected.txt
@@ -39,10 +39,10 @@ text run at (15,20) width 674: "content background and the padding should be aqua (light blue). The text has been right-aligned in order to" text run at (460,40) width 229: "make the right padding easier to see." LayoutNGBlockFlow {P} at (0,427) size 769x60 [bgcolor=#00FFFF] - LayoutText {#text} at (19,0) size 574x59 + LayoutText {#text} at (19,0) size 575x59 text run at (19,0) width 558: "This element should have a right padding of 25%, which is calculated with respect to the" text run at (9,20) width 568: "width of the parent element. Both the content background and the padding should be aqua" - text run at (3,40) width 574: "(light blue). The text has been right-aligned in order to make the right padding easier to see." + text run at (2,40) width 575: "(light blue). The text has been right-aligned in order to make the right padding easier to see." LayoutNGBlockFlow {UL} at (0,503) size 769x80 [bgcolor=#808080] LayoutNGListItem {LI} at (40,0) size 704x40 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 @@ -67,9 +67,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x552 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x524 LayoutNGTableCell {TD} at (0,276) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,252) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right_inline-expected.txt index f149f12b..0c51106 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_right_inline-expected.txt
@@ -14,16 +14,16 @@ text run at (568,16) width 0: " " text run at (0,32) width 0: " " LayoutNGBlockFlow {P} at (0,115) size 784x40 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 193x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "one" - LayoutText {#text} at (733,0) size 781x39 - text run at (733,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 192x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "one" + LayoutText {#text} at (733,0) size 780x39 + text run at (733,0) width 47: ", which" text run at (0,20) width 525: "should result in 25-pixel right padding (which should also be light blue) only in the " LayoutInline {STRONG} at (0,0) size 23x19 LayoutText {#text} at (525,20) size 23x19 @@ -31,16 +31,16 @@ LayoutText {#text} at (548,20) size 232x19 text run at (548,20) width 232: " line in which the inline box appears." LayoutNGBlockFlow {P} at (0,171) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "two" - LayoutText {#text} at (708,0) size 756x39 - text run at (708,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "two" + LayoutText {#text} at (708,0) size 755x39 + text run at (708,0) width 47: ", which" text run at (0,20) width 548: "should result in no right padding, since negative padding values are not allowed, in the " LayoutInline {STRONG} at (0,0) size 23x19 LayoutText {#text} at (548,20) size 23x19 @@ -52,25 +52,25 @@ LayoutTableSection {TBODY} at (1,1) size 782x172 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x144 LayoutNGTableCell {TD} at (0,86) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,62) size 4x19 text run at (4,62) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x144 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 193x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "one" - LayoutText {#text} at (733,0) size 738x39 - text run at (733,0) width 5: "," + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 192x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "one" + LayoutText {#text} at (733,0) size 737x39 + text run at (733,0) width 4: "," text run at (0,20) width 568: "which should result in 25-pixel right padding (which should also be light blue) only in the " LayoutInline {STRONG} at (0,0) size 23x19 LayoutText {#text} at (568,20) size 23x19 @@ -79,16 +79,16 @@ text run at (591,20) width 148: " line in which the inline" text run at (0,40) width 80: "box appears." LayoutNGBlockFlow {P} at (4,80) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 542x19 - text run at (0,0) width 542: "This element is unstyled save for a background color of gray. However, it contains an " - LayoutInline {SPAN} at (0,0) size 168x19 [bgcolor=#00FFFF] - LayoutText {#text} at (541,0) size 144x19 - text run at (541,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (684,3) size 25x16 - text run at (684,3) width 25: "two" - LayoutText {#text} at (708,0) size 756x39 - text run at (708,0) width 48: ", which" + LayoutText {#text} at (0,0) size 541x19 + text run at (0,0) width 541: "This element is unstyled save for a background color of gray. However, it contains an " + LayoutInline {SPAN} at (0,0) size 167x19 [bgcolor=#00FFFF] + LayoutText {#text} at (541,0) size 143x19 + text run at (541,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (684,3) size 24x16 + text run at (684,3) width 24: "two" + LayoutText {#text} at (708,0) size 755x39 + text run at (708,0) width 47: ", which" text run at (0,20) width 548: "should result in no right padding, since negative padding values are not allowed, in the " LayoutInline {STRONG} at (0,0) size 23x19 LayoutText {#text} at (548,20) size 23x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top-expected.txt index 5ed995b..7b6e5221 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top-expected.txt
@@ -47,9 +47,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x676 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x648 LayoutNGTableCell {TD} at (0,338) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,314) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top_inline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top_inline-expected.txt index 20b1a15..b827869 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top_inline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/padding_top_inline-expected.txt
@@ -14,32 +14,32 @@ text run at (400,16) width 0: " " text run at (0,32) width 0: " " LayoutNGBlockFlow {P} at (0,115) size 784x80 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x64 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "one" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x64 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "one" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 228: "background and a 25px top padding" LayoutText {#text} at (228,20) size 767x59 text run at (228,20) width 539: ". Padding on inline elements does not affect line-height calculations, so all lines in this" text run at (0,40) width 755: "element should have the same line-height. There may be implementation-specific limits on how much of the padding the" - text run at (0,60) width 176: "user agent is able to display." + text run at (0,60) width 175: "user agent is able to display." LayoutNGBlockFlow {P} at (0,211) size 784x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 498: "background and no top padding, since negative padding values are not allowed" LayoutText {#text} at (498,20) size 772x39 text run at (498,20) width 274: ". Padding on inline elements does not affect" @@ -48,41 +48,41 @@ LayoutTableSection {TBODY} at (1,1) size 782x192 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x164 LayoutNGTableCell {TD} at (0,96) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,72) size 4x19 text run at (4,72) width 4: " " LayoutNGTableCell {TD} at (12,28) size 770x164 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 762x80 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x64 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "one" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x64 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "one" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 228: "background and a 25px top padding" LayoutText {#text} at (228,20) size 758x59 text run at (228,20) width 513: ". Padding on inline elements does not affect line-height calculations, so all lines in" text run at (0,40) width 758: "this element should have the same line-height. There may be implementation-specific limits on how much of the padding" - text run at (0,60) width 199: "the user agent is able to display." + text run at (0,60) width 198: "the user agent is able to display." LayoutNGBlockFlow {P} at (4,100) size 762x60 [bgcolor=#808080] - LayoutText {#text} at (0,0) size 476x19 - text run at (0,0) width 476: "This element is unstyled save for a background color of gray. It contains an " - LayoutInline {SPAN} at (0,0) size 756x39 [bgcolor=#00FFFF] - LayoutText {#text} at (475,0) size 144x19 - text run at (475,0) width 144: "inline element of class " - LayoutInline {TT} at (0,0) size 25x16 - LayoutText {#text} at (618,3) size 25x16 - text run at (618,3) width 25: "two" - LayoutText {#text} at (642,0) size 756x39 - text run at (642,0) width 114: ", giving it an aqua" + LayoutText {#text} at (0,0) size 475x19 + text run at (0,0) width 475: "This element is unstyled save for a background color of gray. It contains an " + LayoutInline {SPAN} at (0,0) size 755x39 [bgcolor=#00FFFF] + LayoutText {#text} at (475,0) size 143x19 + text run at (475,0) width 143: "inline element of class " + LayoutInline {TT} at (0,0) size 24x16 + LayoutText {#text} at (618,3) size 24x16 + text run at (618,3) width 24: "two" + LayoutText {#text} at (642,0) size 755x39 + text run at (642,0) width 113: ", giving it an aqua" text run at (0,20) width 498: "background and no top padding, since negative padding values are not allowed" LayoutText {#text} at (498,20) size 733x39 text run at (498,20) width 235: ". Padding on inline elements does not"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/width-expected.txt index c0b9d65..f129137 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/box_properties/width-expected.txt
@@ -35,16 +35,16 @@ LayoutInline {CODE} at (0,0) size 40x16 LayoutText {#text} at (246,63) size 40x16 text run at (246,63) width 40: "width" - LayoutText {#text} at (286,60) size 373x39 + LayoutText {#text} at (286,60) size 372x39 text run at (286,60) width 57: " property" - text run at (0,80) width 373: "without the need for the user to resize the viewing window." + text run at (0,80) width 372: "without the need for the user to resize the viewing window." LayoutTable {TABLE} at (0,761.50) size 384x613 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 382x611 LayoutTableRow {TR} at (0,0) size 382x28 LayoutNGTableCell {TD} at (0,0) size 382x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 382x583 LayoutNGTableCell {TD} at (0,305) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,281) size 4x19 @@ -77,9 +77,9 @@ LayoutInline {CODE} at (0,0) size 40x16 LayoutText {#text} at (23,163) size 40x16 text run at (23,163) width 40: "width" - LayoutText {#text} at (63,160) size 173x59 + LayoutText {#text} at (63,160) size 172x59 text run at (63,160) width 109: " property without" text run at (0,180) width 144: "the need for the user to" - text run at (0,200) width 173: "resize the viewing window." + text run at (0,200) width 172: "resize the viewing window." layer at (8,105) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,97) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.png index d9230f3..7e39310 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.txt index 71fa693c..973fea3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/cascade_order-expected.txt
@@ -48,8 +48,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutText {#text} at (0,0) size 189x19 - text run at (0,0) width 189: "This list item should be gray..." + LayoutText {#text} at (0,0) size 188x19 + text run at (0,0) width 188: "This list item should be gray..." LayoutNGListItem {LI} at (40,20) size 689x20 [color=#808080] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 @@ -98,9 +98,9 @@ LayoutTableSection {TBODY} at (1,1) size 703x304 LayoutTableRow {TR} at (0,0) size 703x28 LayoutNGTableCell {TD} at (0,0) size 703x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 703x276 LayoutNGTableCell {TD} at (0,152) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,128) size 4x19 @@ -125,8 +125,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutText {#text} at (0,0) size 189x19 - text run at (0,0) width 189: "This list item should be gray..." + LayoutText {#text} at (0,0) size 188x19 + text run at (0,0) width 188: "This list item should be gray..." LayoutNGListItem {LI} at (40,20) size 603x20 [color=#808080] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/important-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/important-expected.txt index f930851..b475606 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/important-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/cascade/important-expected.txt
@@ -36,9 +36,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x188 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x160 LayoutNGTableCell {TD} at (0,94) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,70) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.png index 8d9442c5..617b0e40 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.txt index 878fae30..deb64ad 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/display-expected.txt
@@ -26,8 +26,8 @@ LayoutText {#text} at (0,0) size 448x19 text run at (0,0) width 448: "This sentence should be part of an inline element, as are the next three. " LayoutInline {P} at (0,0) size 766x59 - LayoutText {#text} at (447,0) size 766x59 - text run at (447,0) width 275: "This sentence and the next two are part of a" + LayoutText {#text} at (448,0) size 766x59 + text run at (448,0) width 274: "This sentence and the next two are part of a" text run at (0,20) width 766: "second inline element. They should therefore appear, along with the sentence above, to be all one paragraph which is four" text run at (0,40) width 350: "sentences long. If this is not the case, then the keyword " LayoutInline {CODE} at (0,0) size 48x16 @@ -46,8 +46,8 @@ LayoutInline {CODE} at (0,0) size 120x16 LayoutText {#text} at (18,23) size 120x16 text run at (18,23) width 120: "list-style-type" - LayoutText {#text} at (138,20) size 719x39 - text run at (138,20) width 581: " is supported, there will be a square for the item marker). A 3em left margin has been applied" + LayoutText {#text} at (138,20) size 720x39 + text run at (138,20) width 582: " is supported, there will be a square for the item marker). A 3em left margin has been applied" text run at (0,40) width 376: "in order to ensure that there is space for the list-item marker." LayoutNGBlockFlow {P} at (0,335) size 769x20 LayoutText {#text} at (0,0) size 456x19 @@ -69,9 +69,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x356 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x328 LayoutNGTableCell {TD} at (0,178) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,154) size 4x19 @@ -85,8 +85,8 @@ LayoutText {#text} at (0,0) size 448x19 text run at (0,0) width 448: "This sentence should be part of an inline element, as are the next three. " LayoutInline {P} at (0,0) size 736x59 - LayoutText {#text} at (447,0) size 736x59 - text run at (447,0) width 275: "This sentence and the next two are part of a" + LayoutText {#text} at (448,0) size 736x59 + text run at (448,0) width 274: "This sentence and the next two are part of a" text run at (0,20) width 736: "second inline element. They should therefore appear, along with the sentence above, to be all one paragraph which is" text run at (0,40) width 380: "four sentences long. If this is not the case, then the keyword " LayoutInline {CODE} at (0,0) size 48x16 @@ -105,8 +105,8 @@ LayoutInline {CODE} at (0,0) size 120x16 LayoutText {#text} at (55,23) size 120x16 text run at (55,23) width 120: "list-style-type" - LayoutText {#text} at (175,20) size 672x39 - text run at (175,20) width 497: " is supported, there will be a square for the item marker). A 3em left margin has" + LayoutText {#text} at (175,20) size 673x39 + text run at (175,20) width 498: " is supported, there will be a square for the item marker). A 3em left margin has" text run at (0,40) width 460: "been applied in order to ensure that there is space for the list-item marker." LayoutNGBlockFlow {P} at (4,192) size 747x20 LayoutText {#text} at (0,0) size 456x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.png index 72c7688d..f02ead1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.txt index 674961e6..52948f9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_position-expected.txt
@@ -26,16 +26,16 @@ LayoutInline (anonymous) at (0,0) size 10x19 LayoutText (anonymous) at (-1,0) size 10x19 text run at (-1,0) width 10: "\x{2022} " - LayoutText {#text} at (24,0) size 713x39 - text run at (24,0) width 689: "The text in this item should not behave as expected; that is, it should line up with the bullet on the left margin," + LayoutText {#text} at (25,0) size 713x39 + text run at (25,0) width 688: "The text in this item should not behave as expected; that is, it should line up with the bullet on the left margin," text run at (0,20) width 263: "leaving no blank space beneath the bullet." LayoutTable {TABLE} at (0,227) size 784x150 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x148 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x120 LayoutNGTableCell {TD} at (0,74) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,50) size 4x19 @@ -54,8 +54,8 @@ LayoutInline (anonymous) at (0,0) size 10x19 LayoutText (anonymous) at (-1,0) size 10x19 text run at (-1,0) width 10: "\x{2022} " - LayoutText {#text} at (24,0) size 713x39 - text run at (24,0) width 689: "The text in this item should not behave as expected; that is, it should line up with the bullet on the left margin," + LayoutText {#text} at (25,0) size 713x39 + text run at (25,0) width 688: "The text in this item should not behave as expected; that is, it should line up with the bullet on the left margin," text run at (0,20) width 263: "leaving no blank space beneath the bullet." layer at (8,105) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,97) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_type-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_type-expected.txt index b593f4b42..fb9467d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_type-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/list_style_type-expected.txt
@@ -193,9 +193,9 @@ LayoutTableSection {TBODY} at (1,1) size 336x720 LayoutTableRow {TR} at (0,0) size 336x28 LayoutNGTableCell {TD} at (0,0) size 336x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 336x692 LayoutNGTableCell {TD} at (0,360) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,336) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/white_space-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/white_space-expected.txt index c807ba3..60c6d08 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/white_space-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/classification/white_space-expected.txt
@@ -16,12 +16,12 @@ text run at (232,32) width 0: " " text run at (0,48) width 0: " " LayoutNGBlockFlow {P} at (0,131) size 784x100 - LayoutText {#text} at (0,0) size 568x79 + LayoutText {#text} at (0,0) size 567x79 text run at (0,0) width 0: " " - text run at (0,20) width 568: "This sentence should show extra space where there would ordinarily not be any." - text run at (567,20) width 1: " " + text run at (0,20) width 567: "This sentence should show extra space where there would ordinarily not be any." + text run at (567,20) width 0: " " text run at (0,40) width 296: " There should also be preservation of returns" - text run at (295,40) width 1: " " + text run at (296,40) width 0: " " text run at (0,60) width 97: "as this sentence" text run at (97,60) width 0: " " text run at (0,80) width 184: " very clearly demonstrates." @@ -43,21 +43,21 @@ LayoutTableSection {TBODY} at (1,1) size 911x228 LayoutTableRow {TR} at (0,0) size 911x28 LayoutNGTableCell {TD} at (0,0) size 911x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 911x200 LayoutNGTableCell {TD} at (0,114) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,90) size 4x19 text run at (4,90) width 4: " " LayoutNGTableCell {TD} at (12,28) size 899x200 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 891x100 - LayoutText {#text} at (0,0) size 568x79 + LayoutText {#text} at (0,0) size 567x79 text run at (0,0) width 0: " " - text run at (0,20) width 568: "This sentence should show extra space where there would ordinarily not be any." - text run at (567,20) width 1: " " + text run at (0,20) width 567: "This sentence should show extra space where there would ordinarily not be any." + text run at (567,20) width 0: " " text run at (0,40) width 296: " There should also be preservation of returns" - text run at (295,40) width 1: " " + text run at (296,40) width 0: " " text run at (0,60) width 97: "as this sentence" text run at (97,60) width 0: " " text run at (0,80) width 184: " very clearly demonstrates."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background-expected.txt index 4f271e54..a2325889 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background-expected.txt
@@ -24,29 +24,29 @@ text run at (0,23) width 64: "repeat-x" LayoutText {#text} at (64,20) size 753x39 text run at (64,20) width 689: " indicates tiling in both directions of the x-axis. Furthermore, the strip should be fixed in place. I'll have to add" - text run at (0,40) width 491: "extra text at the end of this page to make it long enough to scroll conveniently." + text run at (0,40) width 490: "extra text at the end of this page to make it long enough to scroll conveniently." LayoutNGBlockFlow {P} at (0,207) size 769x60 [bgcolor=#00FF00] LayoutText {#text} at (0,0) size 762x59 text run at (0,0) width 743: "This paragraph should have a lime background and an orange strip which starts at the top right and runs to the bottom." text run at (0,20) width 762: "Therefore, extra text would be in order, so that we can intelligently evaluate the performance of your browser in handling" - text run at (0,40) width 425: "these declarations. Hey, I didn't say the page would be pretty, did I?" + text run at (0,40) width 423: "these declarations. Hey, I didn't say the page would be pretty, did I?" LayoutNGBlockFlow {P} at (0,283) size 769x60 [bgcolor=#00FF00] LayoutText {#text} at (0,0) size 762x59 text run at (0,0) width 752: "This paragraph should have a lime background and an orange strip which starts at the center top and runs to the bottom." text run at (0,20) width 762: "Therefore, extra text would be in order, so that we can intelligently evaluate the performance of your browser in handling" - text run at (0,40) width 425: "these declarations. Hey, I didn't say the page would be pretty, did I?" + text run at (0,40) width 423: "these declarations. Hey, I didn't say the page would be pretty, did I?" LayoutNGBlockFlow {P} at (0,359) size 769x60 [bgcolor=#00FF00] LayoutText {#text} at (0,0) size 762x59 text run at (0,0) width 743: "This paragraph should have a lime background and an orange strip which starts at the top left and runs to the top right." text run at (0,20) width 762: "Therefore, extra text would be in order, so that we can intelligently evaluate the performance of your browser in handling" - text run at (0,40) width 425: "these declarations. Hey, I didn't say the page would be pretty, did I?" + text run at (0,40) width 423: "these declarations. Hey, I didn't say the page would be pretty, did I?" LayoutTable {TABLE} at (0,435) size 769x326 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 767x324 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x296 LayoutNGTableCell {TD} at (0,162) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,138) size 4x19 @@ -60,21 +60,21 @@ text run at (0,23) width 64: "repeat-x" LayoutText {#text} at (64,20) size 726x39 text run at (64,20) width 662: " indicates tiling in both directions of the x-axis. Furthermore, the strip should be fixed in place. I'll have to" - text run at (0,40) width 518: "add extra text at the end of this page to make it long enough to scroll conveniently." + text run at (0,40) width 517: "add extra text at the end of this page to make it long enough to scroll conveniently." LayoutNGBlockFlow {P} at (4,80) size 747x60 [bgcolor=#00FF00] LayoutText {#text} at (0,0) size 743x59 text run at (0,0) width 743: "This paragraph should have a lime background and an orange strip which starts at the top right and runs to the bottom." text run at (0,20) width 703: "Therefore, extra text would be in order, so that we can intelligently evaluate the performance of your browser in" - text run at (0,40) width 484: "handling these declarations. Hey, I didn't say the page would be pretty, did I?" + text run at (0,40) width 482: "handling these declarations. Hey, I didn't say the page would be pretty, did I?" LayoutNGBlockFlow {P} at (4,156) size 747x60 [bgcolor=#00FF00] LayoutText {#text} at (0,0) size 739x59 text run at (0,0) width 700: "This paragraph should have a lime background and an orange strip which starts at the center top and runs to the" text run at (0,20) width 739: "bottom. Therefore, extra text would be in order, so that we can intelligently evaluate the performance of your browser" - text run at (0,40) width 500: "in handling these declarations. Hey, I didn't say the page would be pretty, did I?" + text run at (0,40) width 498: "in handling these declarations. Hey, I didn't say the page would be pretty, did I?" LayoutNGBlockFlow {P} at (4,232) size 747x60 [bgcolor=#00FF00] LayoutText {#text} at (0,0) size 743x59 text run at (0,0) width 743: "This paragraph should have a lime background and an orange strip which starts at the top left and runs to the top right." text run at (0,20) width 703: "Therefore, extra text would be in order, so that we can intelligently evaluate the performance of your browser in" - text run at (0,40) width 484: "handling these declarations. Hey, I didn't say the page would be pretty, did I?" + text run at (0,40) width 482: "handling these declarations. Hey, I didn't say the page would be pretty, did I?" layer at (8,121) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,113) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.png index a2ed9b8..fcb8ca15 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.txt index e275e7c..d52a3a0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_attachment-expected.txt
@@ -17,7 +17,7 @@ text run at (0,20) width 776: "NOT scroll with the document. It should, instead, appear to be a fixed pattern past which the content scrolls, even when the" text run at (0,40) width 779: "end of the page is reached. In addition, the default Test Suite background should NOT appear, as it's been overridden by the" text run at (0,60) width 775: "styles shown above. I'll have to add a lot of extra text to the page in order to make all this something we can actually check." - text run at (0,80) width 226: "Don't worry, I'll think of something." + text run at (0,80) width 225: "Don't worry, I'll think of something." LayoutNGBlockFlow {P} at (0,215) size 784x20 LayoutText {#text} at (0,0) size 507x19 text run at (0,0) width 507: "In fact, why not the relevant section from the CSS1 specification? A capital idea." @@ -27,11 +27,11 @@ text run at (0,0) width 220: "5.3.5 'background-attachment'" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (0,325.53) size 784x100 - LayoutInline {EM} at (0,0) size 41x19 - LayoutText {#text} at (0,0) size 41x19 - text run at (0,0) width 41: "Value:" - LayoutText {#text} at (40,0) size 82x19 - text run at (40,0) width 82: " scroll | fixed" + LayoutInline {EM} at (0,0) size 40x19 + LayoutText {#text} at (0,0) size 40x19 + text run at (0,0) width 40: "Value:" + LayoutText {#text} at (40,0) size 81x19 + text run at (40,0) width 81: " scroll | fixed" LayoutBR {BR} at (121,0) size 0x0 LayoutInline {EM} at (0,0) size 42x19 LayoutText {#text} at (0,20) size 42x19 @@ -54,9 +54,9 @@ LayoutInline {EM} at (0,0) size 121x19 LayoutText {#text} at (0,80) size 121x19 text run at (0,80) width 121: "Percentage values:" - LayoutText {#text} at (120,80) size 33x19 - text run at (120,80) width 33: " N/A" - LayoutBR {BR} at (152,80) size 0x0 + LayoutText {#text} at (121,80) size 32x19 + text run at (121,80) width 32: " N/A" + LayoutBR {BR} at (153,80) size 0x0 LayoutNGBlockFlow {P} at (0,441.53) size 784x40 LayoutText {#text} at (0,0) size 782x39 text run at (0,0) width 782: "If a background image is specified, the value of 'background-attachment' determines if it is fixed with regard to the canvas or" @@ -77,17 +77,17 @@ LayoutInline {EM} at (0,0) size 72x19 LayoutText {#text} at (0,0) size 72x19 text run at (0,0) width 72: "CSS1 core:" - LayoutText {#text} at (71,0) size 766x59 - text run at (71,0) width 670: " UAs may treat 'fixed' as 'scroll'. However, it is recommended they interpret 'fixed' correctly, at least on the" - text run at (0,20) width 766: "HTML and BODY elements, since there is no way for an author to provide an image only for those browsers that support" + LayoutText {#text} at (72,0) size 767x59 + text run at (72,0) width 669: " UAs may treat 'fixed' as 'scroll'. However, it is recommended they interpret 'fixed' correctly, at least on the" + text run at (0,20) width 767: "HTML and BODY elements, since there is no way for an author to provide an image only for those browsers that support" text run at (0,40) width 42: "'fixed'." LayoutTable {TABLE} at (0,669.53) size 784x593 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x591 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x563 LayoutNGTableCell {TD} at (0,295) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,271) size 4x19 @@ -99,7 +99,7 @@ text run at (0,20) width 747: "does NOT scroll with the document. It should, instead, appear to be a fixed pattern past which the content scrolls, even" text run at (0,40) width 726: "when the end of the page is reached. In addition, the default Test Suite background should NOT appear, as it's been" text run at (0,60) width 743: "overridden by the styles shown above. I'll have to add a lot of extra text to the page in order to make all this something" - text run at (0,80) width 373: "we can actually check. Don't worry, I'll think of something." + text run at (0,80) width 372: "we can actually check. Don't worry, I'll think of something." LayoutNGBlockFlow {P} at (4,120) size 762x20 LayoutText {#text} at (0,0) size 507x19 text run at (0,0) width 507: "In fact, why not the relevant section from the CSS1 specification? A capital idea." @@ -109,11 +109,11 @@ text run at (0,0) width 220: "5.3.5 'background-attachment'" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (4,230.53) size 762x100 - LayoutInline {EM} at (0,0) size 41x19 - LayoutText {#text} at (0,0) size 41x19 - text run at (0,0) width 41: "Value:" - LayoutText {#text} at (40,0) size 82x19 - text run at (40,0) width 82: " scroll | fixed" + LayoutInline {EM} at (0,0) size 40x19 + LayoutText {#text} at (0,0) size 40x19 + text run at (0,0) width 40: "Value:" + LayoutText {#text} at (40,0) size 81x19 + text run at (40,0) width 81: " scroll | fixed" LayoutBR {BR} at (121,0) size 0x0 LayoutInline {EM} at (0,0) size 42x19 LayoutText {#text} at (0,20) size 42x19 @@ -136,9 +136,9 @@ LayoutInline {EM} at (0,0) size 121x19 LayoutText {#text} at (0,80) size 121x19 text run at (0,80) width 121: "Percentage values:" - LayoutText {#text} at (120,80) size 33x19 - text run at (120,80) width 33: " N/A" - LayoutBR {BR} at (152,80) size 0x0 + LayoutText {#text} at (121,80) size 32x19 + text run at (121,80) width 32: " N/A" + LayoutBR {BR} at (153,80) size 0x0 LayoutNGBlockFlow {P} at (4,346.53) size 762x40 LayoutText {#text} at (0,0) size 718x39 text run at (0,0) width 718: "If a background image is specified, the value of 'background-attachment' determines if it is fixed with regard to the" @@ -159,9 +159,9 @@ LayoutInline {EM} at (0,0) size 72x19 LayoutText {#text} at (0,0) size 72x19 text run at (0,0) width 72: "CSS1 core:" - LayoutText {#text} at (71,0) size 741x59 - text run at (71,0) width 670: " UAs may treat 'fixed' as 'scroll'. However, it is recommended they interpret 'fixed' correctly, at least on the" - text run at (0,20) width 715: "HTML and BODY elements, since there is no way for an author to provide an image only for those browsers that" + LayoutText {#text} at (72,0) size 741x59 + text run at (72,0) width 669: " UAs may treat 'fixed' as 'scroll'. However, it is recommended they interpret 'fixed' correctly, at least on the" + text run at (0,20) width 716: "HTML and BODY elements, since there is no way for an author to provide an image only for those browsers that" text run at (0,40) width 93: "support 'fixed'." layer at (8,89) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,81) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.png index 5e6d454..28534d9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.txt index 76247c8..9b6400a9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_color-expected.txt
@@ -27,9 +27,9 @@ LayoutInline {SPAN} at (0,0) size 75x19 LayoutText {#text} at (652,0) size 75x19 text run at (652,0) width 75: "background" - LayoutText {#text} at (727,0) size 778x59 + LayoutText {#text} at (727,0) size 777x59 text run at (727,0) width 50: ". This is" - text run at (0,20) width 778: "because the background color of the parent element (the paragraph) should \"shine through\" the SPANned word \"sentence,\"" + text run at (0,20) width 777: "because the background color of the parent element (the paragraph) should \"shine through\" the SPANned word \"sentence,\"" text run at (0,40) width 109: "which was set to " LayoutInline {CODE} at (0,0) size 88x16 LayoutText {#text} at (109,43) size 88x16 @@ -43,9 +43,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x204 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x176 LayoutNGTableCell {TD} at (0,102) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,78) size 4x19 @@ -63,9 +63,9 @@ LayoutInline {SPAN} at (0,0) size 75x19 LayoutText {#text} at (652,0) size 75x19 text run at (652,0) width 75: "background" - LayoutText {#text} at (727,0) size 748x59 + LayoutText {#text} at (727,0) size 747x59 text run at (727,0) width 4: "." - text run at (0,20) width 748: "This is because the background color of the parent element (the paragraph) should \"shine through\" the SPANned word" + text run at (0,20) width 747: "This is because the background color of the parent element (the paragraph) should \"shine through\" the SPANned word" text run at (0,40) width 185: "\"sentence,\" which was set to " LayoutInline {CODE} at (0,0) size 88x16 LayoutText {#text} at (185,43) size 88x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_image-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_image-expected.txt index bdcade0..9c6a0b7f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_image-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_image-expected.txt
@@ -30,13 +30,13 @@ LayoutInline {CODE} at (0,0) size 32x16 LayoutText {#text} at (31,23) size 32x16 text run at (31,23) width 32: "none" - LayoutText {#text} at (63,20) size 168x19 - text run at (63,20) width 168: " is interpreted incorrectly. (" - LayoutInline {CODE} at (0,0) size 33x16 - LayoutText {#text} at (230,23) size 33x16 - text run at (230,23) width 33: "none" + LayoutText {#text} at (63,20) size 167x19 + text run at (63,20) width 167: " is interpreted incorrectly. (" + LayoutInline {CODE} at (0,0) size 32x16 + LayoutText {#text} at (230,23) size 32x16 + text run at (230,23) width 32: "none" LayoutText {#text} at (262,20) size 771x59 - text run at (262,20) width 503: " means that the element has no background image, allowing the parent to \"shine" + text run at (262,20) width 502: " means that the element has no background image, allowing the parent to \"shine" text run at (0,40) width 771: "through\" by default; since the parent of the words \"in this sentence\" is the paragraph, then the paragraph's image should be" text run at (0,60) width 50: "visible.)" LayoutNGBlockFlow {P} at (0,267) size 784x40 @@ -47,9 +47,9 @@ LayoutTableSection {TBODY} at (1,1) size 782x228 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x200 LayoutNGTableCell {TD} at (0,114) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,90) size 4x19 @@ -72,13 +72,13 @@ LayoutInline {CODE} at (0,0) size 32x16 LayoutText {#text} at (59,23) size 32x16 text run at (59,23) width 32: "none" - LayoutText {#text} at (91,20) size 168x19 - text run at (91,20) width 168: " is interpreted incorrectly. (" - LayoutInline {CODE} at (0,0) size 33x16 - LayoutText {#text} at (258,23) size 33x16 - text run at (258,23) width 33: "none" + LayoutText {#text} at (91,20) size 167x19 + text run at (91,20) width 167: " is interpreted incorrectly. (" + LayoutInline {CODE} at (0,0) size 32x16 + LayoutText {#text} at (258,23) size 32x16 + text run at (258,23) width 32: "none" LayoutText {#text} at (290,20) size 750x59 - text run at (290,20) width 459: " means that the element has no background image, allowing the parent to" + text run at (290,20) width 458: " means that the element has no background image, allowing the parent to" text run at (0,40) width 750: "\"shine through\" by default; since the parent of the words \"in this sentence\" is the paragraph, then the paragraph's image" text run at (0,60) width 115: "should be visible.)" LayoutNGBlockFlow {P} at (4,156) size 762x40
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_position-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_position-expected.txt index b91baf6..c28af6da 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_position-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_position-expected.txt
@@ -84,9 +84,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x628 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x600 LayoutNGTableCell {TD} at (0,314) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,290) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_repeat-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_repeat-expected.txt new file mode 100644 index 0000000..ac277e1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/background_repeat-expected.txt
@@ -0,0 +1,261 @@ +layer at (0,0) size 800x600 scrollHeight 1993 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x1993 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x1993 + LayoutNGBlockFlow {BODY} at (8,8) size 784x1977 [bgcolor=#CCCCCC] + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 355x19 + text run at (0,0) width 355: "The style declarations which apply to the text below are:" + LayoutNGBlockFlow {PRE} at (0,36) size 784x240 + LayoutText {#text} at (0,0) size 880x224 + text run at (0,0) width 672: ".one {background-image: url(../resources/oransqr.gif); background-repeat: repeat-y;}" + text run at (672,0) width 0: " " + text run at (0,16) width 672: ".two {background-image: url(../resources/oransqr.gif); background-repeat: repeat-x;}" + text run at (672,16) width 0: " " + text run at (0,32) width 696: ".three {background-image: url(../resources/oransqr.gif); background-repeat: no-repeat;}" + text run at (696,32) width 0: " " + text run at (0,48) width 880: ".four {background-image: url(../resources/bg.gif); background-position: 50% 50%; background-repeat: repeat-y;}" + text run at (880,48) width 0: " " + text run at (0,64) width 704: ".five {background-image: url(../resources/crosshair2.gif); background-position: 50% 50%;" + text run at (704,64) width 0: " " + text run at (0,80) width 240: " background-color: red;}" + text run at (240,80) width 0: " " + text run at (0,96) width 720: ".six {background-image: url(../resources/crosshair2.gif); background-position: center top;" + text run at (720,96) width 0: " " + text run at (0,112) width 232: " background-color: red;}" + text run at (232,112) width 0: " " + text run at (0,128) width 720: ".seven {background-image: url(../resources/crosshair2.gif); background-position: top left;" + text run at (720,128) width 0: " " + text run at (0,144) width 248: " background-color: red;}" + text run at (248,144) width 0: " " + text run at (0,160) width 752: ".eight {background-image: url(../resources/crosshair2.gif); background-position: bottom right;" + text run at (752,160) width 0: " " + text run at (0,176) width 248: " background-color: red;}" + text run at (248,176) width 0: " " + text run at (0,192) width 704: ".nine {background-image: url(../resources/crosshair2.gif); background-position: 50% 50%;" + text run at (704,192) width 0: " " + text run at (0,208) width 240: " background-color: red;}" + text run at (240,208) width 0: " " + text run at (0,224) width 0: " " + LayoutNGBlockFlow {P} at (0,307) size 784x60 + LayoutText {#text} at (0,0) size 784x19 + text run at (0,0) width 784: "This sentence should have an orange stripe repeated in the \"y\" direction, starting at the upper left corner (since the default for" + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (0,23) size 152x16 + text run at (0,23) width 152: "background-position" + LayoutText {#text} at (152,20) size 779x39 + text run at (152,20) width 627: " is '0% 0%' and that property is not declared here). This is extra text included for the sole purpose of" + text run at (0,40) width 410: "making the paragraph longer. Thank you for your understanding." + LayoutNGBlockFlow {P} at (0,383) size 784x60 + LayoutText {#text} at (0,0) size 784x19 + text run at (0,0) width 784: "This sentence should have an orange stripe repeated in the \"x\" direction, starting at the upper left corner (since the default for" + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (0,23) size 152x16 + text run at (0,23) width 152: "background-position" + LayoutText {#text} at (152,20) size 779x39 + text run at (152,20) width 627: " is '0% 0%' and that property is not declared here). This is extra text included for the sole purpose of" + text run at (0,40) width 410: "making the paragraph longer. Thank you for your understanding." + LayoutNGBlockFlow {P} at (0,459) size 784x60 + LayoutText {#text} at (0,0) size 697x19 + text run at (0,0) width 697: "This sentence should have a single orange square behind it, placed at the upper left corner (since the default for" + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (0,23) size 152x16 + text run at (0,23) width 152: "background-position" + LayoutText {#text} at (152,20) size 779x39 + text run at (152,20) width 627: " is '0% 0%' and that property is not declared here). This is extra text included for the sole purpose of" + text run at (0,40) width 410: "making the paragraph longer. Thank you for your understanding." + LayoutNGBlockFlow {P} at (0,535) size 784x80 + LayoutText {#text} at (0,0) size 762x39 + text run at (0,0) width 762: "This sentence should have a green-hatch stripe running vertically down the center of the paragraph, with the origin image" + text run at (0,20) width 316: "exactly centered in the paragraph. This is because " + LayoutInline {CODE} at (0,0) size 64x16 + LayoutText {#text} at (316,23) size 64x16 + text run at (316,23) width 64: "repeat-y" + LayoutText {#text} at (380,20) size 114x19 + text run at (380,20) width 114: " specifies tiling in " + LayoutInline {EM} at (0,0) size 28x19 + LayoutText {#text} at (494,20) size 28x19 + text run at (494,20) width 28: "both" + LayoutText {#text} at (522,20) size 764x39 + text run at (522,20) width 242: " directions on the y-axis. Note that this" + text run at (0,40) width 267: "test is only valid if the user agent supports " + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (267,43) size 152x16 + text run at (267,43) width 152: "background-position" + LayoutText {#text} at (419,40) size 33x19 + text run at (419,40) width 33: " (see " + LayoutInline {A} at (0,0) size 57x19 [color=#0000FF] + LayoutText {#text} at (452,40) size 57x19 + text run at (452,40) width 57: "test 5.3.6" + LayoutText {#text} at (509,40) size 759x39 + text run at (509,40) width 250: "). I'll fill the paragraph with extra text to" + text run at (0,60) width 342: "make the conformance (or lack thereof) more obvious." + LayoutNGBlockFlow {P} at (0,631) size 784x100 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 754x19 + text run at (0,0) width 754: "This paragraph should have a tiled background, with the origin image exactly centered in the paragraph. This is because" + LayoutInline {CODE} at (0,0) size 136x16 + LayoutText {#text} at (0,23) size 136x16 + text run at (0,23) width 136: "background-repeat" + LayoutText {#text} at (136,20) size 114x19 + text run at (136,20) width 114: " specifies tiling in " + LayoutInline {EM} at (0,0) size 16x19 + LayoutText {#text} at (250,20) size 16x19 + text run at (250,20) width 16: "all" + LayoutText {#text} at (266,20) size 782x39 + text run at (266,20) width 516: " directions, regardless of the position of the origin image. Note that this test is only" + text run at (0,40) width 196: "valid if the user agent supports " + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (196,43) size 152x16 + text run at (196,43) width 152: "background-position" + LayoutText {#text} at (348,40) size 33x19 + text run at (348,40) width 33: " (see " + LayoutInline {A} at (0,0) size 57x19 [color=#0000FF] + LayoutText {#text} at (381,40) size 57x19 + text run at (381,40) width 57: "test 5.3.6" + LayoutText {#text} at (438,40) size 766x59 + text run at (438,40) width 311: "). I'll fill the paragraph with extra text to make the" + text run at (0,60) width 766: "conformance (or lack thereof) more obvious. A background color is present, although if it is visible then the image has not" + text run at (0,80) width 116: "bee correctly tiled." + LayoutNGBlockFlow {P} at (0,747) size 784x60 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 782x59 + text run at (0,0) width 764: "This sentence should have a fully tiled background which starts at its center top; that is, the background's origin should be" + text run at (0,20) width 782: "the exact center of the top of the paragraph. I'll fill it with extra text to make the conformance (or lack thereof) more obvious." + text run at (0,40) width 652: "A background color is present, although if it is visible, then the image may not have been tiled correctly." + LayoutNGBlockFlow {P} at (0,823) size 784x60 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 776x59 + text run at (0,0) width 708: "This sentence should have a fully tiled background which starts at its top left. I'll fill it with extra text to make the" + text run at (0,20) width 776: "conformance (or lack thereof) more obvious. A background color is present, although if it is visible, then the image may not" + text run at (0,40) width 156: "have been tiled correctly." + LayoutNGBlockFlow {P} at (0,899) size 784x80 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 783x79 + text run at (0,0) width 783: "This sentence should have a fully tiled background which starts at its bottom right; in other words, a complete instance of the" + text run at (0,20) width 781: "image should be anchored in the bottom right corner, with the tiled background extending out from there. I'll fill it with extra" + text run at (0,40) width 783: "text to make the conformance (or lack thereof) more obvious. A background color is present, although if it is visible, then the" + text run at (0,60) width 253: "image may not have been tiled correctly." + LayoutNGBlockFlow {P} at (0,995) size 784x120 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 769x119 + text run at (0,0) width 718: "This sentence should have a fully tiled background which starts at its center and is tiled in all directions; that is, the" + text run at (0,20) width 765: "background's origin should be the exact center of the paragraph. I'll fill it with extra text to make the conformance (or lack" + text run at (0,40) width 769: "thereof) more obvious. In fact, a lot of extra text will be necessary to make this at all obvious. This is true because I am not" + text run at (0,60) width 765: "able to increase the text size without resorting to either headings or other CSS properties, neither of which I want to use in" + text run at (0,80) width 751: "this circumstance. This ought to be enough text, though. A background color is present, although if it is visible, then the" + text run at (0,100) width 253: "image may not have been tiled correctly." + LayoutTable {TABLE} at (0,1131) size 784x846 [border: (1px outset #808080)] + LayoutTableSection {TBODY} at (1,1) size 782x844 + LayoutTableRow {TR} at (0,0) size 782x28 + LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" + LayoutTableRow {TR} at (0,28) size 782x816 + LayoutNGTableCell {TD} at (0,422) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (4,398) size 4x19 + text run at (4,398) width 4: " " + LayoutNGTableCell {TD} at (12,28) size 770x816 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] + LayoutNGBlockFlow {P} at (4,4) size 762x60 + LayoutText {#text} at (0,0) size 762x39 + text run at (0,0) width 762: "This sentence should have an orange stripe repeated in the \"y\" direction, starting at the upper left corner (since the default" + text run at (0,20) width 22: "for " + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (22,23) size 152x16 + text run at (22,23) width 152: "background-position" + LayoutText {#text} at (174,20) size 730x39 + text run at (174,20) width 556: " is '0% 0%' and that property is not declared here). This is extra text included for the sole" + text run at (0,40) width 481: "purpose of making the paragraph longer. Thank you for your understanding." + LayoutNGBlockFlow {P} at (4,80) size 762x60 + LayoutText {#text} at (0,0) size 762x39 + text run at (0,0) width 762: "This sentence should have an orange stripe repeated in the \"x\" direction, starting at the upper left corner (since the default" + text run at (0,20) width 22: "for " + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (22,23) size 152x16 + text run at (22,23) width 152: "background-position" + LayoutText {#text} at (174,20) size 730x39 + text run at (174,20) width 556: " is '0% 0%' and that property is not declared here). This is extra text included for the sole" + text run at (0,40) width 481: "purpose of making the paragraph longer. Thank you for your understanding." + LayoutNGBlockFlow {P} at (4,156) size 762x60 + LayoutText {#text} at (0,0) size 697x19 + text run at (0,0) width 697: "This sentence should have a single orange square behind it, placed at the upper left corner (since the default for" + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (0,23) size 152x16 + text run at (0,23) width 152: "background-position" + LayoutText {#text} at (152,20) size 762x39 + text run at (152,20) width 610: " is '0% 0%' and that property is not declared here). This is extra text included for the sole purpose" + text run at (0,40) width 427: "of making the paragraph longer. Thank you for your understanding." + LayoutNGBlockFlow {P} at (4,232) size 762x80 + LayoutText {#text} at (0,0) size 762x39 + text run at (0,0) width 762: "This sentence should have a green-hatch stripe running vertically down the center of the paragraph, with the origin image" + text run at (0,20) width 316: "exactly centered in the paragraph. This is because " + LayoutInline {CODE} at (0,0) size 64x16 + LayoutText {#text} at (316,23) size 64x16 + text run at (316,23) width 64: "repeat-y" + LayoutText {#text} at (380,20) size 114x19 + text run at (380,20) width 114: " specifies tiling in " + LayoutInline {EM} at (0,0) size 28x19 + LayoutText {#text} at (494,20) size 28x19 + text run at (494,20) width 28: "both" + LayoutText {#text} at (522,20) size 738x39 + text run at (522,20) width 216: " directions on the y-axis. Note that" + text run at (0,40) width 293: "this test is only valid if the user agent supports " + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (293,43) size 152x16 + text run at (293,43) width 152: "background-position" + LayoutText {#text} at (445,40) size 33x19 + text run at (445,40) width 33: " (see " + LayoutInline {A} at (0,0) size 57x19 [color=#0000FF] + LayoutText {#text} at (478,40) size 57x19 + text run at (478,40) width 57: "test 5.3.6" + LayoutText {#text} at (535,40) size 742x39 + text run at (535,40) width 207: "). I'll fill the paragraph with extra" + text run at (0,60) width 385: "text to make the conformance (or lack thereof) more obvious." + LayoutNGBlockFlow {P} at (4,328) size 762x100 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 754x19 + text run at (0,0) width 754: "This paragraph should have a tiled background, with the origin image exactly centered in the paragraph. This is because" + LayoutInline {CODE} at (0,0) size 136x16 + LayoutText {#text} at (0,23) size 136x16 + text run at (0,23) width 136: "background-repeat" + LayoutText {#text} at (136,20) size 114x19 + text run at (136,20) width 114: " specifies tiling in " + LayoutInline {EM} at (0,0) size 16x19 + LayoutText {#text} at (250,20) size 16x19 + text run at (250,20) width 16: "all" + LayoutText {#text} at (266,20) size 750x39 + text run at (266,20) width 484: " directions, regardless of the position of the origin image. Note that this test is" + text run at (0,40) width 228: "only valid if the user agent supports " + LayoutInline {CODE} at (0,0) size 152x16 + LayoutText {#text} at (228,43) size 152x16 + text run at (228,43) width 152: "background-position" + LayoutText {#text} at (380,40) size 33x19 + text run at (380,40) width 33: " (see " + LayoutInline {A} at (0,0) size 57x19 [color=#0000FF] + LayoutText {#text} at (413,40) size 57x19 + text run at (413,40) width 57: "test 5.3.6" + LayoutText {#text} at (470,40) size 758x59 + text run at (470,40) width 288: "). I'll fill the paragraph with extra text to make" + text run at (0,60) width 740: "the conformance (or lack thereof) more obvious. A background color is present, although if it is visible then the image" + text run at (0,80) width 165: "has not bee correctly tiled." + LayoutNGBlockFlow {P} at (4,444) size 762x60 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 745x59 + text run at (0,0) width 745: "This sentence should have a fully tiled background which starts at its center top; that is, the background's origin should" + text run at (0,20) width 743: "be the exact center of the top of the paragraph. I'll fill it with extra text to make the conformance (or lack thereof) more" + text run at (0,40) width 709: "obvious. A background color is present, although if it is visible, then the image may not have been tiled correctly." + LayoutNGBlockFlow {P} at (4,520) size 762x60 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 752x59 + text run at (0,0) width 708: "This sentence should have a fully tiled background which starts at its top left. I'll fill it with extra text to make the" + text run at (0,20) width 752: "conformance (or lack thereof) more obvious. A background color is present, although if it is visible, then the image may" + text run at (0,40) width 180: "not have been tiled correctly." + LayoutNGBlockFlow {P} at (4,596) size 762x80 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 760x79 + text run at (0,0) width 760: "This sentence should have a fully tiled background which starts at its bottom right; in other words, a complete instance of" + text run at (0,20) width 737: "the image should be anchored in the bottom right corner, with the tiled background extending out from there. I'll fill it" + text run at (0,40) width 747: "with extra text to make the conformance (or lack thereof) more obvious. A background color is present, although if it is" + text run at (0,60) width 356: "visible, then the image may not have been tiled correctly." + LayoutNGBlockFlow {P} at (4,692) size 762x120 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 755x119 + text run at (0,0) width 718: "This sentence should have a fully tiled background which starts at its center and is tiled in all directions; that is, the" + text run at (0,20) width 735: "background's origin should be the exact center of the paragraph. I'll fill it with extra text to make the conformance (or" + text run at (0,40) width 752: "lack thereof) more obvious. In fact, a lot of extra text will be necessary to make this at all obvious. This is true because I" + text run at (0,60) width 755: "am not able to increase the text size without resorting to either headings or other CSS properties, neither of which I want" + text run at (0,80) width 754: "to use in this circumstance. This ought to be enough text, though. A background color is present, although if it is visible," + text run at (0,100) width 307: "then the image may not have been tiled correctly." +layer at (8,297) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,289) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/color-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/color-expected.txt index 9204b1b6..190d205e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/color-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/color_and_background/color-expected.txt
@@ -21,9 +21,9 @@ LayoutTableSection {TBODY} at (1,1) size 214x92 LayoutTableRow {TR} at (0,0) size 214x28 LayoutNGTableCell {TD} at (0,0) size 214x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 214x64 LayoutNGTableCell {TD} at (0,46) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,22) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/conformance/forward_compatible_parsing-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/conformance/forward_compatible_parsing-expected.txt index b156883..28c4094a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/conformance/forward_compatible_parsing-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/conformance/forward_compatible_parsing-expected.txt
@@ -117,8 +117,8 @@ LayoutText {#text} at (0,0) size 485x19 text run at (0,0) width 485: "This paragraph should be green, because only the rotation should be ignored." LayoutNGBlockFlow {P} at (0,967) size 769x20 [color=#008000] - LayoutText {#text} at (0,0) size 622x19 - text run at (0,0) width 622: "This paragraph should be green, since error-checking should be done before calculating specificity." + LayoutText {#text} at (0,0) size 621x19 + text run at (0,0) width 621: "This paragraph should be green, since error-checking should be done before calculating specificity." LayoutNGBlockFlow {P} at (0,1003) size 769x40 LayoutText {#text} at (0,0) size 560x19 text run at (0,0) width 560: "This paragraph should have a solid gray background (or a white grid), because in CSS1, " @@ -129,11 +129,11 @@ text run at (616,0) width 144: " is an invalid keyword," text run at (0,20) width 520: "and in CSS2, it will cause the gray background (not the white grid) to be inherited." LayoutNGBlockFlow {P} at (0,1059) size 769x20 - LayoutText {#text} at (0,0) size 638x19 - text run at (0,0) width 638: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." + LayoutText {#text} at (0,0) size 637x19 + text run at (0,0) width 637: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." LayoutNGBlockFlow {P} at (0,1095) size 769x20 - LayoutText {#text} at (0,0) size 638x19 - text run at (0,0) width 638: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." + LayoutText {#text} at (0,0) size 637x19 + text run at (0,0) width 637: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." LayoutNGBlockFlow {P} at (0,1131) size 769x20 LayoutText {#text} at (0,0) size 526x19 text run at (0,0) width 526: "This paragraph should have a white background, since keywords cannot be quoted." @@ -180,25 +180,25 @@ text run at (0,0) width 10: "\x{2022} " LayoutText {#text} at (0,0) size 690x39 text run at (0,0) width 690: "This unordered list item should be black, because, according to CSS1, the selector is invalid, and according to" - text run at (0,20) width 228: "CSS2, the selector should not apply." + text run at (0,20) width 227: "CSS2, the selector should not apply." LayoutNGBlockFlow {BLOCKQUOTE} at (40,1695) size 689x40 LayoutText {#text} at (0,0) size 688x39 text run at (0,0) width 688: "This blockquote should be black, because, according to CSS1, the selector is invalid, and according to CSS2," - text run at (0,20) width 183: "the selector should not apply." + text run at (0,20) width 182: "the selector should not apply." LayoutNGBlockFlow {P} at (0,1751) size 769x40 LayoutInline {ACRONYM} at (0,0) size 748x39 LayoutText {#text} at (0,0) size 748x39 text run at (0,0) width 748: "This acronym should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the selector" - text run at (0,20) width 108: "should not apply." + text run at (0,20) width 107: "should not apply." LayoutNGBlockFlow {ADDRESS} at (0,1807) size 769x40 - LayoutText {#text} at (0,0) size 744x39 - text run at (0,0) width 744: "This address should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the selector" + LayoutText {#text} at (0,0) size 745x39 + text run at (0,0) width 745: "This address should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the selector" text run at (0,20) width 109: "should not apply." LayoutNGBlockFlow {P} at (0,1863) size 769x40 LayoutInline {SPAN} at (0,0) size 768x39 LayoutText {#text} at (0,0) size 768x39 text run at (0,0) width 768: "This span should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the selector should" - text run at (0,20) width 62: "not apply." + text run at (0,20) width 61: "not apply." LayoutNGBlockFlow {P} at (0,1919) size 769x40 LayoutText {#text} at (0,0) size 753x39 text run at (0,0) width 753: "This paragraph should be black, because the style declaration that applies to it is within an invalid at-rule. However, it is" @@ -269,14 +269,14 @@ LayoutNGBlockFlow {P} at (0,2203) size 769x60 LayoutText {#text} at (0,0) size 530x19 text run at (0,0) width 530: "The text of this paragraph should be normal size because the selector is invalid. The " - LayoutInline {EM} at (0,0) size 101x19 - LayoutText {#text} at (529,0) size 101x19 - text run at (529,0) width 101: "emphasized text" - LayoutText {#text} at (629,0) size 55x19 - text run at (629,0) width 55: " and the " - LayoutInline {STRONG} at (0,0) size 73x19 - LayoutText {#text} at (683,0) size 73x19 - text run at (683,0) width 73: "strong text" + LayoutInline {EM} at (0,0) size 100x19 + LayoutText {#text} at (530,0) size 100x19 + text run at (530,0) width 100: "emphasized text" + LayoutText {#text} at (630,0) size 54x19 + text run at (630,0) width 54: " and the " + LayoutInline {STRONG} at (0,0) size 72x19 + LayoutText {#text} at (684,0) size 72x19 + text run at (684,0) width 72: "strong text" LayoutText {#text} at (0,20) size 761x39 text run at (0,20) width 761: "within it should also be normal size, since the entire ruleset should be skipped (since in some future version of CSS, there" text run at (0,40) width 520: "could be an operator within the selector that has higher precedence than a comma)." @@ -288,7 +288,7 @@ text run at (464,0) width 22: "not" LayoutText {#text} at (486,0) size 743x39 text run at (486,0) width 257: " a comment and therefore the selector for" - text run at (0,20) width 138: "P.nineteenb is invalid." + text run at (0,20) width 137: "P.nineteenb is invalid." LayoutNGBlockFlow {P} at (0,2335) size 769x20 [color=#0000FF] LayoutText {#text} at (0,0) size 470x19 text run at (0,0) width 470: "This paragraph should be blue, because only the first declaration is invalid." @@ -315,9 +315,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x1696 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x1668 LayoutNGTableCell {TD} at (0,848) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,824) size 4x19 @@ -327,8 +327,8 @@ LayoutText {#text} at (0,0) size 485x19 text run at (0,0) width 485: "This paragraph should be green, because only the rotation should be ignored." LayoutNGBlockFlow {P} at (4,40) size 747x20 [color=#008000] - LayoutText {#text} at (0,0) size 622x19 - text run at (0,0) width 622: "This paragraph should be green, since error-checking should be done before calculating specificity." + LayoutText {#text} at (0,0) size 621x19 + text run at (0,0) width 621: "This paragraph should be green, since error-checking should be done before calculating specificity." LayoutNGBlockFlow {P} at (4,76) size 747x40 LayoutText {#text} at (0,0) size 560x19 text run at (0,0) width 560: "This paragraph should have a solid gray background (or a white grid), because in CSS1, " @@ -339,11 +339,11 @@ text run at (616,0) width 80: " is an invalid" text run at (0,20) width 584: "keyword, and in CSS2, it will cause the gray background (not the white grid) to be inherited." LayoutNGBlockFlow {P} at (4,132) size 747x20 - LayoutText {#text} at (0,0) size 638x19 - text run at (0,0) width 638: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." + LayoutText {#text} at (0,0) size 637x19 + text run at (0,0) width 637: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." LayoutNGBlockFlow {P} at (4,168) size 747x20 - LayoutText {#text} at (0,0) size 638x19 - text run at (0,0) width 638: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." + LayoutText {#text} at (0,0) size 637x19 + text run at (0,0) width 637: "This paragraph should be black, since in CSS1, the selector is invalid, and in CSS2, it does not apply." LayoutNGBlockFlow {P} at (4,204) size 747x20 LayoutText {#text} at (0,0) size 526x19 text run at (0,0) width 526: "This paragraph should have a white background, since keywords cannot be quoted." @@ -390,25 +390,25 @@ text run at (0,0) width 10: "\x{2022} " LayoutText {#text} at (0,0) size 690x39 text run at (0,0) width 690: "This unordered list item should be black, because, according to CSS1, the selector is invalid, and according to" - text run at (0,20) width 228: "CSS2, the selector should not apply." + text run at (0,20) width 227: "CSS2, the selector should not apply." LayoutNGBlockFlow {BLOCKQUOTE} at (44,768) size 667x40 LayoutText {#text} at (0,0) size 643x39 text run at (0,0) width 643: "This blockquote should be black, because, according to CSS1, the selector is invalid, and according to" - text run at (0,20) width 228: "CSS2, the selector should not apply." + text run at (0,20) width 227: "CSS2, the selector should not apply." LayoutNGBlockFlow {P} at (4,824) size 747x40 LayoutInline {ACRONYM} at (0,0) size 696x39 LayoutText {#text} at (0,0) size 696x39 text run at (0,0) width 696: "This acronym should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the" - text run at (0,20) width 160: "selector should not apply." + text run at (0,20) width 159: "selector should not apply." LayoutNGBlockFlow {ADDRESS} at (4,880) size 747x40 - LayoutText {#text} at (0,0) size 744x39 - text run at (0,0) width 744: "This address should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the selector" + LayoutText {#text} at (0,0) size 745x39 + text run at (0,0) width 745: "This address should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the selector" text run at (0,20) width 109: "should not apply." LayoutNGBlockFlow {P} at (4,936) size 747x40 LayoutInline {SPAN} at (0,0) size 722x39 LayoutText {#text} at (0,0) size 722x39 text run at (0,0) width 722: "This span should be black, because, according to CSS1, the selector is invalid, and according to CSS2, the selector" - text run at (0,20) width 108: "should not apply." + text run at (0,20) width 107: "should not apply." LayoutNGBlockFlow {P} at (4,992) size 747x40 LayoutText {#text} at (0,0) size 739x39 text run at (0,0) width 739: "This paragraph should be black, because the style declaration that applies to it is within an invalid at-rule. However, it" @@ -479,14 +479,14 @@ LayoutNGBlockFlow {P} at (4,1276) size 747x60 LayoutText {#text} at (0,0) size 530x19 text run at (0,0) width 530: "The text of this paragraph should be normal size because the selector is invalid. The " - LayoutInline {EM} at (0,0) size 101x19 - LayoutText {#text} at (529,0) size 101x19 - text run at (529,0) width 101: "emphasized text" - LayoutText {#text} at (629,0) size 55x19 - text run at (629,0) width 55: " and the " + LayoutInline {EM} at (0,0) size 100x19 + LayoutText {#text} at (530,0) size 100x19 + text run at (530,0) width 100: "emphasized text" + LayoutText {#text} at (630,0) size 54x19 + text run at (630,0) width 54: " and the " LayoutInline {STRONG} at (0,0) size 727x39 - LayoutText {#text} at (683,0) size 727x39 - text run at (683,0) width 44: "strong" + LayoutText {#text} at (684,0) size 727x39 + text run at (684,0) width 43: "strong" text run at (0,20) width 25: "text" LayoutText {#text} at (25,20) size 718x39 text run at (25,20) width 693: " within it should also be normal size, since the entire ruleset should be skipped (since in some future version of" @@ -499,7 +499,7 @@ text run at (464,0) width 22: "not" LayoutText {#text} at (486,0) size 743x39 text run at (486,0) width 257: " a comment and therefore the selector for" - text run at (0,20) width 138: "P.nineteenb is invalid." + text run at (0,20) width 137: "P.nineteenb is invalid." LayoutNGBlockFlow {P} at (4,1408) size 747x20 [color=#0000FF] LayoutText {#text} at (0,0) size 470x19 text run at (0,0) width 470: "This paragraph should be blue, because only the first declaration is invalid."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font-expected.png index 582c4fb..53eca15b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font_variant-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font_variant-expected.png index 7053033b..afa0dd9a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font_variant-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/font_properties/font_variant-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.png index ff6c826f..f35a440c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.txt index d16047b..2f357012 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/canvas-expected.txt
@@ -13,26 +13,26 @@ text run at (0,16) width 552: "BODY {background-color: green; background-image: none; margin: 25px;}" text run at (552,16) width 0: " " LayoutNGBlockFlow {P} at (0,99) size 750x60 - LayoutText {#text} at (0,0) size 736x59 + LayoutText {#text} at (0,0) size 737x59 text run at (0,0) width 695: "The body of this document should have a green background. It also has a margin of 25 pixels, so the light blue" - text run at (0,20) width 736: "background set for the HTML element should surround the BODY. If the BODY content is significantly shorter than" + text run at (0,20) width 737: "background set for the HTML element should surround the BODY. If the BODY content is significantly shorter than" text run at (0,40) width 519: "the browser's window height, then the bottom border may be larger than 25 pixels." LayoutTable {TABLE} at (0,175) size 750x98 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 748x96 LayoutTableRow {TR} at (0,0) size 748x28 LayoutNGTableCell {TD} at (0,0) size 748x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 748x68 LayoutNGTableCell {TD} at (0,48) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,24) size 4x19 text run at (4,24) width 4: " " LayoutNGTableCell {TD} at (12,28) size 736x68 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] LayoutNGBlockFlow {P} at (4,4) size 728x60 - LayoutText {#text} at (0,0) size 705x59 + LayoutText {#text} at (0,0) size 706x59 text run at (0,0) width 695: "The body of this document should have a green background. It also has a margin of 25 pixels, so the light blue" - text run at (0,20) width 705: "background set for the HTML element should surround the BODY. If the BODY content is significantly shorter" + text run at (0,20) width 706: "background set for the HTML element should surround the BODY. If the BODY content is significantly shorter" text run at (0,40) width 550: "than the browser's window height, then the bottom border may be larger than 25 pixels." layer at (25,106) size 750x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,81) size 750x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.png index 59f1f34..5542acb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.txt index fcdcfa8..29ccc43 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/floating_elements-expected.txt
@@ -95,8 +95,8 @@ text run at (0,80) width 336: "not go beyond the left or right inner edge of this DIV," text run at (0,100) width 324: "which means that the borders of the floating images" text run at (0,120) width 350: "should not overlap the top or side borders of the DIV in" - text run at (0,140) width 318: "any way. In addition, they should not overlap each" - text run at (0,160) width 346: "other. The first two should be side by side, whereas the" + text run at (0,140) width 317: "any way. In addition, they should not overlap each" + text run at (0,160) width 347: "other. The first two should be side by side, whereas the" text run at (0,180) width 213: "third should be on the next \"line.\"" LayoutNGBlockFlow {DIV} at (2,1077) size 314x384 [border: (5px solid #800080)] LayoutNGBlockFlow (floating) {P} at (5,5) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] @@ -122,8 +122,8 @@ text run at (0,174) width 74: "DIV, which" text run at (0,194) width 292: "means that the borders of the floating elements" text run at (0,214) width 301: "should not overlap the top or side borders of the" - text run at (0,234) width 283: "DIV in any way. In addition, they should not" - text run at (0,254) width 287: "overlap each other in any way, nor should the" + text run at (0,234) width 282: "DIV in any way. In addition, they should not" + text run at (0,254) width 286: "overlap each other in any way, nor should the" text run at (0,274) width 304: "floated elements be overwritten by the DIV text." text run at (0,294) width 290: "In addition, the floated elements should not be" text run at (0,314) width 268: "side-by-side, but instead the first should be" @@ -133,17 +133,17 @@ LayoutImage (floating) {IMG} at (5,5) size 256x36 [border: (3px solid #000000)] LayoutImage (floating) {IMG} at (149,41) size 256x36 [border: (3px solid #000000)] LayoutNGBlockFlow (anonymous) at (5,5) size 400x236 - LayoutText {#text} at (256,0) size 398x235 + LayoutText {#text} at (256,0) size 400x235 text run at (256,0) width 136: "This is text within the" text run at (0,36) width 112: "DIV. The floating" text run at (0,56) width 114: "images within this" text run at (0,76) width 380: "DIV should not go beyond the left or right inner edge of this" text run at (0,96) width 359: "DIV, which means that the borders of the floating images" text run at (0,116) width 377: "should not overlap the top or side borders of the DIV in any" - text run at (0,136) width 370: "way. In addition, they should not overlap each other in any" - text run at (0,156) width 368: "way, nor should the floated elements be overwritten by the" - text run at (0,176) width 398: "DIV text. In addition, the floated images should not be side-by-" - text run at (0,196) width 390: "side, but instead the first should be floated left, and the second" + text run at (0,136) width 369: "way. In addition, they should not overlap each other in any" + text run at (0,156) width 400: "way, nor should the floated elements be overwritten by the DIV" + text run at (0,176) width 394: "text. In addition, the floated images should not be side-by-side," + text run at (0,196) width 357: "but instead the first should be floated left, and the second" text run at (0,216) width 213: "floated to the right below the first." LayoutNGBlockFlow {DIV} at (2,1775) size 765x130 [border: (5px solid #800080)] LayoutNGBlockFlow (floating) {P} at (566,5) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] @@ -162,7 +162,7 @@ text run at (194,20) width 350: "this DIV should not go beyond the top side of this DIV," text run at (194,40) width 335: "which means that the borders of the floating elements" text run at (194,60) width 350: "should not overlap the top or side borders of the DIV in" - text run at (194,80) width 325: "any way. In addition, the top of the left-floating box" + text run at (194,80) width 324: "any way. In addition, the top of the left-floating box" text run at (0,100) width 365: "should not be higher than the top of the right-floating box." LayoutNGBlockFlow {DIV} at (2,1923) size 765x70 [border: (5px solid #800080)] LayoutImage (floating) {IMG} at (5,5) size 15x36 [border: (3px solid #000000)] @@ -171,7 +171,7 @@ LayoutText {#text} at (15,0) size 720x59 text run at (15,0) width 698: "This is text within the DIV. The floating images within this DIV should not go beyond the top side of this DIV," text run at (15,20) width 705: "which means that the borders of the floating images should not overlap the top or side borders of the DIV in any" - text run at (0,40) width 695: "way. In addition, the top of the left-floating image should not be higher than the top of the right-floating image." + text run at (0,40) width 694: "way. In addition, the top of the left-floating image should not be higher than the top of the right-floating image." LayoutNGBlockFlow {DIV} at (2,2043) size 765x150 [border: (5px solid #800080)] LayoutText {#text} at (199,5) size 183x19 text run at (199,5) width 183: "This is text within the DIV. *" @@ -180,8 +180,8 @@ text run at (17,17) width 130: "This is a left-floating" text run at (17,37) width 112: "paragraph (first in" text run at (17,57) width 50: "source)." - LayoutText {#text} at (381,5) size 543x39 - text run at (381,5) width 361: " The floating elements within this DIV should not go any" + LayoutText {#text} at (382,5) size 543x39 + text run at (382,5) width 360: " The floating elements within this DIV should not go any" text run at (199,25) width 489: "higher than the line-box containing the inline content which precedes them. * " LayoutNGBlockFlow (floating) {P} at (566,45) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] LayoutText {#text} at (17,17) size 139x59 @@ -193,20 +193,20 @@ text run at (199,45) width 349: "that the top side of each float can be, at most, as high as" text run at (199,65) width 352: "the top edge of the inline element containing the content" text run at (199,85) width 344: "just before the floating elements occur in the source. In" - text run at (5,105) width 544: "order to mark these points clearly, an asterisk has been inserted just before each floated" + text run at (5,105) width 543: "order to mark these points clearly, an asterisk has been inserted just before each floated" text run at (5,125) width 53: "element." LayoutNGBlockFlow {DIV} at (2,2211) size 765x90 [border: (5px solid #800080)] LayoutText {#text} at (20,5) size 183x19 text run at (20,5) width 183: "This is text within the DIV. *" LayoutImage (floating) {IMG} at (5,5) size 15x36 [border: (3px solid #000000)] - LayoutText {#text} at (202,5) size 686x39 - text run at (202,5) width 504: " The floating images within this DIV should not go any higher than the line-box" + LayoutText {#text} at (203,5) size 686x39 + text run at (203,5) width 503: " The floating images within this DIV should not go any higher than the line-box" text run at (20,25) width 335: "containing the inline content which precedes them. * " LayoutImage (floating) {IMG} at (745,25) size 15x36 [border: (3px solid #000000)] LayoutText {#text} at (355,25) size 738x59 text run at (355,25) width 376: "This means that the top side of each float can be, at most, as" text run at (5,45) width 738: "high as the top edge of the inline element containing the content just before the floating images occur in the source. In" - text run at (5,65) width 590: "order to mark these points clearly, an asterisk has been inserted just before each floated image." + text run at (5,65) width 589: "order to mark these points clearly, an asterisk has been inserted just before each floated image." LayoutNGBlockFlow {DIV} at (2,2351) size 765x290 [border: (5px solid #800080)] LayoutText {#text} at (199,5) size 183x19 text run at (199,5) width 183: "This is text within the DIV. *" @@ -215,8 +215,8 @@ text run at (17,17) width 130: "This is a left-floating" text run at (17,37) width 112: "paragraph (first in" text run at (17,57) width 50: "source)." - LayoutText {#text} at (381,5) size 543x39 - text run at (381,5) width 361: " The floating elements within this DIV should not go any" + LayoutText {#text} at (382,5) size 543x39 + text run at (382,5) width 360: " The floating elements within this DIV should not go any" text run at (199,25) width 489: "higher than the line-box containing the inline content which precedes them. * " LayoutNGBlockFlow (floating) {P} at (566,45) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] LayoutText {#text} at (17,17) size 139x59 @@ -243,9 +243,9 @@ text run at (17,17) width 130: "This is a left-floating" text run at (17,37) width 126: "paragraph (fourth in" text run at (17,57) width 50: "source)." - LayoutText {#text} at (667,145) size 741x139 + LayoutText {#text} at (667,145) size 740x139 text run at (667,145) width 70: " In order to" - text run at (587,165) width 159: "mark these points clearly," + text run at (587,165) width 158: "mark these points clearly," text run at (587,185) width 125: "an asterisk has been" text run at (587,205) width 152: "inserted just before each" text run at (587,225) width 152: "floated element. If a line" @@ -255,8 +255,8 @@ LayoutText {#text} at (20,5) size 183x19 text run at (20,5) width 183: "This is text within the DIV. *" LayoutImage (floating) {IMG} at (5,5) size 15x36 [border: (3px solid #000000)] - LayoutText {#text} at (202,5) size 671x39 - text run at (202,5) width 504: " The floating images within this DIV should not go any higher than the line-box" + LayoutText {#text} at (203,5) size 671x39 + text run at (203,5) width 503: " The floating images within this DIV should not go any higher than the line-box" text run at (35,25) width 335: "containing the inline content which precedes them. * " LayoutImage (floating) {IMG} at (745,25) size 15x36 [border: (3px solid #000000)] LayoutText {#text} at (370,25) size 318x19 @@ -267,8 +267,8 @@ text run at (35,45) width 689: "as high as the top edge of the inline element containing the content just before the floating images occur in the" text run at (20,65) width 57: "source. *" LayoutImage (floating) {IMG} at (5,65) size 15x36 [border: (3px solid #000000)] - LayoutText {#text} at (77,65) size 735x59 - text run at (77,65) width 663: " In order to mark these points clearly, an asterisk has been inserted just before each floated image. If a line" + LayoutText {#text} at (77,65) size 734x59 + text run at (77,65) width 662: " In order to mark these points clearly, an asterisk has been inserted just before each floated image. If a line" text run at (20,85) width 700: "has room for a floated image, then the image should float so that its top is aligned with the top of the line-box in" text run at (5,105) width 575: "which the asterisk appears. Otherwise, its top should align with the top of the next line-box." LayoutNGBlockFlow {DIV} at (2,2839) size 490x330 [border: (5px solid #800080)] @@ -293,7 +293,7 @@ text run at (199,85) width 48: "floating" text run at (5,105) width 475: "element should be placed in the upper left corner of the DIV, and the purple" text run at (5,125) width 447: "border of the DIV should abut the green border of the floating element." - text run at (5,145) width 443: "Similarly, the right floating element should be placed in the upper right" + text run at (5,145) width 442: "Similarly, the right floating element should be placed in the upper right" text run at (5,165) width 466: "corner of the DIV, and the purple border of the DIV should abut the green" text run at (5,185) width 451: "border of the floating element. The text of the DIV element should flow" text run at (5,205) width 461: "between and under the two floating elements. The two asterisk characters" @@ -313,7 +313,7 @@ text run at (86,5) width 359: " text within the DIV. Under CSS1, the left floating image" text run at (20,25) width 422: "should be placed in the upper left corner of the DIV, and the purple" text run at (5,45) width 436: "border of the DIV should abut the green border of the floating image." - text run at (5,65) width 476: "Similarly, the right floating image should be placed in the upper right corner" + text run at (5,65) width 475: "Similarly, the right floating image should be placed in the upper right corner" text run at (5,85) width 467: "of the DIV, and the purple border of the DIV should abut the green border" text run at (5,105) width 479: "of the floating image. The text of the DIV element should flow between and" text run at (5,125) width 477: "under the two floating image. The two asterisk characters mark the insertion" @@ -326,9 +326,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x3293 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x3265 LayoutNGTableCell {TD} at (0,1646) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,1622) size 4x19 @@ -405,8 +405,8 @@ text run at (0,80) width 336: "not go beyond the left or right inner edge of this DIV," text run at (0,100) width 324: "which means that the borders of the floating images" text run at (0,120) width 350: "should not overlap the top or side borders of the DIV in" - text run at (0,140) width 318: "any way. In addition, they should not overlap each" - text run at (0,160) width 346: "other. The first two should be side by side, whereas the" + text run at (0,140) width 317: "any way. In addition, they should not overlap each" + text run at (0,160) width 347: "other. The first two should be side by side, whereas the" text run at (0,180) width 213: "third should be on the next \"line.\"" LayoutNGBlockFlow {DIV} at (6,890) size 314x384 [border: (5px solid #800080)] LayoutNGBlockFlow (floating) {P} at (5,5) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] @@ -432,8 +432,8 @@ text run at (0,174) width 74: "DIV, which" text run at (0,194) width 292: "means that the borders of the floating elements" text run at (0,214) width 301: "should not overlap the top or side borders of the" - text run at (0,234) width 283: "DIV in any way. In addition, they should not" - text run at (0,254) width 287: "overlap each other in any way, nor should the" + text run at (0,234) width 282: "DIV in any way. In addition, they should not" + text run at (0,254) width 286: "overlap each other in any way, nor should the" text run at (0,274) width 304: "floated elements be overwritten by the DIV text." text run at (0,294) width 290: "In addition, the floated elements should not be" text run at (0,314) width 268: "side-by-side, but instead the first should be" @@ -443,17 +443,17 @@ LayoutImage (floating) {IMG} at (5,5) size 256x36 [border: (3px solid #000000)] LayoutImage (floating) {IMG} at (149,41) size 256x36 [border: (3px solid #000000)] LayoutNGBlockFlow (anonymous) at (5,5) size 400x236 - LayoutText {#text} at (256,0) size 398x235 + LayoutText {#text} at (256,0) size 400x235 text run at (256,0) width 136: "This is text within the" text run at (0,36) width 112: "DIV. The floating" text run at (0,56) width 114: "images within this" text run at (0,76) width 380: "DIV should not go beyond the left or right inner edge of this" text run at (0,96) width 359: "DIV, which means that the borders of the floating images" text run at (0,116) width 377: "should not overlap the top or side borders of the DIV in any" - text run at (0,136) width 370: "way. In addition, they should not overlap each other in any" - text run at (0,156) width 368: "way, nor should the floated elements be overwritten by the" - text run at (0,176) width 398: "DIV text. In addition, the floated images should not be side-by-" - text run at (0,196) width 390: "side, but instead the first should be floated left, and the second" + text run at (0,136) width 369: "way. In addition, they should not overlap each other in any" + text run at (0,156) width 400: "way, nor should the floated elements be overwritten by the DIV" + text run at (0,176) width 394: "text. In addition, the floated images should not be side-by-side," + text run at (0,196) width 357: "but instead the first should be floated left, and the second" text run at (0,216) width 213: "floated to the right below the first." LayoutNGBlockFlow {DIV} at (6,1588) size 743x130 [border: (5px solid #800080)] LayoutNGBlockFlow (floating) {P} at (544,5) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] @@ -472,16 +472,16 @@ text run at (194,20) width 333: "within this DIV should not go beyond the top side of" text run at (194,40) width 337: "this DIV, which means that the borders of the floating" text run at (194,60) width 337: "elements should not overlap the top or side borders of" - text run at (194,80) width 321: "the DIV in any way. In addition, the top of the left-" + text run at (194,80) width 320: "the DIV in any way. In addition, the top of the left-" text run at (0,100) width 445: "floating box should not be higher than the top of the right-floating box." LayoutNGBlockFlow {DIV} at (6,1736) size 743x70 [border: (5px solid #800080)] LayoutImage (floating) {IMG} at (5,5) size 15x36 [border: (3px solid #000000)] LayoutImage (floating) {IMG} at (723,5) size 15x36 [border: (3px solid #000000)] LayoutNGBlockFlow (anonymous) at (5,5) size 733x60 - LayoutText {#text} at (15,0) size 722x59 + LayoutText {#text} at (15,0) size 721x59 text run at (15,0) width 698: "This is text within the DIV. The floating images within this DIV should not go beyond the top side of this DIV," text run at (15,20) width 678: "which means that the borders of the floating images should not overlap the top or side borders of the DIV in" - text run at (0,40) width 722: "any way. In addition, the top of the left-floating image should not be higher than the top of the right-floating image." + text run at (0,40) width 721: "any way. In addition, the top of the left-floating image should not be higher than the top of the right-floating image." LayoutNGBlockFlow {DIV} at (6,1856) size 743x150 [border: (5px solid #800080)] LayoutText {#text} at (199,5) size 183x19 text run at (199,5) width 183: "This is text within the DIV. *" @@ -490,32 +490,32 @@ text run at (17,17) width 130: "This is a left-floating" text run at (17,37) width 112: "paragraph (first in" text run at (17,57) width 50: "source)." - LayoutText {#text} at (381,5) size 516x39 - text run at (381,5) width 334: " The floating elements within this DIV should not go" + LayoutText {#text} at (382,5) size 516x39 + text run at (382,5) width 333: " The floating elements within this DIV should not go" text run at (199,25) width 516: "any higher than the line-box containing the inline content which precedes them. * " LayoutNGBlockFlow (floating) {P} at (544,45) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] LayoutText {#text} at (17,17) size 139x59 text run at (17,17) width 139: "This is a right-floating" text run at (17,37) width 132: "paragraph (second in" text run at (17,57) width 50: "source)." - LayoutText {#text} at (199,45) size 538x99 + LayoutText {#text} at (199,45) size 537x99 text run at (199,45) width 321: "This means that the top side of each float can be, at" text run at (199,65) width 313: "most, as high as the top edge of the inline element" text run at (199,85) width 343: "containing the content just before the floating elements" - text run at (5,105) width 538: "occur in the source. In order to mark these points clearly, an asterisk has been inserted" + text run at (5,105) width 537: "occur in the source. In order to mark these points clearly, an asterisk has been inserted" text run at (5,125) width 203: "just before each floated element." LayoutNGBlockFlow {DIV} at (6,2024) size 743x90 [border: (5px solid #800080)] LayoutText {#text} at (20,5) size 183x19 text run at (20,5) width 183: "This is text within the DIV. *" LayoutImage (floating) {IMG} at (5,5) size 15x36 [border: (3px solid #000000)] - LayoutText {#text} at (202,5) size 686x39 - text run at (202,5) width 504: " The floating images within this DIV should not go any higher than the line-box" + LayoutText {#text} at (203,5) size 686x39 + text run at (203,5) width 503: " The floating images within this DIV should not go any higher than the line-box" text run at (20,25) width 335: "containing the inline content which precedes them. * " LayoutImage (floating) {IMG} at (723,25) size 15x36 [border: (3px solid #000000)] LayoutText {#text} at (355,25) size 709x59 text run at (355,25) width 359: "This means that the top side of each float can be, at most," text run at (5,45) width 689: "as high as the top edge of the inline element containing the content just before the floating images occur in the" - text run at (5,65) width 656: "source. In order to mark these points clearly, an asterisk has been inserted just before each floated image." + text run at (5,65) width 655: "source. In order to mark these points clearly, an asterisk has been inserted just before each floated image." LayoutNGBlockFlow {DIV} at (6,2164) size 743x250 [border: (5px solid #800080)] LayoutText {#text} at (199,5) size 183x19 text run at (199,5) width 183: "This is text within the DIV. *" @@ -524,8 +524,8 @@ text run at (17,17) width 130: "This is a left-floating" text run at (17,37) width 112: "paragraph (first in" text run at (17,57) width 50: "source)." - LayoutText {#text} at (381,5) size 516x39 - text run at (381,5) width 334: " The floating elements within this DIV should not go" + LayoutText {#text} at (382,5) size 516x39 + text run at (382,5) width 333: " The floating elements within this DIV should not go" text run at (199,25) width 516: "any higher than the line-box containing the inline content which precedes them. * " LayoutNGBlockFlow (floating) {P} at (544,45) size 194x94 [bgcolor=#C0C0C0] [border: (1px solid #00FF00)] LayoutText {#text} at (17,17) size 139x59 @@ -553,7 +553,7 @@ text run at (17,57) width 50: "source)." LayoutText {#text} at (639,145) size 539x99 text run at (639,145) width 70: " In order to" - text run at (199,165) width 491: "mark these points clearly, an asterisk has been inserted just before each floated" + text run at (199,165) width 490: "mark these points clearly, an asterisk has been inserted just before each floated" text run at (199,185) width 534: "element. If a line has room for a floated element, then the element should float so that" text run at (199,205) width 539: "its top is aligned with the top of the line-box in which the asterisk appears. Otherwise," text run at (199,225) width 329: "its top should align with the top of the next line-box." @@ -561,8 +561,8 @@ LayoutText {#text} at (20,5) size 183x19 text run at (20,5) width 183: "This is text within the DIV. *" LayoutImage (floating) {IMG} at (5,5) size 15x36 [border: (3px solid #000000)] - LayoutText {#text} at (202,5) size 671x39 - text run at (202,5) width 504: " The floating images within this DIV should not go any higher than the line-box" + LayoutText {#text} at (203,5) size 671x39 + text run at (203,5) width 503: " The floating images within this DIV should not go any higher than the line-box" text run at (35,25) width 335: "containing the inline content which precedes them. * " LayoutImage (floating) {IMG} at (723,25) size 15x36 [border: (3px solid #000000)] LayoutText {#text} at (370,25) size 318x19 @@ -574,7 +574,7 @@ text run at (20,65) width 96: "in the source. *" LayoutImage (floating) {IMG} at (5,65) size 15x36 [border: (3px solid #000000)] LayoutText {#text} at (116,65) size 727x59 - text run at (116,65) width 611: " In order to mark these points clearly, an asterisk has been inserted just before each floated image." + text run at (116,65) width 610: " In order to mark these points clearly, an asterisk has been inserted just before each floated image." text run at (20,85) width 712: "If a line has room for a floated image, then the image should float so that its top is aligned with the top of the line-" text run at (5,105) width 619: "box in which the asterisk appears. Otherwise, its top should align with the top of the next line-box." LayoutNGBlockFlow {DIV} at (6,2613) size 490x330 [border: (5px solid #800080)] @@ -599,7 +599,7 @@ text run at (199,85) width 48: "floating" text run at (5,105) width 475: "element should be placed in the upper left corner of the DIV, and the purple" text run at (5,125) width 447: "border of the DIV should abut the green border of the floating element." - text run at (5,145) width 443: "Similarly, the right floating element should be placed in the upper right" + text run at (5,145) width 442: "Similarly, the right floating element should be placed in the upper right" text run at (5,165) width 466: "corner of the DIV, and the purple border of the DIV should abut the green" text run at (5,185) width 451: "border of the floating element. The text of the DIV element should flow" text run at (5,205) width 461: "between and under the two floating elements. The two asterisk characters" @@ -619,7 +619,7 @@ text run at (86,5) width 359: " text within the DIV. Under CSS1, the left floating image" text run at (20,25) width 422: "should be placed in the upper left corner of the DIV, and the purple" text run at (5,45) width 436: "border of the DIV should abut the green border of the floating image." - text run at (5,65) width 476: "Similarly, the right floating image should be placed in the upper right corner" + text run at (5,65) width 475: "Similarly, the right floating image should be placed in the upper right corner" text run at (5,85) width 467: "of the DIV, and the purple border of the DIV should abut the green border" text run at (5,105) width 479: "of the floating image. The text of the DIV element should flow between and" text run at (5,125) width 477: "under the two floating image. The two asterisk characters mark the insertion"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.png index 550a9b7..1039c77 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.txt index 0ec1d459..6aa2677 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/height_of_lines-expected.txt
@@ -59,12 +59,12 @@ text run at (0,2) width 767: "This paragraph should have a font size of 14px and a line height of 20px. This means that the lines of text within it should be separated" text run at (0,22) width 731: "by six pixels. Any images within the paragraph should increase the height of the line-box so that they fit, including their padding" text run at (0,184) width 396: "(5px), border (10px) and margins (15px) within the line box, such as " - LayoutImage {IMG} at (410.75,55) size 130x130 [border: (10px solid #000000)] - LayoutText {#text} at (555,184) size 29x16 - text run at (555,184) width 29: " and " - LayoutImage {IMG} at (598.75,199) size 130x130 [border: (10px solid #000000)] - LayoutText {#text} at (743,184) size 759x257 - text run at (743,184) width 5: "." + LayoutImage {IMG} at (411,55) size 130x130 [border: (10px solid #000000)] + LayoutText {#text} at (556,184) size 28x16 + text run at (556,184) width 28: " and " + LayoutImage {IMG} at (599,199) size 130x130 [border: (10px solid #000000)] + LayoutText {#text} at (744,184) size 759x257 + text run at (744,184) width 4: "." text run at (0,346) width 755: "This is additional text to make sure that there is enough room left below the image so that this line does not hit the image that is text-" text run at (0,366) width 754: "top aligned. It is the outer edge of the margin that should be text-bottom and text-top aligned in this paragraph, so for the first image" text run at (0,386) width 759: "the bottom border of the image should begin 15px above the bottom of the text, and for the second image the top border should begin" @@ -77,9 +77,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x998 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x970 LayoutNGTableCell {TD} at (0,499) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,475) size 4x19 @@ -102,9 +102,9 @@ text run at (0,2) width 711: "This paragraph should have a font size of 14px and a line height of 20px. This means that the lines of text within it should be" text run at (0,22) width 738: "separated by six pixels. Any images within the paragraph should increase the height of the line-box so that they fit, including their" text run at (0,184) width 445: "padding (5px), border (10px) and margins (15px) within the line box, such as " - LayoutImage {IMG} at (459.75,55) size 130x130 [border: (10px solid #000000)] - LayoutText {#text} at (604,184) size 25x16 - text run at (604,184) width 25: " and" + LayoutImage {IMG} at (460,55) size 130x130 [border: (10px solid #000000)] + LayoutText {#text} at (605,184) size 24x16 + text run at (605,184) width 24: " and" LayoutImage {IMG} at (15,219) size 130x130 [border: (10px solid #000000)] LayoutText {#text} at (160,204) size 736x237 text run at (160,204) width 566: ". This is additional text to make sure that there is enough room left below the image so that this line"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.png index 131552e..2f06180 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.txt index 90945cdb..4c5ffe9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/inline_elements-expected.txt
@@ -28,7 +28,7 @@ LayoutText {#text} at (239,6) size 762x147 text run at (239,6) width 523: "very long span in it, and the span has a 10px red border separated from the span by" text run at (0,38) width 727: "2pt, and a margin of 30pt. The padding and border should be present on all sides of the span (although vertical lines" - text run at (0,70) width 746: "should appear only at the beginning and the end of the whole span, not on each line). The padding, border, and margin" + text run at (0,70) width 747: "should appear only at the beginning and the end of the whole span, not on each line). The padding, border, and margin" text run at (0,102) width 754: "should all be noticeable at the beginning and end of the span. However, the line height should not be changed by any of" text run at (0,134) width 585: "them, so the margin should be unnoticeable and the border should overlap text on other lines." LayoutText {#text} at (637,134) size 762x51 @@ -49,9 +49,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x308 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x280 LayoutNGTableCell {TD} at (0,154) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,130) size 4x19 @@ -64,7 +64,7 @@ LayoutText {#text} at (239,6) size 747x147 text run at (239,6) width 503: "very long span in it, and the span has a 10px red border separated from the span" text run at (0,38) width 747: "by 2pt, and a margin of 30pt. The padding and border should be present on all sides of the span (although vertical lines" - text run at (0,70) width 746: "should appear only at the beginning and the end of the whole span, not on each line). The padding, border, and margin" + text run at (0,70) width 747: "should appear only at the beginning and the end of the whole span, not on each line). The padding, border, and margin" text run at (0,102) width 737: "should all be noticeable at the beginning and end of the span. However, the line height should not be changed by any" text run at (0,134) width 602: "of them, so the margin should be unnoticeable and the border should overlap text on other lines." LayoutText {#text} at (654,134) size 711x51
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/replaced_elements-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/replaced_elements-expected.txt index 1a3c80b3..8996740 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/replaced_elements-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/replaced_elements-expected.txt
@@ -50,9 +50,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x1081 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x1053 LayoutNGTableCell {TD} at (0,540) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,516) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/vertical_formatting-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/vertical_formatting-expected.txt index d4d4e4e..64cf0921 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/vertical_formatting-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/formatting_model/vertical_formatting-expected.txt
@@ -69,16 +69,16 @@ text run at (0,0) width 164: "This is another paragraph." LayoutNGBlockFlow {DIV} at (0,805.73) size 769x135.56 LayoutNGBlockFlow {P} at (0,75.56) size 769x60 - LayoutText {#text} at (0,0) size 759x59 + LayoutText {#text} at (0,0) size 758x59 text run at (0,0) width 757: "There should be three centimeters between this text and the text above, but only one centimeter between this text and the" - text run at (0,20) width 759: "text below, because vertical margins of nested elements should collapse only if there is no border or padding between the" + text run at (0,20) width 758: "text below, because vertical margins of nested elements should collapse only if there is no border or padding between the" text run at (0,40) width 54: "margins." LayoutNGBlockFlow {P} at (0,979.08) size 769x20 LayoutText {#text} at (0,0) size 109x19 text run at (0,0) width 109: "This is more text." LayoutNGBlockFlow {P} at (0,1015.08) size 769x115.58 - LayoutText {#text} at (0,0) size 725x39 - text run at (0,0) width 725: "There should be two centimeters between this paragraph and the one below, because negative margins collapse to a" + LayoutText {#text} at (0,0) size 724x39 + text run at (0,0) width 724: "There should be two centimeters between this paragraph and the one below, because negative margins collapse to a" text run at (0,20) width 456: "negative margin with the largest absolute value of the margins collapsed." LayoutNGBlockFlow {P} at (0,1092.88) size 769x77.78 LayoutText {#text} at (0,37) size 765x40 @@ -95,8 +95,8 @@ text run at (384,20) width 357: "the (non-floating) one above it, since the float should not" text run at (384,40) width 182: "effect the paragraph spacing." LayoutNGBlockFlow {P} at (0,1322.22) size 769x77.78 - LayoutText {#text} at (0,0) size 749x39 - text run at (0,0) width 749: "There should be two centimeters of padding between this paragraph and the one below. Padding does not collapse, and" + LayoutText {#text} at (0,0) size 748x39 + text run at (0,0) width 748: "There should be two centimeters of padding between this paragraph and the one below. Padding does not collapse, and" text run at (0,20) width 234: "there is 1cm of padding on each side." LayoutNGBlockFlow {P} at (0,1400) size 769x57.78 LayoutText {#text} at (0,37) size 167x20 @@ -105,9 +105,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x1107 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x1079 LayoutNGTableCell {TD} at (0,553) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,529) size 4x19 @@ -137,14 +137,14 @@ LayoutNGBlockFlow {P} at (0,75.56) size 747x60 LayoutText {#text} at (0,0) size 734x59 text run at (0,0) width 734: "There should be three centimeters between this text and the text above, but only one centimeter between this text and" - text run at (0,20) width 702: "the text below, because vertical margins of nested elements should collapse only if there is no border or padding" + text run at (0,20) width 701: "the text below, because vertical margins of nested elements should collapse only if there is no border or padding" text run at (0,40) width 134: "between the margins." LayoutNGBlockFlow {P} at (4,596.08) size 747x20 LayoutText {#text} at (0,0) size 109x19 text run at (0,0) width 109: "This is more text." LayoutNGBlockFlow {P} at (4,632.08) size 747x115.58 - LayoutText {#text} at (0,0) size 725x39 - text run at (0,0) width 725: "There should be two centimeters between this paragraph and the one below, because negative margins collapse to a" + LayoutText {#text} at (0,0) size 724x39 + text run at (0,0) width 724: "There should be two centimeters between this paragraph and the one below, because negative margins collapse to a" text run at (0,20) width 456: "negative margin with the largest absolute value of the margins collapsed." LayoutNGBlockFlow {P} at (4,709.88) size 747x77.78 LayoutText {#text} at (0,37) size 742x40 @@ -161,8 +161,8 @@ text run at (373,20) width 360: "and the (non-floating) one above it, since the float should" text run at (373,40) width 206: "not effect the paragraph spacing." LayoutNGBlockFlow {P} at (4,939.22) size 747x77.78 - LayoutText {#text} at (0,0) size 722x39 - text run at (0,0) width 722: "There should be two centimeters of padding between this paragraph and the one below. Padding does not collapse," + LayoutText {#text} at (0,0) size 721x39 + text run at (0,0) width 721: "There should be two centimeters of padding between this paragraph and the one below. Padding does not collapse," text run at (0,20) width 261: "and there is 1cm of padding on each side." LayoutNGBlockFlow {P} at (4,1017) size 747x57.78 LayoutText {#text} at (0,37) size 167x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.png index 3c9d021..6d36d56 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.txt index d748959..99086a6ac 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/anchor-expected.txt
@@ -35,33 +35,33 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 109x19 [color=#800080] - LayoutText {#text} at (0,0) size 109x19 - text run at (0,0) width 109: "W3C Web server" + LayoutInline {A} at (0,0) size 108x19 [color=#800080] + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "W3C Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,20) size 689x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 111x19 [color=#800080] - LayoutText {#text} at (0,0) size 111x19 - text run at (0,0) width 111: "NIST Web server" + LayoutInline {A} at (0,0) size 110x19 [color=#800080] + LayoutText {#text} at (0,0) size 110x19 + text run at (0,0) width 110: "NIST Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,40) size 689x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 124x19 [color=#800080] - LayoutText {#text} at (0,0) size 124x19 - text run at (0,0) width 124: "CWRU Web server" + LayoutInline {A} at (0,0) size 123x19 [color=#800080] + LayoutText {#text} at (0,0) size 123x19 + text run at (0,0) width 123: "CWRU Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,60) size 689x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 47x19 [color=#800080] - LayoutText {#text} at (0,0) size 47x19 - text run at (0,0) width 47: "Yahoo!" + LayoutInline {A} at (0,0) size 46x19 [color=#800080] + LayoutText {#text} at (0,0) size 46x19 + text run at (0,0) width 46: "Yahoo!" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,80) size 689x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 @@ -84,9 +84,9 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 124x19 [color=#006600] - LayoutText {#text} at (0,0) size 124x19 - text run at (0,0) width 124: "CWRU Web server" + LayoutInline {A} at (0,0) size 123x19 [color=#006600] + LayoutText {#text} at (0,0) size 123x19 + text run at (0,0) width 123: "CWRU Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (0,375) size 769x40 LayoutText {#text} at (0,0) size 120x19 @@ -94,16 +94,16 @@ LayoutInline {A} at (0,0) size 43x19 [color=#008000] LayoutText {#text} at (120,0) size 43x19 text run at (120,0) width 43: "anchor" - LayoutText {#text} at (163,0) size 731x39 - text run at (163,0) width 568: "\" should be green, NOT purple, since it's part of an anchor. It's a named anchor, and styles" - text run at (0,20) width 674: "declared for the A tag are applied to them under CSS1. It also should NOT turn orange when clicked upon." + LayoutText {#text} at (163,0) size 732x39 + text run at (163,0) width 569: "\" should be green, NOT purple, since it's part of an anchor. It's a named anchor, and styles" + text run at (0,20) width 675: "declared for the A tag are applied to them under CSS1. It also should NOT turn orange when clicked upon." LayoutTable {TABLE} at (0,431) size 769x290 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 767x288 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x260 LayoutNGTableCell {TD} at (0,144) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,120) size 4x19 @@ -125,33 +125,33 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 109x19 [color=#800080] - LayoutText {#text} at (0,0) size 109x19 - text run at (0,0) width 109: "W3C Web server" + LayoutInline {A} at (0,0) size 108x19 [color=#800080] + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "W3C Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,20) size 667x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 111x19 [color=#800080] - LayoutText {#text} at (0,0) size 111x19 - text run at (0,0) width 111: "NIST Web server" + LayoutInline {A} at (0,0) size 110x19 [color=#800080] + LayoutText {#text} at (0,0) size 110x19 + text run at (0,0) width 110: "NIST Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,40) size 667x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 124x19 [color=#800080] - LayoutText {#text} at (0,0) size 124x19 - text run at (0,0) width 124: "CWRU Web server" + LayoutInline {A} at (0,0) size 123x19 [color=#800080] + LayoutText {#text} at (0,0) size 123x19 + text run at (0,0) width 123: "CWRU Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,60) size 667x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 47x19 [color=#800080] - LayoutText {#text} at (0,0) size 47x19 - text run at (0,0) width 47: "Yahoo!" + LayoutInline {A} at (0,0) size 46x19 [color=#800080] + LayoutText {#text} at (0,0) size 46x19 + text run at (0,0) width 46: "Yahoo!" LayoutText {#text} at (0,0) size 0x0 LayoutNGListItem {LI} at (40,80) size 667x20 LayoutNGListMarker (anonymous) at (-18,0) size 10x20 @@ -174,9 +174,9 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{25E6} " - LayoutInline {A} at (0,0) size 124x19 [color=#006600] - LayoutText {#text} at (0,0) size 124x19 - text run at (0,0) width 124: "CWRU Web server" + LayoutInline {A} at (0,0) size 123x19 [color=#006600] + LayoutText {#text} at (0,0) size 123x19 + text run at (0,0) width 123: "CWRU Web server" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (4,216) size 747x40 LayoutText {#text} at (0,0) size 120x19 @@ -184,8 +184,8 @@ LayoutInline {A} at (0,0) size 43x19 [color=#008000] LayoutText {#text} at (120,0) size 43x19 text run at (120,0) width 43: "anchor" - LayoutText {#text} at (163,0) size 731x39 - text run at (163,0) width 568: "\" should be green, NOT purple, since it's part of an anchor. It's a named anchor, and styles" - text run at (0,20) width 674: "declared for the A tag are applied to them under CSS1. It also should NOT turn orange when clicked upon." + LayoutText {#text} at (163,0) size 732x39 + text run at (163,0) width 569: "\" should be green, NOT purple, since it's part of an anchor. It's a named anchor, and styles" + text run at (0,20) width 675: "declared for the A tag are applied to them under CSS1. It also should NOT turn orange when clicked upon." layer at (8,153) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,145) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstletter-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstletter-expected.txt index b80e7be..33a7732 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstletter-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstletter-expected.txt
@@ -46,9 +46,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x311 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x283 LayoutNGTableCell {TD} at (0,155) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,131) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.png index 3cabaf64..5fba63ad 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.txt index 6f4996a4..84d2d3d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/firstline-expected.txt
@@ -27,7 +27,7 @@ text run at (0,57) width 663: "Remember that in order to ensure a complete test, the paragraph must be displayed on more than one line." LayoutNGBlockFlow {P} at (0,300) size 769x80 LayoutText {#text} at (0,0) size 762x59 - text run at (0,0) width 758: "The first line of this paragraph, and only that one, should be displayed in small-caps style. Thus, if the first line is" + text run at (0,0) width 754: "The first line of this paragraph, and only that one, should be displayed in small-caps style. Thus, if the first line is" text run at (0,20) width 762: "not in small-caps style, OR if the entire paragraph turns out in small-caps, then the user agent has failed this test (although" text run at (0,40) width 165: "the problem might be that " LayoutInline {CODE} at (0,0) size 80x16 @@ -40,9 +40,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x285 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x257 LayoutNGTableCell {TD} at (0,142) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,118) size 4x19 @@ -59,8 +59,8 @@ text run at (0,37) width 742: "be a larger font size as well as green. If this precise combination does not occur, then the user agent has failed this test." text run at (0,57) width 663: "Remember that in order to ensure a complete test, the paragraph must be displayed on more than one line." LayoutNGBlockFlow {P} at (4,173) size 747x80 - LayoutText {#text} at (0,0) size 744x59 - text run at (0,0) width 744: "The first line of this paragraph, and only that one, should be displayed in small-caps style. Thus, if the first line" + LayoutText {#text} at (0,0) size 740x59 + text run at (0,0) width 740: "The first line of this paragraph, and only that one, should be displayed in small-caps style. Thus, if the first line" text run at (0,20) width 712: "is not in small-caps style, OR if the entire paragraph turns out in small-caps, then the user agent has failed this test" text run at (0,40) width 229: "(although the problem might be that " LayoutInline {CODE} at (0,0) size 80x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.png index 1fb0370a..7f0d8e4b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.txt index 1fbae8f..4323464 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/pseudo/pseudo_elements_in_selectors-expected.txt
@@ -20,14 +20,14 @@ text run at (0,0) width 718: "The first line of this sentence should be boldfaced. This test is included simply to establish a baseline for the" text run at (0,20) width 636: "following tests, since if this test fails, then the rest of the tests on this page are expected to fail as well." LayoutNGBlockFlow {P} at (0,187) size 769x40 - LayoutText {#text} at (0,0) size 754x39 - text run at (0,0) width 754: "The first line of this sentence should be boldfaced and green, thanks to its selector. If this is not the case, then the" + LayoutText {#text} at (0,0) size 753x39 + text run at (0,0) width 753: "The first line of this sentence should be boldfaced and green, thanks to its selector. If this is not the case, then the" text run at (0,20) width 565: "user agent may have failed to properly parse the selector, or it may simply not support the " - LayoutInline {TT} at (0,0) size 89x16 - LayoutText {#text} at (564,23) size 89x16 - text run at (564,23) width 89: ":first-line" - LayoutText {#text} at (652,20) size 108x19 - text run at (652,20) width 108: " pseudo-element." + LayoutInline {TT} at (0,0) size 88x16 + LayoutText {#text} at (565,23) size 88x16 + text run at (565,23) width 88: ":first-line" + LayoutText {#text} at (653,20) size 107x19 + text run at (653,20) width 107: " pseudo-element." LayoutNGBlockFlow {P} at (0,243) size 769x80 LayoutText {#text} at (0,0) size 766x79 text run at (0,0) width 754: "The first line of this sentence should be boldfaced. If it is red, then the user agent has violated the specification in" @@ -38,9 +38,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x248 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x220 LayoutNGTableCell {TD} at (0,124) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,100) size 4x19 @@ -51,14 +51,14 @@ text run at (0,0) width 718: "The first line of this sentence should be boldfaced. This test is included simply to establish a baseline for the" text run at (0,20) width 636: "following tests, since if this test fails, then the rest of the tests on this page are expected to fail as well." LayoutNGBlockFlow {P} at (4,60) size 747x60 - LayoutText {#text} at (0,0) size 729x39 - text run at (0,0) width 729: "The first line of this sentence should be boldfaced and green, thanks to its selector. If this is not the case, then" + LayoutText {#text} at (0,0) size 728x39 + text run at (0,0) width 728: "The first line of this sentence should be boldfaced and green, thanks to its selector. If this is not the case, then" text run at (0,20) width 588: "the user agent may have failed to properly parse the selector, or it may simply not support the " - LayoutInline {TT} at (0,0) size 89x16 - LayoutText {#text} at (587,23) size 89x16 - text run at (587,23) width 89: ":first-line" - LayoutText {#text} at (675,20) size 730x39 - text run at (675,20) width 55: " pseudo-" + LayoutInline {TT} at (0,0) size 88x16 + LayoutText {#text} at (588,23) size 88x16 + text run at (588,23) width 88: ":first-line" + LayoutText {#text} at (676,20) size 730x39 + text run at (676,20) width 54: " pseudo-" text run at (0,40) width 53: "element." LayoutNGBlockFlow {P} at (4,136) size 747x80 LayoutText {#text} at (0,0) size 737x79
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_align-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_align-expected.png index 33d984e4..e01e01ea 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_align-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_align-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_decoration-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_decoration-expected.png index 21412a0d..1670b7a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_decoration-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_decoration-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_transform-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_transform-expected.png index 3e07eb1..53fe6a0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_transform-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/text_properties/text_transform-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/color_units-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/color_units-expected.txt index e101e38..d5f6529 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/color_units-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/color_units-expected.txt
@@ -36,8 +36,8 @@ LayoutText {#text} at (0,0) size 193x19 text run at (0,0) width 193: "This sentence should be black." LayoutNGBlockFlow {P} at (0,295) size 769x20 [color=#008800] - LayoutText {#text} at (0,0) size 506x19 - text run at (0,0) width 506: "This sentence should be green, although slightly different from those that follow." + LayoutText {#text} at (0,0) size 505x19 + text run at (0,0) width 505: "This sentence should be green, although slightly different from those that follow." LayoutNGBlockFlow {P} at (0,331) size 769x20 [color=#008000] LayoutText {#text} at (0,0) size 194x19 text run at (0,0) width 194: "This sentence should be green." @@ -62,19 +62,19 @@ LayoutText {#text} at (455,0) size 65x19 text run at (455,0) width 65: " is invalid." LayoutNGBlockFlow {P} at (0,547) size 769x40 [color=#0080FF] - LayoutText {#text} at (0,0) size 725x39 - text run at (0,0) width 725: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the next" + LayoutText {#text} at (0,0) size 724x39 + text run at (0,0) width 724: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the next" text run at (0,20) width 67: "paragraph." LayoutNGBlockFlow {P} at (0,603) size 769x40 [color=#0080FF] - LayoutText {#text} at (0,0) size 752x39 - text run at (0,0) width 752: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the previous" + LayoutText {#text} at (0,0) size 751x39 + text run at (0,0) width 751: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the previous" text run at (0,20) width 67: "paragraph." LayoutNGBlockFlow {P} at (0,659) size 769x20 [color=#800099] - LayoutText {#text} at (0,0) size 769x19 - text run at (0,0) width 769: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the next paragraph." + LayoutText {#text} at (0,0) size 768x19 + text run at (0,0) width 768: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the next paragraph." LayoutNGBlockFlow {P} at (0,695) size 769x40 [color=#800099] - LayoutText {#text} at (0,0) size 725x39 - text run at (0,0) width 725: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the previous" + LayoutText {#text} at (0,0) size 724x39 + text run at (0,0) width 724: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the previous" text run at (0,20) width 67: "paragraph." LayoutNGBlockFlow {P} at (0,751) size 769x20 LayoutText {#text} at (0,0) size 193x19 @@ -82,11 +82,11 @@ LayoutNGBlockFlow {P} at (0,787) size 769x20 [color=#008800] LayoutText {#text} at (0,0) size 399x19 text run at (0,0) width 399: "This sentence should be a slightly different green, and used the " - LayoutInline {TT} at (0,0) size 41x16 - LayoutText {#text} at (398,3) size 41x16 - text run at (398,3) width 41: "style" - LayoutText {#text} at (438,0) size 60x19 - text run at (438,0) width 60: " attribute." + LayoutInline {TT} at (0,0) size 40x16 + LayoutText {#text} at (399,3) size 40x16 + text run at (399,3) width 40: "style" + LayoutText {#text} at (439,0) size 59x19 + text run at (439,0) width 59: " attribute." LayoutNGBlockFlow {P} at (0,823) size 769x20 [color=#008000] LayoutText {#text} at (0,0) size 281x19 text run at (0,0) width 281: "This sentence should be green, and used the " @@ -131,9 +131,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x784 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x756 LayoutNGTableCell {TD} at (0,392) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,368) size 4x19 @@ -143,8 +143,8 @@ LayoutText {#text} at (0,0) size 193x19 text run at (0,0) width 193: "This sentence should be black." LayoutNGBlockFlow {P} at (4,40) size 747x20 [color=#008800] - LayoutText {#text} at (0,0) size 506x19 - text run at (0,0) width 506: "This sentence should be green, although slightly different from those that follow." + LayoutText {#text} at (0,0) size 505x19 + text run at (0,0) width 505: "This sentence should be green, although slightly different from those that follow." LayoutNGBlockFlow {P} at (4,76) size 747x20 [color=#008000] LayoutText {#text} at (0,0) size 194x19 text run at (0,0) width 194: "This sentence should be green." @@ -169,20 +169,20 @@ LayoutText {#text} at (455,0) size 65x19 text run at (455,0) width 65: " is invalid." LayoutNGBlockFlow {P} at (4,292) size 747x40 [color=#0080FF] - LayoutText {#text} at (0,0) size 725x39 - text run at (0,0) width 725: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the next" + LayoutText {#text} at (0,0) size 724x39 + text run at (0,0) width 724: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the next" text run at (0,20) width 67: "paragraph." LayoutNGBlockFlow {P} at (4,348) size 747x40 [color=#0080FF] - LayoutText {#text} at (0,0) size 694x39 - text run at (0,0) width 694: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the" + LayoutText {#text} at (0,0) size 693x39 + text run at (0,0) width 693: "This sentence should be a shade of blue-green which, on a typical RGB computer display, exactly matches the" text run at (0,20) width 125: "previous paragraph." LayoutNGBlockFlow {P} at (4,404) size 747x40 [color=#800099] - LayoutText {#text} at (0,0) size 698x39 - text run at (0,0) width 698: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the next" + LayoutText {#text} at (0,0) size 697x39 + text run at (0,0) width 697: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the next" text run at (0,20) width 67: "paragraph." LayoutNGBlockFlow {P} at (4,460) size 747x40 [color=#800099] - LayoutText {#text} at (0,0) size 725x39 - text run at (0,0) width 725: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the previous" + LayoutText {#text} at (0,0) size 724x39 + text run at (0,0) width 724: "This sentence should be a shade of purple which, on a typical RGB computer display, exactly matches the previous" text run at (0,20) width 67: "paragraph." LayoutNGBlockFlow {P} at (4,516) size 747x20 LayoutText {#text} at (0,0) size 193x19 @@ -190,11 +190,11 @@ LayoutNGBlockFlow {P} at (4,552) size 747x20 [color=#008800] LayoutText {#text} at (0,0) size 399x19 text run at (0,0) width 399: "This sentence should be a slightly different green, and used the " - LayoutInline {TT} at (0,0) size 41x16 - LayoutText {#text} at (398,3) size 41x16 - text run at (398,3) width 41: "style" - LayoutText {#text} at (438,0) size 60x19 - text run at (438,0) width 60: " attribute." + LayoutInline {TT} at (0,0) size 40x16 + LayoutText {#text} at (399,3) size 40x16 + text run at (399,3) width 40: "style" + LayoutText {#text} at (439,0) size 59x19 + text run at (439,0) width 59: " attribute." LayoutNGBlockFlow {P} at (4,588) size 747x20 [color=#008000] LayoutText {#text} at (0,0) size 281x19 text run at (0,0) width 281: "This sentence should be green, and used the "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.png index 6074d5d..4fbb3c52 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.txt index c77f182..3a216038 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/length_units-expected.txt
@@ -97,9 +97,9 @@ LayoutTableSection {TBODY} at (1,1) size 767x728 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x700 LayoutNGTableCell {TD} at (0,364) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,340) size 4x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/percentage_units-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/percentage_units-expected.txt index 08050d5..df43c9a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/percentage_units-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/percentage_units-expected.txt
@@ -33,14 +33,14 @@ LayoutNGBlockFlow {P} at (192.25,299) size 576.75x40 LayoutText {#text} at (0,0) size 549x39 text run at (0,0) width 549: "This paragraph should have a left margin of 25% the width of its parent element, which" - text run at (0,20) width 356: "should require some extra text in order to test effectively." + text run at (0,20) width 355: "should require some extra text in order to test effectively." LayoutTable {TABLE} at (0,355) size 769x230 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 767x228 LayoutTableRow {TR} at (0,0) size 767x28 LayoutNGTableCell {TD} at (0,0) size 767x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 767x200 LayoutNGTableCell {TD} at (0,114) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,90) size 4x19 @@ -62,6 +62,6 @@ LayoutNGBlockFlow {P} at (190.75,156) size 560.25x40 LayoutText {#text} at (0,0) size 549x39 text run at (0,0) width 549: "This paragraph should have a left margin of 25% the width of its parent element, which" - text run at (0,20) width 356: "should require some extra text in order to test effectively." + text run at (0,20) width 355: "should require some extra text in order to test effectively." layer at (8,137) size 769x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,129) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/urls-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/urls-expected.txt index 07b15db..270ea9c2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/urls-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css1/units/urls-expected.txt
@@ -21,20 +21,20 @@ LayoutNGBlockFlow {P} at (0,167) size 784x60 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 779x59 text run at (0,0) width 779: "This paragraph should have a white background, but NO image should appear in the background. If an image, in this case a" - text run at (0,20) width 755: "red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation to the" + text run at (0,20) width 756: "red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation to the" text run at (0,40) width 274: "document's URL, not the stylesheet's URL." LayoutNGBlockFlow {P} at (0,243) size 784x60 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 779x59 text run at (0,0) width 779: "This paragraph should have a white background, but NO image should appear in the background. If an image, in this case a" - text run at (0,20) width 755: "red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation to the" + text run at (0,20) width 756: "red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation to the" text run at (0,40) width 274: "document's URL, not the stylesheet's URL." LayoutTable {TABLE} at (0,319) size 784x210 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 782x208 LayoutTableRow {TR} at (0,0) size 782x28 LayoutNGTableCell {TD} at (0,0) size 782x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] - LayoutInline {STRONG} at (0,0) size 161x19 - LayoutText {#text} at (4,4) size 161x19 - text run at (4,4) width 161: "TABLE Testing Section" + LayoutInline {STRONG} at (0,0) size 159x19 + LayoutText {#text} at (4,4) size 159x19 + text run at (4,4) width 159: "TABLE Testing Section" LayoutTableRow {TR} at (0,28) size 782x180 LayoutNGTableCell {TD} at (0,104) size 12x28 [bgcolor=#C0C0C0] [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] LayoutText {#text} at (4,80) size 4x19 @@ -44,14 +44,14 @@ LayoutText {#text} at (0,0) size 386x19 text run at (0,0) width 386: "This page should have a green grid pattern as its background." LayoutNGBlockFlow {P} at (4,40) size 762x60 [bgcolor=#FFFFFF] - LayoutText {#text} at (0,0) size 758x59 + LayoutText {#text} at (0,0) size 759x59 text run at (0,0) width 737: "This paragraph should have a white background, but NO image should appear in the background. If an image, in this" - text run at (0,20) width 758: "case a red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation" + text run at (0,20) width 759: "case a red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation" text run at (0,40) width 313: "to the document's URL, not the stylesheet's URL." LayoutNGBlockFlow {P} at (4,116) size 762x60 [bgcolor=#FFFFFF] - LayoutText {#text} at (0,0) size 758x59 + LayoutText {#text} at (0,0) size 759x59 text run at (0,0) width 737: "This paragraph should have a white background, but NO image should appear in the background. If an image, in this" - text run at (0,20) width 758: "case a red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation" + text run at (0,20) width 759: "case a red square-- or, indeed, any red at all-- is seen there, then the browser has incorrectly interpreted a URL in relation" text run at (0,40) width 313: "to the document's URL, not the stylesheet's URL." layer at (8,121) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,113) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-079-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-079-expected.txt index 668e2ecd..8da69afb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-079-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-079-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x310 LayoutNGBlockFlow {BODY} at (8,16) size 784x286 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 465x19 - text run at (0,0) width 465: "Test passes if the center box in the table below has a border similar to this:" + LayoutText {#text} at (0,0) size 464x19 + text run at (0,0) width 464: "Test passes if the center box in the table below has a border similar to this:" LayoutTable {TABLE} at (0,36) size 60x60 [border: (2px none #808080)] LayoutTableSection {TBODY} at (2,2) size 55x55 LayoutTableRow {TR} at (0,0) size 55x55
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-088-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-088-expected.txt index b168c23..90134597 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-088-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/border-conflict-style-088-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x310 LayoutNGBlockFlow {BODY} at (8,16) size 784x286 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 465x19 - text run at (0,0) width 465: "Test passes if the center box in the table below has a border similar to this:" + LayoutText {#text} at (0,0) size 464x19 + text run at (0,0) width 464: "Test passes if the center box in the table below has a border similar to this:" LayoutTable {TABLE} at (0,36) size 60x60 [border: (2px none #808080)] LayoutTableSection {TBODY} at (2,2) size 55x55 LayoutTableRow {TR} at (0,0) size 55x55
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.png index 55d6e4cdb..f292824 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.txt index 59a8e62..5eb33aa 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/c543-txt-decor-000-expected.txt
@@ -64,11 +64,11 @@ LayoutNGBlockFlow {P} at (0,346) size 784x40 [color=#000080] LayoutText {#text} at (0,0) size 568x19 text run at (0,0) width 568: "This sentence should have a long blue underline including between the two arrows here\x{2192}" - LayoutInline {SPAN} at (0,0) size 157x19 [color=#FFFFFF] - LayoutText {#text} at (568,0) size 157x19 - text run at (568,0) width 157: " FAIL FAIL FAIL FAIL " - LayoutText {#text} at (724,0) size 764x39 - text run at (724,0) width 40: "\x{2190}and" + LayoutInline {SPAN} at (0,0) size 156x19 [color=#FFFFFF] + LayoutText {#text} at (568,0) size 156x19 + text run at (568,0) width 156: " FAIL FAIL FAIL FAIL " + LayoutText {#text} at (724,0) size 763x39 + text run at (724,0) width 39: "\x{2190}and" text run at (0,20) width 31: "here." LayoutNGBlockFlow {P} at (0,402) size 784x20 [color=#000080] LayoutText {#text} at (0,0) size 343x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.png index 73b83962..7ccc756 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.txt index 1d48fbdd..fad0d3e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/inline-table-001-expected.txt
@@ -4,18 +4,18 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 375x19 - text run at (0,0) width 375: "Test passes if the \"Filler Text\" below is all on the same line." + LayoutText {#text} at (0,0) size 373x19 + text run at (0,0) width 373: "Test passes if the \"Filler Text\" below is all on the same line." LayoutNGBlockFlow {DIV} at (0,36) size 784x96 - LayoutInline {SPAN} at (0,0) size 65x19 - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" - LayoutText {#text} at (64,0) size 5x19 - text run at (64,0) width 5: " " - LayoutTable {DIV} at (68.59,0) size 96x96 [bgcolor=#FFA500] + LayoutInline {SPAN} at (0,0) size 64x19 + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" + LayoutText {#text} at (64,0) size 4x19 + text run at (64,0) width 4: " " + LayoutTable {DIV} at (68,0) size 96x96 [bgcolor=#FFA500] LayoutTableSection (anonymous) at (0,0) size 96x96 LayoutTableRow {DIV} at (0,0) size 96x96 LayoutNGTableCell {DIV} at (0,0) size 96x20 [r=0 c=0 rs=1 cs=1] - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/list-style-position-005-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/list-style-position-005-expected.txt index b76972f..56d5e5fb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/list-style-position-005-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/list-style-position-005-expected.txt
@@ -4,13 +4,13 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x262 LayoutNGBlockFlow {BODY} at (8,16) size 784x238 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 91x19 - text run at (0,0) width 91: "To pass, there " - LayoutInline {STRONG} at (0,0) size 34x19 - LayoutText {#text} at (90,0) size 34x19 - text run at (90,0) width 34: "must" - LayoutText {#text} at (123,0) size 276x19 - text run at (123,0) width 276: " be a green bar stacked on top of a blue bar." + LayoutText {#text} at (0,0) size 90x19 + text run at (0,0) width 90: "To pass, there " + LayoutInline {STRONG} at (0,0) size 33x19 + LayoutText {#text} at (90,0) size 33x19 + text run at (90,0) width 33: "must" + LayoutText {#text} at (123,0) size 275x19 + text run at (123,0) width 275: " be a green bar stacked on top of a blue bar." LayoutNGListItem {DIV} at (0,36) size 784x202 [color=#00FF00] [bgcolor=#00FF00] LayoutNGBlockFlow (anonymous) at (0,0) size 784x101 LayoutInline (anonymous) at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.png index af577b9c..f7fc38b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.txt index caac23d..5e898e9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/margin-applies-to-010-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x72 LayoutNGBlockFlow {BODY} at (8,16) size 784x40 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 778x39 - text run at (0,0) width 778: "Test passes if there is space between the blue and orange lines below and there is a marker bullet on the left-hand side of the" + LayoutText {#text} at (0,0) size 777x39 + text run at (0,0) width 777: "Test passes if there is space between the blue and orange lines below and there is a marker bullet on the left-hand side of the" text run at (0,20) width 75: "orange box." layer at (8,72) size 340x340 LayoutNGBlockFlow (positioned) {DIV} at (8,72) size 340x340 [border: (10px solid #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.png index 9c509a2..e524e89 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.txt index 56c3c6b10..19680fc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-001-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x176 LayoutNGBlockFlow {BODY} at (8,16) size 784x152 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 300x19 - text run at (0,0) width 300: "Test passes if the \"Filler Text\" is above the box." + LayoutText {#text} at (0,0) size 298x19 + text run at (0,0) width 298: "Test passes if the \"Filler Text\" is above the box." LayoutTable {DIV} at (0,36) size 96x116 LayoutBlockFlow {DIV} at (0,0) size 96x20 - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutTableSection (anonymous) at (0,20) size 96x96 LayoutTableRow {DIV} at (0,0) size 96x48 LayoutNGTableCell {DIV} at (0,0) size 48x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.png index a4c930a..cb917ea 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.txt index 675f188..22b8966 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-horizontal-alignment-001-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x88 LayoutNGBlockFlow {BODY} at (8,16) size 784x64 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 423x19 - text run at (0,0) width 423: "Test passes if the \"Filler Text\" below is on the right side of the box." + LayoutText {#text} at (0,0) size 421x19 + text run at (0,0) width 421: "Test passes if the \"Filler Text\" below is on the right side of the box." LayoutTable {TABLE} at (0,36) size 202x28 LayoutBlockFlow {CAPTION} at (0,0) size 202x22 [border: (1px solid #000000)] - LayoutText {#text} at (136,1) size 65x19 - text run at (136,1) width 65: "Filler Text" + LayoutText {#text} at (137,1) size 64x19 + text run at (137,1) width 64: "Filler Text" LayoutTableSection {TBODY} at (0,22) size 202x6 LayoutTableRow {TR} at (0,2) size 202x2 LayoutNGTableCell {TD} at (2,2) size 198x2 [r=0 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.png index bc48534e..c693aec6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.txt index f534606..35039df6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-001-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x300 LayoutNGBlockFlow {BODY} at (8,16) size 784x276 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 635x19 - text run at (0,0) width 635: "Test passes if the top square below has \"Filler Text\" directly above it and the bottom square does not." + LayoutText {#text} at (0,0) size 633x19 + text run at (0,0) width 633: "Test passes if the top square below has \"Filler Text\" directly above it and the bottom square does not." LayoutTable {DIV} at (0,36) size 100x120 LayoutBlockFlow {DIV} at (0,0) size 100x20 - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutTableSection (anonymous) at (0,20) size 100x100 LayoutTableRow {DIV} at (0,0) size 100x50 LayoutNGTableCell {DIV} at (0,0) size 50x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.png index df004a0..5139e7fb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.txt index 342fb06..5c6facc7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-caption-optional-002-expected.txt
@@ -4,13 +4,13 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x180 LayoutNGBlockFlow {BODY} at (8,16) size 784x156 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 663x19 - text run at (0,0) width 663: "Test passes if the left square below has \"Filler Text\" directly above it and the square on the right does not." + LayoutText {#text} at (0,0) size 661x19 + text run at (0,0) width 661: "Test passes if the left square below has \"Filler Text\" directly above it and the square on the right does not." LayoutNGBlockFlow {DIV} at (0,36) size 784x120 LayoutTable {SPAN} at (0,0) size 100x120 LayoutBlockFlow {SPAN} at (0,0) size 100x20 - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutTableSection (anonymous) at (0,20) size 100x100 LayoutTableRow {SPAN} at (0,0) size 100x50 LayoutNGTableCell {SPAN} at (0,0) size 50x0 [bgcolor=#000000] [r=0 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.png index b9ee9d53..a3d2c4a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.txt index e5face7..640a5de7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-023-expected.txt
@@ -4,20 +4,20 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x160 LayoutNGBlockFlow {BODY} at (8,16) size 784x136 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 388x19 - text run at (0,0) width 388: "Test passes if the bottom of the \"Filler Text\" below is aligned." - LayoutTable {TABLE} at (0,36) size 355x100 - LayoutTableSection {TBODY} at (0,0) size 355x100 - LayoutTableRow {TR} at (0,2) size 355x96 + LayoutText {#text} at (0,0) size 386x19 + text run at (0,0) width 386: "Test passes if the bottom of the \"Filler Text\" below is aligned." + LayoutTable {TABLE} at (0,36) size 354x100 + LayoutTableSection {TBODY} at (0,0) size 354x100 + LayoutTableRow {TR} at (0,2) size 354x96 LayoutNGTableCell {TD} at (2,27) size 59x18 [r=0 c=0 rs=1 cs=1] LayoutNGBlockFlow {DIV} at (1,1) size 57x16 LayoutText {#text} at (0,0) size 56x15 text run at (0,0) width 56: "Filler Text" - LayoutNGTableCell {TD} at (63,15) size 119x34 [r=0 c=1 rs=1 cs=1] - LayoutNGBlockFlow {DIV} at (1,1) size 117x32 + LayoutNGTableCell {TD} at (63,15) size 118x34 [r=0 c=1 rs=1 cs=1] + LayoutNGBlockFlow {DIV} at (1,1) size 116x32 LayoutText {#text} at (0,0) size 116x31 text run at (0,0) width 116: "Filler Text" - LayoutNGTableCell {TD} at (184,2) size 169x50 [r=0 c=2 rs=1 cs=1] + LayoutNGTableCell {TD} at (183,2) size 169x50 [r=0 c=2 rs=1 cs=1] LayoutNGBlockFlow {DIV} at (1,1) size 167x48 LayoutText {#text} at (0,1) size 166x46 text run at (0,1) width 166: "Filler Text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.png index b9ee9d53..a3d2c4a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.txt index e5face7..640a5de7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/20110323/table-height-algorithm-024-expected.txt
@@ -4,20 +4,20 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x160 LayoutNGBlockFlow {BODY} at (8,16) size 784x136 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 388x19 - text run at (0,0) width 388: "Test passes if the bottom of the \"Filler Text\" below is aligned." - LayoutTable {TABLE} at (0,36) size 355x100 - LayoutTableSection {TBODY} at (0,0) size 355x100 - LayoutTableRow {TR} at (0,2) size 355x96 + LayoutText {#text} at (0,0) size 386x19 + text run at (0,0) width 386: "Test passes if the bottom of the \"Filler Text\" below is aligned." + LayoutTable {TABLE} at (0,36) size 354x100 + LayoutTableSection {TBODY} at (0,0) size 354x100 + LayoutTableRow {TR} at (0,2) size 354x96 LayoutNGTableCell {TD} at (2,27) size 59x18 [r=0 c=0 rs=1 cs=1] LayoutNGBlockFlow {DIV} at (1,1) size 57x16 LayoutText {#text} at (0,0) size 56x15 text run at (0,0) width 56: "Filler Text" - LayoutNGTableCell {TD} at (63,15) size 119x34 [r=0 c=1 rs=1 cs=1] - LayoutNGBlockFlow {DIV} at (1,1) size 117x32 + LayoutNGTableCell {TD} at (63,15) size 118x34 [r=0 c=1 rs=1 cs=1] + LayoutNGBlockFlow {DIV} at (1,1) size 116x32 LayoutText {#text} at (0,0) size 116x31 text run at (0,0) width 116: "Filler Text" - LayoutNGTableCell {TD} at (184,2) size 169x50 [r=0 c=2 rs=1 cs=1] + LayoutNGTableCell {TD} at (183,2) size 169x50 [r=0 c=2 rs=1 cs=1] LayoutNGBlockFlow {DIV} at (1,1) size 167x48 LayoutText {#text} at (0,1) size 166x46 text run at (0,1) width 166: "Filler Text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0402-c71-fwd-parsing-02-f-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0402-c71-fwd-parsing-02-f-expected.png index e59f733..2379415 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0402-c71-fwd-parsing-02-f-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0402-c71-fwd-parsing-02-f-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t040302-c61-phys-len-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t040302-c61-phys-len-00-b-expected.txt index c20b3df..5a1ba88 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t040302-c61-phys-len-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t040302-c61-phys-len-00-b-expected.txt
@@ -4,11 +4,11 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x212 LayoutNGBlockFlow {BODY} at (8,16) size 784x188 LayoutNGBlockFlow {P} at (0,0) size 784x20 [color=#000080] - LayoutText {#text} at (0,0) size 320x19 - text run at (0,0) width 320: "There should be two unbroken vertical bars below." + LayoutText {#text} at (0,0) size 319x19 + text run at (0,0) width 319: "There should be two unbroken vertical bars below." LayoutNGBlockFlow {P} at (0,36) size 784x40 [color=#000080] - LayoutText {#text} at (0,0) size 784x39 - text run at (0,0) width 784: "Hold up a credit card to your display. The distance between the two vertical bars should be exactly the length of a credit card" + LayoutText {#text} at (0,0) size 783x39 + text run at (0,0) width 783: "Hold up a credit card to your display. The distance between the two vertical bars should be exactly the length of a credit card" text run at (0,20) width 74: "(85.60mm)." LayoutNGBlockFlow {DIV} at (0,92) size 784x96 [border: none (3px solid #000000)] LayoutNGBlockFlow {DIV} at (326.52,0) size 457.48x16 [border: none (3px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-01-c-io-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-01-c-io-expected.png index 12ea0f88..7b3d989 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-01-c-io-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-01-c-io-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-02-c-io-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-02-c-io-expected.png index 3e767ed..caaac7d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-02-c-io-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051103-dom-hover-02-c-io-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051202-c24-first-lttr-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051202-c24-first-lttr-00-b-expected.txt index beb0881..233c54a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051202-c24-first-lttr-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t051202-c24-first-lttr-00-b-expected.txt
@@ -17,8 +17,8 @@ LayoutInline {STRONG} at (0,0) size 38x19 LayoutText {#text} at (395,0) size 38x19 text run at (395,0) width 38: "green" - LayoutText {#text} at (432,0) size 761x39 - text run at (432,0) width 329: ". If this precise combination does not occur, then the" + LayoutText {#text} at (433,0) size 761x39 + text run at (433,0) width 328: ". If this precise combination does not occur, then the" text run at (0,20) width 183: "user agent has failed this test." LayoutNGBlockFlow {P} at (0,56) size 784x57 LayoutInline {<pseudo:first-letter>} at (0,0) size 20x36 [color=#008000] @@ -39,8 +39,8 @@ LayoutInline {STRONG} at (0,0) size 38x19 LayoutText {#text} at (603,13) size 38x19 text run at (603,13) width 38: "green" - LayoutText {#text} at (640,13) size 733x43 - text run at (640,13) width 93: ". If this precise" + LayoutText {#text} at (641,13) size 733x43 + text run at (641,13) width 92: ". If this precise" text run at (0,37) width 419: "combination does not occur, then the user agent has failed this test." LayoutNGBlockFlow {P} at (0,129) size 784x106 LayoutInline {<pseudo:first-letter>} at (0,0) size 57x64 [color=#008000] @@ -62,6 +62,6 @@ LayoutInline {STRONG} at (0,0) size 38x19 LayoutText {#text} at (246,66) size 38x19 text run at (246,66) width 38: "green" - LayoutText {#text} at (283,66) size 770x39 - text run at (283,66) width 487: ". If this precise combination does not occur, then the user agent has failed this" + LayoutText {#text} at (284,66) size 770x39 + text run at (284,66) width 486: ". If this precise combination does not occur, then the user agent has failed this" text run at (0,86) width 25: "test."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0602-inherit-bdr-pad-b-00-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0602-inherit-bdr-pad-b-00-expected.txt index a5e7063..8f913ab 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0602-inherit-bdr-pad-b-00-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0602-inherit-bdr-pad-b-00-expected.txt
@@ -4,11 +4,11 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x88 LayoutNGBlockFlow {BODY} at (8,16) size 784x56 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 238x19 - text run at (0,0) width 238: "This sentence should have no border. " + LayoutText {#text} at (0,0) size 239x19 + text run at (0,0) width 239: "This sentence should have no border. " LayoutInline {SPAN} at (0,0) size 275x29 [border: (5px solid #00FF00)] - LayoutText {#text} at (242,0) size 265x19 - text run at (242,0) width 265: "This sentence should have a green border." + LayoutText {#text} at (244,0) size 265x19 + text run at (244,0) width 265: "This sentence should have a green border." LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutInline {SPAN} at (0,0) size 374x35 [bgcolor=#FF0000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0803-c5505-mrgn-02-c-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0803-c5505-mrgn-02-c-expected.txt index c86fc1da..f0fa756 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0803-c5505-mrgn-02-c-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0803-c5505-mrgn-02-c-expected.txt
@@ -5,5 +5,5 @@ LayoutNGBlockFlow {BODY} at (8,-2) size 784x40 LayoutNGBlockFlow {P} at (-10,0) size 804x40 [color=#000080] LayoutBR {BR} at (0,0) size 0x0 - LayoutText {#text} at (0,20) size 293x19 - text run at (0,20) width 293: " This page should have a horizontal scroll bar." + LayoutText {#text} at (0,20) size 294x19 + text run at (0,20) width 294: " This page should have a horizontal scroll bar."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-brdr-c-00-a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-brdr-c-00-a-expected.png index bcba4cc..b33629e3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-brdr-c-00-a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-brdr-c-00-a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-ibrdr-c-00-a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-ibrdr-c-00-a-expected.png index f340ca1..a4ccf0fa 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-ibrdr-c-00-a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5516-ibrdr-c-00-a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5517-ibrdr-s-00-a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5517-ibrdr-s-00-a-expected.png index e084c13f..027186b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5517-ibrdr-s-00-a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5517-ibrdr-s-00-a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.png index c1147e9..2a1887c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.txt index 15ac50c..2020d0a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5519-brdr-r-02-e-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x368 LayoutNGBlockFlow {BODY} at (8,16) size 784x336 [color=#0000FF] LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 747x19 - text run at (0,0) width 747: "There should be a solid line to the right of the text below, having three segments each of a different colour as indicated." + LayoutText {#text} at (0,0) size 746x19 + text run at (0,0) width 746: "There should be a solid line to the right of the text below, having three segments each of a different colour as indicated." LayoutNGBlockFlow {UL} at (0,36) size 588x300 LayoutNGListItem {LI} at (40,0) size 548x80 [border: none (3px solid #FFA500) none] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 @@ -43,8 +43,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (0,0) size 516x199 - text run at (0,0) width 516: "Yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" + LayoutText {#text} at (0,0) size 515x199 + text run at (0,0) width 515: "Yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (0,20) width 513: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (0,40) width 513: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (0,60) width 513: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" @@ -53,4 +53,4 @@ text run at (0,120) width 513: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (0,140) width 513: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (0,160) width 513: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" - text run at (0,180) width 281: "yellow yellow yellow yellow yellow yellow." + text run at (0,180) width 280: "yellow yellow yellow yellow yellow yellow."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-00-a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-00-a-expected.txt index 4b13a861..47e6221b6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-00-a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-00-a-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (10,0) size 354x19 text run at (10,0) width 354: "\x{21E6} This paragraph should have two blue lines on its left. " LayoutInline {SPAN} at (0,0) size 745x99 [color=#C0C0C0] - LayoutText {#text} at (363,0) size 745x99 - text run at (363,0) width 392: "dummy text dummy text dummy text dummy text dummy text" + LayoutText {#text} at (364,0) size 745x99 + text run at (364,0) width 391: "dummy text dummy text dummy text dummy text dummy text" text run at (10,20) width 707: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (10,40) width 707: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (10,60) width 707: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" @@ -18,8 +18,8 @@ LayoutText {#text} at (1,0) size 359x19 text run at (1,0) width 359: "\x{21E6} This paragraph should have a thin blue line on its left. " LayoutInline {SPAN} at (0,0) size 759x99 [color=#C0C0C0] - LayoutText {#text} at (359,0) size 759x99 - text run at (359,0) width 392: "dummy text dummy text dummy text dummy text dummy text" + LayoutText {#text} at (360,0) size 759x99 + text run at (360,0) width 391: "dummy text dummy text dummy text dummy text dummy text" text run at (1,20) width 759: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy" text run at (1,40) width 734: "text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (1,60) width 759: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.png index a65a089..9b5d2079 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.txt index f46fdd40..bacaa1885 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5521-brdr-l-02-e-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x308 LayoutNGBlockFlow {BODY} at (8,16) size 784x276 [color=#0000FF] LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 738x19 - text run at (0,0) width 738: "There should be a solid line to the left of the text below, having three segments each of a different colour as indicated." + LayoutText {#text} at (0,0) size 737x19 + text run at (0,0) width 737: "There should be a solid line to the left of the text below, having three segments each of a different colour as indicated." LayoutNGBlockFlow {UL} at (0,36) size 784x240 LayoutNGListItem {LI} at (40,0) size 744x80 [border: none (3px solid #FFA500)] LayoutNGListMarker (anonymous) at (-18,0) size 10x20 @@ -43,11 +43,11 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (3,0) size 704x139 - text run at (3,0) width 704: "Yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" + LayoutText {#text} at (3,0) size 703x139 + text run at (3,0) width 703: "Yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (3,20) width 701: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (3,40) width 701: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (3,60) width 701: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (3,80) width 701: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" text run at (3,100) width 701: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow" - text run at (3,120) width 704: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow." + text run at (3,120) width 703: "yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5522-brdr-00-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5522-brdr-00-b-expected.png index 271f933..018afab 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5522-brdr-00-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0805-c5522-brdr-00-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.png index 852fc0b8..b47156a7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.txt index b564bad..d1cb4a6b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t09-c5526c-display-00-e-expected.txt
@@ -53,15 +53,15 @@ text run at (0,0) width 473: "This is a nonsensical document, but syntactically valid HTML 4.0. All 100%-conformant CSS1" text run at (0,13) width 480: "agents should be able to render the document elements above this paragraph indistinguishably" text run at (0,26) width 122: "(to the pixel) from this " - LayoutInline {A} at (0,0) size 103x12 [color=#999999] - LayoutText {#text} at (121,26) size 103x12 - text run at (121,26) width 103: "reference rendering," - LayoutText {#text} at (223,26) size 474x25 - text run at (223,26) width 251: " (except font rasterization and form widgets). All" + LayoutInline {A} at (0,0) size 102x12 [color=#999999] + LayoutText {#text} at (122,26) size 102x12 + text run at (122,26) width 102: "reference rendering," + LayoutText {#text} at (224,26) size 474x25 + text run at (224,26) width 250: " (except font rasterization and form widgets). All" text run at (0,39) width 410: "discrepancies should be traceable to CSS1 implementation shortcomings. Please " LayoutInline {A} at (0,0) size 462x25 [color=#CC0000] - LayoutText {#text} at (409,39) size 462x25 - text run at (409,39) width 53: "report any" + LayoutText {#text} at (410,39) size 462x25 + text run at (410,39) width 52: "report any" text run at (0,52) width 29: "errors" LayoutText {#text} at (29,52) size 284x12 text run at (29,52) width 284: " you find between the CSS and the reference rendering."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-02-c-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-02-c-expected.png index 73fcd654..e08fa13 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-02-c-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-02-c-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-03-c-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-03-c-expected.png index 39869994..1556013a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-03-c-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-03-c-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.png index ffe8da2..4abf6d0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.txt index 46035fd3..a0cd1353 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-04-c-expected.txt
@@ -39,8 +39,8 @@ LayoutText {#text} at (71,7) size 48x19 text run at (71,7) width 48: "B 10 \x{21E8}" LayoutNGBlockFlow (floating) {P} at (4,214) size 126x34 [color=#FFFFFF] [bgcolor=#000080] [border: (3px solid #0000FF)] - LayoutText {#text} at (7,7) size 47x19 - text run at (7,7) width 47: "\x{21E6} A 11" + LayoutText {#text} at (7,7) size 48x19 + text run at (7,7) width 48: "\x{21E6} A 11" LayoutNGBlockFlow (floating) {P} at (190,214) size 126x34 [color=#FFFFFF] [bgcolor=#000080] [border: (3px solid #0000FF)] LayoutText {#text} at (71,7) size 48x19 text run at (71,7) width 48: "B 12 \x{21E8}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-fit-01-d-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-fit-01-d-g-expected.txt index 8969d12..6459cb7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-fit-01-d-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-fit-01-d-g-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x272 LayoutNGBlockFlow {BODY} at (8,16) size 784x246 LayoutNGBlockFlow {P} at (0,0) size 784x20 [color=#000080] - LayoutText {#text} at (0,0) size 765x19 - text run at (0,0) width 765: "There should be a complete unbroken drawing of a yin-yang (\x{262F}) symbol below, slightly on the left (\x{21E6}) inside a blue box." + LayoutText {#text} at (0,0) size 764x19 + text run at (0,0) width 764: "There should be a complete unbroken drawing of a yin-yang (\x{262F}) symbol below, slightly on the left (\x{21E6}) inside a blue box." LayoutNGBlockFlow {DIV} at (10,36) size 260x210 [border: (5px solid #0000FF)] LayoutNGBlockFlow (floating) {P} at (5,5) size 100x100 [color=#000080] LayoutImage {IMG} at (0,0) size 100x100
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-wrap-00-e-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-wrap-00-e-expected.txt index 7de267a..ba94cb4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-wrap-00-e-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c414-flt-wrap-00-e-expected.txt
@@ -4,18 +4,18 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x208.63 LayoutNGBlockFlow {BODY} at (8,16) size 784x176.63 LayoutNGBlockFlow {P} at (0,0) size 784x20 [color=#000080] - LayoutText {#text} at (0,0) size 262x19 - text run at (0,0) width 262: "The word \"fail\" should not appear below." + LayoutText {#text} at (0,0) size 261x19 + text run at (0,0) width 261: "The word \"fail\" should not appear below." LayoutNGBlockFlow {DIV} at (16,36) size 240x140.63 [color=#FFFFFF] [bgcolor=#FFFFFF] - LayoutNGBlockFlow (floating) {P} at (0,0) size 42.52x20.31 [color=#000080] - LayoutText {#text} at (0,0) size 43x20 - text run at (0,0) width 43: "TEST:" + LayoutNGBlockFlow (floating) {P} at (0,0) size 43.31x20.31 [color=#000080] + LayoutText {#text} at (0,0) size 44x20 + text run at (0,0) width 44: "TEST:" LayoutNGBlockFlow (floating) {P} at (0.02,20.31) size 239.98x20.31 [color=#00FFFF] [bgcolor=#008080] LayoutText {#text} at (101,0) size 38x20 text run at (101,0) width 38: "PASS" LayoutNGBlockFlow (anonymous) at (0,0) size 240x140.63 - LayoutText {#text} at (42,0) size 236x140 - text run at (42,0) width 189: "fail fail fail fail fail fail fail fail" + LayoutText {#text} at (43,0) size 236x140 + text run at (43,0) width 189: "fail fail fail fail fail fail fail fail" text run at (0,40) width 236: "fail fail fail fail fail fail fail fail fail fail" text run at (0,60) width 236: "fail fail fail fail fail fail fail fail fail fail" text run at (0,80) width 236: "fail fail fail fail fail fail fail fail fail fail"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltblck-00-d-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltblck-00-d-ag-expected.txt new file mode 100644 index 0000000..f3bf7b57 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltblck-00-d-ag-expected.txt
@@ -0,0 +1,25 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x186 + LayoutNGBlockFlow {HTML} at (0,0) size 800x186 + LayoutNGBlockFlow {BODY} at (8,8) size 784x170 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 273x19 + text run at (0,0) width 273: "There should be a green box to the right. \x{2798}" + LayoutNGBlockFlow {DIV} at (0,20) size 784x150 [bgcolor=#FFFFFF] + LayoutNGBlockFlow (floating) {P} at (458,10) size 316x91 [color=#008000] [border: (3px solid #008000)] + LayoutText {#text} at (8,8) size 300x75 + text run at (8,8) width 300: "x x xxxx xx xxxx x x" + text run at (8,23) width 300: "x xx xx xxxx xx xx x" + text run at (8,38) width 300: "x xxx xx xx xx xxx x" + text run at (8,53) width 300: "x xx xx xxxx xx xx x" + text run at (8,68) width 300: "x x xxxx xx xxxx x x" + LayoutNGBlockFlow {P} at (0,0) size 784x45 [color=#FFFFFF] + LayoutText {#text} at (433,0) size 15x15 + text run at (433,0) width 15: "x" + LayoutBR {BR} at (448,0) size 0x0 + LayoutText {#text} at (433,15) size 15x15 + text run at (433,15) width 15: "x" + LayoutBR {BR} at (448,15) size 0x0 + LayoutText {#text} at (433,30) size 15x15 + text run at (433,30) width 15: "x"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltblck-01-d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltblck-01-d-expected.txt index fbfd3b9..558d4262 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltblck-01-d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltblck-01-d-expected.txt
@@ -10,5 +10,5 @@ text run at (0,0) width 313: "This teal box should start inside the dark blue box" text run at (0,20) width 252: "and spill out onto the blue area below it." LayoutNGBlockFlow {P} at (3,3) size 778x20 - LayoutText {#text} at (0,0) size 255x19 - text run at (0,0) width 255: "You should see a teal box to the right. \x{21E8}" + LayoutText {#text} at (0,0) size 254x19 + text run at (0,0) width 254: "You should see a teal box to the right. \x{21E8}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltclr-00-c-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltclr-00-c-ag-expected.txt index f49a4e679..f4076c6f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltclr-00-c-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltclr-00-c-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x711 LayoutNGBlockFlow {BODY} at (8,16) size 784x687 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 250x19 - text run at (0,0) width 250: "There should be a big green box below." + LayoutText {#text} at (0,0) size 249x19 + text run at (0,0) width 249: "There should be a big green box below." LayoutNGBlockFlow {DIV} at (0,36) size 306x651 [color=#008000] [bgcolor=#FF0000] [border: (3px solid #000000)] LayoutImage (floating) {IMG} at (3,3) size 50x50 LayoutNGBlockFlow {P} at (3,18) size 300x90
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.png index 39e57b6..3eb368b6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.txt index d5444fa..79a7a52 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltcont-00-d-g-expected.txt
@@ -16,8 +16,8 @@ text run at (0,0) width 277: "Inside this blue block on the right there" text run at (0,20) width 163: "should be a teal box. \x{21E8} " LayoutInline {SPAN} at (0,0) size 588x259 [color=#000080] - LayoutText {#text} at (162,20) size 588x259 - text run at (162,20) width 115: "FAIL FAIL FAIL" + LayoutText {#text} at (163,20) size 588x259 + text run at (163,20) width 114: "FAIL FAIL FAIL" text run at (0,40) width 277: "FAIL FAIL FAIL FAIL FAIL FAIL FAIL" text run at (0,60) width 277: "FAIL FAIL FAIL FAIL FAIL FAIL FAIL" text run at (0,80) width 588: "FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL" @@ -29,5 +29,5 @@ text run at (0,200) width 588: "FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL" text run at (0,220) width 588: "FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL" text run at (0,240) width 588: "FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL FAIL" - text run at (0,260) width 150: "FAIL FAIL FAIL FAIL" + text run at (0,260) width 148: "FAIL FAIL FAIL FAIL" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltinln-00-c-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltinln-00-c-ag-expected.txt index f99af182..4a385a7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltinln-00-c-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltinln-00-c-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x184 LayoutNGBlockFlow {BODY} at (8,16) size 784x153 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 273x19 - text run at (0,0) width 273: "There should be two boxes of green below." + LayoutText {#text} at (0,0) size 272x19 + text run at (0,0) width 272: "There should be two boxes of green below." LayoutNGBlockFlow {DIV} at (15,36) size 96x51 [color=#008000] [bgcolor=#FF0000] [border: (3px solid #000000)] LayoutNGBlockFlow (floating) {SPAN} at (3,3) size 45x30 LayoutText {#text} at (0,0) size 30x30
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltmrgn-00-c-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltmrgn-00-c-ag-expected.txt new file mode 100644 index 0000000..24185346f --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltmrgn-00-c-ag-expected.txt
@@ -0,0 +1,55 @@ +layer at (0,0) size 800x600 scrollHeight 621 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x621 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x621 + LayoutNGBlockFlow {BODY} at (8,16) size 784x597 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 328x19 + text run at (0,0) width 328: "There should be a tall green box below, with no red." + LayoutNGBlockFlow {DIV} at (0,36) size 126x561 [color=#008000] [bgcolor=#FF0000] [border: (3px solid #000000)] + LayoutNGBlockFlow {P} at (18,18) size 90x45 + LayoutText {#text} at (0,0) size 90x45 + text run at (0,0) width 75: "x x x" + text run at (0,15) width 90: "xx x x" + text run at (0,30) width 15: "x" + LayoutNGBlockFlow {P} at (18,78) size 90x60 + LayoutImage (floating) {IMG} at (0,0) size 45x45 [color=#FF0000] + LayoutNGBlockFlow (anonymous) at (0,0) size 90x60 + LayoutText {#text} at (45,0) size 90x60 + text run at (45,0) width 45: "x x" + text run at (45,15) width 15: "x" + text run at (45,30) width 30: "xx" + text run at (0,45) width 75: "x x x" + LayoutNGBlockFlow {P} at (18,153) size 90x105 + LayoutImage (floating) {IMG} at (30,30) size 45x45 [color=#FF0000] + LayoutNGBlockFlow (anonymous) at (0,0) size 90x105 + LayoutText {#text} at (75,0) size 90x105 + text run at (75,0) width 15: "x" + text run at (75,15) width 15: "x" + text run at (75,30) width 15: "x" + text run at (0,75) width 90: "xx x x" + text run at (0,90) width 15: "x" + LayoutNGBlockFlow {P} at (48,303) size 60x60 + LayoutImage (floating) {IMG} at (-30,-30) size 45x45 [color=#FF0000] + LayoutNGBlockFlow (anonymous) at (0,0) size 60x60 + LayoutText {#text} at (15,0) size 60x60 + text run at (15,0) width 45: "x x" + text run at (0,15) width 60: "x xx" + text run at (0,30) width 45: "x x" + text run at (0,45) width 15: "x" + LayoutNGBlockFlow {P} at (18,378) size 90x105 + LayoutImage (floating) {IMG} at (0,0) size 45x45 [color=#FF0000] + LayoutNGBlockFlow (anonymous) at (0,0) size 90x105 + LayoutText {#text} at (75,0) size 90x105 + text run at (75,0) width 15: "x" + text run at (75,15) width 15: "x" + text run at (75,30) width 15: "x" + text run at (0,75) width 90: "xx x x" + text run at (0,90) width 15: "x" + LayoutNGBlockFlow {P} at (18,498) size 90x45 + LayoutImage (floating) {IMG} at (0,0) size 45x45 [color=#FF0000] + LayoutNGBlockFlow (anonymous) at (0,0) size 90x45 + LayoutText {#text} at (15,0) size 90x45 + text run at (15,0) width 75: "x x x" + text run at (0,15) width 90: "xx x x" + text run at (0,30) width 15: "x"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png index a1e1185..b83e960 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt index 5059998..7f5db35 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-00-c-g-expected.txt
@@ -28,7 +28,7 @@ text run at (0,300) width 385: "float text ignore this float text ignore this float text" text run at (0,320) width 385: "ignore this float text ignore this float text ignore this" text run at (0,340) width 385: "float text ignore this float text ignore this float text" - text run at (0,360) width 257: "ignore this float text ignore this float" + text run at (0,360) width 255: "ignore this float text ignore this float" LayoutNGBlockFlow {DIV} at (0,145) size 769x520 [color=#C0C0C0] LayoutText {#text} at (384,0) size 769x519 text run at (384,0) width 385: "this is some dummy text this is some dummy text this is"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-02-c-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-02-c-g-expected.txt index c0bbd09..82689c76 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-02-c-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-02-c-g-expected.txt
@@ -7,7 +7,7 @@ LayoutNGBlockFlow (floating) {P} at (0,0) size 392x48 LayoutText {#text} at (0,0) size 352x47 text run at (0,0) width 352: "There should be a green square to the right," - text run at (0,25) width 311: "roughly in the middle, horizontally. \x{21E8}" + text run at (0,25) width 310: "roughly in the middle, horizontally. \x{21E8}" LayoutNGBlockFlow (anonymous) at (0,0) size 784x17 LayoutImage {IMG} at (392,0) size 15x15 [color=#FF0000] LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-03-c-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-03-c-g-expected.txt index b0b130f..7bc1afa 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-03-c-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwidth-03-c-g-expected.txt
@@ -9,7 +9,7 @@ LayoutImage {IMG} at (0,0) size 15x15 [color=#FF0000] LayoutText {#text} at (15,0) size 359x39 text run at (15,0) width 344: " \x{21E6} There should be a green square at the top left of the" - text run at (0,20) width 55: "window." + text run at (0,20) width 54: "window." LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 LayoutImage {IMG} at (0,0) size 15x15 [color=#FF0000] LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwrap-00-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwrap-00-b-expected.png index 7ecfe34..3a88fe18e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwrap-00-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5525-fltwrap-00-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5526-fltclr-00-c-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5526-fltclr-00-c-ag-expected.txt index f49a4e679..f4076c6f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5526-fltclr-00-c-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t0905-c5526-fltclr-00-c-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x711 LayoutNGBlockFlow {BODY} at (8,16) size 784x687 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 250x19 - text run at (0,0) width 250: "There should be a big green box below." + LayoutText {#text} at (0,0) size 249x19 + text run at (0,0) width 249: "There should be a big green box below." LayoutNGBlockFlow {DIV} at (0,36) size 306x651 [color=#008000] [bgcolor=#FF0000] [border: (3px solid #000000)] LayoutImage (floating) {IMG} at (3,3) size 50x50 LayoutNGBlockFlow {P} at (3,18) size 300x90
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.png index de76e88..b00a3504 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.txt index f8e63330..cce21cc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-00-d-expected.txt
@@ -9,17 +9,17 @@ LayoutNGBlockFlow {DIV} at (0,36) size 784x116 LayoutNGBlockFlow {DIV} at (16,0) size 752x116 [color=#0000FF] [bgcolor=#000080] [border: (8px solid #0000FF) none (8px solid #0000FF)] LayoutNGBlockFlow (floating) {P} at (8,8) size 176x96 [color=#00FFFF] [bgcolor=#008080] [border: (4px solid #00FFFF)] - LayoutText {#text} at (8,8) size 144x79 - text run at (8,8) width 144: "Teal block. Teal block." - text run at (8,28) width 144: "Teal block. Teal block." - text run at (8,48) width 144: "Teal block. Teal block." - text run at (8,68) width 144: "Teal block. Teal block." + LayoutText {#text} at (8,8) size 142x79 + text run at (8,8) width 142: "Teal block. Teal block." + text run at (8,28) width 142: "Teal block. Teal block." + text run at (8,48) width 142: "Teal block. Teal block." + text run at (8,68) width 142: "Teal block. Teal block." LayoutNGBlockFlow (floating) {P} at (568,8) size 176x96 [color=#00FFFF] [bgcolor=#008080] [border: (4px solid #00FFFF)] - LayoutText {#text} at (8,8) size 144x79 - text run at (8,8) width 144: "Teal block. Teal block." - text run at (8,28) width 144: "Teal block. Teal block." - text run at (8,48) width 144: "Teal block. Teal block." - text run at (8,68) width 144: "Teal block. Teal block." + LayoutText {#text} at (8,8) size 142x79 + text run at (8,8) width 142: "Teal block. Teal block." + text run at (8,28) width 142: "Teal block. Teal block." + text run at (8,48) width 142: "Teal block. Teal block." + text run at (8,68) width 142: "Teal block. Teal block." LayoutNGBlockFlow (anonymous) at (8,8) size 736x100 LayoutText {#text} at (176,0) size 358x99 text run at (176,0) width 327: "Blue rectangle. Blue rectangle. Blue rectangle. Blue"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.png index fdb3e08a..d1df56f7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.txt index 86827764..088ef29 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-01-b-expected.txt
@@ -17,7 +17,7 @@ text run at (8,8) width 115: "\x{21E8} This blue block" text run at (8,28) width 141: "should be on the right." LayoutNGBlockFlow (anonymous) at (8,8) size 736x60 - LayoutText {#text} at (176,0) size 379x59 - text run at (176,0) width 379: "Teal rectangle. Teal rectangle. Teal rectangle. Teal rectangle." - text run at (176,20) width 379: "Teal rectangle. Teal rectangle. Teal rectangle. Teal rectangle." - text run at (176,40) width 379: "Teal rectangle. Teal rectangle. Teal rectangle. Teal rectangle." + LayoutText {#text} at (176,0) size 376x59 + text run at (176,0) width 376: "Teal rectangle. Teal rectangle. Teal rectangle. Teal rectangle." + text run at (176,20) width 376: "Teal rectangle. Teal rectangle. Teal rectangle. Teal rectangle." + text run at (176,40) width 376: "Teal rectangle. Teal rectangle. Teal rectangle. Teal rectangle."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.png index 57f5860..5512e20 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.txt index 7606f3a..78f6851 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-00-d-expected.txt
@@ -11,16 +11,16 @@ LayoutNGBlockFlow {DIV} at (16,76) size 752x382 [color=#C0C0C0] [border: (5px solid #800080)] LayoutText {#text} at (171,21) size 474x19 text run at (171,21) width 474: "dummy text dummy text dummy text dummy text dummy text dummy text " - LayoutInline {SPAN} at (0,0) size 18x25 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] - LayoutText {#text} at (647,21) size 12x19 - text run at (647,21) width 12: "A" - LayoutText {#text} at (661,21) size 5x19 - text run at (661,21) width 5: " " + LayoutInline {SPAN} at (0,0) size 17x25 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] + LayoutText {#text} at (648,21) size 11x19 + text run at (648,21) width 11: "A" + LayoutText {#text} at (662,21) size 4x19 + text run at (662,21) width 4: " " LayoutNGBlockFlow (floating) {P} at (21,21) size 150x58 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] LayoutText {#text} at (19,19) size 48x19 text run at (19,19) width 48: "AAAA" - LayoutText {#text} at (665,21) size 543x39 - text run at (665,21) width 49: "dummy" + LayoutText {#text} at (666,21) size 543x39 + text run at (666,21) width 48: "dummy" text run at (171,41) width 422: "text dummy text dummy text dummy text dummy text dummy text " LayoutInline {SPAN} at (0,0) size 17x25 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] LayoutText {#text} at (596,41) size 11x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.png index 62f3c9e..51e0280 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.txt index 8ae58c94..821129c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-02-d-expected.txt
@@ -11,16 +11,16 @@ LayoutNGBlockFlow {DIV} at (16,76) size 752x442 [color=#C0C0C0] [border: (5px solid #800080)] LayoutText {#text} at (21,21) size 553x19 text run at (21,21) width 553: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text " - LayoutInline {SPAN} at (0,0) size 18x25 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] - LayoutText {#text} at (576,21) size 12x19 - text run at (576,21) width 12: "A" - LayoutText {#text} at (590,21) size 5x19 - text run at (590,21) width 5: " " + LayoutInline {SPAN} at (0,0) size 17x25 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] + LayoutText {#text} at (577,21) size 11x19 + text run at (577,21) width 11: "A" + LayoutText {#text} at (591,21) size 4x19 + text run at (591,21) width 4: " " LayoutNGBlockFlow (floating) {P} at (21,41) size 150x58 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] LayoutText {#text} at (19,19) size 48x19 text run at (19,19) width 48: "AAAA" - LayoutText {#text} at (594,21) size 551x39 - text run at (594,21) width 128: "dummy text dummy" + LayoutText {#text} at (595,21) size 551x39 + text run at (595,21) width 127: "dummy text dummy" text run at (171,41) width 343: "text dummy text dummy text dummy text dummy text " LayoutInline {SPAN} at (0,0) size 17x25 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] LayoutText {#text} at (517,41) size 11x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.png index da6e7c98..45eafef 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.txt index d7fa2bb..bbf5bdb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c414-flt-ln-03-d-expected.txt
@@ -11,24 +11,24 @@ LayoutNGBlockFlow {DIV} at (16,76) size 752x362 [color=#C0C0C0] [border: (5px solid #800080)] LayoutText {#text} at (171,21) size 316x19 text run at (171,21) width 316: "dummy text dummy text dummy text dummy text " - LayoutInline {SPAN} at (0,0) size 18x25 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] - LayoutText {#text} at (489,21) size 12x19 - text run at (489,21) width 12: "A" - LayoutText {#text} at (503,21) size 5x19 - text run at (503,21) width 5: " " + LayoutInline {SPAN} at (0,0) size 17x25 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] + LayoutText {#text} at (490,21) size 11x19 + text run at (490,21) width 11: "A" + LayoutText {#text} at (504,21) size 4x19 + text run at (504,21) width 4: " " LayoutNGBlockFlow (floating) {P} at (21,21) size 150x58 [color=#FFFFFF] [bgcolor=#008080] [border: (3px solid #00FFFF)] LayoutText {#text} at (19,19) size 48x19 text run at (19,19) width 48: "AAAA" - LayoutInline {SPAN} at (0,0) size 18x25 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] - LayoutText {#text} at (510,21) size 12x19 - text run at (510,21) width 12: "B" - LayoutText {#text} at (524,21) size 5x19 - text run at (524,21) width 5: " " + LayoutInline {SPAN} at (0,0) size 17x25 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] + LayoutText {#text} at (511,21) size 11x19 + text run at (511,21) width 11: "B" + LayoutText {#text} at (525,21) size 4x19 + text run at (525,21) width 4: " " LayoutNGBlockFlow (floating) {P} at (581,21) size 150x58 [color=#FFFFFF] [bgcolor=#800080] [border: (3px solid #FF00FF)] LayoutText {#text} at (19,19) size 44x19 text run at (19,19) width 44: "BBBB" - LayoutText {#text} at (528,21) size 707x319 - text run at (528,21) width 49: "dummy" + LayoutText {#text} at (529,21) size 707x319 + text run at (529,21) width 48: "dummy" text run at (171,41) width 391: "text dummy text dummy text dummy text dummy text dummy" text run at (171,61) width 391: "text dummy text dummy text dummy text dummy text dummy" text run at (21,81) width 707: "text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c5525-flt-l-00-b-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c5525-flt-l-00-b-g-expected.txt index 7c84f7a9..b5c4dd1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c5525-flt-l-00-b-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t090501-c5525-flt-l-00-b-g-expected.txt
@@ -9,8 +9,8 @@ LayoutText {#text} at (50,0) size 325x19 text run at (50,0) width 325: "\x{21E6} This text should flow around the box on the left. " LayoutInline {SPAN} at (0,0) size 766x279 [color=#C0C0C0] - LayoutText {#text} at (374,0) size 766x279 - text run at (374,0) width 392: "dummy text dummy text dummy text dummy text dummy text" + LayoutText {#text} at (375,0) size 766x279 + text run at (375,0) width 391: "dummy text dummy text dummy text dummy text dummy text" text run at (50,20) width 707: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (50,40) width 707: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,60) width 759: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1002-c5523-width-02-b-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1002-c5523-width-02-b-g-expected.txt index 14e21b3..dbe83c74 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1002-c5523-width-02-b-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1002-c5523-width-02-b-g-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 785x660 LayoutNGBlockFlow {BODY} at (8,16) size 769x636 LayoutNGBlockFlow {P} at (0,0) size 769x20 - LayoutText {#text} at (0,0) size 416x19 - text run at (0,0) width 416: "The blue text should not go past the 50% mark on the ruler below." + LayoutText {#text} at (0,0) size 415x19 + text run at (0,0) width 415: "The blue text should not go past the 50% mark on the ruler below." LayoutNGBlockFlow {DIV} at (0,36) size 384.50x560 [color=#0000FF] LayoutText {#text} at (0,0) size 377x559 text run at (0,0) width 377: "a bit of dummy text a bit of dummy text a bit of dummy text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100304-c43-rpl-bbx-01-d-g-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100304-c43-rpl-bbx-01-d-g-expected.txt index a00f886..435d850 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100304-c43-rpl-bbx-01-d-g-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100304-c43-rpl-bbx-01-d-g-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x480 LayoutNGBlockFlow {BODY} at (8,16) size 784x448 LayoutNGBlockFlow {P} at (0,0) size 784x40 [color=#000080] - LayoutText {#text} at (0,0) size 768x39 - text run at (0,0) width 768: "Below this paragraph there should be a big teal square half the width of the window, aligned flush with the right hand side" + LayoutText {#text} at (0,0) size 767x39 + text run at (0,0) width 767: "Below this paragraph there should be a big teal square half the width of the window, aligned flush with the right hand side" text run at (0,20) width 27: "(\x{21E8})." LayoutNGBlockFlow {P} at (0,56) size 784x392 [color=#000080] LayoutImage {IMG} at (392,0) size 392x392
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-00-d-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-00-d-ag-expected.txt index fb2c682..1b35a9c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-00-d-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-00-d-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x220 LayoutNGBlockFlow {BODY} at (8,16) size 784x196 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 438x19 - text run at (0,0) width 438: "There should be no red below, just the outline of an empty green box." + LayoutText {#text} at (0,0) size 437x19 + text run at (0,0) width 437: "There should be no red below, just the outline of an empty green box." LayoutNGBlockFlow {DIV} at (0,36) size 230x160 [color=#FFFFFF] [bgcolor=#FF0000] [border: (10px solid #008000)] LayoutText {#text} at (20,20) size 190x30 text run at (20,20) width 190: "xxxx xxxx xxxx xxxx"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-01-d-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-01-d-ag-expected.txt index 5f9d3a1..d45c62e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-01-d-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-01-d-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x300 LayoutNGBlockFlow {BODY} at (8,16) size 784x276 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 438x19 - text run at (0,0) width 438: "There should be no red below, just the outline of an empty green box." + LayoutText {#text} at (0,0) size 437x19 + text run at (0,0) width 437: "There should be no red below, just the outline of an empty green box." LayoutNGBlockFlow {DIV} at (0,36) size 430x240 [color=#FFFFFF] [bgcolor=#FF0000] [border: (10px solid #008000)] LayoutText {#text} at (20,20) size 390x105 text run at (20,20) width 390: "xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-02-d-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-02-d-ag-expected.txt index 2ba43cd..57815d8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-02-d-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-02-d-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x322 LayoutNGBlockFlow {BODY} at (8,16) size 784x298 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 438x19 - text run at (0,0) width 438: "There should be no red below, just the outline of an empty green box." + LayoutText {#text} at (0,0) size 437x19 + text run at (0,0) width 437: "There should be no red below, just the outline of an empty green box." LayoutNGBlockFlow {DIV} at (0,36) size 360x262 [color=#FFFFFF] [bgcolor=#FF0000] [border: (20px solid #008000)] LayoutText {#text} at (40,40) size 280x102 text run at (40,40) width 280: "xxxx xxxx xxxx"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-03-d-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-03-d-ag-expected.txt index fd2ce7d..47d856c3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-03-d-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1008-c44-ln-box-03-d-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x320 LayoutNGBlockFlow {BODY} at (8,16) size 784x296 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 438x19 - text run at (0,0) width 438: "There should be no red below, just the outline of an empty green box." + LayoutText {#text} at (0,0) size 437x19 + text run at (0,0) width 437: "There should be no red below, just the outline of an empty green box." LayoutNGBlockFlow {DIV} at (0,36) size 360x260 [color=#FFFFFF] [bgcolor=#FF0000] [border: (20px solid #008000)] LayoutText {#text} at (40,40) size 280x100 text run at (40,40) width 280: "xxxx xxxx xxxx"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100801-c42-ibx-ht-00-d-a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100801-c42-ibx-ht-00-d-a-expected.txt index b2e855f5..ab53a1b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100801-c42-ibx-ht-00-d-a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t100801-c42-ibx-ht-00-d-a-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x120 LayoutNGBlockFlow {BODY} at (8,16) size 784x96 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 357x19 - text run at (0,0) width 357: "There should be no red below, only green lines and dots." + LayoutText {#text} at (0,0) size 356x19 + text run at (0,0) width 356: "There should be no red below, only green lines and dots." LayoutNGBlockFlow {DIV} at (0,36) size 200x60 [color=#008000] LayoutText {#text} at (0,1) size 40x10 text run at (0,1) width 40: "z z "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-00-b-expected.txt index 68c8b78..f190c6d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-00-b-expected.txt
@@ -71,12 +71,12 @@ LayoutInline {<pseudo:before>} at (0,0) size 16x19 LayoutCounter (anonymous) at (128,0) size 16x19 text run at (128,0) width 16: "11" - LayoutText {#text} at (143,0) size 5x19 - text run at (143,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (147,0) size 17x19 - text run at (147,0) width 17: "12" + LayoutText {#text} at (144,0) size 4x19 + text run at (144,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (148,0) size 16x19 + text run at (148,0) width 16: "12" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 164x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-01-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-01-b-expected.txt index 23226950..401975dc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-01-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-01-b-expected.txt
@@ -9,8 +9,8 @@ LayoutInline {EM} at (0,0) size 91x19 LayoutText {#text} at (233,0) size 91x19 text run at (233,0) width 91: "approximately" - LayoutText {#text} at (323,0) size 64x19 - text run at (323,0) width 64: " the same:" + LayoutText {#text} at (324,0) size 63x19 + text run at (324,0) width 63: " the same:" LayoutNGBlockFlow {DIV} at (0,36) size 784x20 LayoutInline {SPAN} at (0,0) size 7x19 LayoutInline {<pseudo:before>} at (0,0) size 7x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-02-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-02-b-expected.txt index 6aac8fb..386ed7c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-02-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-02-b-expected.txt
@@ -9,8 +9,8 @@ LayoutInline {EM} at (0,0) size 91x19 LayoutText {#text} at (233,0) size 91x19 text run at (233,0) width 91: "approximately" - LayoutText {#text} at (323,0) size 64x19 - text run at (323,0) width 64: " the same:" + LayoutText {#text} at (324,0) size 63x19 + text run at (324,0) width 63: " the same:" LayoutNGBlockFlow {DIV} at (0,36) size 784x20 LayoutInline {SPAN} at (0,0) size 6x19 LayoutInline {<pseudo:before>} at (0,0) size 6x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-03-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-03-b-expected.txt index aec71f4c..27d64b93 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-03-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-03-b-expected.txt
@@ -9,8 +9,8 @@ LayoutInline {EM} at (0,0) size 91x19 LayoutText {#text} at (233,0) size 91x19 text run at (233,0) width 91: "approximately" - LayoutText {#text} at (323,0) size 64x19 - text run at (323,0) width 64: " the same:" + LayoutText {#text} at (324,0) size 63x19 + text run at (324,0) width 63: " the same:" LayoutNGBlockFlow {DIV} at (0,36) size 784x20 LayoutInline {SPAN} at (0,0) size 6x19 LayoutInline {<pseudo:before>} at (0,0) size 6x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-05-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-05-b-expected.txt index 68c8b78..f190c6d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-05-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-05-b-expected.txt
@@ -71,12 +71,12 @@ LayoutInline {<pseudo:before>} at (0,0) size 16x19 LayoutCounter (anonymous) at (128,0) size 16x19 text run at (128,0) width 16: "11" - LayoutText {#text} at (143,0) size 5x19 - text run at (143,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (147,0) size 17x19 - text run at (147,0) width 17: "12" + LayoutText {#text} at (144,0) size 4x19 + text run at (144,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (148,0) size 16x19 + text run at (148,0) width 16: "12" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 164x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-06-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-06-b-expected.txt index 6db86e3..f7eeda6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-06-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-06-b-expected.txt
@@ -71,30 +71,30 @@ LayoutInline {<pseudo:before>} at (0,0) size 16x19 LayoutCounter (anonymous) at (200,0) size 16x19 text run at (200,0) width 16: "11" - LayoutText {#text} at (215,0) size 5x19 - text run at (215,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (219,0) size 17x19 - text run at (219,0) width 17: "12" - LayoutText {#text} at (235,0) size 5x19 - text run at (235,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (239,0) size 17x19 - text run at (239,0) width 17: "99" - LayoutText {#text} at (255,0) size 5x19 - text run at (255,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 25x19 - LayoutInline {<pseudo:before>} at (0,0) size 25x19 - LayoutCounter (anonymous) at (259,0) size 25x19 - text run at (259,0) width 25: "100" - LayoutText {#text} at (283,0) size 5x19 - text run at (283,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 25x19 - LayoutInline {<pseudo:before>} at (0,0) size 25x19 - LayoutCounter (anonymous) at (287,0) size 25x19 - text run at (287,0) width 25: "101" + LayoutText {#text} at (216,0) size 4x19 + text run at (216,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (220,0) size 16x19 + text run at (220,0) width 16: "12" + LayoutText {#text} at (236,0) size 4x19 + text run at (236,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (240,0) size 16x19 + text run at (240,0) width 16: "99" + LayoutText {#text} at (256,0) size 4x19 + text run at (256,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 24x19 + LayoutInline {<pseudo:before>} at (0,0) size 24x19 + LayoutCounter (anonymous) at (260,0) size 24x19 + text run at (260,0) width 24: "100" + LayoutText {#text} at (284,0) size 4x19 + text run at (284,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 24x19 + LayoutInline {<pseudo:before>} at (0,0) size 24x19 + LayoutCounter (anonymous) at (288,0) size 24x19 + text run at (288,0) width 24: "101" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 312x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.png index e682f880..9f234b5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.txt index b0ae33f0..6b8aab30 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-08-b-expected.txt
@@ -29,97 +29,97 @@ LayoutInline {<pseudo:before>} at (0,0) size 17x19 LayoutCounter (anonymous) at (42,0) size 17x19 text run at (42,0) width 17: "IV" - LayoutText {#text} at (58,0) size 5x19 - text run at (58,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (62,0) size 13x19 - text run at (62,0) width 13: "V" - LayoutText {#text} at (74,0) size 5x19 - text run at (74,0) width 5: " " + LayoutText {#text} at (59,0) size 4x19 + text run at (59,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (63,0) size 12x19 + text run at (63,0) width 12: "V" + LayoutText {#text} at (75,0) size 4x19 + text run at (75,0) width 4: " " LayoutInline {SPAN} at (0,0) size 17x19 LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (78,0) size 17x19 - text run at (78,0) width 17: "VI" - LayoutText {#text} at (94,0) size 5x19 - text run at (94,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 23x19 - LayoutInline {<pseudo:before>} at (0,0) size 23x19 - LayoutCounter (anonymous) at (98,0) size 23x19 - text run at (98,0) width 23: "VII" - LayoutText {#text} at (120,0) size 5x19 - text run at (120,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (124,0) size 28x19 - text run at (124,0) width 28: "VIII" - LayoutText {#text} at (151,0) size 5x19 - text run at (151,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 18x19 - LayoutInline {<pseudo:before>} at (0,0) size 18x19 - LayoutCounter (anonymous) at (155,0) size 18x19 - text run at (155,0) width 18: "IX" - LayoutText {#text} at (172,0) size 5x19 - text run at (172,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (176,0) size 13x19 - text run at (176,0) width 13: "X" - LayoutText {#text} at (188,0) size 5x19 - text run at (188,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 18x19 - LayoutInline {<pseudo:before>} at (0,0) size 18x19 - LayoutCounter (anonymous) at (192,0) size 18x19 - text run at (192,0) width 18: "XI" - LayoutText {#text} at (209,0) size 5x19 - text run at (209,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 23x19 - LayoutInline {<pseudo:before>} at (0,0) size 23x19 - LayoutCounter (anonymous) at (213,0) size 23x19 - text run at (213,0) width 23: "XII" - LayoutText {#text} at (235,0) size 5x19 - text run at (235,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 40x19 - LayoutInline {<pseudo:before>} at (0,0) size 40x19 - LayoutCounter (anonymous) at (239,0) size 40x19 - text run at (239,0) width 40: "XLIX" - LayoutText {#text} at (278,0) size 5x19 - text run at (278,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 11x19 - LayoutInline {<pseudo:before>} at (0,0) size 11x19 - LayoutCounter (anonymous) at (282,0) size 11x19 - text run at (282,0) width 11: "L" - LayoutText {#text} at (292,0) size 4x19 - text run at (292,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 97x19 - LayoutInline {<pseudo:before>} at (0,0) size 97x19 - LayoutCounter (anonymous) at (295,0) size 97x19 - text run at (295,0) width 97: "CCCLXXXIX" - LayoutText {#text} at (391,0) size 5x19 - text run at (391,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 57x19 - LayoutInline {<pseudo:before>} at (0,0) size 57x19 - LayoutCounter (anonymous) at (395,0) size 57x19 - text run at (395,0) width 57: "CCCXC" - LayoutText {#text} at (451,0) size 5x19 - text run at (451,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 129x19 - LayoutInline {<pseudo:before>} at (0,0) size 129x19 - LayoutCounter (anonymous) at (455,0) size 129x19 - text run at (455,0) width 129: "MMMCDLXXXIX" - LayoutText {#text} at (583,0) size 5x19 - text run at (583,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 89x19 - LayoutInline {<pseudo:before>} at (0,0) size 89x19 - LayoutCounter (anonymous) at (587,0) size 89x19 - text run at (587,0) width 89: "MMMCDXC" - LayoutText {#text} at (675,0) size 5x19 - text run at (675,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 94x19 - LayoutInline {<pseudo:before>} at (0,0) size 94x19 - LayoutCounter (anonymous) at (679,0) size 94x19 - text run at (679,0) width 94: "MMMCDXCI" + LayoutCounter (anonymous) at (79,0) size 17x19 + text run at (79,0) width 17: "VI" + LayoutText {#text} at (96,0) size 4x19 + text run at (96,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 22x19 + LayoutInline {<pseudo:before>} at (0,0) size 22x19 + LayoutCounter (anonymous) at (100,0) size 22x19 + text run at (100,0) width 22: "VII" + LayoutText {#text} at (122,0) size 4x19 + text run at (122,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 27x19 + LayoutInline {<pseudo:before>} at (0,0) size 27x19 + LayoutCounter (anonymous) at (126,0) size 27x19 + text run at (126,0) width 27: "VIII" + LayoutText {#text} at (153,0) size 4x19 + text run at (153,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 17x19 + LayoutInline {<pseudo:before>} at (0,0) size 17x19 + LayoutCounter (anonymous) at (157,0) size 17x19 + text run at (157,0) width 17: "IX" + LayoutText {#text} at (174,0) size 4x19 + text run at (174,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (178,0) size 12x19 + text run at (178,0) width 12: "X" + LayoutText {#text} at (190,0) size 4x19 + text run at (190,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 17x19 + LayoutInline {<pseudo:before>} at (0,0) size 17x19 + LayoutCounter (anonymous) at (194,0) size 17x19 + text run at (194,0) width 17: "XI" + LayoutText {#text} at (211,0) size 4x19 + text run at (211,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 22x19 + LayoutInline {<pseudo:before>} at (0,0) size 22x19 + LayoutCounter (anonymous) at (215,0) size 22x19 + text run at (215,0) width 22: "XII" + LayoutText {#text} at (237,0) size 4x19 + text run at (237,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 39x19 + LayoutInline {<pseudo:before>} at (0,0) size 39x19 + LayoutCounter (anonymous) at (241,0) size 39x19 + text run at (241,0) width 39: "XLIX" + LayoutText {#text} at (280,0) size 4x19 + text run at (280,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 10x19 + LayoutInline {<pseudo:before>} at (0,0) size 10x19 + LayoutCounter (anonymous) at (284,0) size 10x19 + text run at (284,0) width 10: "L" + LayoutText {#text} at (294,0) size 4x19 + text run at (294,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 96x19 + LayoutInline {<pseudo:before>} at (0,0) size 96x19 + LayoutCounter (anonymous) at (298,0) size 96x19 + text run at (298,0) width 96: "CCCLXXXIX" + LayoutText {#text} at (394,0) size 4x19 + text run at (394,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 56x19 + LayoutInline {<pseudo:before>} at (0,0) size 56x19 + LayoutCounter (anonymous) at (398,0) size 56x19 + text run at (398,0) width 56: "CCCXC" + LayoutText {#text} at (454,0) size 4x19 + text run at (454,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 128x19 + LayoutInline {<pseudo:before>} at (0,0) size 128x19 + LayoutCounter (anonymous) at (458,0) size 128x19 + text run at (458,0) width 128: "MMMCDLXXXIX" + LayoutText {#text} at (586,0) size 4x19 + text run at (586,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 88x19 + LayoutInline {<pseudo:before>} at (0,0) size 88x19 + LayoutCounter (anonymous) at (590,0) size 88x19 + text run at (590,0) width 88: "MMMCDXC" + LayoutText {#text} at (678,0) size 4x19 + text run at (678,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 93x19 + LayoutInline {<pseudo:before>} at (0,0) size 93x19 + LayoutCounter (anonymous) at (682,0) size 93x19 + text run at (682,0) width 93: "MMMCDXCI" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 773x19 - text run at (0,0) width 773: "I II III IV V VI VII VIII IX X XI XII XLIX L CCCLXXXIX CCCXC MMMCDLXXXIX MMMCDXC MMMCDXCI" + LayoutText {#text} at (0,0) size 775x19 + text run at (0,0) width 775: "I II III IV V VI VII VIII IX X XI XII XLIX L CCCLXXXIX CCCXC MMMCDLXXXIX MMMCDXC MMMCDXCI"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.png index b3f8b8b..f59d06da 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.txt index bf91646..f5dd16fd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-13-b-expected.txt
@@ -11,72 +11,72 @@ LayoutInline {<pseudo:before>} at (0,0) size 12x19 LayoutCounter (anonymous) at (0,0) size 12x19 text run at (0,0) width 12: "A" - LayoutText {#text} at (11,0) size 5x19 - text run at (11,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 12x19 - LayoutInline {<pseudo:before>} at (0,0) size 12x19 - LayoutCounter (anonymous) at (15,0) size 12x19 - text run at (15,0) width 12: "B" - LayoutText {#text} at (26,0) size 5x19 - text run at (26,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 12x19 - LayoutInline {<pseudo:before>} at (0,0) size 12x19 - LayoutCounter (anonymous) at (30,0) size 12x19 - text run at (30,0) width 12: "C" - LayoutText {#text} at (41,0) size 5x19 - text run at (41,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (45,0) size 13x19 - text run at (45,0) width 13: "D" - LayoutText {#text} at (57,0) size 5x19 - text run at (57,0) width 5: " " + LayoutText {#text} at (12,0) size 4x19 + text run at (12,0) width 4: " " LayoutInline {SPAN} at (0,0) size 11x19 LayoutInline {<pseudo:before>} at (0,0) size 11x19 - LayoutCounter (anonymous) at (61,0) size 11x19 - text run at (61,0) width 11: "E" - LayoutText {#text} at (71,0) size 5x19 - text run at (71,0) width 5: " " + LayoutCounter (anonymous) at (16,0) size 11x19 + text run at (16,0) width 11: "B" + LayoutText {#text} at (27,0) size 4x19 + text run at (27,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 11x19 + LayoutInline {<pseudo:before>} at (0,0) size 11x19 + LayoutCounter (anonymous) at (31,0) size 11x19 + text run at (31,0) width 11: "C" + LayoutText {#text} at (42,0) size 4x19 + text run at (42,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (46,0) size 12x19 + text run at (46,0) width 12: "D" + LayoutText {#text} at (58,0) size 4x19 + text run at (58,0) width 4: " " LayoutInline {SPAN} at (0,0) size 10x19 LayoutInline {<pseudo:before>} at (0,0) size 10x19 - LayoutCounter (anonymous) at (75,0) size 10x19 - text run at (75,0) width 10: "F" - LayoutText {#text} at (84,0) size 5x19 - text run at (84,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (88,0) size 13x19 - text run at (88,0) width 13: "G" - LayoutText {#text} at (100,0) size 5x19 - text run at (100,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (104,0) size 13x19 - text run at (104,0) width 13: "H" - LayoutText {#text} at (116,0) size 5x19 - text run at (116,0) width 5: " " + LayoutCounter (anonymous) at (62,0) size 10x19 + text run at (62,0) width 10: "E" + LayoutText {#text} at (72,0) size 4x19 + text run at (72,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 9x19 + LayoutInline {<pseudo:before>} at (0,0) size 9x19 + LayoutCounter (anonymous) at (76,0) size 9x19 + text run at (76,0) width 9: "F" + LayoutText {#text} at (85,0) size 4x19 + text run at (85,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (89,0) size 12x19 + text run at (89,0) width 12: "G" + LayoutText {#text} at (101,0) size 4x19 + text run at (101,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (105,0) size 12x19 + text run at (105,0) width 12: "H" + LayoutText {#text} at (117,0) size 4x19 + text run at (117,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 5x19 + LayoutInline {<pseudo:before>} at (0,0) size 5x19 + LayoutCounter (anonymous) at (121,0) size 5x19 + text run at (121,0) width 5: "I" + LayoutText {#text} at (126,0) size 4x19 + text run at (126,0) width 4: " " LayoutInline {SPAN} at (0,0) size 6x19 LayoutInline {<pseudo:before>} at (0,0) size 6x19 - LayoutCounter (anonymous) at (120,0) size 6x19 - text run at (120,0) width 6: "I" - LayoutText {#text} at (125,0) size 5x19 - text run at (125,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 7x19 - LayoutInline {<pseudo:before>} at (0,0) size 7x19 - LayoutCounter (anonymous) at (129,0) size 7x19 - text run at (129,0) width 7: "J" - LayoutText {#text} at (135,0) size 5x19 - text run at (135,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (139,0) size 13x19 - text run at (139,0) width 13: "K" - LayoutText {#text} at (151,0) size 5x19 - text run at (151,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 11x19 - LayoutInline {<pseudo:before>} at (0,0) size 11x19 - LayoutCounter (anonymous) at (155,0) size 11x19 - text run at (155,0) width 11: "L" + LayoutCounter (anonymous) at (130,0) size 6x19 + text run at (130,0) width 6: "J" + LayoutText {#text} at (136,0) size 4x19 + text run at (136,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (140,0) size 12x19 + text run at (140,0) width 12: "K" + LayoutText {#text} at (152,0) size 4x19 + text run at (152,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 10x19 + LayoutInline {<pseudo:before>} at (0,0) size 10x19 + LayoutCounter (anonymous) at (156,0) size 10x19 + text run at (156,0) width 10: "L" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 166x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.png index b3f8b8b..f59d06da 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.txt index bf91646..f5dd16fd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-14-b-expected.txt
@@ -11,72 +11,72 @@ LayoutInline {<pseudo:before>} at (0,0) size 12x19 LayoutCounter (anonymous) at (0,0) size 12x19 text run at (0,0) width 12: "A" - LayoutText {#text} at (11,0) size 5x19 - text run at (11,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 12x19 - LayoutInline {<pseudo:before>} at (0,0) size 12x19 - LayoutCounter (anonymous) at (15,0) size 12x19 - text run at (15,0) width 12: "B" - LayoutText {#text} at (26,0) size 5x19 - text run at (26,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 12x19 - LayoutInline {<pseudo:before>} at (0,0) size 12x19 - LayoutCounter (anonymous) at (30,0) size 12x19 - text run at (30,0) width 12: "C" - LayoutText {#text} at (41,0) size 5x19 - text run at (41,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (45,0) size 13x19 - text run at (45,0) width 13: "D" - LayoutText {#text} at (57,0) size 5x19 - text run at (57,0) width 5: " " + LayoutText {#text} at (12,0) size 4x19 + text run at (12,0) width 4: " " LayoutInline {SPAN} at (0,0) size 11x19 LayoutInline {<pseudo:before>} at (0,0) size 11x19 - LayoutCounter (anonymous) at (61,0) size 11x19 - text run at (61,0) width 11: "E" - LayoutText {#text} at (71,0) size 5x19 - text run at (71,0) width 5: " " + LayoutCounter (anonymous) at (16,0) size 11x19 + text run at (16,0) width 11: "B" + LayoutText {#text} at (27,0) size 4x19 + text run at (27,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 11x19 + LayoutInline {<pseudo:before>} at (0,0) size 11x19 + LayoutCounter (anonymous) at (31,0) size 11x19 + text run at (31,0) width 11: "C" + LayoutText {#text} at (42,0) size 4x19 + text run at (42,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (46,0) size 12x19 + text run at (46,0) width 12: "D" + LayoutText {#text} at (58,0) size 4x19 + text run at (58,0) width 4: " " LayoutInline {SPAN} at (0,0) size 10x19 LayoutInline {<pseudo:before>} at (0,0) size 10x19 - LayoutCounter (anonymous) at (75,0) size 10x19 - text run at (75,0) width 10: "F" - LayoutText {#text} at (84,0) size 5x19 - text run at (84,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (88,0) size 13x19 - text run at (88,0) width 13: "G" - LayoutText {#text} at (100,0) size 5x19 - text run at (100,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (104,0) size 13x19 - text run at (104,0) width 13: "H" - LayoutText {#text} at (116,0) size 5x19 - text run at (116,0) width 5: " " + LayoutCounter (anonymous) at (62,0) size 10x19 + text run at (62,0) width 10: "E" + LayoutText {#text} at (72,0) size 4x19 + text run at (72,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 9x19 + LayoutInline {<pseudo:before>} at (0,0) size 9x19 + LayoutCounter (anonymous) at (76,0) size 9x19 + text run at (76,0) width 9: "F" + LayoutText {#text} at (85,0) size 4x19 + text run at (85,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (89,0) size 12x19 + text run at (89,0) width 12: "G" + LayoutText {#text} at (101,0) size 4x19 + text run at (101,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (105,0) size 12x19 + text run at (105,0) width 12: "H" + LayoutText {#text} at (117,0) size 4x19 + text run at (117,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 5x19 + LayoutInline {<pseudo:before>} at (0,0) size 5x19 + LayoutCounter (anonymous) at (121,0) size 5x19 + text run at (121,0) width 5: "I" + LayoutText {#text} at (126,0) size 4x19 + text run at (126,0) width 4: " " LayoutInline {SPAN} at (0,0) size 6x19 LayoutInline {<pseudo:before>} at (0,0) size 6x19 - LayoutCounter (anonymous) at (120,0) size 6x19 - text run at (120,0) width 6: "I" - LayoutText {#text} at (125,0) size 5x19 - text run at (125,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 7x19 - LayoutInline {<pseudo:before>} at (0,0) size 7x19 - LayoutCounter (anonymous) at (129,0) size 7x19 - text run at (129,0) width 7: "J" - LayoutText {#text} at (135,0) size 5x19 - text run at (135,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 13x19 - LayoutInline {<pseudo:before>} at (0,0) size 13x19 - LayoutCounter (anonymous) at (139,0) size 13x19 - text run at (139,0) width 13: "K" - LayoutText {#text} at (151,0) size 5x19 - text run at (151,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 11x19 - LayoutInline {<pseudo:before>} at (0,0) size 11x19 - LayoutCounter (anonymous) at (155,0) size 11x19 - text run at (155,0) width 11: "L" + LayoutCounter (anonymous) at (130,0) size 6x19 + text run at (130,0) width 6: "J" + LayoutText {#text} at (136,0) size 4x19 + text run at (136,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 12x19 + LayoutInline {<pseudo:before>} at (0,0) size 12x19 + LayoutCounter (anonymous) at (140,0) size 12x19 + text run at (140,0) width 12: "K" + LayoutText {#text} at (152,0) size 4x19 + text run at (152,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 10x19 + LayoutInline {<pseudo:before>} at (0,0) size 10x19 + LayoutCounter (anonymous) at (156,0) size 10x19 + text run at (156,0) width 10: "L" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 166x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-16-f-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-16-f-expected.txt index 68c8b78..f190c6d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-16-f-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counter-16-f-expected.txt
@@ -71,12 +71,12 @@ LayoutInline {<pseudo:before>} at (0,0) size 16x19 LayoutCounter (anonymous) at (128,0) size 16x19 text run at (128,0) width 16: "11" - LayoutText {#text} at (143,0) size 5x19 - text run at (143,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (147,0) size 17x19 - text run at (147,0) width 17: "12" + LayoutText {#text} at (144,0) size 4x19 + text run at (144,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (148,0) size 16x19 + text run at (148,0) width 16: "12" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 164x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-00-b-expected.txt index af7050d..f3910b2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-00-b-expected.txt
@@ -71,12 +71,12 @@ LayoutInline {<pseudo:before>} at (0,0) size 28x19 LayoutCounter (anonymous) at (248,0) size 28x19 text run at (248,0) width 28: "1.11" - LayoutText {#text} at (275,0) size 5x19 - text run at (275,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutInline {<pseudo:before>} at (0,0) size 29x19 - LayoutCounter (anonymous) at (279,0) size 29x19 - text run at (279,0) width 29: "1.12" + LayoutText {#text} at (276,0) size 4x19 + text run at (276,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (280,0) size 28x19 + text run at (280,0) width 28: "1.12" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 308x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-01-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-01-b-expected.txt index 4600549..13ee75d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-01-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-01-b-expected.txt
@@ -9,8 +9,8 @@ LayoutInline {EM} at (0,0) size 91x19 LayoutText {#text} at (233,0) size 91x19 text run at (233,0) width 91: "approximately" - LayoutText {#text} at (323,0) size 64x19 - text run at (323,0) width 64: " the same:" + LayoutText {#text} at (324,0) size 63x19 + text run at (324,0) width 63: " the same:" LayoutNGBlockFlow {DIV} at (0,36) size 784x20 LayoutInline {SPAN} at (0,0) size 11x19 LayoutInline {<pseudo:before>} at (0,0) size 11x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-02-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-02-b-expected.txt index c46060a7..b1b95af 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-02-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-02-b-expected.txt
@@ -9,8 +9,8 @@ LayoutInline {EM} at (0,0) size 91x19 LayoutText {#text} at (233,0) size 91x19 text run at (233,0) width 91: "approximately" - LayoutText {#text} at (323,0) size 64x19 - text run at (323,0) width 64: " the same:" + LayoutText {#text} at (324,0) size 63x19 + text run at (324,0) width 63: " the same:" LayoutNGBlockFlow {DIV} at (0,36) size 784x20 LayoutInline {SPAN} at (0,0) size 16x19 LayoutInline {<pseudo:before>} at (0,0) size 16x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-03-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-03-b-expected.txt index abce7c92..06714a9b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-03-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-03-b-expected.txt
@@ -9,8 +9,8 @@ LayoutInline {EM} at (0,0) size 91x19 LayoutText {#text} at (233,0) size 91x19 text run at (233,0) width 91: "approximately" - LayoutText {#text} at (323,0) size 64x19 - text run at (323,0) width 64: " the same:" + LayoutText {#text} at (324,0) size 63x19 + text run at (324,0) width 63: " the same:" LayoutNGBlockFlow {DIV} at (0,36) size 784x20 LayoutInline {SPAN} at (0,0) size 16x19 LayoutInline {<pseudo:before>} at (0,0) size 16x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-05-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-05-b-expected.txt index af7050d..f3910b2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-05-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-05-b-expected.txt
@@ -71,12 +71,12 @@ LayoutInline {<pseudo:before>} at (0,0) size 28x19 LayoutCounter (anonymous) at (248,0) size 28x19 text run at (248,0) width 28: "1.11" - LayoutText {#text} at (275,0) size 5x19 - text run at (275,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutInline {<pseudo:before>} at (0,0) size 29x19 - LayoutCounter (anonymous) at (279,0) size 29x19 - text run at (279,0) width 29: "1.12" + LayoutText {#text} at (276,0) size 4x19 + text run at (276,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (280,0) size 28x19 + text run at (280,0) width 28: "1.12" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 308x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-06-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-06-b-expected.txt index 9d9b1a9..922c2d0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-06-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-06-b-expected.txt
@@ -71,30 +71,30 @@ LayoutInline {<pseudo:before>} at (0,0) size 36x19 LayoutCounter (anonymous) at (400,0) size 36x19 text run at (400,0) width 36: "01.11" - LayoutText {#text} at (435,0) size 5x19 - text run at (435,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 37x19 - LayoutInline {<pseudo:before>} at (0,0) size 37x19 - LayoutCounter (anonymous) at (439,0) size 37x19 - text run at (439,0) width 37: "01.12" - LayoutText {#text} at (475,0) size 5x19 - text run at (475,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 37x19 - LayoutInline {<pseudo:before>} at (0,0) size 37x19 - LayoutCounter (anonymous) at (479,0) size 37x19 - text run at (479,0) width 37: "01.99" - LayoutText {#text} at (515,0) size 5x19 - text run at (515,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 45x19 - LayoutInline {<pseudo:before>} at (0,0) size 45x19 - LayoutCounter (anonymous) at (519,0) size 45x19 - text run at (519,0) width 45: "01.100" - LayoutText {#text} at (563,0) size 5x19 - text run at (563,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 45x19 - LayoutInline {<pseudo:before>} at (0,0) size 45x19 - LayoutCounter (anonymous) at (567,0) size 45x19 - text run at (567,0) width 45: "01.101" + LayoutText {#text} at (436,0) size 4x19 + text run at (436,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 36x19 + LayoutInline {<pseudo:before>} at (0,0) size 36x19 + LayoutCounter (anonymous) at (440,0) size 36x19 + text run at (440,0) width 36: "01.12" + LayoutText {#text} at (476,0) size 4x19 + text run at (476,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 36x19 + LayoutInline {<pseudo:before>} at (0,0) size 36x19 + LayoutCounter (anonymous) at (480,0) size 36x19 + text run at (480,0) width 36: "01.99" + LayoutText {#text} at (516,0) size 4x19 + text run at (516,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 44x19 + LayoutInline {<pseudo:before>} at (0,0) size 44x19 + LayoutCounter (anonymous) at (520,0) size 44x19 + text run at (520,0) width 44: "01.100" + LayoutText {#text} at (564,0) size 4x19 + text run at (564,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 44x19 + LayoutInline {<pseudo:before>} at (0,0) size 44x19 + LayoutCounter (anonymous) at (568,0) size 44x19 + text run at (568,0) width 44: "01.101" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 612x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.png index 2a426d4..e1dbaa66 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.txt index af174712..adae94e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-08-b-expected.txt
@@ -29,97 +29,97 @@ LayoutInline {<pseudo:before>} at (0,0) size 26x19 LayoutCounter (anonymous) at (69,0) size 26x19 text run at (69,0) width 26: "I.IV" - LayoutText {#text} at (94,0) size 5x19 - text run at (94,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 22x19 - LayoutInline {<pseudo:before>} at (0,0) size 22x19 - LayoutCounter (anonymous) at (98,0) size 22x19 - text run at (98,0) width 22: "I.V" - LayoutText {#text} at (119,0) size 5x19 - text run at (119,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 27x19 - LayoutInline {<pseudo:before>} at (0,0) size 27x19 - LayoutCounter (anonymous) at (123,0) size 27x19 - text run at (123,0) width 27: "I.VI" - LayoutText {#text} at (149,0) size 5x19 - text run at (149,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 32x19 - LayoutInline {<pseudo:before>} at (0,0) size 32x19 - LayoutCounter (anonymous) at (153,0) size 32x19 - text run at (153,0) width 32: "I.VII" - LayoutText {#text} at (184,0) size 5x19 - text run at (184,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 37x19 - LayoutInline {<pseudo:before>} at (0,0) size 37x19 - LayoutCounter (anonymous) at (188,0) size 37x19 - text run at (188,0) width 37: "I.VIII" - LayoutText {#text} at (224,0) size 5x19 - text run at (224,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 27x19 - LayoutInline {<pseudo:before>} at (0,0) size 27x19 - LayoutCounter (anonymous) at (228,0) size 27x19 - text run at (228,0) width 27: "I.IX" - LayoutText {#text} at (254,0) size 5x19 - text run at (254,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 22x19 - LayoutInline {<pseudo:before>} at (0,0) size 22x19 - LayoutCounter (anonymous) at (258,0) size 22x19 - text run at (258,0) width 22: "I.X" - LayoutText {#text} at (279,0) size 5x19 - text run at (279,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 27x19 - LayoutInline {<pseudo:before>} at (0,0) size 27x19 - LayoutCounter (anonymous) at (283,0) size 27x19 - text run at (283,0) width 27: "I.XI" - LayoutText {#text} at (309,0) size 5x19 - text run at (309,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 32x19 - LayoutInline {<pseudo:before>} at (0,0) size 32x19 - LayoutCounter (anonymous) at (313,0) size 32x19 - text run at (313,0) width 32: "I.XII" - LayoutText {#text} at (344,0) size 5x19 - text run at (344,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 49x19 - LayoutInline {<pseudo:before>} at (0,0) size 49x19 - LayoutCounter (anonymous) at (348,0) size 49x19 - text run at (348,0) width 49: "I.XLIX" - LayoutText {#text} at (396,0) size 5x19 - text run at (396,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 20x19 - LayoutInline {<pseudo:before>} at (0,0) size 20x19 - LayoutCounter (anonymous) at (400,0) size 20x19 - text run at (400,0) width 20: "I.L" - LayoutText {#text} at (419,0) size 4x19 - text run at (419,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 106x19 - LayoutInline {<pseudo:before>} at (0,0) size 106x19 - LayoutCounter (anonymous) at (422,0) size 106x19 - text run at (422,0) width 106: "I.CCCLXXXIX" - LayoutText {#text} at (527,0) size 5x19 - text run at (527,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 66x19 - LayoutInline {<pseudo:before>} at (0,0) size 66x19 - LayoutCounter (anonymous) at (531,0) size 66x19 - text run at (531,0) width 66: "I.CCCXC" - LayoutText {#text} at (596,0) size 5x19 - text run at (596,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 138x19 - LayoutInline {<pseudo:before>} at (0,0) size 138x19 - LayoutCounter (anonymous) at (600,0) size 138x19 - text run at (600,0) width 138: "I.MMMCDLXXXIX" - LayoutText {#text} at (737,0) size 5x19 - text run at (737,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 98x19 - LayoutInline {<pseudo:before>} at (0,0) size 98x19 - LayoutCounter (anonymous) at (741,0) size 98x19 - text run at (741,0) width 98: "I.MMMCDXC" - LayoutText {#text} at (838,0) size 5x19 - text run at (838,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 103x19 - LayoutInline {<pseudo:before>} at (0,0) size 103x19 - LayoutCounter (anonymous) at (842,0) size 103x19 - text run at (842,0) width 103: "I.MMMCDXCI" + LayoutText {#text} at (95,0) size 4x19 + text run at (95,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 21x19 + LayoutInline {<pseudo:before>} at (0,0) size 21x19 + LayoutCounter (anonymous) at (99,0) size 21x19 + text run at (99,0) width 21: "I.V" + LayoutText {#text} at (120,0) size 4x19 + text run at (120,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 26x19 + LayoutInline {<pseudo:before>} at (0,0) size 26x19 + LayoutCounter (anonymous) at (124,0) size 26x19 + text run at (124,0) width 26: "I.VI" + LayoutText {#text} at (150,0) size 4x19 + text run at (150,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 31x19 + LayoutInline {<pseudo:before>} at (0,0) size 31x19 + LayoutCounter (anonymous) at (154,0) size 31x19 + text run at (154,0) width 31: "I.VII" + LayoutText {#text} at (185,0) size 4x19 + text run at (185,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 36x19 + LayoutInline {<pseudo:before>} at (0,0) size 36x19 + LayoutCounter (anonymous) at (189,0) size 36x19 + text run at (189,0) width 36: "I.VIII" + LayoutText {#text} at (225,0) size 4x19 + text run at (225,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 26x19 + LayoutInline {<pseudo:before>} at (0,0) size 26x19 + LayoutCounter (anonymous) at (229,0) size 26x19 + text run at (229,0) width 26: "I.IX" + LayoutText {#text} at (255,0) size 4x19 + text run at (255,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 21x19 + LayoutInline {<pseudo:before>} at (0,0) size 21x19 + LayoutCounter (anonymous) at (259,0) size 21x19 + text run at (259,0) width 21: "I.X" + LayoutText {#text} at (280,0) size 4x19 + text run at (280,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 26x19 + LayoutInline {<pseudo:before>} at (0,0) size 26x19 + LayoutCounter (anonymous) at (284,0) size 26x19 + text run at (284,0) width 26: "I.XI" + LayoutText {#text} at (310,0) size 4x19 + text run at (310,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 31x19 + LayoutInline {<pseudo:before>} at (0,0) size 31x19 + LayoutCounter (anonymous) at (314,0) size 31x19 + text run at (314,0) width 31: "I.XII" + LayoutText {#text} at (345,0) size 4x19 + text run at (345,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 48x19 + LayoutInline {<pseudo:before>} at (0,0) size 48x19 + LayoutCounter (anonymous) at (349,0) size 48x19 + text run at (349,0) width 48: "I.XLIX" + LayoutText {#text} at (397,0) size 4x19 + text run at (397,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 19x19 + LayoutInline {<pseudo:before>} at (0,0) size 19x19 + LayoutCounter (anonymous) at (401,0) size 19x19 + text run at (401,0) width 19: "I.L" + LayoutText {#text} at (420,0) size 4x19 + text run at (420,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 105x19 + LayoutInline {<pseudo:before>} at (0,0) size 105x19 + LayoutCounter (anonymous) at (424,0) size 105x19 + text run at (424,0) width 105: "I.CCCLXXXIX" + LayoutText {#text} at (529,0) size 4x19 + text run at (529,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 65x19 + LayoutInline {<pseudo:before>} at (0,0) size 65x19 + LayoutCounter (anonymous) at (533,0) size 65x19 + text run at (533,0) width 65: "I.CCCXC" + LayoutText {#text} at (598,0) size 4x19 + text run at (598,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 137x19 + LayoutInline {<pseudo:before>} at (0,0) size 137x19 + LayoutCounter (anonymous) at (602,0) size 137x19 + text run at (602,0) width 137: "I.MMMCDLXXXIX" + LayoutText {#text} at (739,0) size 4x19 + text run at (739,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 97x19 + LayoutInline {<pseudo:before>} at (0,0) size 97x19 + LayoutCounter (anonymous) at (743,0) size 97x19 + text run at (743,0) width 97: "I.MMMCDXC" + LayoutText {#text} at (840,0) size 4x19 + text run at (840,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 102x19 + LayoutInline {<pseudo:before>} at (0,0) size 102x19 + LayoutCounter (anonymous) at (844,0) size 102x19 + text run at (844,0) width 102: "I.MMMCDXCI" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 945x19 - text run at (0,0) width 945: "I.I I.II I.III I.IV I.V I.VI I.VII I.VIII I.IX I.X I.XI I.XII I.XLIX I.L I.CCCLXXXIX I.CCCXC I.MMMCDLXXXIX I.MMMCDXC I.MMMCDXCI" + LayoutText {#text} at (0,0) size 946x19 + text run at (0,0) width 946: "I.I I.II I.III I.IV I.V I.VI I.VII I.VIII I.IX I.X I.XI I.XII I.XLIX I.L I.CCCLXXXIX I.CCCXC I.MMMCDLXXXIX I.MMMCDXC I.MMMCDXCI"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.png index 6f9e2d0..68f26064 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.txt index 6556c4f..dc95e2b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-13-b-expected.txt
@@ -11,73 +11,73 @@ LayoutInline {<pseudo:before>} at (0,0) size 28x19 LayoutCounter (anonymous) at (0,0) size 28x19 text run at (0,0) width 28: "A.A" - LayoutText {#text} at (27,0) size 4x19 - text run at (27,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (30,0) size 28x19 - text run at (30,0) width 28: "A.B" - LayoutText {#text} at (57,0) size 4x19 - text run at (57,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (60,0) size 28x19 - text run at (60,0) width 28: "A.C" - LayoutText {#text} at (87,0) size 4x19 - text run at (87,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutInline {<pseudo:before>} at (0,0) size 29x19 - LayoutCounter (anonymous) at (90,0) size 29x19 - text run at (90,0) width 29: "A.D" - LayoutText {#text} at (118,0) size 5x19 - text run at (118,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 26x19 - LayoutInline {<pseudo:before>} at (0,0) size 26x19 - LayoutCounter (anonymous) at (122,0) size 26x19 - text run at (122,0) width 26: "A.E" - LayoutText {#text} at (147,0) size 5x19 - text run at (147,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 25x19 - LayoutInline {<pseudo:before>} at (0,0) size 25x19 - LayoutCounter (anonymous) at (151,0) size 25x19 - text run at (151,0) width 25: "A.F" - LayoutText {#text} at (175,0) size 5x19 - text run at (175,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (179,0) size 28x19 - text run at (179,0) width 28: "A.G" - LayoutText {#text} at (206,0) size 5x19 - text run at (206,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (210,0) size 28x19 - text run at (210,0) width 28: "A.H" - LayoutText {#text} at (238,0) size 4x19 - text run at (238,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 22x19 - LayoutInline {<pseudo:before>} at (0,0) size 22x19 - LayoutCounter (anonymous) at (241,0) size 22x19 - text run at (241,0) width 22: "A.I" - LayoutText {#text} at (262,0) size 4x19 - text run at (262,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 23x19 - LayoutInline {<pseudo:before>} at (0,0) size 23x19 - LayoutCounter (anonymous) at (265,0) size 23x19 - text run at (265,0) width 23: "A.J" - LayoutText {#text} at (287,0) size 4x19 - text run at (287,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutInline {<pseudo:before>} at (0,0) size 29x19 - LayoutCounter (anonymous) at (290,0) size 29x19 - text run at (290,0) width 29: "A.K" - LayoutText {#text} at (318,0) size 4x19 - text run at (318,0) width 4: " " + LayoutText {#text} at (28,0) size 3x19 + text run at (28,0) width 3: " " LayoutInline {SPAN} at (0,0) size 27x19 LayoutInline {<pseudo:before>} at (0,0) size 27x19 - LayoutCounter (anonymous) at (321,0) size 27x19 - text run at (321,0) width 27: "A.L" + LayoutCounter (anonymous) at (31,0) size 27x19 + text run at (31,0) width 27: "A.B" + LayoutText {#text} at (58,0) size 4x19 + text run at (58,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 27x19 + LayoutInline {<pseudo:before>} at (0,0) size 27x19 + LayoutCounter (anonymous) at (62,0) size 27x19 + text run at (62,0) width 27: "A.C" + LayoutText {#text} at (89,0) size 4x19 + text run at (89,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (93,0) size 28x19 + text run at (93,0) width 28: "A.D" + LayoutText {#text} at (121,0) size 4x19 + text run at (121,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 26x19 + LayoutInline {<pseudo:before>} at (0,0) size 26x19 + LayoutCounter (anonymous) at (125,0) size 26x19 + text run at (125,0) width 26: "A.E" + LayoutText {#text} at (151,0) size 4x19 + text run at (151,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 25x19 + LayoutInline {<pseudo:before>} at (0,0) size 25x19 + LayoutCounter (anonymous) at (155,0) size 25x19 + text run at (155,0) width 25: "A.F" + LayoutText {#text} at (180,0) size 4x19 + text run at (180,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (184,0) size 28x19 + text run at (184,0) width 28: "A.G" + LayoutText {#text} at (212,0) size 4x19 + text run at (212,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (216,0) size 28x19 + text run at (216,0) width 28: "A.H" + LayoutText {#text} at (244,0) size 4x19 + text run at (244,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 21x19 + LayoutInline {<pseudo:before>} at (0,0) size 21x19 + LayoutCounter (anonymous) at (248,0) size 21x19 + text run at (248,0) width 21: "A.I" + LayoutText {#text} at (269,0) size 4x19 + text run at (269,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 22x19 + LayoutInline {<pseudo:before>} at (0,0) size 22x19 + LayoutCounter (anonymous) at (273,0) size 22x19 + text run at (273,0) width 22: "A.J" + LayoutText {#text} at (295,0) size 4x19 + text run at (295,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (299,0) size 28x19 + text run at (299,0) width 28: "A.K" + LayoutText {#text} at (327,0) size 4x19 + text run at (327,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 26x19 + LayoutInline {<pseudo:before>} at (0,0) size 26x19 + LayoutCounter (anonymous) at (331,0) size 26x19 + text run at (331,0) width 26: "A.L" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 348x19 - text run at (0,0) width 348: "A.A A.B A.C A.D A.E A.F A.G A.H A.I A.J A.K A.L" + LayoutText {#text} at (0,0) size 357x19 + text run at (0,0) width 357: "A.A A.B A.C A.D A.E A.F A.G A.H A.I A.J A.K A.L"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.png index 6f9e2d0..68f26064 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.txt index 6556c4f..dc95e2b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-14-b-expected.txt
@@ -11,73 +11,73 @@ LayoutInline {<pseudo:before>} at (0,0) size 28x19 LayoutCounter (anonymous) at (0,0) size 28x19 text run at (0,0) width 28: "A.A" - LayoutText {#text} at (27,0) size 4x19 - text run at (27,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (30,0) size 28x19 - text run at (30,0) width 28: "A.B" - LayoutText {#text} at (57,0) size 4x19 - text run at (57,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (60,0) size 28x19 - text run at (60,0) width 28: "A.C" - LayoutText {#text} at (87,0) size 4x19 - text run at (87,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutInline {<pseudo:before>} at (0,0) size 29x19 - LayoutCounter (anonymous) at (90,0) size 29x19 - text run at (90,0) width 29: "A.D" - LayoutText {#text} at (118,0) size 5x19 - text run at (118,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 26x19 - LayoutInline {<pseudo:before>} at (0,0) size 26x19 - LayoutCounter (anonymous) at (122,0) size 26x19 - text run at (122,0) width 26: "A.E" - LayoutText {#text} at (147,0) size 5x19 - text run at (147,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 25x19 - LayoutInline {<pseudo:before>} at (0,0) size 25x19 - LayoutCounter (anonymous) at (151,0) size 25x19 - text run at (151,0) width 25: "A.F" - LayoutText {#text} at (175,0) size 5x19 - text run at (175,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (179,0) size 28x19 - text run at (179,0) width 28: "A.G" - LayoutText {#text} at (206,0) size 5x19 - text run at (206,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 28x19 - LayoutInline {<pseudo:before>} at (0,0) size 28x19 - LayoutCounter (anonymous) at (210,0) size 28x19 - text run at (210,0) width 28: "A.H" - LayoutText {#text} at (238,0) size 4x19 - text run at (238,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 22x19 - LayoutInline {<pseudo:before>} at (0,0) size 22x19 - LayoutCounter (anonymous) at (241,0) size 22x19 - text run at (241,0) width 22: "A.I" - LayoutText {#text} at (262,0) size 4x19 - text run at (262,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 23x19 - LayoutInline {<pseudo:before>} at (0,0) size 23x19 - LayoutCounter (anonymous) at (265,0) size 23x19 - text run at (265,0) width 23: "A.J" - LayoutText {#text} at (287,0) size 4x19 - text run at (287,0) width 4: " " - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutInline {<pseudo:before>} at (0,0) size 29x19 - LayoutCounter (anonymous) at (290,0) size 29x19 - text run at (290,0) width 29: "A.K" - LayoutText {#text} at (318,0) size 4x19 - text run at (318,0) width 4: " " + LayoutText {#text} at (28,0) size 3x19 + text run at (28,0) width 3: " " LayoutInline {SPAN} at (0,0) size 27x19 LayoutInline {<pseudo:before>} at (0,0) size 27x19 - LayoutCounter (anonymous) at (321,0) size 27x19 - text run at (321,0) width 27: "A.L" + LayoutCounter (anonymous) at (31,0) size 27x19 + text run at (31,0) width 27: "A.B" + LayoutText {#text} at (58,0) size 4x19 + text run at (58,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 27x19 + LayoutInline {<pseudo:before>} at (0,0) size 27x19 + LayoutCounter (anonymous) at (62,0) size 27x19 + text run at (62,0) width 27: "A.C" + LayoutText {#text} at (89,0) size 4x19 + text run at (89,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (93,0) size 28x19 + text run at (93,0) width 28: "A.D" + LayoutText {#text} at (121,0) size 4x19 + text run at (121,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 26x19 + LayoutInline {<pseudo:before>} at (0,0) size 26x19 + LayoutCounter (anonymous) at (125,0) size 26x19 + text run at (125,0) width 26: "A.E" + LayoutText {#text} at (151,0) size 4x19 + text run at (151,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 25x19 + LayoutInline {<pseudo:before>} at (0,0) size 25x19 + LayoutCounter (anonymous) at (155,0) size 25x19 + text run at (155,0) width 25: "A.F" + LayoutText {#text} at (180,0) size 4x19 + text run at (180,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (184,0) size 28x19 + text run at (184,0) width 28: "A.G" + LayoutText {#text} at (212,0) size 4x19 + text run at (212,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (216,0) size 28x19 + text run at (216,0) width 28: "A.H" + LayoutText {#text} at (244,0) size 4x19 + text run at (244,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 21x19 + LayoutInline {<pseudo:before>} at (0,0) size 21x19 + LayoutCounter (anonymous) at (248,0) size 21x19 + text run at (248,0) width 21: "A.I" + LayoutText {#text} at (269,0) size 4x19 + text run at (269,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 22x19 + LayoutInline {<pseudo:before>} at (0,0) size 22x19 + LayoutCounter (anonymous) at (273,0) size 22x19 + text run at (273,0) width 22: "A.J" + LayoutText {#text} at (295,0) size 4x19 + text run at (295,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (299,0) size 28x19 + text run at (299,0) width 28: "A.K" + LayoutText {#text} at (327,0) size 4x19 + text run at (327,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 26x19 + LayoutInline {<pseudo:before>} at (0,0) size 26x19 + LayoutCounter (anonymous) at (331,0) size 26x19 + text run at (331,0) width 26: "A.L" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 348x19 - text run at (0,0) width 348: "A.A A.B A.C A.D A.E A.F A.G A.H A.I A.J A.K A.L" + LayoutText {#text} at (0,0) size 357x19 + text run at (0,0) width 357: "A.A A.B A.C A.D A.E A.F A.G A.H A.I A.J A.K A.L"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-18-f-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-18-f-expected.txt index af7050d..f3910b2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-18-f-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1202-counters-18-f-expected.txt
@@ -71,12 +71,12 @@ LayoutInline {<pseudo:before>} at (0,0) size 28x19 LayoutCounter (anonymous) at (248,0) size 28x19 text run at (248,0) width 28: "1.11" - LayoutText {#text} at (275,0) size 5x19 - text run at (275,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutInline {<pseudo:before>} at (0,0) size 29x19 - LayoutCounter (anonymous) at (279,0) size 29x19 - text run at (279,0) width 29: "1.12" + LayoutText {#text} at (276,0) size 4x19 + text run at (276,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutInline {<pseudo:before>} at (0,0) size 28x19 + LayoutCounter (anonymous) at (280,0) size 28x19 + text run at (280,0) width 28: "1.12" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 308x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-00-c-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-00-c-expected.txt index a2892d3..7edb143b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-00-c-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-00-c-expected.txt
@@ -89,34 +89,34 @@ LayoutInline {<pseudo:before>} at (0,0) size 16x19 LayoutCounter (anonymous) at (140,0) size 16x19 text run at (140,0) width 16: "11" - LayoutText {#text} at (155,0) size 5x19 - text run at (155,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (159,0) size 17x19 - text run at (159,0) width 17: "12" - LayoutText {#text} at (175,0) size 5x19 - text run at (175,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (179,0) size 17x19 - text run at (179,0) width 17: "12" - LayoutText {#text} at (195,0) size 5x19 - text run at (195,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (199,0) size 17x19 - text run at (199,0) width 17: "12" - LayoutText {#text} at (215,0) size 5x19 - text run at (215,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 17x19 - LayoutCounter (anonymous) at (219,0) size 17x19 - text run at (219,0) width 17: "12" + LayoutText {#text} at (156,0) size 4x19 + text run at (156,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (160,0) size 16x19 + text run at (160,0) width 16: "12" + LayoutText {#text} at (176,0) size 4x19 + text run at (176,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (180,0) size 16x19 + text run at (180,0) width 16: "12" + LayoutText {#text} at (196,0) size 4x19 + text run at (196,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (200,0) size 16x19 + text run at (200,0) width 16: "12" + LayoutText {#text} at (216,0) size 4x19 + text run at (216,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 16x19 + LayoutCounter (anonymous) at (220,0) size 16x19 + text run at (220,0) width 16: "12" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 236x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.png index 466f317..8e8a535b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.txt index 07b0354..4469976 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1204-order-01-d-expected.txt
@@ -4,15 +4,15 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x191 LayoutNGBlockFlow {BODY} at (8,16) size 784x167 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 727x19 - text run at (0,0) width 727: "You should see nine boxes below, each just containing a unique multiple of eleven, from 11 to 99, and nothing else." + LayoutText {#text} at (0,0) size 726x19 + text run at (0,0) width 726: "You should see nine boxes below, each just containing a unique multiple of eleven, from 11 to 99, and nothing else." LayoutNGBlockFlow {UL} at (0,36) size 784x131 LayoutNGBlockFlow {LI} at (0,0) size 50x22 [border: (1px solid #000000)] LayoutInline {<pseudo:before>} at (0,0) size 8x19 LayoutCounter (anonymous) at (1,1) size 8x19 text run at (1,1) width 8: "1" - LayoutText {#text} at (8,1) size 9x19 - text run at (8,1) width 9: "1" + LayoutText {#text} at (9,1) size 8x19 + text run at (9,1) width 8: "1" LayoutNGBlockFlow (floating) {LI} at (0,22) size 50x22 [border: (1px solid #000000)] LayoutInline {<pseudo:before>} at (0,0) size 8x19 LayoutCounter (anonymous) at (1,1) size 8x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.png index c7eb0ae..9e63e18 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.txt index 410966e..9c24686 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t120401-scope-00-b-expected.txt
@@ -7,7 +7,7 @@ LayoutText {#text} at (0,0) size 227x19 text run at (0,0) width 227: "The next 2 lines should be identical:" LayoutNGBlockFlow {DIV} at (0,36) size 784x20 - LayoutInline {SPAN} at (0,0) size 40x19 + LayoutInline {SPAN} at (0,0) size 39x19 LayoutInline {<pseudo:before>} at (0,0) size 8x19 LayoutCounter (anonymous) at (0,0) size 8x19 text run at (0,0) width 8: "1" @@ -23,38 +23,38 @@ LayoutInline {<pseudo:before>} at (0,0) size 8x19 LayoutCounter (anonymous) at (24,0) size 8x19 text run at (24,0) width 8: "1" - LayoutInline {<pseudo:after>} at (0,0) size 9x19 - LayoutCounter (anonymous) at (31,0) size 9x19 - text run at (31,0) width 9: "1" + LayoutInline {<pseudo:after>} at (0,0) size 7x19 + LayoutCounter (anonymous) at (32,0) size 7x19 + text run at (32,0) width 7: "1" LayoutInline {SPAN} at (0,0) size 8x19 LayoutInline {<pseudo:before>} at (0,0) size 8x19 LayoutCounter (anonymous) at (39,0) size 8x19 text run at (39,0) width 8: "1" - LayoutText {#text} at (46,0) size 5x19 - text run at (46,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 41x19 - LayoutInline {<pseudo:before>} at (0,0) size 9x19 - LayoutCounter (anonymous) at (50,0) size 9x19 - text run at (50,0) width 9: "1" - LayoutInline {SPAN} at (0,0) size 17x19 - LayoutInline {<pseudo:before>} at (0,0) size 9x19 - LayoutCounter (anonymous) at (58,0) size 9x19 - text run at (58,0) width 9: "3" - LayoutInline {SPAN} at (0,0) size 9x19 - LayoutInline {<pseudo:before>} at (0,0) size 9x19 - LayoutCounter (anonymous) at (66,0) size 9x19 - text run at (66,0) width 9: "3" - LayoutInline {SPAN} at (0,0) size 9x19 - LayoutInline {<pseudo:before>} at (0,0) size 9x19 - LayoutCounter (anonymous) at (74,0) size 9x19 - text run at (74,0) width 9: "3" - LayoutInline {<pseudo:after>} at (0,0) size 9x19 - LayoutCounter (anonymous) at (82,0) size 9x19 - text run at (82,0) width 9: "3" - LayoutInline {SPAN} at (0,0) size 9x19 - LayoutInline {<pseudo:before>} at (0,0) size 9x19 - LayoutCounter (anonymous) at (90,0) size 9x19 - text run at (90,0) width 9: "1" + LayoutText {#text} at (47,0) size 4x19 + text run at (47,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 40x19 + LayoutInline {<pseudo:before>} at (0,0) size 8x19 + LayoutCounter (anonymous) at (51,0) size 8x19 + text run at (51,0) width 8: "1" + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {<pseudo:before>} at (0,0) size 8x19 + LayoutCounter (anonymous) at (59,0) size 8x19 + text run at (59,0) width 8: "3" + LayoutInline {SPAN} at (0,0) size 8x19 + LayoutInline {<pseudo:before>} at (0,0) size 8x19 + LayoutCounter (anonymous) at (67,0) size 8x19 + text run at (67,0) width 8: "3" + LayoutInline {SPAN} at (0,0) size 8x19 + LayoutInline {<pseudo:before>} at (0,0) size 8x19 + LayoutCounter (anonymous) at (75,0) size 8x19 + text run at (75,0) width 8: "3" + LayoutInline {<pseudo:after>} at (0,0) size 8x19 + LayoutCounter (anonymous) at (83,0) size 8x19 + text run at (83,0) width 8: "3" + LayoutInline {SPAN} at (0,0) size 8x19 + LayoutInline {<pseudo:before>} at (0,0) size 8x19 + LayoutCounter (anonymous) at (91,0) size 8x19 + text run at (91,0) width 8: "1" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 99x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c561-list-displ-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c561-list-displ-00-b-expected.txt index 8d9bb5ad..f6d1639 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c561-list-displ-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c561-list-displ-00-b-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x220 LayoutNGBlockFlow {BODY} at (8,16) size 784x196 LayoutNGBlockFlow {P} at (0,0) size 784x20 [color=#000080] - LayoutText {#text} at (0,0) size 756x19 - text run at (0,0) width 756: "There should be eight numbered lines below, all identical except for the numbering, which should match the description." + LayoutText {#text} at (0,0) size 755x19 + text run at (0,0) width 755: "There should be eight numbered lines below, all identical except for the numbering, which should match the description." LayoutNGListItem {DIV} at (0,36) size 784x20 [color=#000080] LayoutInline (anonymous) at (0,0) size 16x19 LayoutText (anonymous) at (0,0) size 16x19 text run at (0,0) width 16: "1. " - LayoutText {#text} at (15,0) size 152x19 - text run at (15,0) width 152: "This should be line one." + LayoutText {#text} at (16,0) size 151x19 + text run at (16,0) width 151: "This should be line one." LayoutNGBlockFlow {DIV} at (0,56) size 784x20 [color=#000080] LayoutText {#text} at (0,0) size 168x19 text run at (0,0) width 168: "2. This should be line two." @@ -20,13 +20,13 @@ LayoutText {#text} at (0,0) size 94x19 text run at (0,0) width 94: "3. This should " LayoutText {#text} at (0,0) size 0x0 - LayoutInline {DIV} at (0,0) size 82x19 [color=#000080] - LayoutText {#text} at (93,0) size 82x19 - text run at (93,0) width 82: "be line three." + LayoutInline {DIV} at (0,0) size 81x19 [color=#000080] + LayoutText {#text} at (94,0) size 81x19 + text run at (94,0) width 81: "be line three." LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,96) size 784x20 [color=#000080] - LayoutText {#text} at (0,0) size 169x19 - text run at (0,0) width 169: "4. This should be line four." + LayoutText {#text} at (0,0) size 170x19 + text run at (0,0) width 170: "4. This should be line four." LayoutNGBlockFlow {DIV} at (0,116) size 784x20 [color=#000080] LayoutText {#text} at (0,0) size 168x19 text run at (0,0) width 168: "5. This should be line five."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c565-list-pos-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c565-list-pos-00-b-expected.txt index 15f05db5..11c733d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c565-list-pos-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c565-list-pos-00-b-expected.txt
@@ -14,13 +14,13 @@ LayoutInline {SPAN} at (0,0) size 12x19 [color=#000080] LayoutText {#text} at (0,0) size 12x19 text run at (0,0) width 12: "1." - LayoutText {#text} at (12,0) size 30x19 - text run at (12,0) width 30: " Test" + LayoutText {#text} at (12,0) size 29x19 + text run at (12,0) width 29: " Test" LayoutNGBlockFlow {OL} at (80,57.59) size 160x20 [color=#000080] [bgcolor=#000080] LayoutNGListItem {LI} at (0,0) size 160x20 LayoutInline (anonymous) at (0,0) size 16x19 LayoutText (anonymous) at (0,0) size 16x19 text run at (0,0) width 16: "1. " - LayoutInline {SPAN} at (0,0) size 27x19 [color=#FFFFFF] - LayoutText {#text} at (15,0) size 27x19 - text run at (15,0) width 27: "Test" + LayoutInline {SPAN} at (0,0) size 25x19 [color=#FFFFFF] + LayoutText {#text} at (16,0) size 25x19 + text run at (16,0) width 25: "Test"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c566-list-stl-00-e-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c566-list-stl-00-e-ag-expected.txt index ac97836..f717006 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c566-list-stl-00-e-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1205-c566-list-stl-00-e-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x118 LayoutNGBlockFlow {BODY} at (8,16) size 784x87 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 192x19 - text run at (0,0) width 192: "There should be no red below." + LayoutText {#text} at (0,0) size 191x19 + text run at (0,0) width 191: "There should be no red below." LayoutNGBlockFlow {UL} at (75,36) size 96x51 [color=#00FF00] [bgcolor=#FF0000] [border: (3px solid #000000)] LayoutNGListItem {LI} at (3,3) size 90x45 LayoutInline (anonymous) at (0,0) size 45x15
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1402-c45-bg-canvas-00-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1402-c45-bg-canvas-00-b-expected.png index c496e07..9eff48f5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1402-c45-bg-canvas-00-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1402-c45-bg-canvas-00-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png index adc53db..44ca81d5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c535-bg-fixd-00-b-g-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png index 166dd46..10791621 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.txt index f23d9e6..33fae872 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t140201-c537-bgfxps-00-c-ag-expected.txt
@@ -15,7 +15,7 @@ LayoutNGBlockFlow {P} at (0,108) size 769x40 LayoutText {#text} at (0,0) size 763x39 text run at (0,0) width 763: "Scroll this document. A line of blue should remain stuck at the top of the viewport the whole time, and there should be no" - text run at (0,20) width 202: "red below, just a block of green." + text run at (0,20) width 201: "red below, just a block of green." LayoutNGBlockFlow {DIV} at (30,164) size 165x75 [color=#008000] [bgcolor=#008000] LayoutText {#text} at (0,0) size 165x75 text run at (0,0) width 165: " X"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1506-c525-font-wt-00-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1506-c525-font-wt-00-b-expected.png index 9c55bf6..56d53dd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1506-c525-font-wt-00-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1506-c525-font-wt-00-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-00-b-expected.txt index a0c0420..b0bf52ad4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-00-b-expected.txt
@@ -4,11 +4,11 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x106 LayoutNGBlockFlow {BODY} at (8,13) size 784x80 [color=#000080] LayoutNGBlockFlow {P} at (0,0) size 784x80 - LayoutText {#text} at (0,0) size 636x16 - text run at (0,0) width 636: "This text should be 13px Helvetica in small-caps and italicized. There should be a small gap between each line. " + LayoutText {#text} at (0,0) size 637x16 + text run at (0,0) width 637: "This text should be 13px Helvetica in small-caps and italicized. There should be a small gap between each line. " LayoutInline {SPAN} at (0,0) size 784x80 [color=#C0C0C0] - LayoutText {#text} at (635,0) size 784x80 - text run at (635,0) width 133: "dummy text dummy text" + LayoutText {#text} at (637,0) size 784x80 + text run at (637,0) width 132: "dummy text dummy text" text run at (0,16) width 784: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy" text run at (0,32) width 772: "text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,48) width 784: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-01-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-01-b-expected.txt index 3f2281cb..b151a7e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-01-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-01-b-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,3) size 565x20 text run at (0,3) width 565: "This text should be 18px serif. There should be a 9px gap between each line. " LayoutInline {SPAN} at (0,0) size 744x182 [color=#C0C0C0] - LayoutText {#text} at (564,3) size 744x182 - text run at (564,3) width 180: "dummy text dummy text" + LayoutText {#text} at (565,3) size 744x182 + text run at (565,3) width 179: "dummy text dummy text" text run at (0,30) width 731: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,57) width 731: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,84) width 731: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-02-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-02-b-expected.txt index 12fe2f1..af6c376 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-02-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-02-b-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,3) size 662x21 text run at (0,3) width 662: "This text should be 18px sans-serif. There should be a 9px gap between each line. " LayoutInline {SPAN} at (0,0) size 779x183 [color=#C0C0C0] - LayoutText {#text} at (661,3) size 779x183 - text run at (661,3) width 94: "dummy text" + LayoutText {#text} at (662,3) size 779x183 + text run at (662,3) width 93: "dummy text" text run at (0,30) width 779: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,57) width 779: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,84) width 779: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-04-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-04-b-expected.txt index 08adad8..b34f978 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-04-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-04-b-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x252 LayoutNGBlockFlow {BODY} at (8,18) size 784x216 [color=#000080] LayoutNGBlockFlow {P} at (0,0) size 784x216 - LayoutText {#text} at (0,3) size 784x48 - text run at (0,3) width 784: "This text should be 18px sans-serif, in small-caps, italicized, and very bold. There should be a 9px" - text run at (0,30) width 184: "gap between each line. " - LayoutInline {SPAN} at (0,0) size 739x183 [color=#C0C0C0] - LayoutText {#text} at (184,30) size 739x183 - text run at (184,30) width 553: "dummy text dummy text dummy text dummy text dummy text dummy text" + LayoutText {#text} at (0,3) size 752x48 + text run at (0,3) width 752: "This text should be 18px sans-serif, in small-caps, italicized, and very bold. There should be a" + text run at (0,30) width 217: "9px gap between each line. " + LayoutInline {SPAN} at (0,0) size 770x183 [color=#C0C0C0] + LayoutText {#text} at (217,30) size 770x183 + text run at (217,30) width 553: "dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,57) width 739: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,84) width 739: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,111) width 739: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-05-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-05-b-expected.txt index 135ceef8..edc16dd0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-05-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-05-b-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x468 LayoutNGBlockFlow {BODY} at (8,18) size 784x432 [color=#000080] LayoutNGBlockFlow {P} at (0,0) size 784x432 - LayoutText {#text} at (0,16) size 748x76 - text run at (0,16) width 748: "This text should be 18px sans-serif, in small-caps, italicized, and very light. There should be a" + LayoutText {#text} at (0,16) size 749x76 + text run at (0,16) width 749: "This text should be 18px sans-serif, in small-caps, italicized, and very light. There should be a" text run at (0,70) width 226: "36px gap between each line. " LayoutInline {SPAN} at (0,0) size 779x346 [color=#C0C0C0] LayoutText {#text} at (226,70) size 779x346
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-07-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-07-b-expected.txt index 177eeec..3de9329 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-07-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-07-b-expected.txt
@@ -6,10 +6,10 @@ LayoutNGBlockFlow {P} at (0,0) size 784x672 LayoutText {#text} at (0,37) size 735x118 text run at (0,37) width 735: "This text should be 18px sans-serif, in small-caps and italicized. The lines should be one inch" - text run at (0,133) width 53: "apart. " + text run at (0,133) width 54: "apart. " LayoutInline {SPAN} at (0,0) size 778x502 [color=#C0C0C0] - LayoutText {#text} at (52,133) size 778x502 - text run at (52,133) width 701: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy" + LayoutText {#text} at (54,133) size 778x502 + text run at (54,133) width 700: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy" text run at (0,229) width 778: "text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,325) width 739: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,421) width 739: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-09-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-09-b-expected.txt index 1baf31d..977fe5d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-09-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-09-b-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,5) size 472x13 text run at (0,5) width 472: "This test should be about 10px, sans-serif, and light. There should be about 15px between each line. " LayoutInline {SPAN} at (0,0) size 781x82 [color=#C0C0C0] - LayoutText {#text} at (471,5) size 781x82 - text run at (471,5) width 278: "dummy text dummy text dummy text dummy text dummy text" + LayoutText {#text} at (472,5) size 781x82 + text run at (472,5) width 277: "dummy text dummy text dummy text dummy text dummy text" text run at (0,28) width 781: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,51) width 781: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,74) width 781: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-10-c-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-10-c-expected.txt index 76830e6b..a4c01e5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-10-c-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1508-c527-font-10-c-expected.txt
@@ -5,12 +5,12 @@ LayoutNGBlockFlow {BODY} at (8,18) size 784x432 LayoutNGBlockFlow {P} at (0,0) size 784x432 LayoutInline {SPAN} at (0,0) size 778x400 [color=#FFFFFF] [bgcolor=#000080] - LayoutText {#text} at (0,16) size 748x76 - text run at (0,16) width 748: "This text should be 18px sans-serif, in small-caps, italicized, and very light. There should be a" + LayoutText {#text} at (0,16) size 749x76 + text run at (0,16) width 749: "This text should be 18px sans-serif, in small-caps, italicized, and very light. There should be a" text run at (0,70) width 703: "36px gap betwen each line. The text should have a blue background, the gap should not. " LayoutInline {SPAN} at (0,0) size 778x346 [color=#0000FF] - LayoutText {#text} at (702,70) size 778x346 - text run at (702,70) width 50: "dummy" + LayoutText {#text} at (703,70) size 778x346 + text run at (703,70) width 49: "dummy" text run at (0,124) width 778: "text dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,178) width 739: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text" text run at (0,232) width 739: "dummy text dummy text dummy text dummy text dummy text dummy text dummy text dummy text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1601-c547-indent-01-d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1601-c547-indent-01-d-expected.txt index d23f9b8..7b99cc7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1601-c547-indent-01-d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1601-c547-indent-01-d-expected.txt
@@ -20,11 +20,11 @@ LayoutInline {EM} at (0,0) size 113x19 LayoutText {#text} at (0,60) size 113x19 text run at (0,60) width 113: "aligned on the left" - LayoutText {#text} at (113,60) size 99x19 - text run at (113,60) width 99: " of the window." + LayoutText {#text} at (113,60) size 98x19 + text run at (113,60) width 98: " of the window." LayoutNGBlockFlow {DIV} at (0,152) size 196x80 [bgcolor=#00FFFF] LayoutText {#text} at (392,0) size 404x79 text run at (392,0) width 12: "X" text run at (0,20) width 169: "The X on the previous line" text run at (0,40) width 184: "should be centered across the" - text run at (0,60) width 55: "window." + text run at (0,60) width 54: "window."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.png index dae0124b..837de13 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.txt index 8f7beca..53d9c68 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1602-c546-txt-align-00-b-expected.txt
@@ -13,11 +13,11 @@ LayoutText {#text} at (286,0) size 212x19 text run at (286,0) width 212: "This sentence should be centered." LayoutNGBlockFlow {P} at (0,108) size 784x280 [color=#000080] - LayoutText {#text} at (0,0) size 497x19 - text run at (0,0) width 497: "This paragraph should be justified (the right and left margins should line up). " - LayoutInline {SPAN} at (0,0) size 784x279 [color=#C0C0C0] - LayoutText {#text} at (496,0) size 784x279 - text run at (496,0) width 288: "This is just lovely dummy text. Dummy text." + LayoutText {#text} at (0,0) size 498x19 + text run at (0,0) width 498: "This paragraph should be justified (the right and left margins should line up). " + LayoutInline {SPAN} at (0,0) size 785x279 [color=#C0C0C0] + LayoutText {#text} at (497,0) size 785x279 + text run at (497,0) width 288: "This is just lovely dummy text. Dummy text." text run at (0,20) width 784: "Dummy text. This is just lovely dummy text. This is just lovely dummy text. Dummy text. This is just lovely dummy text." text run at (0,40) width 784: "This is just lovely dummy text. Dummy text. Dummy text. This is just lovely dummy text. This is just lovely dummy text." text run at (0,60) width 784: "Dummy text. This is just lovely dummy text. This is just lovely dummy text. Dummy text. Dummy text. This is just lovely" @@ -31,5 +31,5 @@ text run at (0,220) width 784: "just lovely dummy text. Dummy text. This is just lovely dummy text. This is just lovely dummy text. Dummy text. Dummy" text run at (0,240) width 784: "text. This is just lovely dummy text. This is just lovely dummy text. Dummy text. This is just lovely dummy text. This is just" text run at (0,260) width 387: "lovely dummy text. Dummy text. Dummy text. Dummy text. " - LayoutText {#text} at (386,260) size 382x19 - text run at (386,260) width 382: "This sentence should be at the end of the block, not justified." + LayoutText {#text} at (387,260) size 381x19 + text run at (387,260) width 381: "This sentence should be at the end of the block, not justified."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1606-c562-white-sp-00-b-ag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1606-c562-white-sp-00-b-ag-expected.txt index 7d935262..a26fd7c0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1606-c562-white-sp-00-b-ag-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css2.1/t1606-c562-white-sp-00-b-ag-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x156 LayoutNGBlockFlow {BODY} at (8,16) size 784x132 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 278x19 - text run at (0,0) width 278: "There should be a single green block below." + LayoutText {#text} at (0,0) size 277x19 + text run at (0,0) width 277: "There should be a single green block below." LayoutNGBlockFlow {DIV} at (0,36) size 231x96 [color=#008000] [bgcolor=#FF0000] [border: (3px solid #000000)] LayoutNGBlockFlow {P} at (3,3) size 225x45 LayoutText {#text} at (0,0) size 165x45
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/css3-modsel-35-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/css3-modsel-35-expected.png index ab3be6c..151b1de 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/css3-modsel-35-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/css3-modsel-35-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/flexbox/button-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/flexbox/button-expected.png index c04283f7..d74b1727 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/flexbox/button-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/flexbox/button-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.png index bbf1d4b..fb7d5f2b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.txt index 86bfa0c..889dc55 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/font-feature-settings-rendering-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 780x39 - text run at (0,0) width 780: "Test for font-feature-settings property. The first word of the following three words should be displayed like \"WebKit\", while" + LayoutText {#text} at (0,0) size 777x39 + text run at (0,0) width 777: "Test for font-feature-settings property. The first word of the following three words should be displayed like \"WebKit\", while" text run at (0,20) width 267: "others should be displayed as black boxes." LayoutNGBlockFlow {DIV} at (0,56) size 784x17 LayoutText {#text} at (0,0) size 30x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/masking/clip-path-inset-corners-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/masking/clip-path-inset-corners-expected.png index 5955ecf..2bd546c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/masking/clip-path-inset-corners-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/masking/clip-path-inset-corners-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.png index 684fd3c..15d2f22 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.txt index 0593dbd..d2a649b9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-13-expected.txt
@@ -20,7 +20,7 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutInline {SPAN} at (0,0) size 597x19 - LayoutText {#text} at (0,0) size 597x19 - text run at (0,0) width 597: "This list item should have green background because the inner SPAN does not match SPAN.t3" + LayoutInline {SPAN} at (0,0) size 595x19 + LayoutText {#text} at (0,0) size 595x19 + text run at (0,0) width 595: "This list item should have green background because the inner SPAN does not match SPAN.t3" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.png index 0433937..5e4aded 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.txt index 3bb3a83..b6b3f3f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-15-expected.txt
@@ -20,6 +20,6 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutInline {SPAN} at (0,0) size 589x19 - LayoutText {#text} at (0,0) size 589x19 - text run at (0,0) width 589: "This list item should have a green background. because the inner SPAN does not match \"#t4\"" + LayoutInline {SPAN} at (0,0) size 588x19 + LayoutText {#text} at (0,0) size 588x19 + text run at (0,0) width 588: "This list item should have a green background. because the inner SPAN does not match \"#t4\""
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18-expected.txt index bf2daba..f13f38f6ec 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18-expected.txt
@@ -9,27 +9,27 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (674,0) size 30x19 text run at (674,0) width 30: "here" - LayoutText {#text} at (703,0) size 744x39 - text run at (703,0) width 41: ") or its" + LayoutText {#text} at (704,0) size 744x39 + text run at (704,0) width 40: ") or its" text run at (0,20) width 157: "whitespace background, " LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (157,20) size 30x19 text run at (157,20) width 30: "here" - LayoutText {#text} at (186,20) size 5x19 - text run at (186,20) width 5: ":" + LayoutText {#text} at (187,20) size 4x19 + text run at (187,20) width 4: ":" LayoutNGBlockFlow {ADDRESS} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " - LayoutInline {A} at (0,0) size 115x19 [color=#0000EE] - LayoutText {#text} at (160,0) size 81x19 - text run at (160,0) width 81: "this anchor (" - LayoutInline {STRONG} at (0,0) size 30x19 - LayoutText {#text} at (240,0) size 30x19 - text run at (240,0) width 30: "here" - LayoutText {#text} at (269,0) size 6x19 - text run at (269,0) width 6: ")" - LayoutText {#text} at (274,0) size 387x19 - text run at (274,0) width 387: " should turn to green when the pointing device hovers over it." + LayoutInline {A} at (0,0) size 114x19 [color=#0000EE] + LayoutText {#text} at (161,0) size 80x19 + text run at (161,0) width 80: "this anchor (" + LayoutInline {STRONG} at (0,0) size 29x19 + LayoutText {#text} at (241,0) size 29x19 + text run at (241,0) width 29: "here" + LayoutText {#text} at (270,0) size 5x19 + text run at (270,0) width 5: ")" + LayoutText {#text} at (275,0) size 387x19 + text run at (275,0) width 387: " should turn to green when the pointing device hovers over it." LayoutTable {TABLE} at (0,76) size 278x194 LayoutTableSection {TBODY} at (0,0) size 278x194 LayoutTableRow {TR} at (0,5) size 278x22 @@ -62,8 +62,8 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (41,1) size 30x19 text run at (41,1) width 30: "here" - LayoutText {#text} at (70,1) size 10x19 - text run at (70,1) width 10: ")." + LayoutText {#text} at (71,1) size 9x19 + text run at (71,1) width 9: ")." LayoutNGTableCell {TD} at (174,69) size 99x2 [r=2 c=2 rs=1 cs=1] LayoutTableRow {TR} at (0,86) size 278x22 LayoutNGTableCell {TD} at (5,86) size 78x22 [r=3 c=0 rs=1 cs=1] @@ -95,8 +95,8 @@ LayoutInline {STRONG} at (0,0) size 35x19 LayoutText {#text} at (33,1) size 35x19 text run at (33,1) width 35: "there" - LayoutText {#text} at (67,1) size 5x19 - text run at (67,1) width 5: ":" + LayoutText {#text} at (68,1) size 4x19 + text run at (68,1) width 4: ":" LayoutNGTableCell {TD} at (174,150) size 99x2 [r=5 c=2 rs=1 cs=1] LayoutTableRow {TR} at (0,167) size 278x22 LayoutNGTableCell {TD} at (5,167) size 78x22 [r=6 c=0 rs=1 cs=1] @@ -105,8 +105,8 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (33,1) size 30x19 text run at (33,1) width 30: "here" - LayoutText {#text} at (62,1) size 5x19 - text run at (62,1) width 5: ":" + LayoutText {#text} at (63,1) size 4x19 + text run at (63,1) width 4: ":" LayoutNGTableCell {TD} at (88,177) size 81x2 [r=6 c=1 rs=1 cs=1] LayoutNGTableCell {TD} at (174,167) size 99x22 [r=6 c=2 rs=1 cs=1] LayoutText {#text} at (1,1) size 81x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.png index 282f3d5..2a24b9d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.txt index 1c95f00..4fac73d8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-18a-expected.txt
@@ -12,10 +12,10 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 388x19 - text run at (273,0) width 388: " should turn to green when the pointing device hovers over it." + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 387x19 + text run at (274,0) width 387: " should turn to green when the pointing device hovers over it." LayoutNGBlockFlow {P} at (0,36) size 784x20 [color=#000080] LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " @@ -25,15 +25,15 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 51x19 - text run at (273,0) width 51: " should " + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 50x19 + text run at (274,0) width 50: " should " LayoutInline {STRONG} at (0,0) size 216x19 - LayoutText {#text} at (323,0) size 216x19 - text run at (323,0) width 216: "remain green when you hover it" - LayoutText {#text} at (538,0) size 5x19 - text run at (538,0) width 5: "." + LayoutText {#text} at (324,0) size 216x19 + text run at (324,0) width 216: "remain green when you hover it" + LayoutText {#text} at (540,0) size 4x19 + text run at (540,0) width 4: "." LayoutNGBlockFlow {P} at (0,72) size 784x40 [color=#000080] LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " @@ -43,13 +43,13 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 51x19 - text run at (273,0) width 51: " should " + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 50x19 + text run at (274,0) width 50: " should " LayoutInline {STRONG} at (0,0) size 358x19 - LayoutText {#text} at (323,0) size 358x19 - text run at (323,0) width 358: "remain green when the pointing device hovers over it" - LayoutText {#text} at (680,0) size 775x39 - text run at (680,0) width 95: " (do not follow" + LayoutText {#text} at (324,0) size 358x19 + text run at (324,0) width 358: "remain green when the pointing device hovers over it" + LayoutText {#text} at (682,0) size 776x39 + text run at (682,0) width 94: " (do not follow" text run at (0,20) width 60: "that link)."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.png index ea6b0ef0..05e9ab7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.txt index dd6fdbf..8c360ac 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-21-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,0) size 755x19 text run at (0,0) width 755: "This paragraph should be unstyled. The background of the following paragraph should become green when you follow " LayoutInline {A} at (0,0) size 777x39 [color=#0000EE] - LayoutText {#text} at (754,0) size 777x39 - text run at (754,0) width 23: "this" + LayoutText {#text} at (755,0) size 777x39 + text run at (755,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 4x19 text run at (24,20) width 4: "." @@ -16,8 +16,8 @@ LayoutText {#text} at (0,0) size 739x19 text run at (0,0) width 739: "This paragraph should initially be unstyled. It should become green when you select the link above. When you select " LayoutInline {A} at (0,0) size 761x39 [color=#0000EE] - LayoutText {#text} at (738,0) size 761x39 - text run at (738,0) width 23: "this" + LayoutText {#text} at (739,0) size 761x39 + text run at (739,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 636x19 text run at (24,20) width 636: ", it should return to being unstyled and the background of the paragraph below should become green." @@ -25,8 +25,8 @@ LayoutText {#text} at (0,0) size 745x19 text run at (0,0) width 745: "This paragraph should initially be unstyled. It should become green when you select the link above. When you follow " LayoutInline {A} at (0,0) size 767x39 [color=#0000EE] - LayoutText {#text} at (744,0) size 767x39 - text run at (744,0) width 23: "this" + LayoutText {#text} at (745,0) size 767x39 + text run at (745,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 357x19 text run at (24,20) width 357: ", the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.png index a030556..1758b829 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.txt index 741085e..fd81bb7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-22-expected.txt
@@ -14,8 +14,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (0,0) size 482x19 - text run at (0,0) width 482: "This list item should be green because its language is British English (Wales)" + LayoutText {#text} at (0,0) size 481x19 + text run at (0,0) width 481: "This list item should be green because its language is British English (Wales)" LayoutNGBlockFlow {OL} at (0,56) size 784x40 LayoutNGListItem {LI} at (40,0) size 744x20 LayoutNGListMarker (anonymous) at (-16,0) size 16x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-34-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-34-expected.txt index 80f42f8..1d88c5d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-34-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-34-expected.txt
@@ -8,11 +8,11 @@ LayoutText {#text} at (0,0) size 188x19 text run at (0,0) width 188: "This div contains 3 addresses:" LayoutNGBlockFlow {ADDRESS} at (16,20) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 329x19 - text run at (0,0) width 329: "A first address that should have a green background" + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "A first address that should have a green background" LayoutNGBlockFlow {ADDRESS} at (16,56) size 768x20 - LayoutText {#text} at (0,0) size 271x19 - text run at (0,0) width 271: "A second address with normal background" + LayoutText {#text} at (0,0) size 272x19 + text run at (0,0) width 272: "A second address with normal background" LayoutNGBlockFlow {ADDRESS} at (16,92) size 768x20 - LayoutText {#text} at (0,0) size 256x19 - text run at (0,0) width 256: "A third address with normal background" + LayoutText {#text} at (0,0) size 258x19 + text run at (0,0) width 258: "A third address with normal background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-35-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-35-expected.png index ab3be6c..151b1de 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-35-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-35-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39-expected.png index 57e0921..6e442f5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39a-expected.txt index 941d453..ae1ca97 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39a-expected.txt
@@ -10,7 +10,7 @@ text run at (0,0) width 20: "T" LayoutTextFragment (anonymous) at (0,0) size 0x0 LayoutText {#text} at (20,13) size 779x243 - text run at (20,13) width 731: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." + text run at (20,13) width 730: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,37) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,57) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,77) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39b-expected.png index 57e0921..6e442f5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39c-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39c-expected.txt index 941d453..ae1ca97 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39c-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-39c-expected.txt
@@ -10,7 +10,7 @@ text run at (0,0) width 20: "T" LayoutTextFragment (anonymous) at (0,0) size 0x0 LayoutText {#text} at (20,13) size 779x243 - text run at (20,13) width 731: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." + text run at (20,13) width 730: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,37) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,57) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,77) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.png index 21836da..b7898f595 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.txt index a89926a..31d0ba0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41-expected.txt
@@ -7,6 +7,6 @@ LayoutInline {<pseudo:before>} at (0,0) size 182x19 [bgcolor=#00FF00] LayoutTextFragment (anonymous) at (0,0) size 182x19 text run at (0,0) width 182: "GENERATED CONTENT " - LayoutText {#text} at (181,0) size 734x39 - text run at (181,0) width 553: "You should see before this paragraph the words GENERATED CONTENT over green" + LayoutText {#text} at (182,0) size 734x39 + text run at (182,0) width 552: "You should see before this paragraph the words GENERATED CONTENT over green" text run at (0,20) width 75: "background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.png index 21836da..b7898f595 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.txt index a89926a..31d0ba0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-41a-expected.txt
@@ -7,6 +7,6 @@ LayoutInline {<pseudo:before>} at (0,0) size 182x19 [bgcolor=#00FF00] LayoutTextFragment (anonymous) at (0,0) size 182x19 text run at (0,0) width 182: "GENERATED CONTENT " - LayoutText {#text} at (181,0) size 734x39 - text run at (181,0) width 553: "You should see before this paragraph the words GENERATED CONTENT over green" + LayoutText {#text} at (182,0) size 734x39 + text run at (182,0) width 552: "You should see before this paragraph the words GENERATED CONTENT over green" text run at (0,20) width 75: "background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.png index dba7ae6d..53219b9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.txt index 3ec6a08..51ad30d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x72 LayoutNGBlockFlow {BODY} at (8,16) size 784x40 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 620x19 - text run at (0,0) width 620: "You should see after this paragraph the words GENERATED CONTENT over green background" - LayoutInline {<pseudo:after>} at (0,0) size 717x39 [bgcolor=#00FF00] - LayoutTextFragment (anonymous) at (619,0) size 717x39 - text run at (619,0) width 98: "GENERATED" + LayoutText {#text} at (0,0) size 619x19 + text run at (0,0) width 619: "You should see after this paragraph the words GENERATED CONTENT over green background" + LayoutInline {<pseudo:after>} at (0,0) size 716x39 [bgcolor=#00FF00] + LayoutTextFragment (anonymous) at (619,0) size 716x39 + text run at (619,0) width 97: "GENERATED" text run at (0,20) width 77: "CONTENT"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.png index dba7ae6d..53219b9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.txt index 3ec6a08..51ad30d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-42a-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x72 LayoutNGBlockFlow {BODY} at (8,16) size 784x40 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 620x19 - text run at (0,0) width 620: "You should see after this paragraph the words GENERATED CONTENT over green background" - LayoutInline {<pseudo:after>} at (0,0) size 717x39 [bgcolor=#00FF00] - LayoutTextFragment (anonymous) at (619,0) size 717x39 - text run at (619,0) width 98: "GENERATED" + LayoutText {#text} at (0,0) size 619x19 + text run at (0,0) width 619: "You should see after this paragraph the words GENERATED CONTENT over green background" + LayoutInline {<pseudo:after>} at (0,0) size 716x39 [bgcolor=#00FF00] + LayoutTextFragment (anonymous) at (619,0) size 716x39 + text run at (619,0) width 97: "GENERATED" text run at (0,20) width 77: "CONTENT"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.png index f550858b..1a8512c3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.txt index a4df6498..8f3067f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-66-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,0) size 747x19 text run at (0,0) width 747: "This paragraph should be unstyled. The background of the following paragraph should become blue when you follow " LayoutInline {A} at (0,0) size 769x39 [color=#0000EE] - LayoutText {#text} at (746,0) size 769x39 - text run at (746,0) width 23: "this" + LayoutText {#text} at (747,0) size 769x39 + text run at (747,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 4x19 text run at (24,20) width 4: "." @@ -16,8 +16,8 @@ LayoutText {#text} at (0,0) size 731x19 text run at (0,0) width 731: "This paragraph should initially be unstyled. It should become blue when you select the link above. When you select " LayoutInline {A} at (0,0) size 753x39 [color=#0000EE] - LayoutText {#text} at (730,0) size 753x39 - text run at (730,0) width 23: "this" + LayoutText {#text} at (731,0) size 753x39 + text run at (731,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 628x19 text run at (24,20) width 628: ", it should return to being unstyled and the background of the paragraph below should become blue." @@ -25,8 +25,8 @@ LayoutText {#text} at (0,0) size 737x19 text run at (0,0) width 737: "This paragraph should initially be unstyled. It should become blue when you select the link above. When you follow " LayoutInline {A} at (0,0) size 759x39 [color=#0000EE] - LayoutText {#text} at (736,0) size 759x39 - text run at (736,0) width 23: "this" + LayoutText {#text} at (737,0) size 759x39 + text run at (737,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 357x19 text run at (24,20) width 357: ", the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-7-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-7-expected.txt index 7bd78a2..adb9a988 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-7-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-7-expected.txt
@@ -10,9 +10,9 @@ LayoutInline {SPAN} at (0,0) size 156x19 LayoutText {#text} at (0,0) size 156x19 text run at (0,0) width 156: "This address should also" - LayoutText {#text} at (155,0) size 5x19 - text run at (155,0) width 5: " " + LayoutText {#text} at (156,0) size 4x19 + text run at (156,0) width 4: " " LayoutInline {SPAN} at (0,0) size 598x19 - LayoutText {#text} at (159,0) size 598x19 - text run at (159,0) width 598: "have green background because the selector in the last rule does not apply to the inner SPANs." + LayoutText {#text} at (160,0) size 598x19 + text run at (160,0) width 598: "have green background because the selector in the last rule does not apply to the inner SPANs." LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.png index ef1979f..cb1b9f0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.txt index 347e2e5..50646871 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-79-expected.txt
@@ -8,11 +8,11 @@ LayoutText {#text} at (0,0) size 192x19 text run at (0,0) width 192: "This div contains 3 addresses :" LayoutNGBlockFlow {ADDRESS} at (16,20) size 768x20 - LayoutText {#text} at (0,0) size 251x19 - text run at (0,0) width 251: "A first address with normal background" + LayoutText {#text} at (0,0) size 252x19 + text run at (0,0) width 252: "A first address with normal background" LayoutNGBlockFlow {ADDRESS} at (16,56) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 349x19 - text run at (0,0) width 349: "A second address that should have a green background" + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "A second address that should have a green background" LayoutNGBlockFlow {ADDRESS} at (16,92) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 335x19 - text run at (0,0) width 335: "A third address that should have a green background" + LayoutText {#text} at (0,0) size 337x19 + text run at (0,0) width 337: "A third address that should have a green background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-8-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-8-expected.txt index c0b37d5..0c493f2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-8-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-8-expected.txt
@@ -10,9 +10,9 @@ LayoutInline {SPAN} at (0,0) size 156x19 LayoutText {#text} at (0,0) size 156x19 text run at (0,0) width 156: "This address should also" - LayoutText {#text} at (155,0) size 5x19 - text run at (155,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 505x19 - LayoutText {#text} at (159,0) size 505x19 - text run at (159,0) width 505: "have green background because the language of the inner SPANs is not French." + LayoutText {#text} at (156,0) size 4x19 + text run at (156,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 506x19 + LayoutText {#text} at (160,0) size 506x19 + text run at (160,0) width 506: "have green background because the language of the inner SPANs is not French." LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-80-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-80-expected.txt index 81428ea..36738ff 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-80-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/html/css3-modsel-80-expected.txt
@@ -5,14 +5,14 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x128 LayoutNGBlockFlow {DIV} at (0,0) size 784x128 LayoutNGBlockFlow {ADDRESS} at (16,0) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 329x19 - text run at (0,0) width 329: "A first address that should have a green background" + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "A first address that should have a green background" LayoutNGBlockFlow {ADDRESS} at (16,36) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 349x19 - text run at (0,0) width 349: "A second address that should have a green background" + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "A second address that should have a green background" LayoutNGBlockFlow {ADDRESS} at (16,72) size 768x20 - LayoutText {#text} at (0,0) size 256x19 - text run at (0,0) width 256: "A third address with normal background" + LayoutText {#text} at (0,0) size 258x19 + text run at (0,0) width 258: "A third address with normal background" LayoutNGBlockFlow (anonymous) at (0,108) size 784x20 LayoutText {#text} at (0,0) size 289x19 text run at (0,0) width 289: "This div should have three addresses above it."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.png index 684fd3c..15d2f22 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.txt index 0b54be10..559b26e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-13-expected.txt
@@ -20,7 +20,7 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutInline {span} at (0,0) size 597x19 - LayoutText {#text} at (0,0) size 597x19 - text run at (0,0) width 597: "This list item should have green background because the inner SPAN does not match SPAN.t3" + LayoutInline {span} at (0,0) size 595x19 + LayoutText {#text} at (0,0) size 595x19 + text run at (0,0) width 595: "This list item should have green background because the inner SPAN does not match SPAN.t3" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.png index 0433937..5e4aded 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.txt index f95a6d52..90c73b8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-15-expected.txt
@@ -20,6 +20,6 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutInline {span} at (0,0) size 589x19 - LayoutText {#text} at (0,0) size 589x19 - text run at (0,0) width 589: "This list item should have a green background. because the inner SPAN does not match \"#t4\"" + LayoutInline {span} at (0,0) size 588x19 + LayoutText {#text} at (0,0) size 588x19 + text run at (0,0) width 588: "This list item should have a green background. because the inner SPAN does not match \"#t4\""
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18-expected.txt index 48860247..a671928 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18-expected.txt
@@ -9,27 +9,27 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (674,0) size 30x19 text run at (674,0) width 30: "here" - LayoutText {#text} at (703,0) size 744x39 - text run at (703,0) width 41: ") or its" + LayoutText {#text} at (704,0) size 744x39 + text run at (704,0) width 40: ") or its" text run at (0,20) width 157: "whitespace background, " LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (157,20) size 30x19 text run at (157,20) width 30: "here" - LayoutText {#text} at (186,20) size 5x19 - text run at (186,20) width 5: ":" + LayoutText {#text} at (187,20) size 4x19 + text run at (187,20) width 4: ":" LayoutNGBlockFlow {address} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " - LayoutInline {a} at (0,0) size 115x19 [color=#0000EE] - LayoutText {#text} at (160,0) size 81x19 - text run at (160,0) width 81: "this anchor (" - LayoutInline {strong} at (0,0) size 30x19 - LayoutText {#text} at (240,0) size 30x19 - text run at (240,0) width 30: "here" - LayoutText {#text} at (269,0) size 6x19 - text run at (269,0) width 6: ")" - LayoutText {#text} at (274,0) size 387x19 - text run at (274,0) width 387: " should turn to green when the pointing device hovers over it." + LayoutInline {a} at (0,0) size 114x19 [color=#0000EE] + LayoutText {#text} at (161,0) size 80x19 + text run at (161,0) width 80: "this anchor (" + LayoutInline {strong} at (0,0) size 29x19 + LayoutText {#text} at (241,0) size 29x19 + text run at (241,0) width 29: "here" + LayoutText {#text} at (270,0) size 5x19 + text run at (270,0) width 5: ")" + LayoutText {#text} at (275,0) size 387x19 + text run at (275,0) width 387: " should turn to green when the pointing device hovers over it." LayoutTable {table} at (0,76) size 278x194 LayoutTableSection {tbody} at (0,0) size 278x194 LayoutTableRow {tr} at (0,5) size 278x22 @@ -62,8 +62,8 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (41,1) size 30x19 text run at (41,1) width 30: "here" - LayoutText {#text} at (70,1) size 10x19 - text run at (70,1) width 10: ")." + LayoutText {#text} at (71,1) size 9x19 + text run at (71,1) width 9: ")." LayoutNGTableCell {td} at (174,69) size 99x2 [r=2 c=2 rs=1 cs=1] LayoutTableRow {tr} at (0,86) size 278x22 LayoutNGTableCell {td} at (5,86) size 78x22 [r=3 c=0 rs=1 cs=1] @@ -95,8 +95,8 @@ LayoutInline {strong} at (0,0) size 35x19 LayoutText {#text} at (33,1) size 35x19 text run at (33,1) width 35: "there" - LayoutText {#text} at (67,1) size 5x19 - text run at (67,1) width 5: ":" + LayoutText {#text} at (68,1) size 4x19 + text run at (68,1) width 4: ":" LayoutNGTableCell {td} at (174,150) size 99x2 [r=5 c=2 rs=1 cs=1] LayoutTableRow {tr} at (0,167) size 278x22 LayoutNGTableCell {td} at (5,167) size 78x22 [r=6 c=0 rs=1 cs=1] @@ -105,8 +105,8 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (33,1) size 30x19 text run at (33,1) width 30: "here" - LayoutText {#text} at (62,1) size 5x19 - text run at (62,1) width 5: ":" + LayoutText {#text} at (63,1) size 4x19 + text run at (63,1) width 4: ":" LayoutNGTableCell {td} at (88,177) size 81x2 [r=6 c=1 rs=1 cs=1] LayoutNGTableCell {td} at (174,167) size 99x22 [r=6 c=2 rs=1 cs=1] LayoutText {#text} at (1,1) size 81x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.png index 282f3d5..2a24b9d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.txt index a4aebcbb1..bb6160c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-18a-expected.txt
@@ -12,10 +12,10 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 388x19 - text run at (273,0) width 388: " should turn to green when the pointing device hovers over it." + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 387x19 + text run at (274,0) width 387: " should turn to green when the pointing device hovers over it." LayoutNGBlockFlow {p} at (0,36) size 784x20 [color=#000080] LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " @@ -25,15 +25,15 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 51x19 - text run at (273,0) width 51: " should " + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 50x19 + text run at (274,0) width 50: " should " LayoutInline {strong} at (0,0) size 216x19 - LayoutText {#text} at (323,0) size 216x19 - text run at (323,0) width 216: "remain green when you hover it" - LayoutText {#text} at (538,0) size 5x19 - text run at (538,0) width 5: "." + LayoutText {#text} at (324,0) size 216x19 + text run at (324,0) width 216: "remain green when you hover it" + LayoutText {#text} at (540,0) size 4x19 + text run at (540,0) width 4: "." LayoutNGBlockFlow {p} at (0,72) size 784x40 [color=#000080] LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " @@ -43,13 +43,13 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 51x19 - text run at (273,0) width 51: " should " + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 50x19 + text run at (274,0) width 50: " should " LayoutInline {strong} at (0,0) size 358x19 - LayoutText {#text} at (323,0) size 358x19 - text run at (323,0) width 358: "remain green when the pointing device hovers over it" - LayoutText {#text} at (680,0) size 775x39 - text run at (680,0) width 95: " (do not follow" + LayoutText {#text} at (324,0) size 358x19 + text run at (324,0) width 358: "remain green when the pointing device hovers over it" + LayoutText {#text} at (682,0) size 776x39 + text run at (682,0) width 94: " (do not follow" text run at (0,20) width 60: "that link)."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.png index ea6b0ef0..05e9ab7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.txt index 76b369d5..5b49d12 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-21-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,0) size 755x19 text run at (0,0) width 755: "This paragraph should be unstyled. The background of the following paragraph should become green when you follow " LayoutInline {a} at (0,0) size 777x39 [color=#0000EE] - LayoutText {#text} at (754,0) size 777x39 - text run at (754,0) width 23: "this" + LayoutText {#text} at (755,0) size 777x39 + text run at (755,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 4x19 text run at (24,20) width 4: "." @@ -16,8 +16,8 @@ LayoutText {#text} at (0,0) size 739x19 text run at (0,0) width 739: "This paragraph should initially be unstyled. It should become green when you select the link above. When you select " LayoutInline {a} at (0,0) size 761x39 [color=#0000EE] - LayoutText {#text} at (738,0) size 761x39 - text run at (738,0) width 23: "this" + LayoutText {#text} at (739,0) size 761x39 + text run at (739,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 636x19 text run at (24,20) width 636: ", it should return to being unstyled and the background of the paragraph below should become green." @@ -25,8 +25,8 @@ LayoutText {#text} at (0,0) size 745x19 text run at (0,0) width 745: "This paragraph should initially be unstyled. It should become green when you select the link above. When you follow " LayoutInline {a} at (0,0) size 767x39 [color=#0000EE] - LayoutText {#text} at (744,0) size 767x39 - text run at (744,0) width 23: "this" + LayoutText {#text} at (745,0) size 767x39 + text run at (745,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 357x19 text run at (24,20) width 357: ", the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.png index a030556..1758b829 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.txt index 5c5bed5..64404b8b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-22-expected.txt
@@ -14,8 +14,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (0,0) size 482x19 - text run at (0,0) width 482: "This list item should be green because its language is British English (Wales)" + LayoutText {#text} at (0,0) size 481x19 + text run at (0,0) width 481: "This list item should be green because its language is British English (Wales)" LayoutNGBlockFlow {ol} at (0,56) size 784x40 LayoutNGListItem {li} at (40,0) size 744x20 LayoutNGListMarker (anonymous) at (-16,0) size 16x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-3-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-3-expected.png index 10697ca..745f811 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-3-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-34-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-34-expected.txt index 5040f11..a06213b6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-34-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-34-expected.txt
@@ -8,11 +8,11 @@ LayoutText {#text} at (0,0) size 188x19 text run at (0,0) width 188: "This div contains 3 addresses:" LayoutNGBlockFlow {address} at (16,20) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 329x19 - text run at (0,0) width 329: "A first address that should have a green background" + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "A first address that should have a green background" LayoutNGBlockFlow {address} at (16,56) size 768x20 - LayoutText {#text} at (0,0) size 271x19 - text run at (0,0) width 271: "A second address with normal background" + LayoutText {#text} at (0,0) size 272x19 + text run at (0,0) width 272: "A second address with normal background" LayoutNGBlockFlow {address} at (16,92) size 768x20 - LayoutText {#text} at (0,0) size 256x19 - text run at (0,0) width 256: "A third address with normal background" + LayoutText {#text} at (0,0) size 258x19 + text run at (0,0) width 258: "A third address with normal background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-35-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-35-expected.png index ab3be6c..151b1de 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-35-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-35-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39-expected.png index 57e0921..6e442f5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39a-expected.txt index 4635f3d2..63472228 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39a-expected.txt
@@ -10,7 +10,7 @@ text run at (0,0) width 20: "T" LayoutTextFragment (anonymous) at (0,0) size 0x0 LayoutText {#text} at (20,13) size 779x243 - text run at (20,13) width 731: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." + text run at (20,13) width 730: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,37) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,57) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,77) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39b-expected.png index 57e0921..6e442f5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39c-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39c-expected.txt index 4635f3d2..63472228 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39c-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-39c-expected.txt
@@ -10,7 +10,7 @@ text run at (0,0) width 20: "T" LayoutTextFragment (anonymous) at (0,0) size 0x0 LayoutText {#text} at (20,13) size 779x243 - text run at (20,13) width 731: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." + text run at (20,13) width 730: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,37) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,57) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,77) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.png index 21836da..b7898f595 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.txt index 148be8f..794c9a4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41-expected.txt
@@ -7,6 +7,6 @@ LayoutInline {<pseudo:before>} at (0,0) size 182x19 [bgcolor=#00FF00] LayoutTextFragment (anonymous) at (0,0) size 182x19 text run at (0,0) width 182: "GENERATED CONTENT " - LayoutText {#text} at (181,0) size 734x39 - text run at (181,0) width 553: "You should see before this paragraph the words GENERATED CONTENT over green" + LayoutText {#text} at (182,0) size 734x39 + text run at (182,0) width 552: "You should see before this paragraph the words GENERATED CONTENT over green" text run at (0,20) width 75: "background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.png index 21836da..b7898f595 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.txt index 148be8f..794c9a4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-41a-expected.txt
@@ -7,6 +7,6 @@ LayoutInline {<pseudo:before>} at (0,0) size 182x19 [bgcolor=#00FF00] LayoutTextFragment (anonymous) at (0,0) size 182x19 text run at (0,0) width 182: "GENERATED CONTENT " - LayoutText {#text} at (181,0) size 734x39 - text run at (181,0) width 553: "You should see before this paragraph the words GENERATED CONTENT over green" + LayoutText {#text} at (182,0) size 734x39 + text run at (182,0) width 552: "You should see before this paragraph the words GENERATED CONTENT over green" text run at (0,20) width 75: "background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.png index dba7ae6d..53219b9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.txt index 69992d4a..c01b758e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {html} at (0,0) size 800x72 LayoutNGBlockFlow {body} at (8,16) size 784x40 LayoutNGBlockFlow {p} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 620x19 - text run at (0,0) width 620: "You should see after this paragraph the words GENERATED CONTENT over green background" - LayoutInline {<pseudo:after>} at (0,0) size 717x39 [bgcolor=#00FF00] - LayoutTextFragment (anonymous) at (619,0) size 717x39 - text run at (619,0) width 98: "GENERATED" + LayoutText {#text} at (0,0) size 619x19 + text run at (0,0) width 619: "You should see after this paragraph the words GENERATED CONTENT over green background" + LayoutInline {<pseudo:after>} at (0,0) size 716x39 [bgcolor=#00FF00] + LayoutTextFragment (anonymous) at (619,0) size 716x39 + text run at (619,0) width 97: "GENERATED" text run at (0,20) width 77: "CONTENT"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.png index dba7ae6d..53219b9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.txt index 69992d4a..c01b758e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-42a-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {html} at (0,0) size 800x72 LayoutNGBlockFlow {body} at (8,16) size 784x40 LayoutNGBlockFlow {p} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 620x19 - text run at (0,0) width 620: "You should see after this paragraph the words GENERATED CONTENT over green background" - LayoutInline {<pseudo:after>} at (0,0) size 717x39 [bgcolor=#00FF00] - LayoutTextFragment (anonymous) at (619,0) size 717x39 - text run at (619,0) width 98: "GENERATED" + LayoutText {#text} at (0,0) size 619x19 + text run at (0,0) width 619: "You should see after this paragraph the words GENERATED CONTENT over green background" + LayoutInline {<pseudo:after>} at (0,0) size 716x39 [bgcolor=#00FF00] + LayoutTextFragment (anonymous) at (619,0) size 716x39 + text run at (619,0) width 97: "GENERATED" text run at (0,20) width 77: "CONTENT"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.png index f550858b..1a8512c3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.txt index 460c833..0bce0a6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-66-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,0) size 747x19 text run at (0,0) width 747: "This paragraph should be unstyled. The background of the following paragraph should become blue when you follow " LayoutInline {a} at (0,0) size 769x39 [color=#0000EE] - LayoutText {#text} at (746,0) size 769x39 - text run at (746,0) width 23: "this" + LayoutText {#text} at (747,0) size 769x39 + text run at (747,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 4x19 text run at (24,20) width 4: "." @@ -16,8 +16,8 @@ LayoutText {#text} at (0,0) size 731x19 text run at (0,0) width 731: "This paragraph should initially be unstyled. It should become blue when you select the link above. When you select " LayoutInline {a} at (0,0) size 753x39 [color=#0000EE] - LayoutText {#text} at (730,0) size 753x39 - text run at (730,0) width 23: "this" + LayoutText {#text} at (731,0) size 753x39 + text run at (731,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 628x19 text run at (24,20) width 628: ", it should return to being unstyled and the background of the paragraph below should become blue." @@ -25,8 +25,8 @@ LayoutText {#text} at (0,0) size 737x19 text run at (0,0) width 737: "This paragraph should initially be unstyled. It should become blue when you select the link above. When you follow " LayoutInline {a} at (0,0) size 759x39 [color=#0000EE] - LayoutText {#text} at (736,0) size 759x39 - text run at (736,0) width 23: "this" + LayoutText {#text} at (737,0) size 759x39 + text run at (737,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 357x19 text run at (24,20) width 357: ", the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-7-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-7-expected.txt index 47f2e084..e024372 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-7-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-7-expected.txt
@@ -10,9 +10,9 @@ LayoutInline {span} at (0,0) size 156x19 LayoutText {#text} at (0,0) size 156x19 text run at (0,0) width 156: "This address should also" - LayoutText {#text} at (155,0) size 5x19 - text run at (155,0) width 5: " " + LayoutText {#text} at (156,0) size 4x19 + text run at (156,0) width 4: " " LayoutInline {span} at (0,0) size 598x19 - LayoutText {#text} at (159,0) size 598x19 - text run at (159,0) width 598: "have green background because the selector in the last rule does not apply to the inner SPANs." + LayoutText {#text} at (160,0) size 598x19 + text run at (160,0) width 598: "have green background because the selector in the last rule does not apply to the inner SPANs." LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.png index ef1979f..cb1b9f0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.txt index bd1009f..ccbfdc8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-79-expected.txt
@@ -8,11 +8,11 @@ LayoutText {#text} at (0,0) size 192x19 text run at (0,0) width 192: "This div contains 3 addresses :" LayoutNGBlockFlow {address} at (16,20) size 768x20 - LayoutText {#text} at (0,0) size 251x19 - text run at (0,0) width 251: "A first address with normal background" + LayoutText {#text} at (0,0) size 252x19 + text run at (0,0) width 252: "A first address with normal background" LayoutNGBlockFlow {address} at (16,56) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 349x19 - text run at (0,0) width 349: "A second address that should have a green background" + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "A second address that should have a green background" LayoutNGBlockFlow {address} at (16,92) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 335x19 - text run at (0,0) width 335: "A third address that should have a green background" + LayoutText {#text} at (0,0) size 337x19 + text run at (0,0) width 337: "A third address that should have a green background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-8-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-8-expected.txt index 301dd36..b54abfed 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-8-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-8-expected.txt
@@ -10,9 +10,9 @@ LayoutInline {span} at (0,0) size 156x19 LayoutText {#text} at (0,0) size 156x19 text run at (0,0) width 156: "This address should also" - LayoutText {#text} at (155,0) size 5x19 - text run at (155,0) width 5: " " - LayoutInline {span} at (0,0) size 505x19 - LayoutText {#text} at (159,0) size 505x19 - text run at (159,0) width 505: "have green background because the language of the inner SPANs is not French." + LayoutText {#text} at (156,0) size 4x19 + text run at (156,0) width 4: " " + LayoutInline {span} at (0,0) size 506x19 + LayoutText {#text} at (160,0) size 506x19 + text run at (160,0) width 506: "have green background because the language of the inner SPANs is not French." LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-80-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-80-expected.txt index 0518f5c8..2e6568c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-80-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xhtml/css3-modsel-80-expected.txt
@@ -5,14 +5,14 @@ LayoutNGBlockFlow {body} at (8,8) size 784x128 LayoutNGBlockFlow {div} at (0,0) size 784x128 LayoutNGBlockFlow {address} at (16,0) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 329x19 - text run at (0,0) width 329: "A first address that should have a green background" + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "A first address that should have a green background" LayoutNGBlockFlow {address} at (16,36) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 349x19 - text run at (0,0) width 349: "A second address that should have a green background" + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "A second address that should have a green background" LayoutNGBlockFlow {address} at (16,72) size 768x20 - LayoutText {#text} at (0,0) size 256x19 - text run at (0,0) width 256: "A third address with normal background" + LayoutText {#text} at (0,0) size 258x19 + text run at (0,0) width 258: "A third address with normal background" LayoutNGBlockFlow (anonymous) at (0,108) size 784x20 LayoutText {#text} at (0,0) size 289x19 text run at (0,0) width 289: "This div should have three addresses above it."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.png index 0974df0..5febe4dd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.txt index b1f2d08..e2be4f0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-13-expected.txt
@@ -19,7 +19,7 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutInline {span} at (0,0) size 597x19 - LayoutText {#text} at (0,0) size 597x19 - text run at (0,0) width 597: "This list item should have green background because the inner SPAN does not match SPAN.t3" + LayoutInline {span} at (0,0) size 595x19 + LayoutText {#text} at (0,0) size 595x19 + text run at (0,0) width 595: "This list item should have green background because the inner SPAN does not match SPAN.t3" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.png index f7d4d900..1fdcf00 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.txt index 186fb5a..2b1ef339 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-15-expected.txt
@@ -19,6 +19,6 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutInline {span} at (0,0) size 589x19 - LayoutText {#text} at (0,0) size 589x19 - text run at (0,0) width 589: "This list item should have a green background. because the inner SPAN does not match \"#t4\"" + LayoutInline {span} at (0,0) size 588x19 + LayoutText {#text} at (0,0) size 588x19 + text run at (0,0) width 588: "This list item should have a green background. because the inner SPAN does not match \"#t4\""
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18-expected.txt index bdffb5d..333ef9f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18-expected.txt
@@ -8,27 +8,27 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (674,0) size 30x19 text run at (674,0) width 30: "here" - LayoutText {#text} at (703,0) size 744x39 - text run at (703,0) width 41: ") or its" + LayoutText {#text} at (704,0) size 744x39 + text run at (704,0) width 40: ") or its" text run at (0,20) width 157: "whitespace background, " LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (157,20) size 30x19 text run at (157,20) width 30: "here" - LayoutText {#text} at (186,20) size 5x19 - text run at (186,20) width 5: ":" + LayoutText {#text} at (187,20) size 4x19 + text run at (187,20) width 4: ":" LayoutNGBlockFlow {address} at (0,72) size 800x20 LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " - LayoutInline {a} at (0,0) size 115x19 [color=#0000EE] - LayoutText {#text} at (160,0) size 81x19 - text run at (160,0) width 81: "this anchor (" - LayoutInline {strong} at (0,0) size 30x19 - LayoutText {#text} at (240,0) size 30x19 - text run at (240,0) width 30: "here" - LayoutText {#text} at (269,0) size 6x19 - text run at (269,0) width 6: ")" - LayoutText {#text} at (274,0) size 387x19 - text run at (274,0) width 387: " should turn to green when the pointing device hovers over it." + LayoutInline {a} at (0,0) size 114x19 [color=#0000EE] + LayoutText {#text} at (161,0) size 80x19 + text run at (161,0) width 80: "this anchor (" + LayoutInline {strong} at (0,0) size 29x19 + LayoutText {#text} at (241,0) size 29x19 + text run at (241,0) width 29: "here" + LayoutText {#text} at (270,0) size 5x19 + text run at (270,0) width 5: ")" + LayoutText {#text} at (275,0) size 387x19 + text run at (275,0) width 387: " should turn to green when the pointing device hovers over it." LayoutTable {table} at (0,92) size 278x194 LayoutTableSection {tbody} at (0,0) size 278x194 LayoutTableRow {tr} at (0,5) size 278x22 @@ -61,8 +61,8 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (41,1) size 30x19 text run at (41,1) width 30: "here" - LayoutText {#text} at (70,1) size 10x19 - text run at (70,1) width 10: ")." + LayoutText {#text} at (71,1) size 9x19 + text run at (71,1) width 9: ")." LayoutNGTableCell {td} at (174,69) size 99x2 [r=2 c=2 rs=1 cs=1] LayoutTableRow {tr} at (0,86) size 278x22 LayoutNGTableCell {td} at (5,86) size 78x22 [r=3 c=0 rs=1 cs=1] @@ -94,8 +94,8 @@ LayoutInline {strong} at (0,0) size 35x19 LayoutText {#text} at (33,1) size 35x19 text run at (33,1) width 35: "there" - LayoutText {#text} at (67,1) size 5x19 - text run at (67,1) width 5: ":" + LayoutText {#text} at (68,1) size 4x19 + text run at (68,1) width 4: ":" LayoutNGTableCell {td} at (174,150) size 99x2 [r=5 c=2 rs=1 cs=1] LayoutTableRow {tr} at (0,167) size 278x22 LayoutNGTableCell {td} at (5,167) size 78x22 [r=6 c=0 rs=1 cs=1] @@ -104,8 +104,8 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (33,1) size 30x19 text run at (33,1) width 30: "here" - LayoutText {#text} at (62,1) size 5x19 - text run at (62,1) width 5: ":" + LayoutText {#text} at (63,1) size 4x19 + text run at (63,1) width 4: ":" LayoutNGTableCell {td} at (88,177) size 81x2 [r=6 c=1 rs=1 cs=1] LayoutNGTableCell {td} at (174,167) size 99x22 [r=6 c=2 rs=1 cs=1] LayoutText {#text} at (1,1) size 81x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.png index d338961..d873f24 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.txt index 32b2b89..239f067d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-18a-expected.txt
@@ -11,10 +11,10 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 388x19 - text run at (273,0) width 388: " should turn to green when the pointing device hovers over it." + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 387x19 + text run at (274,0) width 387: " should turn to green when the pointing device hovers over it." LayoutNGBlockFlow {p} at (0,52) size 800x20 [color=#000080] LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " @@ -24,15 +24,15 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 51x19 - text run at (273,0) width 51: " should " + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 50x19 + text run at (274,0) width 50: " should " LayoutInline {strong} at (0,0) size 216x19 - LayoutText {#text} at (323,0) size 216x19 - text run at (323,0) width 216: "remain green when you hover it" - LayoutText {#text} at (538,0) size 5x19 - text run at (538,0) width 5: "." + LayoutText {#text} at (324,0) size 216x19 + text run at (324,0) width 216: "remain green when you hover it" + LayoutText {#text} at (540,0) size 4x19 + text run at (540,0) width 4: "." LayoutNGBlockFlow {p} at (0,88) size 800x40 [color=#000080] LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " @@ -42,13 +42,13 @@ LayoutInline {strong} at (0,0) size 30x19 LayoutText {#text} at (239,0) size 30x19 text run at (239,0) width 30: "here" - LayoutText {#text} at (268,0) size 6x19 - text run at (268,0) width 6: ")" - LayoutText {#text} at (273,0) size 51x19 - text run at (273,0) width 51: " should " + LayoutText {#text} at (269,0) size 5x19 + text run at (269,0) width 5: ")" + LayoutText {#text} at (274,0) size 50x19 + text run at (274,0) width 50: " should " LayoutInline {strong} at (0,0) size 358x19 - LayoutText {#text} at (323,0) size 358x19 - text run at (323,0) width 358: "remain green when the pointing device hovers over it" - LayoutText {#text} at (680,0) size 775x39 - text run at (680,0) width 95: " (do not follow" + LayoutText {#text} at (324,0) size 358x19 + text run at (324,0) width 358: "remain green when the pointing device hovers over it" + LayoutText {#text} at (682,0) size 776x39 + text run at (682,0) width 94: " (do not follow" text run at (0,20) width 60: "that link)."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.png index 8866e7f8..5e92284 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.txt index 2853d352..20b1f36d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-21-expected.txt
@@ -6,26 +6,26 @@ LayoutText {#text} at (0,0) size 755x19 text run at (0,0) width 755: "This paragraph should be unstyled. The background of the following paragraph should become green when you follow " LayoutInline {a} at (0,0) size 777x39 [color=#0000EE] - LayoutText {#text} at (754,0) size 777x39 - text run at (754,0) width 23: "this" + LayoutText {#text} at (755,0) size 777x39 + text run at (755,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 4x19 text run at (24,20) width 4: "." LayoutNGBlockFlow {p} at (0,72) size 800x40 LayoutText {#text} at (0,0) size 739x19 text run at (0,0) width 739: "This paragraph should initially be unstyled. It should become green when you select the link above. When you select " - LayoutInline {a} at (0,0) size 51x19 [color=#0000EE] - LayoutText {#text} at (738,0) size 51x19 - text run at (738,0) width 51: "this link" - LayoutText {#text} at (788,0) size 793x39 - text run at (788,0) width 5: "," + LayoutInline {a} at (0,0) size 50x19 [color=#0000EE] + LayoutText {#text} at (739,0) size 50x19 + text run at (739,0) width 50: "this link" + LayoutText {#text} at (789,0) size 793x39 + text run at (789,0) width 4: "," text run at (0,20) width 628: "it should return to being unstyled and the background of the paragraph below should become green." LayoutNGBlockFlow {p} at (0,128) size 800x40 LayoutText {#text} at (0,0) size 745x19 text run at (0,0) width 745: "This paragraph should initially be unstyled. It should become green when you select the link above. When you follow " - LayoutInline {a} at (0,0) size 51x19 [color=#0000EE] - LayoutText {#text} at (744,0) size 51x19 - text run at (744,0) width 51: "this link" - LayoutText {#text} at (794,0) size 799x39 - text run at (794,0) width 5: "," + LayoutInline {a} at (0,0) size 50x19 [color=#0000EE] + LayoutText {#text} at (745,0) size 50x19 + text run at (745,0) width 50: "this link" + LayoutText {#text} at (795,0) size 799x39 + text run at (795,0) width 4: "," text run at (0,20) width 349: "the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.png index 3daca99a..d2af8090 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.txt index ab9fe9a0..7d1cecbf 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-22-expected.txt
@@ -13,8 +13,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (0,0) size 482x19 - text run at (0,0) width 482: "This list item should be green because its language is British English (Wales)" + LayoutText {#text} at (0,0) size 481x19 + text run at (0,0) width 481: "This list item should be green because its language is British English (Wales)" LayoutNGBlockFlow {ol} at (0,72) size 800x40 LayoutNGListItem {li} at (40,0) size 760x20 LayoutNGListMarker (anonymous) at (-16,0) size 16x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-3-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-3-expected.png index f698a64f..e40c20a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-3-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-34-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-34-expected.txt index f05ea722..a18c304 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-34-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-34-expected.txt
@@ -7,11 +7,11 @@ LayoutText {#text} at (0,0) size 188x19 text run at (0,0) width 188: "This div contains 3 addresses:" LayoutNGBlockFlow {address} at (16,20) size 784x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 329x19 - text run at (0,0) width 329: "A first address that should have a green background" + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "A first address that should have a green background" LayoutNGBlockFlow {address} at (16,56) size 784x20 - LayoutText {#text} at (0,0) size 271x19 - text run at (0,0) width 271: "A second address with normal background" + LayoutText {#text} at (0,0) size 272x19 + text run at (0,0) width 272: "A second address with normal background" LayoutNGBlockFlow {address} at (16,92) size 784x20 - LayoutText {#text} at (0,0) size 256x19 - text run at (0,0) width 256: "A third address with normal background" + LayoutText {#text} at (0,0) size 258x19 + text run at (0,0) width 258: "A third address with normal background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-35-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-35-expected.png index ad4075a..10decd4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-35-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-35-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39-expected.png index 4e036086..7e051227 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39a-expected.txt index b45d453e..d2221c6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39a-expected.txt
@@ -9,7 +9,7 @@ text run at (0,0) width 20: "T" LayoutTextFragment (anonymous) at (0,0) size 0x0 LayoutText {#text} at (20,13) size 779x243 - text run at (20,13) width 731: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." + text run at (20,13) width 730: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,37) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,57) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,77) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39b-expected.png index 4e036086..7e051227 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39c-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39c-expected.txt index b45d453e..d2221c6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39c-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-39c-expected.txt
@@ -9,7 +9,7 @@ text run at (0,0) width 20: "T" LayoutTextFragment (anonymous) at (0,0) size 0x0 LayoutText {#text} at (20,13) size 779x243 - text run at (20,13) width 731: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." + text run at (20,13) width 730: "his very long paragraph should have a big green first letter T. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,37) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,57) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text." text run at (0,77) width 779: "Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text. Dummy text."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.png index 348c59cd..bfa059e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.txt index 1fbea59..553a20d3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41-expected.txt
@@ -6,6 +6,6 @@ LayoutInline {<pseudo:before>} at (0,0) size 182x19 [bgcolor=#00FF00] LayoutTextFragment (anonymous) at (0,0) size 182x19 text run at (0,0) width 182: "GENERATED CONTENT " - LayoutText {#text} at (181,0) size 734x39 - text run at (181,0) width 553: "You should see before this paragraph the words GENERATED CONTENT over green" + LayoutText {#text} at (182,0) size 734x39 + text run at (182,0) width 552: "You should see before this paragraph the words GENERATED CONTENT over green" text run at (0,20) width 75: "background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.png index 348c59cd..bfa059e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.txt index 1fbea59..553a20d3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-41a-expected.txt
@@ -6,6 +6,6 @@ LayoutInline {<pseudo:before>} at (0,0) size 182x19 [bgcolor=#00FF00] LayoutTextFragment (anonymous) at (0,0) size 182x19 text run at (0,0) width 182: "GENERATED CONTENT " - LayoutText {#text} at (181,0) size 734x39 - text run at (181,0) width 553: "You should see before this paragraph the words GENERATED CONTENT over green" + LayoutText {#text} at (182,0) size 734x39 + text run at (182,0) width 552: "You should see before this paragraph the words GENERATED CONTENT over green" text run at (0,20) width 75: "background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.png index bcdc6b87..48c7737 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.txt index 57b74964..a5892189 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x52 LayoutNGBlockFlow {test} at (0,0) size 800x52 LayoutNGBlockFlow {p} at (0,16) size 800x20 - LayoutText {#text} at (0,0) size 620x19 - text run at (0,0) width 620: "You should see after this paragraph the words GENERATED CONTENT over green background" - LayoutInline {<pseudo:after>} at (0,0) size 179x19 [bgcolor=#00FF00] - LayoutTextFragment (anonymous) at (619,0) size 179x19 - text run at (619,0) width 179: "GENERATED CONTENT" + LayoutText {#text} at (0,0) size 619x19 + text run at (0,0) width 619: "You should see after this paragraph the words GENERATED CONTENT over green background" + LayoutInline {<pseudo:after>} at (0,0) size 178x19 [bgcolor=#00FF00] + LayoutTextFragment (anonymous) at (619,0) size 178x19 + text run at (619,0) width 178: "GENERATED CONTENT"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.png index bcdc6b87..48c7737 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.txt index 57b74964..a5892189 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-42a-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x52 LayoutNGBlockFlow {test} at (0,0) size 800x52 LayoutNGBlockFlow {p} at (0,16) size 800x20 - LayoutText {#text} at (0,0) size 620x19 - text run at (0,0) width 620: "You should see after this paragraph the words GENERATED CONTENT over green background" - LayoutInline {<pseudo:after>} at (0,0) size 179x19 [bgcolor=#00FF00] - LayoutTextFragment (anonymous) at (619,0) size 179x19 - text run at (619,0) width 179: "GENERATED CONTENT" + LayoutText {#text} at (0,0) size 619x19 + text run at (0,0) width 619: "You should see after this paragraph the words GENERATED CONTENT over green background" + LayoutInline {<pseudo:after>} at (0,0) size 178x19 [bgcolor=#00FF00] + LayoutTextFragment (anonymous) at (619,0) size 178x19 + text run at (619,0) width 178: "GENERATED CONTENT"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.png index 2bff7d5d..096cc7e4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.txt index 75588da..d567e199 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-66-expected.txt
@@ -6,26 +6,26 @@ LayoutText {#text} at (0,0) size 747x19 text run at (0,0) width 747: "This paragraph should be unstyled. The background of the following paragraph should become blue when you follow " LayoutInline {a} at (0,0) size 769x39 [color=#0000EE] - LayoutText {#text} at (746,0) size 769x39 - text run at (746,0) width 23: "this" + LayoutText {#text} at (747,0) size 769x39 + text run at (747,0) width 22: "this" text run at (0,20) width 24: "link" LayoutText {#text} at (24,20) size 4x19 text run at (24,20) width 4: "." LayoutNGBlockFlow {p} at (0,72) size 800x40 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 731x19 text run at (0,0) width 731: "This paragraph should initially be unstyled. It should become blue when you select the link above. When you select " - LayoutInline {a} at (0,0) size 51x19 [color=#0000EE] - LayoutText {#text} at (730,0) size 51x19 - text run at (730,0) width 51: "this link" - LayoutText {#text} at (780,0) size 797x39 - text run at (780,0) width 17: ", it" + LayoutInline {a} at (0,0) size 50x19 [color=#0000EE] + LayoutText {#text} at (731,0) size 50x19 + text run at (731,0) width 50: "this link" + LayoutText {#text} at (781,0) size 797x39 + text run at (781,0) width 16: ", it" text run at (0,20) width 608: "should return to being unstyled and the background of the paragraph below should become blue." LayoutNGBlockFlow {p} at (0,128) size 800x40 [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 737x19 text run at (0,0) width 737: "This paragraph should initially be unstyled. It should become blue when you select the link above. When you follow " - LayoutInline {a} at (0,0) size 51x19 [color=#0000EE] - LayoutText {#text} at (736,0) size 51x19 - text run at (736,0) width 51: "this link" - LayoutText {#text} at (786,0) size 791x39 - text run at (786,0) width 5: "," + LayoutInline {a} at (0,0) size 50x19 [color=#0000EE] + LayoutText {#text} at (737,0) size 50x19 + text run at (737,0) width 50: "this link" + LayoutText {#text} at (787,0) size 791x39 + text run at (787,0) width 4: "," text run at (0,20) width 349: "the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-7-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-7-expected.txt index fd241e9..b0d8ee7d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-7-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-7-expected.txt
@@ -9,9 +9,9 @@ LayoutInline {span} at (0,0) size 156x19 LayoutText {#text} at (0,0) size 156x19 text run at (0,0) width 156: "This address should also" - LayoutText {#text} at (155,0) size 5x19 - text run at (155,0) width 5: " " + LayoutText {#text} at (156,0) size 4x19 + text run at (156,0) width 4: " " LayoutInline {span} at (0,0) size 598x19 - LayoutText {#text} at (159,0) size 598x19 - text run at (159,0) width 598: "have green background because the selector in the last rule does not apply to the inner SPANs." + LayoutText {#text} at (160,0) size 598x19 + text run at (160,0) width 598: "have green background because the selector in the last rule does not apply to the inner SPANs." LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.png index a998a86..0a73188 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.txt index 34cf022..b0437d7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-79-expected.txt
@@ -7,11 +7,11 @@ LayoutText {#text} at (0,0) size 192x19 text run at (0,0) width 192: "This div contains 3 addresses :" LayoutNGBlockFlow {address} at (16,20) size 784x20 - LayoutText {#text} at (0,0) size 251x19 - text run at (0,0) width 251: "A first address with normal background" + LayoutText {#text} at (0,0) size 252x19 + text run at (0,0) width 252: "A first address with normal background" LayoutNGBlockFlow {address} at (16,56) size 784x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 349x19 - text run at (0,0) width 349: "A second address that should have a green background" + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "A second address that should have a green background" LayoutNGBlockFlow {address} at (16,92) size 784x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 335x19 - text run at (0,0) width 335: "A third address that should have a green background" + LayoutText {#text} at (0,0) size 337x19 + text run at (0,0) width 337: "A third address that should have a green background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-8-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-8-expected.txt index 7692bb1..c298189f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-8-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-8-expected.txt
@@ -9,9 +9,9 @@ LayoutInline {span} at (0,0) size 156x19 LayoutText {#text} at (0,0) size 156x19 text run at (0,0) width 156: "This address should also" - LayoutText {#text} at (155,0) size 5x19 - text run at (155,0) width 5: " " - LayoutInline {span} at (0,0) size 505x19 - LayoutText {#text} at (159,0) size 505x19 - text run at (159,0) width 505: "have green background because the language of the inner SPANs is not French." + LayoutText {#text} at (156,0) size 4x19 + text run at (156,0) width 4: " " + LayoutInline {span} at (0,0) size 506x19 + LayoutText {#text} at (160,0) size 506x19 + text run at (160,0) width 506: "have green background because the language of the inner SPANs is not French." LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-80-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-80-expected.txt index 526c900..1f3dcc8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-80-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/css3/selectors3/xml/css3-modsel-80-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {test} at (0,0) size 800x128 LayoutNGBlockFlow {div} at (0,0) size 800x128 LayoutNGBlockFlow {address} at (16,0) size 784x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 329x19 - text run at (0,0) width 329: "A first address that should have a green background" + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "A first address that should have a green background" LayoutNGBlockFlow {address} at (16,36) size 784x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 349x19 - text run at (0,0) width 349: "A second address that should have a green background" + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "A second address that should have a green background" LayoutNGBlockFlow {address} at (16,72) size 784x20 - LayoutText {#text} at (0,0) size 256x19 - text run at (0,0) width 256: "A third address with normal background" + LayoutText {#text} at (0,0) size 258x19 + text run at (0,0) width 258: "A third address with normal background" LayoutNGBlockFlow (anonymous) at (0,108) size 800x20 LayoutText {#text} at (0,0) size 289x19 text run at (0,0) width 289: "This div should have three addresses above it."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-003-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-003-expected.txt index fc3bbec3..b6a75db7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-003-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-003-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x215 LayoutNGBlockFlow {BODY} at (8,16) size 784x191 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 765x19 - text run at (0,0) width 765: "Test passes if, when the text area below is focused for editing, the text insertion caret is green, like the text in that textarea." + LayoutText {#text} at (0,0) size 764x19 + text run at (0,0) width 764: "Test passes if, when the text area below is focused for editing, the text insertion caret is green, like the text in that textarea." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 432x19 text run at (0,0) width 432: "The shape of the caret, and whether it flashes, are not part of the test."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-004-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-004-expected.txt index e148010b..7763b9e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-004-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-004-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x235 LayoutNGBlockFlow {BODY} at (8,16) size 784x211 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 775x39 - text run at (0,0) width 775: "Test passes if, when the text area below is focused for editing, the text insertion caret is either black or some other color that" + LayoutText {#text} at (0,0) size 774x39 + text run at (0,0) width 774: "Test passes if, when the text area below is focused for editing, the text insertion caret is either black or some other color that" text run at (0,20) width 224: "contrasts well with the background." LayoutNGBlockFlow {P} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 432x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-005-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-005-expected.txt index 9b5e4a0..69f9e23e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-005-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-color-005-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x235 LayoutNGBlockFlow {BODY} at (8,16) size 784x211 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 776x39 - text run at (0,0) width 776: "Test passes if, when the text area below is focused for editing, the text insertion caret is either white or some other color that" + LayoutText {#text} at (0,0) size 775x39 + text run at (0,0) width 775: "Test passes if, when the text area below is focused for editing, the text insertion caret is either white or some other color that" text run at (0,20) width 224: "contrasts well with the background." LayoutNGBlockFlow {P} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 432x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-position-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-position-expected.txt index bb0d7b1..f70f4cba 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-position-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/caret/caret-position-expected.txt
@@ -3,10 +3,10 @@ layer at (0,0) size 800x38 LayoutNGBlockFlow {HTML} at (0,0) size 800x38 LayoutNGBlockFlow {BODY} at (8,8) size 784x22 - LayoutText {#text} at (0,1) size 313x19 - text run at (0,1) width 313: "This tests if the caret position is aligned correctly. " - LayoutTextControl {INPUT} at (312.97,0) size 205x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutText {#text} at (0,1) size 312x19 + text run at (0,1) width 312: "This tests if the caret position is aligned correctly. " + LayoutTextControl {INPUT} at (312,0) size 205x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 -layer at (324,11) size 200x16 +layer at (323,11) size 200x16 LayoutBlockFlow {DIV} at (3,3) size 200x16 caret: position 0 of child 0 {DIV} of {#document-fragment} of child 1 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/4922367-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/4922367-expected.txt new file mode 100644 index 0000000..79060e8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/4922367-expected.txt
@@ -0,0 +1,22 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 772x39 + text run at (0,0) width 772: "This tests selecting and deleting the paragraph before a table. You should see only a table in the editable region below, with" + text run at (0,20) width 139: "the caret just before it." + LayoutBlockFlow {DIV} at (0,56) size 784x30 + LayoutBlockFlow {DIV} at (0,0) size 784x30 + LayoutTable {TABLE} at (0,0) size 32x30 [border: (1px solid #BBBBBB)] + LayoutTableSection {TBODY} at (1,1) size 30x28 + LayoutTableRow {TR} at (0,2) size 30x24 + LayoutTableCell {TD} at (2,2) size 12x24 [border: (1px solid #BBBBBB)] [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 8x19 + text run at (2,2) width 8: "1" + LayoutTableCell {TD} at (16,2) size 12x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 8x19 + text run at (2,2) width 8: "2" + LayoutNGBlockFlow {UL} at (0,102) size 784x0 +caret: position 0 of child 0 {TABLE} of child 1 {DIV} of child 2 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5433862-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5433862-2-expected.txt index e8235f8..994fd82 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5433862-2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5433862-2-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 783x39 text run at (0,0) width 783: "This tests for a bug where empty table rows well after the selection to delete were removed. There should be five rows in the" - text run at (0,20) width 260: "table below, before and after the deletion." + text run at (0,20) width 259: "table below, before and after the deletion." LayoutBlockFlow {DIV} at (0,56) size 784x140 LayoutTable {TABLE} at (0,0) size 109x140 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 107x138
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5483370-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5483370-expected.txt index 723f711..98cb6fd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5483370-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/deleting/5483370-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 760x39 - text run at (0,0) width 760: "This tests for a problem where empty table rows after the selection being deleted would be removed incorrectly. Only the" - text run at (0,20) width 343: "last letter in 'foo' should be removed during this delete." + LayoutText {#text} at (0,0) size 784x39 + text run at (0,0) width 784: "This tests for a problem where empty table rows after the selection being deleted would be removed incorrectly. Only the last" + text run at (0,20) width 318: "letter in 'foo' should be removed during this delete." LayoutBlockFlow {DIV} at (0,56) size 784x56 LayoutTable {TABLE} at (0,0) size 29x56 [border: (1px outset #808080)] LayoutTableSection {TBODY} at (1,1) size 27x54
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/execCommand/5142012-1-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/execCommand/5142012-1-expected.txt index d0b27b58..d4b13105 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/execCommand/5142012-1-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/execCommand/5142012-1-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 766x39 text run at (0,0) width 766: "This tests for a bug when removing links from a selection with Unlink. There shouldn't be any links *inside the selection*" - text run at (0,20) width 42: "below." + text run at (0,20) width 41: "below." LayoutBlockFlow {DIV} at (0,56) size 784x40 LayoutBlockFlow {DIV} at (0,0) size 784x20 LayoutInline {A} at (0,0) size 23x19 [color=#0000EE]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/5510537-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/5510537-expected.txt index c584ee07..249f6d6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/5510537-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/5510537-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 773x39 text run at (0,0) width 773: "This tests that inserting a newline at the beginning of quoted content doesn't add an extra quoted line. The test has passed if" - text run at (0,20) width 400: "there are no empty lines (quoted or unquoted) in the box below." + text run at (0,20) width 399: "there are no empty lines (quoted or unquoted) in the box below." LayoutBlockFlow {DIV} at (0,56) size 784x100 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 LayoutText {#text} at (0,0) size 59x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/5549929-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/5549929-2-expected.txt new file mode 100644 index 0000000..895e21a3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/5549929-2-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 733x39 + text run at (0,0) width 733: "This tests to make sure that a br isn't inserted into a tab span during an InsertLineBreak operation. You can test for its" + text run at (0,20) width 432: "existence with the DOM inspector or you can look at the render tree." + LayoutBlockFlow {DIV} at (0,56) size 784x40 + LayoutBlockFlow {DIV} at (0,0) size 784x40 + LayoutBR {BR} at (0,0) size 0x19 + LayoutInline {SPAN} at (0,0) size 32x19 + LayoutText {#text} at (0,20) size 32x19 + text run at (0,20) width 32: "\x{9}" + LayoutText {#text} at (32,20) size 20x19 + text run at (32,20) width 20: "bar" +caret: position 0 of child 0 {#text} of child 1 {SPAN} of child 1 {DIV} of child 2 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/6703873-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/6703873-expected.txt index 79d0e0a..cbe0b10c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/6703873-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/inserting/6703873-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 742x39 text run at (0,0) width 742: "This tests that inserting a newline in place of a full line of quoted content doesn't add an extra quoted line. The test has" - text run at (0,20) width 459: "passed if there are no empty lines (quoted or unquoted) in the box below." + text run at (0,20) width 458: "passed if there are no empty lines (quoted or unquoted) in the box below." LayoutBlockFlow {DIV} at (0,56) size 784x60 LayoutBlockFlow {BLOCKQUOTE} at (0,0) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)] LayoutBlockFlow {DIV} at (12,0) size 772x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/4806874-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/4806874-expected.txt new file mode 100644 index 0000000..3bd7e47 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/4806874-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 543x19 + text run at (0,0) width 543: "This tests for an infinite loop on Paste. You should see 'Hello: ' and then an input field." + LayoutBlockFlow {DIV} at (0,36) size 784x22 + LayoutText {#text} at (0,1) size 35x19 + text run at (0,1) width 35: "Hello" + LayoutTextControl {INPUT} at (35,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutText {#text} at (189,1) size 4x19 + text run at (189,1) width 4: ":" +layer at (45,47) size 150x16 + LayoutBlockFlow {DIV} at (2,3) size 150x16 +caret: position 1 of child 1 {INPUT} of child 2 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/4947130-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/4947130-expected.txt new file mode 100644 index 0000000..2548098 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/4947130-expected.txt
@@ -0,0 +1,20 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 778x39 + text run at (0,0) width 778: "This tests to see if dragging an image is a move drag by default (it should be). You should only see one picture and it should" + text run at (0,20) width 200: "be somewhere near the middle. " + LayoutInline {B} at (0,0) size 492x19 + LayoutText {#text} at (200,20) size 492x19 + text run at (200,20) width 492: "This demonstrates a bug, the ghost of the drag caret is left after the drop." + LayoutBlockFlow {DIV} at (0,56) size 784x108 + LayoutText {#text} at (0,88) size 48x19 + text run at (0,88) width 48: "xxxxxx" + LayoutImage {IMG} at (48,0) size 76x103 + LayoutText {#text} at (124,88) size 32x19 + text run at (124,88) width 32: "xxxx" +selection start: position 0 of child 1 {IMG} of child 2 {DIV} of body +selection end: position 1 of child 1 {IMG} of child 2 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5006779-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5006779-expected.txt index 776cd04..2db61962 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5006779-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5006779-expected.txt
@@ -13,11 +13,11 @@ LayoutBR {BR} at (20,15) size 0x0 LayoutBR {BR} at (0,20) size 0x19 LayoutBlockFlow {BLOCKQUOTE} at (0,40) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)] - LayoutText {#text} at (12,0) size 163x19 - text run at (12,0) width 163: "On Tuesday, Dave wrote:" + LayoutText {#text} at (12,0) size 162x19 + text run at (12,0) width 162: "On Tuesday, Dave wrote:" LayoutBlockFlow {BLOCKQUOTE} at (0,60) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)] LayoutBR {BR} at (12,0) size 0x19 LayoutBlockFlow {BLOCKQUOTE} at (0,80) size 784x20 [color=#0000FF] [border: none (2px solid #0000FF)] - LayoutText {#text} at (12,0) size 82x19 - text run at (12,0) width 82: "Hello World." + LayoutText {#text} at (12,0) size 81x19 + text run at (12,0) width 81: "Hello World." caret: position 3 of child 0 {#text} of child 2 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5134759-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5134759-expected.txt new file mode 100644 index 0000000..46e796c --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5134759-expected.txt
@@ -0,0 +1,22 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 646x19 + text run at (0,0) width 646: "This tests for a hang when pasting underlined content at the end of a paragraph. You should see 'Hello " + LayoutInline {U} at (0,0) size 43x19 + LayoutText {#text} at (646,0) size 43x19 + text run at (646,0) width 43: "World!" + LayoutText {#text} at (689,0) size 48x19 + text run at (689,0) width 48: "' below." + LayoutBlockFlow {DIV} at (0,36) size 784x20 + LayoutBlockFlow {DIV} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Hello " + LayoutInline {SPAN} at (0,0) size 43x19 + LayoutText {#text} at (39,0) size 43x19 + text run at (39,0) width 43: "World!" + LayoutNGBlockFlow (anonymous) at (0,20) size 784x0 +caret: position 6 of child 0 {#text} of child 1 {SPAN} of child 0 {DIV} of child 2 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5601583-1-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5601583-1-expected.txt index 8f0d85d8..e062d5c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5601583-1-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/pasteboard/5601583-1-expected.txt
@@ -6,20 +6,20 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 719x39 text run at (0,0) width 719: "This tests for a bug where a copied link wouldn't paste as a link. Both editable regions below should contain a link" - text run at (0,20) width 104: "\"Hello\\nWorld\"." + text run at (0,20) width 103: "\"Hello\\nWorld\"." LayoutBlockFlow {DIV} at (0,56) size 784x40 - LayoutInline {A} at (0,0) size 39x39 [color=#0000EE] + LayoutInline {A} at (0,0) size 38x39 [color=#0000EE] LayoutText {#text} at (0,0) size 35x19 text run at (0,0) width 35: "Hello" LayoutBR {BR} at (35,15) size 0x0 - LayoutText {#text} at (0,20) size 39x19 - text run at (0,20) width 39: "World" + LayoutText {#text} at (0,20) size 38x19 + text run at (0,20) width 38: "World" LayoutText {#text} at (0,0) size 0x0 LayoutBlockFlow {DIV} at (0,96) size 784x40 - LayoutInline {A} at (0,0) size 39x39 [color=#0000EE] + LayoutInline {A} at (0,0) size 38x39 [color=#0000EE] LayoutText {#text} at (0,0) size 35x19 text run at (0,0) width 35: "Hello" LayoutBR {BR} at (35,15) size 0x0 - LayoutText {#text} at (0,20) size 39x19 - text run at (0,20) width 39: "World" + LayoutText {#text} at (0,20) size 38x19 + text run at (0,20) width 38: "World" caret: position 5 of child 2 {#text} of child 0 {A} of child 4 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-1-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-1-expected.txt index d92823ce..be58c6a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-1-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-1-expected.txt
@@ -11,16 +11,16 @@ LayoutBlockFlow {DIV} at (26,26) size 732x20 LayoutText {#text} at (0,0) size 99x19 text run at (0,0) width 99: "Paragraph One." - LayoutTable {TABLE} at (26,46) size 92x30 [border: (1px solid #BBBBBB)] - LayoutTableSection {TBODY} at (1,1) size 90x28 - LayoutTableRow {TR} at (0,2) size 90x24 [border: (1px solid #BBBBBB)] + LayoutTable {TABLE} at (26,46) size 91x30 [border: (1px solid #BBBBBB)] + LayoutTableSection {TBODY} at (1,1) size 89x28 + LayoutTableRow {TR} at (0,2) size 89x24 [border: (1px solid #BBBBBB)] LayoutTableCell {TD} at (2,2) size 8x24 [border: (1px solid #BBBBBB)] [r=0 c=0 rs=1 cs=1] LayoutText {#text} at (2,2) size 4x19 text run at (2,2) width 4: " " - LayoutTableCell {TD} at (12,2) size 76x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] - LayoutText {#text} at (2,2) size 72x19 - text run at (2,2) width 72: "ToDo One." + LayoutTableCell {TD} at (12,2) size 75x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 71x19 + text run at (2,2) width 71: "ToDo One." LayoutBlockFlow {DIV} at (26,76) size 732x20 - LayoutText {#text} at (0,0) size 101x19 - text run at (0,0) width 101: "Paragraph Two." + LayoutText {#text} at (0,0) size 100x19 + text run at (0,0) width 100: "Paragraph Two." caret: position 0 of child 0 {#text} of child 1 {DIV} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.png index e9268a7..7b3dd3c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.txt index 9ff0f4f..a8e2d2a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-2-expected.txt
@@ -4,23 +4,23 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 776x39 - text run at (0,0) width 776: "This tests clicking to place a caret in the padding of an editable region. The eventSender clicks to the left of the ToDo in the" - text run at (0,20) width 503: "left padding of the editable region and the caret should be just before that ToDo." + LayoutText {#text} at (0,0) size 775x39 + text run at (0,0) width 775: "This tests clicking to place a caret in the padding of an editable region. The eventSender clicks to the left of the ToDo in the" + text run at (0,20) width 502: "left padding of the editable region and the caret should be just before that ToDo." LayoutBlockFlow {DIV} at (0,56) size 784x122 [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (26,26) size 732x20 LayoutText {#text} at (0,0) size 99x19 text run at (0,0) width 99: "Paragraph One." - LayoutTable {TABLE} at (26,46) size 92x30 [border: (1px solid #BBBBBB)] - LayoutTableSection {TBODY} at (1,1) size 90x28 - LayoutTableRow {TR} at (0,2) size 90x24 [border: (1px solid #BBBBBB)] + LayoutTable {TABLE} at (26,46) size 91x30 [border: (1px solid #BBBBBB)] + LayoutTableSection {TBODY} at (1,1) size 89x28 + LayoutTableRow {TR} at (0,2) size 89x24 [border: (1px solid #BBBBBB)] LayoutTableCell {TD} at (2,2) size 8x24 [border: (1px solid #BBBBBB)] [r=0 c=0 rs=1 cs=1] LayoutText {#text} at (2,2) size 4x19 text run at (2,2) width 4: " " - LayoutTableCell {TD} at (12,2) size 76x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] - LayoutText {#text} at (2,2) size 72x19 - text run at (2,2) width 72: "ToDo One." + LayoutTableCell {TD} at (12,2) size 75x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 71x19 + text run at (2,2) width 71: "ToDo One." LayoutBlockFlow {DIV} at (26,76) size 732x20 - LayoutText {#text} at (0,0) size 101x19 - text run at (0,0) width 101: "Paragraph Two." + LayoutText {#text} at (0,0) size 100x19 + text run at (0,0) width 100: "Paragraph Two." caret: position 0 of child 3 {TABLE} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-3-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-3-expected.txt index 73af418..5ff9cb7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-3-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-3-expected.txt
@@ -11,16 +11,16 @@ LayoutBlockFlow {DIV} at (26,26) size 732x20 LayoutText {#text} at (0,0) size 99x19 text run at (0,0) width 99: "Paragraph One." - LayoutTable {TABLE} at (26,46) size 92x30 [border: (1px solid #BBBBBB)] - LayoutTableSection {TBODY} at (1,1) size 90x28 - LayoutTableRow {TR} at (0,2) size 90x24 [border: (1px solid #BBBBBB)] + LayoutTable {TABLE} at (26,46) size 91x30 [border: (1px solid #BBBBBB)] + LayoutTableSection {TBODY} at (1,1) size 89x28 + LayoutTableRow {TR} at (0,2) size 89x24 [border: (1px solid #BBBBBB)] LayoutTableCell {TD} at (2,2) size 8x24 [border: (1px solid #BBBBBB)] [r=0 c=0 rs=1 cs=1] LayoutText {#text} at (2,2) size 4x19 text run at (2,2) width 4: " " - LayoutTableCell {TD} at (12,2) size 76x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] - LayoutText {#text} at (2,2) size 72x19 - text run at (2,2) width 72: "ToDo One." + LayoutTableCell {TD} at (12,2) size 75x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 71x19 + text run at (2,2) width 71: "ToDo One." LayoutBlockFlow {DIV} at (26,76) size 732x20 - LayoutText {#text} at (0,0) size 101x19 - text run at (0,0) width 101: "Paragraph Two." + LayoutText {#text} at (0,0) size 100x19 + text run at (0,0) width 100: "Paragraph Two." caret: position 0 of child 0 {#text} of child 5 {DIV} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-4-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-4-expected.txt index 632002de..caea3b9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-4-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/5131716-4-expected.txt
@@ -11,16 +11,16 @@ LayoutBlockFlow {DIV} at (26,26) size 732x20 LayoutText {#text} at (0,0) size 99x19 text run at (0,0) width 99: "Paragraph One." - LayoutTable {TABLE} at (26,46) size 92x30 [border: (1px solid #BBBBBB)] - LayoutTableSection {TBODY} at (1,1) size 90x28 - LayoutTableRow {TR} at (0,2) size 90x24 [border: (1px solid #BBBBBB)] + LayoutTable {TABLE} at (26,46) size 91x30 [border: (1px solid #BBBBBB)] + LayoutTableSection {TBODY} at (1,1) size 89x28 + LayoutTableRow {TR} at (0,2) size 89x24 [border: (1px solid #BBBBBB)] LayoutTableCell {TD} at (2,2) size 8x24 [border: (1px solid #BBBBBB)] [r=0 c=0 rs=1 cs=1] LayoutText {#text} at (2,2) size 4x19 text run at (2,2) width 4: " " - LayoutTableCell {TD} at (12,2) size 76x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] - LayoutText {#text} at (2,2) size 72x19 - text run at (2,2) width 72: "ToDo One." + LayoutTableCell {TD} at (12,2) size 75x24 [border: (1px solid #BBBBBB)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 71x19 + text run at (2,2) width 71: "ToDo One." LayoutBlockFlow {DIV} at (26,76) size 732x20 - LayoutText {#text} at (0,0) size 101x19 - text run at (0,0) width 101: "Paragraph Two." + LayoutText {#text} at (0,0) size 100x19 + text run at (0,0) width 100: "Paragraph Two." caret: position 14 of child 0 {#text} of child 5 {DIV} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.png index 073dd11..0c1bb1b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.txt index 3d7e0af..dc30052 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/6476-expected.txt
@@ -7,12 +7,12 @@ LayoutBlockFlow {DIV} at (0,0) size 250x40 LayoutText {#text} at (0,0) size 203x19 text run at (0,0) width 203: "Try to create a caret after this lin" - LayoutInline {SPAN} at (0,0) size 8x19 - LayoutText {#text} at (202,0) size 8x19 - text run at (202,0) width 8: "e" - LayoutText {#text} at (209,0) size 5x19 - text run at (209,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 1x19 + LayoutInline {SPAN} at (0,0) size 7x19 + LayoutText {#text} at (203,0) size 7x19 + text run at (203,0) width 7: "e" + LayoutText {#text} at (210,0) size 4x19 + text run at (210,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 0x19 LayoutText {#text} at (0,20) size 181x19 text run at (0,20) width 181: "thisshouldbeonthesecondline" LayoutNGBlockFlow {P} at (0,66) size 784x40 @@ -21,12 +21,12 @@ LayoutInline {A} at (0,0) size 343x19 [color=#0000EE] LayoutText {#text} at (131,0) size 343x19 text run at (131,0) width 343: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6476" - LayoutText {#text} at (473,0) size 779x39 - text run at (473,0) width 306: ". Creating an upstream caret with the mouse was" + LayoutText {#text} at (474,0) size 779x39 + text run at (474,0) width 305: ". Creating an upstream caret with the mouse was" text run at (0,20) width 591: "impossible if the upstream and downstream carets were separated only by unrendered content." LayoutNGBlockFlow {P} at (0,122) size 784x40 - LayoutText {#text} at (0,0) size 764x39 - text run at (0,0) width 764: "This test uses the eventSender to do mouse clicks. To run it manually, click in the space after all the text on the first line in" + LayoutText {#text} at (0,0) size 762x39 + text run at (0,0) width 762: "This test uses the eventSender to do mouse clicks. To run it manually, click in the space after all the text on the first line in" text run at (0,20) width 550: "the above editable region. Clicking should create a caret after the first space after the 'e'." layer at (8,56) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,48) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-and-focus-ring-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-and-focus-ring-expected.png index 5076a83..b3141c11 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-and-focus-ring-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-and-focus-ring-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.png index 7506797..17d3f2d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.txt index b902154..5dc79b7e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-expected.txt
@@ -6,12 +6,12 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 754x39 text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for LTR text in a RTL block. To test" - text run at (0,20) width 464: "manually, click the right of the text. The caret should be on the right edge." + text run at (0,20) width 463: "manually, click the right of the text. The caret should be on the right edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] - LayoutText {#text} at (118,11) size 73x22 - text run at (118,11) width 73: "WebKit2" + LayoutText {#text} at (119,11) size 72x22 + text run at (119,11) width 72: "WebKit2" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 0 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.png index 5168f8ad..915f189 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.txt index 0be69bf..80764235 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-2-left-expected.txt
@@ -6,12 +6,12 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 754x39 text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for LTR text in a RTL block. To test" - text run at (0,20) width 446: "manually, click the left of the text. The caret should be on the left edge." + text run at (0,20) width 445: "manually, click the left of the text. The caret should be on the left edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] - LayoutText {#text} at (118,11) size 73x22 - text run at (118,11) width 73: "WebKit2" + LayoutText {#text} at (119,11) size 72x22 + text run at (119,11) width 72: "WebKit2" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 7 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-expected.txt index 12f5145..e449ae5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x145 LayoutNGBlockFlow {BODY} at (8,16) size 784x121 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 754x39 - text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for LTR text in a LTR block. To test" - text run at (0,20) width 446: "manually, click the left of the text. The caret should be on the left edge." + LayoutText {#text} at (0,0) size 752x39 + text run at (0,0) width 752: "This tests that clicking in a contenteditable div will set the caret in the right position for LTR text in a LTR block. To test" + text run at (0,20) width 445: "manually, click the left of the text. The caret should be on the left edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] - LayoutText {#text} at (11,11) size 73x22 - text run at (11,11) width 73: "WebKit2" + LayoutText {#text} at (11,11) size 72x22 + text run at (11,11) width 72: "WebKit2" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 0 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-right-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-right-expected.txt index 1a039df..5134e04 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-right-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-ltr-right-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x145 LayoutNGBlockFlow {BODY} at (8,16) size 784x121 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 754x39 - text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for LTR text in a LTR block. To test" - text run at (0,20) width 464: "manually, click the right of the text. The caret should be on the right edge." + LayoutText {#text} at (0,0) size 752x39 + text run at (0,0) width 752: "This tests that clicking in a contenteditable div will set the caret in the right position for LTR text in a LTR block. To test" + text run at (0,20) width 463: "manually, click the right of the text. The caret should be on the right edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] - LayoutText {#text} at (11,11) size 73x22 - text run at (11,11) width 73: "WebKit2" + LayoutText {#text} at (11,11) size 72x22 + text run at (11,11) width 72: "WebKit2" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 7 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.png index 6548ac8..0d2af914 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.txt index 10d6ce5..8f4ce0f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x145 LayoutNGBlockFlow {BODY} at (8,16) size 784x121 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 754x39 - text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for RTL text in a RTL block. To test" - text run at (0,20) width 464: "manually, click the right of the text. The caret should be on the right edge." + LayoutText {#text} at (0,0) size 756x39 + text run at (0,0) width 756: "This tests that clicking in a contenteditable div will set the caret in the right position for RTL text in a RTL block. To test" + text run at (0,20) width 463: "manually, click the right of the text. The caret should be on the right edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] LayoutText {#text} at (11,11) size 58x22 text run at (11,11) width 58 RTL: "\x{5E9}\x{5D3}\x{5D4} \x{5D1}\x{5D5}\x{5E8}" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 7 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.png index ad9ac803..fd4849d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.txt index ee8a1856..8f4ea66 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-2-left-expected.txt
@@ -6,12 +6,12 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 754x39 text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for RTL text in a LTR block. To test" - text run at (0,20) width 446: "manually, click the left of the text. The caret should be on the left edge." + text run at (0,20) width 445: "manually, click the left of the text. The caret should be on the left edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] LayoutText {#text} at (11,11) size 58x22 text run at (11,11) width 58 RTL: "\x{5E9}\x{5D3}\x{5D4} \x{5D1}\x{5D5}\x{5E8}" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 0 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.png index 56fba39..c9ed209 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.txt index de75ff0a..ac15c054 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x145 LayoutNGBlockFlow {BODY} at (8,16) size 784x121 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 754x39 - text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for RTL text in a RTL block. To test" - text run at (0,20) width 446: "manually, click the left of the text. The caret should be on the left edge." + LayoutText {#text} at (0,0) size 756x39 + text run at (0,0) width 756: "This tests that clicking in a contenteditable div will set the caret in the right position for RTL text in a RTL block. To test" + text run at (0,20) width 445: "manually, click the left of the text. The caret should be on the left edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] LayoutText {#text} at (133,11) size 58x22 text run at (133,11) width 58 RTL: "\x{5E9}\x{5D3}\x{5D4} \x{5D1}\x{5D5}\x{5E8}" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 7 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.png index bc73234..953cd15 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.txt index b25a5b9b..f468043 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/caret-rtl-right-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x145 LayoutNGBlockFlow {BODY} at (8,16) size 784x121 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 754x39 - text run at (0,0) width 754: "This tests that clicking in a contenteditable div will set the caret in the right position for RTL text in a RTL block. To test" - text run at (0,20) width 464: "manually, click the right of the text. The caret should be on the right edge." + LayoutText {#text} at (0,0) size 756x39 + text run at (0,0) width 756: "This tests that clicking in a contenteditable div will set the caret in the right position for RTL text in a RTL block. To test" + text run at (0,20) width 463: "manually, click the right of the text. The caret should be on the right edge." LayoutBlockFlow {DIV} at (0,56) size 202x45 [border: (1px solid #000000)] LayoutText {#text} at (133,11) size 58x22 text run at (133,11) width 58 RTL: "\x{5E9}\x{5D3}\x{5D4} \x{5D1}\x{5D5}\x{5E8}" LayoutNGBlockFlow (anonymous) at (0,101) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutBR {BR} at (37,0) size 0x0 caret: position 0 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.png index 6c45a2cd..b085d74 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.txt index 86717f3..94a201a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/click-start-of-line-expected.txt
@@ -11,19 +11,19 @@ LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (104,0) size 348x19 text run at (104,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9978" - LayoutText {#text} at (451,0) size 776x39 - text run at (451,0) width 325: " REGRESSION (r12949-r12988): Clicking the first" - text run at (0,20) width 383: "letter on a line places the caret at the end of the previous line" - LayoutText {#text} at (382,20) size 5x19 - text run at (382,20) width 5: "." + LayoutText {#text} at (452,0) size 776x39 + text run at (452,0) width 324: " REGRESSION (r12949-r12988): Clicking the first" + text run at (0,20) width 384: "letter on a line places the caret at the end of the previous line" + LayoutText {#text} at (384,20) size 4x19 + text run at (384,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 727x19 - text run at (0,0) width 727: "To test interactively, click the left side of the W on the second line. The caret should be move to the start of that line." + LayoutText {#text} at (0,0) size 726x19 + text run at (0,0) width 726: "To test interactively, click the left side of the W on the second line. The caret should be move to the start of that line." LayoutBlockFlow {DIV} at (0,102) size 250x114 - LayoutText {#text} at (0,1) size 233x112 + LayoutText {#text} at (0,1) size 232x112 text run at (0,1) width 152: "Alice in" text run at (152,1) width 12: " " - text run at (0,58) width 233: "Wonderland" + text run at (0,58) width 232: "Wonderland" layer at (8,100) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)] caret: position 10 of child 0 {#text} of child 7 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.png index ece031c..c768a6ea 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.txt index 2587624c..678f774 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/contains-boundaries-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 743x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=14347" - LayoutText {#text} at (352,0) size 743x39 - text run at (352,0) width 391: " REGRESSION (r21291): Initiating a drag near the edge of a" + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 742x39 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=14347" + LayoutText {#text} at (352,0) size 742x39 + text run at (352,0) width 390: " REGRESSION (r21291): Initiating a drag near the edge of a" text run at (0,20) width 127: "selection deselects it" LayoutText {#text} at (127,20) size 4x19 text run at (127,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/inline-closest-leaf-child-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/inline-closest-leaf-child-expected.txt new file mode 100644 index 0000000..e479450 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/inline-closest-leaf-child-expected.txt
@@ -0,0 +1,34 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 783x39 + LayoutInline {A} at (0,0) size 299x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 299x19 + text run at (51,0) width 299: "http://bugs.webkit.org/show_bug.cgi?id=14911" + LayoutText {#text} at (350,0) size 783x39 + text run at (350,0) width 433: " REGRESSION: Clicking in pasted text doesn't position the insertion" + text run at (0,20) width 92: "point correctly" + LayoutText {#text} at (92,20) size 4x19 + text run at (92,20) width 4: "." + LayoutNGBlockFlow {P} at (0,56) size 784x20 + LayoutText {#text} at (0,0) size 556x19 + text run at (0,0) width 556: "You should be able to select individual letters in \x{201C}ipsum\x{201D} by dragging in the yellow area " + LayoutInline {EM} at (0,0) size 38x19 + LayoutText {#text} at (556,0) size 38x19 + text run at (556,0) width 38: "above" + LayoutText {#text} at (594,0) size 39x19 + text run at (594,0) width 39: " them." + LayoutNGBlockFlow (floating) {DIV} at (0,92) size 84x80 [bgcolor=#FFFFAA] + LayoutInline {SPAN} at (0,0) size 84x19 [bgcolor=#FFFFFF] + LayoutText {#text} at (0,30) size 46x19 + text run at (0,30) width 46: "Lorem " + LayoutText {#text} at (46,30) size 38x19 + text run at (46,30) width 38: "ipsum" + LayoutText {#text} at (0,0) size 0x0 +selection start: position 2 of child 0 {#text} of child 1 {SPAN} of child 4 {DIV} of body +selection end: position 5 of child 2 {#text} of child 1 {SPAN} of child 4 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.png index 24e1415..28def78 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.txt index 05494ae..67a0b56 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/leave-requested-block-expected.txt
@@ -6,13 +6,13 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 126x19 - text run at (0,0) width 126: "Test case for fix for " - LayoutInline {A} at (0,0) size 344x19 [color=#0000EE] - LayoutText {#text} at (125,0) size 344x19 - text run at (125,0) width 344: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5354" - LayoutText {#text} at (468,0) size 5x19 - text run at (468,0) width 5: "." + LayoutText {#text} at (0,0) size 125x19 + text run at (0,0) width 125: "Test case for fix for " + LayoutInline {A} at (0,0) size 343x19 [color=#0000EE] + LayoutText {#text} at (125,0) size 343x19 + text run at (125,0) width 343: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5354" + LayoutText {#text} at (468,0) size 4x19 + text run at (468,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x40 LayoutText {#text} at (0,0) size 771x39 text run at (0,0) width 771: "Changes were made to VisiblePosition's so that init() will not leave the block containing the requested position unless there"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.png index 5323489..f1a92bb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.txt index 0fb97ef..f0ab5811 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-6-expected.txt
@@ -4,22 +4,22 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 778x39 - text run at (0,0) width 778: "This tests Select All when the caret is inside an editable region that is inside a non editable region. Whenever the selection is" + LayoutText {#text} at (0,0) size 779x39 + text run at (0,0) width 779: "This tests Select All when the caret is inside an editable region that is inside a non editable region. Whenever the selection is" text run at (0,20) width 537: "in an editable region, Select All should select the contents of the highest editable root." LayoutBlockFlow {DIV} at (0,56) size 784x60 LayoutBlockFlow {DIV} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 27x19 text run at (0,0) width 27: "One" LayoutBlockFlow {DIV} at (0,20) size 784x20 - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutText {#text} at (0,0) size 29x19 - text run at (0,0) width 29: "Two" - LayoutText {#text} at (28,0) size 5x19 - text run at (28,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 38x19 - LayoutText {#text} at (32,0) size 38x19 - text run at (32,0) width 38: "Three" + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutText {#text} at (0,0) size 28x19 + text run at (0,0) width 28: "Two" + LayoutText {#text} at (28,0) size 4x19 + text run at (28,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 37x19 + LayoutText {#text} at (32,0) size 37x19 + text run at (32,0) width 37: "Three" LayoutBlockFlow {DIV} at (0,40) size 784x20 LayoutText {#text} at (0,0) size 30x19 text run at (0,0) width 30: "Four"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-7-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-7-expected.txt index b1bba44..db76ff93 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-7-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/mixed-editability-7-expected.txt
@@ -12,14 +12,14 @@ LayoutText {#text} at (0,0) size 27x19 text run at (0,0) width 27: "One" LayoutBlockFlow {DIV} at (0,20) size 784x20 - LayoutInline {SPAN} at (0,0) size 29x19 - LayoutText {#text} at (0,0) size 29x19 - text run at (0,0) width 29: "Two" - LayoutText {#text} at (28,0) size 5x19 - text run at (28,0) width 5: " " - LayoutInline {SPAN} at (0,0) size 38x19 - LayoutText {#text} at (32,0) size 38x19 - text run at (32,0) width 38: "Three" + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutText {#text} at (0,0) size 28x19 + text run at (0,0) width 28: "Two" + LayoutText {#text} at (28,0) size 4x19 + text run at (28,0) width 4: " " + LayoutInline {SPAN} at (0,0) size 37x19 + LayoutText {#text} at (32,0) size 37x19 + text run at (32,0) width 37: "Three" LayoutBlockFlow {DIV} at (0,40) size 784x20 LayoutText {#text} at (0,0) size 30x19 text run at (0,0) width 30: "Four"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/previous-line-position-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/previous-line-position-expected.png index 57efcaf..d0d9e8a1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/previous-line-position-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/previous-line-position-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNode-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNode-expected.png index 997ee2c..d3ee7e4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNode-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNode-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNodeContents-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNodeContents-expected.png index c08d570..0f4c68f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNodeContents-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selectNodeContents-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.png index b7f626b..a31feb6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.txt index b6d8472..6ee4cec1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-background-expected.txt
@@ -5,8 +5,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 764x19 - text run at (0,0) width 764: "This tests that the selection tint is grey when the WebView is not focused (using the pixel output from DumpRenderTree)." + LayoutText {#text} at (0,0) size 765x19 + text run at (0,0) width 765: "This tests that the selection tint is grey when the WebView is not focused (using the pixel output from DumpRenderTree)." LayoutNGBlockFlow {DIV} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 178x19 text run at (0,0) width 178: "This text should be selected."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.png index 586eeaa..a4163a5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.txt index 20a3615..1f9a549 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-delete-003-expected.txt
@@ -20,10 +20,10 @@ LayoutNGBlockFlow {DIV} at (20,20) size 744x69 LayoutText {#text} at (0,0) size 59x26 text run at (0,0) width 59: "Tests:" - LayoutBR {BR} at (58,0) size 0x0 + LayoutBR {BR} at (59,0) size 0x0 LayoutText {#text} at (0,27) size 658x20 text run at (0,27) width 658: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well." - LayoutBR {BR} at (657,27) size 0x0 + LayoutBR {BR} at (658,27) size 0x0 LayoutInline {I} at (0,0) size 99x20 LayoutText {#text} at (0,48) size 99x20 text run at (0,48) width 99: "For this test: "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.png index 7a9661c..33064b8f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.txt index 559a316b..9b4bb3a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-after-expected.txt
@@ -17,15 +17,15 @@ LayoutNGBlockFlow {DIV} at (20,20) size 744x69 LayoutText {#text} at (0,0) size 59x26 text run at (0,0) width 59: "Tests:" - LayoutBR {BR} at (58,0) size 0x0 + LayoutBR {BR} at (59,0) size 0x0 LayoutText {#text} at (0,27) size 658x20 text run at (0,27) width 658: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well." - LayoutBR {BR} at (657,27) size 0x0 + LayoutBR {BR} at (658,27) size 0x0 LayoutInline {I} at (0,0) size 99x20 LayoutText {#text} at (0,48) size 99x20 text run at (0,48) width 99: "For this test: " - LayoutText {#text} at (99,48) size 222x20 - text run at (99,48) width 222: "Test typing at the end of a list." + LayoutText {#text} at (99,48) size 221x20 + text run at (99,48) width 221: "Test typing at the end of a list." LayoutNGBlockFlow (anonymous) at (20,89) size 744x21 LayoutBR {BR} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (20,110) size 744x90 @@ -39,8 +39,8 @@ LayoutInline {I} at (0,0) size 99x20 LayoutText {#text} at (0,69) size 99x20 text run at (0,69) width 99: "For this test: " - LayoutText {#text} at (99,69) size 423x20 - text run at (99,69) width 423: "Typed text should appear after (on the line below) the list." + LayoutText {#text} at (99,69) size 422x20 + text run at (99,69) width 422: "Typed text should appear after (on the line below) the list." LayoutNGBlockFlow {DIV} at (0,230) size 784x136 [border: (2px solid #008000)] LayoutNGBlockFlow {UL} at (2,26) size 780x84 LayoutNGListItem {LI} at (40,0) size 740x28
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.png index bb186883..92bd7374 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.txt index ad4c106..c23dc43 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/list-type-before-expected.txt
@@ -14,15 +14,15 @@ LayoutNGBlockFlow {DIV} at (20,20) size 744x69 LayoutText {#text} at (0,0) size 59x26 text run at (0,0) width 59: "Tests:" - LayoutBR {BR} at (58,0) size 0x0 + LayoutBR {BR} at (59,0) size 0x0 LayoutText {#text} at (0,27) size 658x20 text run at (0,27) width 658: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well." - LayoutBR {BR} at (657,27) size 0x0 + LayoutBR {BR} at (658,27) size 0x0 LayoutInline {I} at (0,0) size 99x20 LayoutText {#text} at (0,48) size 99x20 text run at (0,48) width 99: "For this test: " - LayoutText {#text} at (99,48) size 227x20 - text run at (99,48) width 227: "Test typing at the start of a list." + LayoutText {#text} at (99,48) size 226x20 + text run at (99,48) width 226: "Test typing at the start of a list." LayoutNGBlockFlow (anonymous) at (20,89) size 744x21 LayoutBR {BR} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (20,110) size 744x90 @@ -36,8 +36,8 @@ LayoutInline {I} at (0,0) size 99x20 LayoutText {#text} at (0,69) size 99x20 text run at (0,69) width 99: "For this test: " - LayoutText {#text} at (99,69) size 414x20 - text run at (99,69) width 414: "Typed text should appear at the start of the first list item." + LayoutText {#text} at (99,69) size 413x20 + text run at (99,69) width 413: "Typed text should appear at the start of the first list item." LayoutNGBlockFlow {DIV} at (0,230) size 784x136 [border: (2px solid #008000)] LayoutNGBlockFlow {UL} at (2,26) size 780x84 LayoutNGListItem {LI} at (40,0) size 740x28
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.png index 898f101..debe9a6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.txt index c874771..c1094792 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-001-expected.txt
@@ -29,10 +29,10 @@ LayoutNGBlockFlow {DIV} at (20,20) size 744x69 LayoutText {#text} at (0,0) size 59x26 text run at (0,0) width 59: "Tests:" - LayoutBR {BR} at (58,0) size 0x0 + LayoutBR {BR} at (59,0) size 0x0 LayoutText {#text} at (0,27) size 658x20 text run at (0,27) width 658: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well." - LayoutBR {BR} at (657,27) size 0x0 + LayoutBR {BR} at (658,27) size 0x0 LayoutInline {I} at (0,0) size 99x20 LayoutText {#text} at (0,48) size 99x20 text run at (0,48) width 99: "For this test: "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.png index ab28680c..7dc12a1c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.txt index 494e2bc..ad239fa 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/unsupported-content/table-delete-003-expected.txt
@@ -20,10 +20,10 @@ LayoutNGBlockFlow {DIV} at (20,20) size 744x69 LayoutText {#text} at (0,0) size 59x26 text run at (0,0) width 59: "Tests:" - LayoutBR {BR} at (58,0) size 0x0 + LayoutBR {BR} at (59,0) size 0x0 LayoutText {#text} at (0,27) size 658x20 text run at (0,27) width 658: "Our ability to \"edit around\" content the HTML editing code does not yet handle very well." - LayoutBR {BR} at (657,27) size 0x0 + LayoutBR {BR} at (658,27) size 0x0 LayoutInline {I} at (0,0) size 99x20 LayoutText {#text} at (0,48) size 99x20 text run at (0,48) width 99: "For this test: " @@ -45,7 +45,7 @@ LayoutText {#text} at (99,69) size 744x41 text run at (99,69) width 645: "Only selected content should get deleted. Surrounding content that is not selected should" text run at (0,90) width 201: "(obviously) not be affected." - LayoutBR {BR} at (200,90) size 0x0 + LayoutBR {BR} at (201,90) size 0x0 LayoutInline {B} at (0,0) size 718x20 LayoutText {#text} at (0,111) size 718x20 text run at (0,111) width 718: "There is a bug: the caret ends up in the wrong position, it should be in the empty paragraph."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/animated-gif-as-background-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/animated-gif-as-background-expected.png new file mode 100644 index 0000000..f44ebd4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/animated-gif-as-background-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/animated-gif-as-background-rounded-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/animated-gif-as-background-rounded-expected.png new file mode 100644 index 0000000..e2e5f3a --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/animated-gif-as-background-rounded-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/body-generated-image-propagated-to-root-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/body-generated-image-propagated-to-root-expected.txt new file mode 100644 index 0000000..e6ae73c --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/body-generated-image-propagated-to-root-expected.txt
@@ -0,0 +1,21 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x40 [bgcolor=#FFFFFF] + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 760x39 + LayoutInline {A} at (0,0) size 307x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 307x19 + text run at (51,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=18445" + LayoutText {#text} at (358,0) size 760x39 + text run at (358,0) width 402: " Assertion failure in CSSGradientValue::image() when the body" + text run at (0,20) width 224: "element has a background gradient" + LayoutText {#text} at (224,20) size 4x19 + text run at (224,20) width 4: "." + LayoutNGBlockFlow {P} at (0,56) size 784x40 [bgcolor=#FFFFFF] + LayoutText {#text} at (0,0) size 747x39 + text run at (0,0) width 747: "The test passes if the root element\x{2019}s background is a linear gradient from black at the top to white at the bottom, and no" + text run at (0,20) width 148: "assertion failure occurs."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/mask-negative-offset-repeat-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/mask-negative-offset-repeat-expected.txt index 291902e..b6985b7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/mask-negative-offset-repeat-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/mask-negative-offset-repeat-expected.txt
@@ -6,15 +6,15 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 153x19 text run at (0,0) width 153: "Mask version of test for " - LayoutInline {I} at (0,0) size 750x39 + LayoutInline {I} at (0,0) size 751x39 LayoutInline {A} at (0,0) size 293x19 [color=#0000EE] LayoutText {#text} at (153,0) size 293x19 text run at (153,0) width 293: "http://bugs.webkit.org/show_bug.cgi?id=5399" - LayoutText {#text} at (445,0) size 750x39 - text run at (445,0) width 305: " no-repeat on negatively positioned fill images is" + LayoutText {#text} at (446,0) size 751x39 + text run at (446,0) width 305: " no-repeat on negatively positioned fill images is" text run at (0,20) width 49: "ignored" - LayoutText {#text} at (48,20) size 5x19 - text run at (48,20) width 5: "." + LayoutText {#text} at (49,20) size 4x19 + text run at (49,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 412x19 text run at (0,0) width 412: "Element with mask image starting at (-13, -13) with no-repeat set:"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/negative-offset-repeat-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/negative-offset-repeat-expected.txt new file mode 100644 index 0000000..33d22ed1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/negative-offset-repeat-expected.txt
@@ -0,0 +1,52 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x544 + LayoutNGBlockFlow {HTML} at (0,0) size 800x544 + LayoutNGBlockFlow {BODY} at (8,16) size 784x466 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 722x19 + LayoutInline {A} at (0,0) size 293x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 293x19 + text run at (51,0) width 293: "http://bugs.webkit.org/show_bug.cgi?id=5399" + LayoutText {#text} at (344,0) size 429x19 + text run at (344,0) width 429: " no-repeat on negatively positioned background images are ignored" + LayoutText {#text} at (773,0) size 4x19 + text run at (773,0) width 4: "." + LayoutNGBlockFlow {P} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 454x19 + text run at (0,0) width 454: "Element with background image starting at (-13, -13) with no-repeat set:" + LayoutNGBlockFlow (floating) {DIV} at (6,78) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,78) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,78) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,118) size 784x20 + LayoutText {#text} at (0,0) size 446x19 + text run at (0,0) width 446: "Element with background image starting at (-13, -13) with repeat-y set:" + LayoutNGBlockFlow (floating) {DIV} at (6,160) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,160) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,160) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,200) size 784x20 + LayoutText {#text} at (0,0) size 446x19 + text run at (0,0) width 446: "Element with background image starting at (-13, -13) with repeat-x set:" + LayoutNGBlockFlow (floating) {DIV} at (6,242) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,242) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,242) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,282) size 784x20 + LayoutText {#text} at (0,0) size 444x19 + text run at (0,0) width 444: "Element with background image starting at (13, 13) with no-repeat set:" + LayoutNGBlockFlow (floating) {DIV} at (6,324) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,324) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,324) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,364) size 784x20 + LayoutText {#text} at (0,0) size 436x19 + text run at (0,0) width 436: "Element with background image starting at (13, 13) with repeat-y set:" + LayoutNGBlockFlow (floating) {DIV} at (6,406) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,406) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,406) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,446) size 784x20 + LayoutText {#text} at (0,0) size 436x19 + text run at (0,0) width 436: "Element with background image starting at (13, 13) with repeat-x set:" + LayoutNGBlockFlow (floating) {DIV} at (6,488) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,488) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,488) size 24x24 [border: (1px dotted #008000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt new file mode 100644 index 0000000..91fdf64 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/backgrounds/repeat/negative-offset-repeat-transformed-expected.txt
@@ -0,0 +1,92 @@ +layer at (0,0) size 800x600 scrollWidth 1122 scrollHeight 1026 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x1026 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x1026 + LayoutNGBlockFlow {BODY} at (8,16) size 784x1002 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 722x19 + LayoutInline {A} at (0,0) size 293x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 293x19 + text run at (51,0) width 293: "http://bugs.webkit.org/show_bug.cgi?id=5399" + LayoutText {#text} at (344,0) size 429x19 + text run at (344,0) width 429: " no-repeat on negatively positioned background images are ignored" + LayoutText {#text} at (773,0) size 4x19 + text run at (773,0) width 4: "." + LayoutNGBlockFlow {P} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 454x19 + text run at (0,0) width 454: "Element with background image starting at (-13, -13) with no-repeat set:" + LayoutNGBlockFlow (floating) {DIV} at (6,78) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,78) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,78) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,118) size 784x20 + LayoutText {#text} at (0,0) size 446x19 + text run at (0,0) width 446: "Element with background image starting at (-13, -13) with repeat-y set:" + LayoutNGBlockFlow (floating) {DIV} at (6,160) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,160) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,160) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,200) size 784x20 + LayoutText {#text} at (0,0) size 446x19 + text run at (0,0) width 446: "Element with background image starting at (-13, -13) with repeat-x set:" + LayoutNGBlockFlow (floating) {DIV} at (6,242) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,242) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,242) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,282) size 784x20 + LayoutText {#text} at (0,0) size 444x19 + text run at (0,0) width 444: "Element with background image starting at (13, 13) with no-repeat set:" + LayoutNGBlockFlow (floating) {DIV} at (6,324) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,324) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,324) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,364) size 784x20 + LayoutText {#text} at (0,0) size 436x19 + text run at (0,0) width 436: "Element with background image starting at (13, 13) with repeat-y set:" + LayoutNGBlockFlow (floating) {DIV} at (6,406) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,406) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,406) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (0,446) size 784x20 + LayoutText {#text} at (0,0) size 436x19 + text run at (0,0) width 436: "Element with background image starting at (13, 13) with repeat-x set:" + LayoutNGBlockFlow (floating) {DIV} at (6,488) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (52,488) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (93,488) size 24x24 [border: (1px dotted #008000)] +layer at (8,514) size 0x5000 + LayoutNGBlockFlow (positioned) {P} at (8,514) size 0x5000 +layer at (8,544) size 464x474 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 + LayoutTable {TABLE} at (0,528) size 464x474 [border: (5px outset #808080)] + LayoutTableSection {TBODY} at (5,5) size 454x464 + LayoutTableRow {TR} at (0,2) size 454x460 + LayoutNGTableCell {TD} at (2,2) size 450x460 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1] + LayoutNGBlockFlow (floating) {DIV} at (8,8) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (54,8) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (95,8) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (2,48) size 446x20 + LayoutText {#text} at (0,0) size 446x19 + text run at (0,0) width 446: "Element with background image starting at (-13, -13) with repeat-y set:" + LayoutNGBlockFlow (floating) {DIV} at (8,90) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (54,90) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (95,90) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (2,130) size 446x20 + LayoutText {#text} at (0,0) size 446x19 + text run at (0,0) width 446: "Element with background image starting at (-13, -13) with repeat-x set:" + LayoutNGBlockFlow (floating) {DIV} at (8,172) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (54,172) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (95,172) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (2,212) size 446x20 + LayoutText {#text} at (0,0) size 444x19 + text run at (0,0) width 444: "Element with background image starting at (13, 13) with no-repeat set:" + LayoutNGBlockFlow (floating) {DIV} at (8,254) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (54,254) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (95,254) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (2,294) size 446x20 + LayoutText {#text} at (0,0) size 436x19 + text run at (0,0) width 436: "Element with background image starting at (13, 13) with repeat-y set:" + LayoutNGBlockFlow (floating) {DIV} at (8,336) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (54,336) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (95,336) size 24x24 [border: (1px dotted #008000)] + LayoutNGBlockFlow {P} at (2,376) size 446x20 + LayoutText {#text} at (0,0) size 436x19 + text run at (0,0) width 436: "Element with background image starting at (13, 13) with repeat-x set:" + LayoutNGBlockFlow (floating) {DIV} at (8,418) size 34x34 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (54,418) size 29x29 [border: (1px dotted #008000)] + LayoutNGBlockFlow (floating) {DIV} at (95,418) size 24x24 [border: (1px dotted #008000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/011-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/011-expected.png index 546ffbf..9ae04e5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/011-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/011-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/014-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/014-expected.png index c3a3bfa2..48d4f00 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/014-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/014-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/015-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/015-expected.png index 6275fdd..cc8b117 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/015-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/015-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/016-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/016-expected.png index 06ca48b..4213812 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/016-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/016-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/020-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/020-expected.png index c3d90be..2cd81d5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/020-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/020-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/truncation-rtl-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/truncation-rtl-expected.png new file mode 100644 index 0000000..fc29067 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/truncation-rtl-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/white-space-pre-wraps-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/white-space-pre-wraps-expected.png index 6822702f..550b20b7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/white-space-pre-wraps-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/basic/white-space-pre-wraps-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/001-expected.png index 078c0ef..f2f58d4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/001-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/002-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/002-expected.png index 05090c7..af553bbe 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/002-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/014-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/014-expected.png index 69ed72cb..1db7316 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/014-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/014-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/avoidance-percent-width-strict-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/avoidance-percent-width-strict-expected.png index e265b5831..c75646d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/avoidance-percent-width-strict-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/avoidance-percent-width-strict-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/centered-float-avoidance-complexity-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/centered-float-avoidance-complexity-expected.png index 98a8a2e6..d529a55fe 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/centered-float-avoidance-complexity-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/centered-float-avoidance-complexity-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/editable-text-overlapping-float-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/editable-text-overlapping-float-expected.png new file mode 100644 index 0000000..db323db5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/editable-text-overlapping-float-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/independent-align-positioning-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/independent-align-positioning-expected.png index 78fd7083..50019cef 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/independent-align-positioning-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/independent-align-positioning-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/shrink-to-fit-width-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/shrink-to-fit-width-expected.png index ae3cfd1..f549ca8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/shrink-to-fit-width-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/shrink-to-fit-width-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/vertical-move-relayout-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/vertical-move-relayout-expected.png index aea54ba..33f85f7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/vertical-move-relayout-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/vertical-move-relayout-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/margin-collapse/103-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/margin-collapse/103-expected.png index d3d35c0..29d0cdb6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/margin-collapse/103-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/margin-collapse/103-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/positioning/absolute-in-inline-short-rtl-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/positioning/absolute-in-inline-short-rtl-expected.png index f0f75fb..1d01f37 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/positioning/absolute-in-inline-short-rtl-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/positioning/absolute-in-inline-short-rtl-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/canvas/fillrect_gradient-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/canvas/fillrect_gradient-expected.png index e27dc16..d8ff85b3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/canvas/fillrect_gradient-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/canvas/fillrect_gradient-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/compact/003-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/compact/003-expected.txt index 6958bfeb..4638578 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/compact/003-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/compact/003-expected.txt
@@ -10,6 +10,6 @@ LayoutNGBlockFlow {DT} at (0,20) size 784x20 LayoutText {#text} at (0,0) size 33x19 text run at (0,0) width 33: "Line " - LayoutInline {SPAN} at (0,0) size 30x19 - LayoutText {#text} at (32,0) size 30x19 - text run at (32,0) width 30: "Two" + LayoutInline {SPAN} at (0,0) size 28x19 + LayoutText {#text} at (33,0) size 28x19 + text run at (33,0) width 28: "Two"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/002-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/002-expected.txt new file mode 100644 index 0000000..f7fac8c --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/002-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutInline {<pseudo:before>} at (0,0) size 54x19 + LayoutInline {<pseudo:first-letter>} at (0,0) size 9x19 [color=#FFD800] + LayoutTextFragment (anonymous) at (0,0) size 9x19 + text run at (0,0) width 9: "S" + LayoutTextFragment (anonymous) at (9,0) size 45x19 + text run at (9,0) width 45: "pecial: " + LayoutText {#text} at (54,0) size 590x19 + text run at (54,0) width 590: "The \"S\" to the left should be gold. This is testing :before used in conjunction with :first-letter. " + LayoutInline {<pseudo:after>} at (0,0) size 65x19 + LayoutTextFragment (anonymous) at (644,0) size 65x19 + text run at (644,0) width 65: "[The End]"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/after-order-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/after-order-expected.txt new file mode 100644 index 0000000..d07a5680 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/after-order-expected.txt
@@ -0,0 +1,41 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x582 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutInline {EM} at (0,0) size 629x19 + LayoutText {#text} at (0,0) size 629x19 + text run at (0,0) width 629: "When an :after rule has multiple pieces of content, older versions of Safari display them backwards." + LayoutNGBlockFlow {DIV} at (10,36) size 764x52 [border: (1px solid #000000)] + LayoutText {#text} at (11,21) size 44x19 + text run at (11,21) width 44: "Inline: " + LayoutInline {<pseudo:after>} at (0,0) size 483x29 + LayoutTextFragment (anonymous) at (55,21) size 235x19 + text run at (55,21) width 235: "This should be before the green box. " + LayoutImage (anonymous) at (290,11) size 25x25 + LayoutTextFragment (anonymous) at (315,21) size 223x19 + text run at (315,21) width 223: " This should be after the green box." + LayoutNGBlockFlow {DIV} at (10,98) size 764x92 [border: (1px solid #000000)] + LayoutText {#text} at (11,61) size 84x19 + text run at (11,61) width 84: "Inline-block: " + LayoutNGBlockFlow {<pseudo:after>} at (95,11) size 200x70 + LayoutTextFragment (anonymous) at (0,0) size 199x49 + text run at (0,0) width 199: "This should be before the green" + text run at (0,30) width 32: "box. " + LayoutImage (anonymous) at (32,20) size 25x25 + LayoutTextFragment (anonymous) at (57,30) size 186x39 + text run at (57,30) width 129: " This should be after" + text run at (0,50) width 90: "the green box." + LayoutNGBlockFlow {DIV} at (10,200) size 764x112 [border: (1px solid #000000)] + LayoutNGBlockFlow (anonymous) at (11,11) size 742x20 + LayoutText {#text} at (0,0) size 42x19 + text run at (0,0) width 42: "Block:" + LayoutNGBlockFlow {<pseudo:after>} at (11,31) size 200x70 + LayoutTextFragment (anonymous) at (0,0) size 199x49 + text run at (0,0) width 199: "This should be before the green" + text run at (0,30) width 32: "box. " + LayoutImage (anonymous) at (32,20) size 25x25 + LayoutTextFragment (anonymous) at (57,30) size 186x39 + text run at (57,30) width 129: " This should be after" + text run at (0,50) width 90: "the green box."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/before-with-first-letter-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/before-with-first-letter-expected.txt new file mode 100644 index 0000000..e287157 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/before-with-first-letter-expected.txt
@@ -0,0 +1,26 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 654x39 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=14221" + LayoutText {#text} at (352,0) size 654x39 + text run at (352,0) width 302: " Repro crash (ASSERTION FAILED: oldText in" + text run at (0,20) width 593: "LayoutBlockFlow::updateFirstLetter() during relayout of :before content with first-letter style)" + LayoutText {#text} at (593,20) size 4x19 + text run at (593,20) width 4: "." + LayoutNGBlockFlow {DIV} at (0,56) size 784x34 + LayoutInline {<pseudo:before>} at (0,0) size 47x33 + LayoutInline {<pseudo:first-letter>} at (0,0) size 18x33 [color=#008000] + LayoutTextFragment (anonymous) at (0,0) size 18x33 + text run at (0,0) width 18: "T" + LayoutTextFragment (anonymous) at (18,5) size 29x27 + text run at (18,5) width 29: "he " + LayoutText {#text} at (47,5) size 413x27 + text run at (47,5) width 413: "first letter is green and larger than the rest."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/hover-style-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/hover-style-change-expected.txt new file mode 100644 index 0000000..7c5d5ce --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/hover-style-change-expected.txt
@@ -0,0 +1,34 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x222 + LayoutNGBlockFlow {HTML} at (0,0) size 800x222 + LayoutNGBlockFlow {BODY} at (8,8) size 784x198 + LayoutNGBlockFlow {DIV} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 82x19 + text run at (0,0) width 82: "This is a test " + LayoutInline {<pseudo:after>} at (0,0) size 178x19 + LayoutTextFragment (anonymous) at (82,0) size 178x19 + text run at (82,0) width 178: "and generated hover content" + LayoutNGBlockFlow {P} at (0,46) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 781x39 + LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 348x19 + text run at (51,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6431" + LayoutText {#text} at (399,0) size 781x39 + text run at (399,0) width 382: " REGRESSION: style change where :hover changes only an" + text run at (0,20) width 150: ":after style doesn't work" + LayoutText {#text} at (150,20) size 4x19 + text run at (150,20) width 4: "." + LayoutNGBlockFlow {P} at (0,102) size 784x40 + LayoutText {#text} at (0,0) size 741x39 + text run at (0,0) width 741: "The line at the top of the page should read \x{201C}This is a test and generated content\x{201D} or \x{201C}This is a test and generated hover" + text run at (0,20) width 283: "content\x{201D} depending on whether it is hovered." + LayoutNGBlockFlow {P} at (0,158) size 784x40 + LayoutText {#text} at (0,0) size 753x39 + text run at (0,0) width 753: "To reproduce the bug outside of DumpRenderTree, mouse over the div several times, and the style change won't update" + text run at (0,20) width 155: "every time like it should." +layer at (8,36) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,28) size 784x2 [border: (1px inset #EEEEEE)] +caret: position 3 of child 0 {#text} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/inline-display-types-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/inline-display-types-expected.txt index 6af114b..8bdc6d8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/inline-display-types-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/inline-display-types-expected.txt
@@ -7,51 +7,51 @@ LayoutText {#text} at (0,0) size 90x36 text run at (0,0) width 90: "Blocks" LayoutNGBlockFlow {DIV} at (0,58.44) size 784x20 - LayoutInline {<pseudo:before>} at (0,0) size 34x19 - LayoutTextFragment (anonymous) at (0,0) size 34x19 - text run at (0,0) width 34: "Test: " - LayoutText {#text} at (33,0) size 47x19 - text run at (33,0) width 47: "content" + LayoutInline {<pseudo:before>} at (0,0) size 33x19 + LayoutTextFragment (anonymous) at (0,0) size 33x19 + text run at (0,0) width 33: "Test: " + LayoutText {#text} at (33,0) size 46x19 + text run at (33,0) width 46: "content" LayoutNGBlockFlow {DIV} at (0,78.44) size 784x20 - LayoutNGBlockFlow {<pseudo:before>} at (0,0) size 29.89x20 - LayoutTextFragment (anonymous) at (0,0) size 30x19 - text run at (0,0) width 30: "Test:" - LayoutText {#text} at (29,0) size 47x19 - text run at (29,0) width 47: "content" + LayoutNGBlockFlow {<pseudo:before>} at (0,0) size 29x20 + LayoutTextFragment (anonymous) at (0,0) size 29x19 + text run at (0,0) width 29: "Test:" + LayoutText {#text} at (29,0) size 46x19 + text run at (29,0) width 46: "content" LayoutNGBlockFlow {DIV} at (0,98.44) size 784x20 - LayoutTable {<pseudo:before>} at (0,0) size 30x20 - LayoutTableSection (anonymous) at (0,0) size 30x20 - LayoutTableRow (anonymous) at (0,0) size 30x20 - LayoutTableCell (anonymous) at (0,0) size 30x20 [r=0 c=0 rs=1 cs=1] - LayoutTextFragment (anonymous) at (0,0) size 30x19 - text run at (0,0) width 30: "Test:" - LayoutText {#text} at (30,0) size 46x19 - text run at (30,0) width 46: "content" + LayoutTable {<pseudo:before>} at (0,0) size 29x20 + LayoutTableSection (anonymous) at (0,0) size 29x20 + LayoutTableRow (anonymous) at (0,0) size 29x20 + LayoutTableCell (anonymous) at (0,0) size 29x20 [r=0 c=0 rs=1 cs=1] + LayoutTextFragment (anonymous) at (0,0) size 29x19 + text run at (0,0) width 29: "Test:" + LayoutText {#text} at (29,0) size 46x19 + text run at (29,0) width 46: "content" LayoutNGBlockFlow {H1} at (0,139.88) size 784x37 LayoutText {#text} at (0,0) size 92x36 text run at (0,0) width 92: "Inlines" LayoutNGBlockFlow (anonymous) at (0,198.31) size 784x60 - LayoutInline {SPAN} at (0,0) size 80x19 - LayoutInline {<pseudo:before>} at (0,0) size 34x19 - LayoutTextFragment (anonymous) at (0,0) size 34x19 - text run at (0,0) width 34: "Test: " - LayoutText {#text} at (33,0) size 47x19 - text run at (33,0) width 47: "content" + LayoutInline {SPAN} at (0,0) size 79x19 + LayoutInline {<pseudo:before>} at (0,0) size 33x19 + LayoutTextFragment (anonymous) at (0,0) size 33x19 + text run at (0,0) width 33: "Test: " + LayoutText {#text} at (33,0) size 46x19 + text run at (33,0) width 46: "content" LayoutBR {BR} at (79,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 76x20 - LayoutNGBlockFlow {<pseudo:before>} at (0,20) size 29.89x20 - LayoutTextFragment (anonymous) at (0,0) size 30x19 - text run at (0,0) width 30: "Test:" - LayoutText {#text} at (29,20) size 47x19 - text run at (29,20) width 47: "content" + LayoutInline {SPAN} at (0,0) size 75x20 + LayoutNGBlockFlow {<pseudo:before>} at (0,20) size 29x20 + LayoutTextFragment (anonymous) at (0,0) size 29x19 + text run at (0,0) width 29: "Test:" + LayoutText {#text} at (29,20) size 46x19 + text run at (29,20) width 46: "content" LayoutBR {BR} at (75,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 76x20 - LayoutTable {<pseudo:before>} at (0,40) size 30x20 - LayoutTableSection (anonymous) at (0,0) size 30x20 - LayoutTableRow (anonymous) at (0,0) size 30x20 - LayoutTableCell (anonymous) at (0,0) size 30x20 [r=0 c=0 rs=1 cs=1] - LayoutTextFragment (anonymous) at (0,0) size 30x19 - text run at (0,0) width 30: "Test:" - LayoutText {#text} at (30,40) size 46x19 - text run at (30,40) width 46: "content" - LayoutBR {BR} at (76,55) size 0x0 + LayoutInline {SPAN} at (0,0) size 75x20 + LayoutTable {<pseudo:before>} at (0,40) size 29x20 + LayoutTableSection (anonymous) at (0,0) size 29x20 + LayoutTableRow (anonymous) at (0,0) size 29x20 + LayoutTableCell (anonymous) at (0,0) size 29x20 [r=0 c=0 rs=1 cs=1] + LayoutTextFragment (anonymous) at (0,0) size 29x19 + text run at (0,0) width 29: "Test:" + LayoutText {#text} at (29,40) size 46x19 + text run at (29,40) width 46: "content" + LayoutBR {BR} at (75,55) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/wbr-with-before-content-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/wbr-with-before-content-expected.txt index f4c0f97a..4fce6ef 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/wbr-with-before-content-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/wbr-with-before-content-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 186x19 - text run at (0,0) width 186: "You should not see any cyan." + LayoutText {#text} at (0,0) size 185x19 + text run at (0,0) width 185: "You should not see any cyan." LayoutNGBlockFlow {DIV} at (0,20) size 202x27 [bgcolor=#00FFFF] [border: (1px solid #777777)] LayoutNGBlockFlow {A} at (1,1) size 200x25 [color=#0000EE] [bgcolor=#FFFFFF] LayoutText {#text} at (0,3) size 21x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/001-expected.txt index a0ba35b..f2ec8a7b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/001-expected.txt
@@ -8,8 +8,8 @@ LayoutInline (anonymous) at (0,0) size 10x19 LayoutText (anonymous) at (-1,0) size 10x19 text run at (-1,0) width 10: "\x{2022} " - LayoutText {#text} at (24,0) size 265x19 - text run at (24,0) width 265: "This list item should have an inside bullet." - LayoutBR {BR} at (288,0) size 0x0 + LayoutText {#text} at (25,0) size 264x19 + text run at (25,0) width 264: "This list item should have an inside bullet." + LayoutBR {BR} at (289,0) size 0x0 LayoutText {#text} at (0,20) size 246x19 text run at (0,20) width 246: "This line should begin under the bullet."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/002-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/002-expected.txt index c9330ed..8009527 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/002-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/002-expected.txt
@@ -4,10 +4,10 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x560 LayoutNGBlockFlow (anonymous) at (0,0) size 784x76 - LayoutText {#text} at (0,0) size 742x76 - text run at (0,0) width 742: "These two lines should both be Verdana. They" + LayoutText {#text} at (0,0) size 741x76 + text run at (0,0) width 741: "These two lines should both be Verdana. They" text run at (0,38) width 313: "should be identical." LayoutNGBlockFlow {P} at (0,108) size 784x76 - LayoutText {#text} at (0,0) size 742x76 - text run at (0,0) width 742: "These two lines should both be Verdana. They" + LayoutText {#text} at (0,0) size 741x76 + text run at (0,0) width 741: "These two lines should both be Verdana. They" text run at (0,38) width 313: "should be identical."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.png index 0faa6c77..03fea1c0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.txt index 07f27b8..063fa051 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/004-expected.txt
@@ -4,11 +4,11 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x283.88 LayoutNGBlockFlow {BODY} at (8,21.44) size 784x246.44 LayoutNGBlockFlow {H1} at (0,0) size 784x37 - LayoutText {#text} at (0,0) size 420x36 - text run at (0,0) width 420: "Shorthand border properties 2" + LayoutText {#text} at (0,0) size 421x36 + text run at (0,0) width 421: "Shorthand border properties 2" LayoutNGBlockFlow {P} at (0,58.44) size 784x20 - LayoutText {#text} at (0,0) size 500x19 - text run at (0,0) width 500: "This test was written to test a point I mentioned to Tantek \x{C7}elik on 2000-07-13." + LayoutText {#text} at (0,0) size 499x19 + text run at (0,0) width 499: "This test was written to test a point I mentioned to Tantek \x{C7}elik on 2000-07-13." LayoutNGBlockFlow {P} at (0,94.44) size 784x26 [color=#008000] [border: (3px solid #008000)] LayoutText {#text} at (3,3) size 274x19 text run at (3,3) width 274: "This paragraph should have a green border."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.png index 7c1a55db..6d5a524 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.txt index 867455d..73711b8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/005-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x769.88 LayoutNGBlockFlow {BODY} at (8,21.44) size 784x732.44 LayoutNGBlockFlow {H1} at (0,0) size 784x37 - LayoutText {#text} at (0,0) size 377x36 - text run at (0,0) width 377: "Shorthand border property" + LayoutText {#text} at (0,0) size 378x36 + text run at (0,0) width 378: "Shorthand border property" LayoutNGBlockFlow {P} at (0,58.44) size 784x26 [color=#008000] [bgcolor=#FFFFFF] [border: (3px solid #008000)] LayoutText {#text} at (3,3) size 363x19 text run at (3,3) width 363: "This paragraph should have a medium solid green border."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers-expected.png index d74a8b82..12a8c5f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers2-expected.png index 5a691c6..d78bc37 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ZeroOpacityLayers2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.png index 9e6cdec..18a18816 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.txt index afd297b..3fb2537 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/acid2-expected.txt
@@ -79,10 +79,10 @@ LayoutInline {A} at (0,0) size 214x27 [color=#0000FF] LayoutText {#text} at (0,0) size 214x27 text run at (0,0) width 214: "Take The Acid2 Test" - LayoutText {#text} at (213,0) size 199x27 - text run at (213,0) width 199: " and compare it to " - LayoutInline {A} at (0,0) size 247x27 [color=#0000FF] - LayoutText {#text} at (411,0) size 247x27 - text run at (411,0) width 247: "the reference rendering" - LayoutText {#text} at (657,0) size 8x27 - text run at (657,0) width 8: "." + LayoutText {#text} at (214,0) size 198x27 + text run at (214,0) width 198: " and compare it to " + LayoutInline {A} at (0,0) size 246x27 [color=#0000FF] + LayoutText {#text} at (412,0) size 246x27 + text run at (412,0) width 246: "the reference rendering" + LayoutText {#text} at (658,0) size 7x27 + text run at (658,0) width 7: "."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.png index afd0061..4db2373 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.txt index f008694..f5737ee9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/background-shorthand-invalid-url-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x186.88 LayoutNGBlockFlow {BODY} at (8,21.44) size 784x149.44 LayoutNGBlockFlow {H1} at (0,0) size 784x37 - LayoutText {#text} at (0,0) size 571x36 - text run at (0,0) width 571: "The background image should not repeat." + LayoutText {#text} at (0,0) size 572x36 + text run at (0,0) width 572: "The background image should not repeat." LayoutNGBlockFlow {DIV} at (0,58.44) size 784x91 LayoutNGBlockFlow {UL} at (0,0) size 784x91 LayoutNGListItem {LI} at (40,0) size 744x91 [border: (1px solid #FF0000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.png index 304a190..338401a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.txt index ac30af1..83202bc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/beforeSelectorOnCodeElement-expected.txt
@@ -6,11 +6,11 @@ LayoutNGBlockFlow {P} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 725x19 text run at (0,0) width 725: "The word \"PASSED\" should be shown below with a cirlce before and a square after. This is a test for WebKit bug " - LayoutInline {A} at (0,0) size 40x19 [color=#0000EE] - LayoutText {#text} at (724,0) size 40x19 - text run at (724,0) width 40: "11197" - LayoutText {#text} at (763,0) size 5x19 - text run at (763,0) width 5: "." + LayoutInline {A} at (0,0) size 39x19 [color=#0000EE] + LayoutText {#text} at (725,0) size 39x19 + text run at (725,0) width 39: "11197" + LayoutText {#text} at (764,0) size 4x19 + text run at (764,0) width 4: "." LayoutNGBlockFlow (anonymous) at (0,36) size 784x16 LayoutInline {CODE} at (0,0) size 64x16 LayoutInline {<pseudo:before>} at (0,0) size 8x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.png index de981d6..9b4942d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.txt index 791014d4..5840198f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/bidi-override-in-anonymous-block-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 785x1294.86 LayoutNGBlockFlow {BODY} at (8,16) size 769x1270.86 LayoutNGBlockFlow {P} at (0,0) size 769x20 - LayoutText {#text} at (0,0) size 161x19 - text run at (0,0) width 161: "div, span, nested div/span" + LayoutText {#text} at (0,0) size 160x19 + text run at (0,0) width 160: "div, span, nested div/span" LayoutNGBlockFlow {P} at (0,36) size 769x20 LayoutText {#text} at (0,0) size 64x19 text run at (0,0) width 64: "Single div" @@ -180,7 +180,7 @@ text run at (0,0) width 417: "The following 2 tables should be identical, ignorning whitespaces:" LayoutTable {TABLE} at (1.39,1000.69) size 82x72 [border: (1px solid #808080)] LayoutBlockFlow {CAPTION} at (0,0) size 82x20 - LayoutText {#text} at (0,0) size 83x19 + LayoutText {#text} at (0,0) size 82x19 text run at (0,0) width 82: "NormalTable" LayoutTableSection {TBODY} at (1,21) size 80x50 LayoutTableRow {TR} at (0,2) size 80x22 @@ -199,7 +199,7 @@ text run at (14,1) width 24: "opq" LayoutTable {DIV} at (1.39,1074.08) size 143x62 [border: (1px solid #000000)] LayoutBlockFlow {DIV} at (0,0) size 143x20 - LayoutText {#text} at (0,0) size 144x19 + LayoutText {#text} at (0,0) size 143x19 text run at (0,0) width 143: "AnonymousTableRow" LayoutTableSection (anonymous) at (1,21) size 141x40 LayoutTableRow {DIV} at (0,0) size 141x20 @@ -217,8 +217,8 @@ LayoutText {#text} at (50,0) size 24x19 text run at (50,0) width 24: "opq" LayoutNGBlockFlow {P} at (0,1152.08) size 769x20 - LayoutText {#text} at (0,0) size 514x19 - text run at (0,0) width 514: "Anonymous TABLE, TABLE_ROW, TABLE_ROW_GROUP, TABLE_CELL" + LayoutText {#text} at (0,0) size 511x19 + text run at (0,0) width 511: "Anonymous TABLE, TABLE_ROW, TABLE_ROW_GROUP, TABLE_CELL" LayoutNGBlockFlow {DIV} at (0,1188.08) size 769x82.78 [border: (1.39px solid #000000)] LayoutTable (anonymous) at (1.39,1.39) size 24x80 LayoutTableSection (anonymous) at (0,20) size 24x40
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.png index eccb46e..61ab9e3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.txt index 5962f114..e67724a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/border-radius-outline-offset-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 618x19 - LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 301x19 - text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=11930" - LayoutText {#text} at (351,0) size 318x19 - text run at (351,0) width 318: " Specifying border-radius makes the outline shrink" - LayoutText {#text} at (668,0) size 5x19 - text run at (668,0) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 617x19 + LayoutInline {A} at (0,0) size 299x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 299x19 + text run at (51,0) width 299: "http://bugs.webkit.org/show_bug.cgi?id=11930" + LayoutText {#text} at (350,0) size 318x19 + text run at (350,0) width 318: " Specifying border-radius makes the outline shrink" + LayoutText {#text} at (668,0) size 4x19 + text run at (668,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 273x19 text run at (0,0) width 273: "These two squares should be the same size:"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/clip-zooming-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/clip-zooming-expected.png index d1f2464de..90eab68 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/clip-zooming-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/clip-zooming-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/clip-zooming-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/clip-zooming-expected.txt new file mode 100644 index 0000000..255625ba --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/clip-zooming-expected.txt
@@ -0,0 +1,16 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x128 + LayoutNGBlockFlow {HTML} at (0,0) size 800x128 + LayoutNGBlockFlow {BODY} at (0,24) size 800x80 + LayoutNGBlockFlow {P} at (0,0) size 800x28 + LayoutInline {A} at (0,0) size 468x27 [color=#0000EE] + LayoutText {#text} at (0,0) size 468x27 + text run at (0,0) width 468: "https://bugs.webkit.org/show_bug.cgi?id=24753" + LayoutNGBlockFlow {P} at (0,52) size 800x28 + LayoutText {#text} at (0,0) size 608x27 + text run at (0,0) width 608: "Test CSS clip with zooming. You should not see any red below" +layer at (75,150) size 150x150 + LayoutNGBlockFlow (positioned) {DIV} at (75,150) size 150x150 [bgcolor=#FF0000] +layer at (0,75) size 300x300 backgroundClip at (75,150) size 150x150 clip at (75,150) size 150x150 + LayoutNGBlockFlow (positioned) {DIV} at (0,75) size 300x300 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.png index 8435e03..2e0a0514 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.txt index ccca9e2..b86da63 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/color-correction-expected.txt
@@ -4,10 +4,10 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x100 - LayoutText {#text} at (0,0) size 768x99 + LayoutText {#text} at (0,0) size 769x99 text run at (0,0) width 763: "This test demonstrates -webkit-color-correction. Below are 3 images with 20 pixel borders. The images are all the same --" text run at (0,20) width 755: "purple with an sRGB color profile. The border is the same CSS color for all three images. The first image has no special" - text run at (0,40) width 768: "CSS. The second has -webkit-color-correction set to default, so it matches the first image. And the third has -webkit-color-" + text run at (0,40) width 769: "CSS. The second has -webkit-color-correction set to default, so it matches the first image. And the third has -webkit-color-" text run at (0,60) width 759: "correction set to sRGB. This color-corrects the purple border from the sRGB color space, and the result is that the border" text run at (0,80) width 134: "and the image match." LayoutNGBlockFlow (anonymous) at (0,116) size 784x145
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/compare-content-style-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/compare-content-style-expected.txt index 0cf0469..1da70a58 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/compare-content-style-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/compare-content-style-expected.txt
@@ -5,29 +5,29 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x232 LayoutNGBlockFlow {DIV} at (0,0) size 784x120 LayoutNGBlockFlow {DIV} at (0,0) size 784x20 - LayoutInline {<pseudo:before>} at (0,0) size 38x19 - LayoutTextFragment (anonymous) at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutInline {<pseudo:before>} at (0,0) size 37x19 + LayoutTextFragment (anonymous) at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutNGBlockFlow {DIV} at (0,20) size 784x20 - LayoutInline {<pseudo:before>} at (0,0) size 38x19 - LayoutTextFragment (anonymous) at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutInline {<pseudo:before>} at (0,0) size 37x19 + LayoutTextFragment (anonymous) at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutNGBlockFlow {DIV} at (0,40) size 784x20 - LayoutInline {<pseudo:before>} at (0,0) size 38x19 - LayoutTextFragment (anonymous) at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutInline {<pseudo:before>} at (0,0) size 37x19 + LayoutTextFragment (anonymous) at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutNGBlockFlow {DIV} at (0,60) size 784x20 - LayoutInline {<pseudo:before>} at (0,0) size 38x19 - LayoutTextFragment (anonymous) at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutInline {<pseudo:before>} at (0,0) size 37x19 + LayoutTextFragment (anonymous) at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutNGBlockFlow {DIV} at (0,80) size 784x20 - LayoutInline {<pseudo:before>} at (0,0) size 38x19 - LayoutTextFragment (anonymous) at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutInline {<pseudo:before>} at (0,0) size 37x19 + LayoutTextFragment (anonymous) at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutNGBlockFlow {DIV} at (0,100) size 784x20 - LayoutInline {<pseudo:before>} at (0,0) size 38x19 - LayoutTextFragment (anonymous) at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutInline {<pseudo:before>} at (0,0) size 37x19 + LayoutTextFragment (anonymous) at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" LayoutNGBlockFlow {DIV} at (0,136) size 784x96 LayoutNGBlockFlow {P} at (0,0) size 784x20 LayoutInline {A} at (0,0) size 671x19 [color=#0000EE] @@ -38,8 +38,8 @@ LayoutNGListMarker (anonymous) at (-16,0) size 16x20 LayoutText (anonymous) at (0,0) size 16x19 text run at (0,0) width 16: "1. " - LayoutText {#text} at (0,0) size 344x19 - text run at (0,0) width 344: "All lines above should be \"PASS\" on initial page load." + LayoutText {#text} at (0,0) size 343x19 + text run at (0,0) width 343: "All lines above should be \"PASS\" on initial page load." LayoutNGListItem {LI} at (40,20) size 744x20 LayoutNGListMarker (anonymous) at (-16,0) size 16x20 LayoutText (anonymous) at (0,0) size 16x19 @@ -50,5 +50,5 @@ LayoutNGListMarker (anonymous) at (-16,0) size 16x20 LayoutText (anonymous) at (0,0) size 16x19 text run at (0,0) width 16: "3. " - LayoutText {#text} at (0,0) size 246x19 - text run at (0,0) width 246: "All lines above should still be \"PASS\"." + LayoutText {#text} at (0,0) size 245x19 + text run at (0,0) width 245: "All lines above should still be \"PASS\"."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/continuationCrash-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/continuationCrash-expected.txt index 718a670..a2d89267 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/continuationCrash-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/continuationCrash-expected.txt
@@ -30,8 +30,8 @@ LayoutNGListMarker (anonymous) at (-16,0) size 16x20 LayoutText (anonymous) at (0,0) size 16x19 text run at (0,0) width 16: "3. " - LayoutText {#text} at (0,0) size 265x19 - text run at (0,0) width 265: "(The ouline will not be updated correctly.)" + LayoutText {#text} at (0,0) size 264x19 + text run at (0,0) width 264: "(The ouline will not be updated correctly.)" LayoutNGListItem {LI} at (40,60) size 744x20 LayoutNGListMarker (anonymous) at (-16,0) size 16x20 LayoutText (anonymous) at (0,0) size 16x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css-imports-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css-imports-expected.png index 5bb7500..0b84335e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css-imports-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css-imports-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.png index 2122f487..df8a3184 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.txt index ae3240c6..9f006bfc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css1_forward_compatible_parsing-expected.txt
@@ -5,28 +5,28 @@ LayoutNGBlockFlow {BODY} at (8,16) size 784x395.42 LayoutNGBlockFlow {DIV} at (0,0) size 784x40 [color=#008000] [bgcolor=#FFFFFF] LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 772x39 - text run at (0,0) width 772: "First sentence: this text should be green. The markup code is invalid according to W3C HTML validator and the CSS code" - text run at (0,20) width 272: "is invalid according to W3C CSS validator." + LayoutText {#text} at (0,0) size 773x39 + text run at (0,0) width 773: "First sentence: this text should be green. The markup code is invalid according to W3C HTML validator and the CSS code" + text run at (0,20) width 273: "is invalid according to W3C CSS validator." LayoutNGBlockFlow {DIV} at (0,56) size 784x40 [color=#008000] [bgcolor=#FFFFFF] LayoutNGBlockFlow {P} at (0,0) size 784x40 [color=#FF0000] LayoutText {#text} at (0,0) size 776x39 text run at (0,0) width 776: "Second sentence: this text should be green according to CSS 1 but it should be red according to CSS 2.1. The markup code" - text run at (0,20) width 751: "is also invalid according to W3C HTML validator but the CSS code is perfectly valid according to W3C CSS validator." + text run at (0,20) width 753: "is also invalid according to W3C HTML validator but the CSS code is perfectly valid according to W3C CSS validator." LayoutNGBlockFlow {H3} at (0,114.72) size 784x46 [color=#008000] [bgcolor=#FFFFFF] - LayoutText {#text} at (0,0) size 766x45 - text run at (0,0) width 766: "Third sentence: this text should be green. The markup code is valid according to W3C HTML" + LayoutText {#text} at (0,0) size 767x45 + text run at (0,0) width 767: "Third sentence: this text should be green. The markup code is valid according to W3C HTML" text run at (0,23) width 579: "validator but the CSS code is invalid according to W3C CSS validator." LayoutNGBlockFlow {H4} at (0,181.98) size 784x60 [color=#FF0000] [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 776x59 text run at (0,0) width 776: "Fourth sentence: this text should be green according to CSS 1 (class name can not start with a dash in CSS 1) but it" - text run at (0,20) width 772: "should be red according to CSS 2.1 and the markup code is valid according to W3C HTML validator and the CSS" - text run at (0,40) width 375: "code is perfectly valid according to W3C CSS validator." + text run at (0,20) width 773: "should be red according to CSS 2.1 and the markup code is valid according to W3C HTML validator and the CSS" + text run at (0,40) width 374: "code is perfectly valid according to W3C CSS validator." LayoutNGBlockFlow {H5} at (0,268.70) size 784x80 [color=#800080] [bgcolor=#FFFFFF] LayoutText {#text} at (0,0) size 775x79 text run at (0,0) width 761: "Fifth sentence: this text should be green according to CSS 1 (class name can not start with a dash in CSS 1) but it" text run at (0,20) width 775: "should be purple according to latest CSS 2.1 WD (class name can not start with a dash unless immediately followed" - text run at (0,40) width 770: "by [_A-Za-z] character in CSS 2.1) and the markup code is valid according to W3C HTML validator and the CSS" + text run at (0,40) width 771: "by [_A-Za-z] character in CSS 2.1) and the markup code is valid according to W3C HTML validator and the CSS" text run at (0,60) width 402: "code is perfectly valid according to the W3C CSS validator!" LayoutNGBlockFlow {P} at (0,375.42) size 784x20 LayoutText {#text} at (0,0) size 27x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.png index ba4a708d..1758b829 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.txt index 741085e..fd81bb7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-modsel-22-expected.txt
@@ -14,8 +14,8 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (0,0) size 482x19 - text run at (0,0) width 482: "This list item should be green because its language is British English (Wales)" + LayoutText {#text} at (0,0) size 481x19 + text run at (0,0) width 481: "This list item should be green because its language is British English (Wales)" LayoutNGBlockFlow {OL} at (0,56) size 784x40 LayoutNGListItem {LI} at (40,0) size 744x20 LayoutNGListMarker (anonymous) at (-16,0) size 16x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-space-in-nth-and-lang-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-space-in-nth-and-lang-expected.png index e1b7fb3..94f992a1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-space-in-nth-and-lang-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/css3-space-in-nth-and-lang-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.png index 15e8f0c..454f6d84 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.txt index 307c692..2856e76 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/ex-after-font-variant-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 684x19 - LayoutInline {A} at (0,0) size 349x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 349x19 - text run at (51,0) width 349: "http://bugzilla.opendarwin.org/show_bug.cgi?id=4227" - LayoutText {#text} at (399,0) size 336x19 - text run at (399,0) width 336: " The ex unit doesn't work for font-variant: small-caps" - LayoutText {#text} at (734,0) size 5x19 - text run at (734,0) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 683x19 + LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 348x19 + text run at (51,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=4227" + LayoutText {#text} at (399,0) size 335x19 + text run at (399,0) width 335: " The ex unit doesn't work for font-variant: small-caps" + LayoutText {#text} at (734,0) size 4x19 + text run at (734,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 244x19 text run at (0,0) width 244: "There should be a green square below:"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.png index 017f86f..1ebee02 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.txt index 1dbf63d..df57c435 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/find-next-layer-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 727x19 - LayoutInline {A} at (0,0) size 349x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 349x19 - text run at (51,0) width 349: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9124" - LayoutText {#text} at (399,0) size 379x19 - text run at (399,0) width 379: " Drop shadow obscures \"add more stuff\" bubble at live.com" - LayoutText {#text} at (777,0) size 5x19 - text run at (777,0) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 728x19 + LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 348x19 + text run at (51,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9124" + LayoutText {#text} at (399,0) size 380x19 + text run at (399,0) width 380: " Drop shadow obscures \"add more stuff\" bubble at live.com" + LayoutText {#text} at (779,0) size 4x19 + text run at (779,0) width 4: "." layer at (8,44) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,36) size 784x2 [border: (1px inset #EEEEEE)] layer at (8,54) size 784x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.png index 8cb7db6..83c64dd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.txt index ab7fb68..5b6e2a4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-capitalized-expected.txt
@@ -4,17 +4,17 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 666x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=14545" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=14545" LayoutText {#text} at (352,0) size 666x39 text run at (352,0) width 314: " REGRESSION (r21854-r21869): Repro crash in" text run at (0,20) width 350: "LayoutBlockFlow::updateFirstLetter @ nola.com/rose/" - LayoutText {#text} at (349,20) size 5x19 - text run at (349,20) width 5: "." + LayoutText {#text} at (350,20) size 4x19 + text run at (350,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 249x19 text run at (0,0) width 249: "The following lines should be identical:"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.png index d00f7f79..ae9a550a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.txt index e35cc76..1b74ed0b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-detach-expected.txt
@@ -4,42 +4,42 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 724x39 - LayoutInline {A} at (0,0) size 349x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 349x19 - text run at (51,0) width 349: "http://bugzilla.opendarwin.org/show_bug.cgi?id=3560" + LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 348x19 + text run at (51,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=3560" LayoutText {#text} at (399,0) size 724x39 text run at (399,0) width 325: " page with use of first-letter crashes reproducibly in" - text run at (0,20) width 186: "LayoutObject::renderArena()" - LayoutText {#text} at (185,20) size 5x19 - text run at (185,20) width 5: "." + text run at (0,20) width 187: "LayoutObject::renderArena()" + LayoutText {#text} at (187,20) size 4x19 + text run at (187,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 231x19 text run at (0,0) width 231: "The next three lines should all read \x{201C}" - LayoutInline {SPAN} at (0,0) size 9x19 [color=#0000FF] - LayoutText {#text} at (231,0) size 9x19 - text run at (231,0) width 9: "P" - LayoutText {#text} at (239,0) size 207x19 - text run at (239,0) width 207: "ASS\x{201D}, with nothing before the P." + LayoutInline {SPAN} at (0,0) size 8x19 [color=#0000FF] + LayoutText {#text} at (231,0) size 8x19 + text run at (231,0) width 8: "P" + LayoutText {#text} at (239,0) size 206x19 + text run at (239,0) width 206: "ASS\x{201D}, with nothing before the P." LayoutNGBlockFlow {P} at (0,110) size 784x20 - LayoutInline {<pseudo:first-letter>} at (0,0) size 9x19 [color=#0000FF] - LayoutTextFragment (anonymous) at (0,0) size 9x19 - text run at (0,0) width 9: "P" - LayoutTextFragment {#text} at (8,0) size 30x19 - text run at (8,0) width 30: "ASS" + LayoutInline {<pseudo:first-letter>} at (0,0) size 8x19 [color=#0000FF] + LayoutTextFragment (anonymous) at (0,0) size 8x19 + text run at (0,0) width 8: "P" + LayoutTextFragment {#text} at (8,0) size 29x19 + text run at (8,0) width 29: "ASS" LayoutNGBlockFlow {P} at (0,146) size 784x20 - LayoutInline {<pseudo:first-letter>} at (0,0) size 9x19 [color=#0000FF] - LayoutTextFragment (anonymous) at (0,0) size 9x19 - text run at (0,0) width 9: "P" - LayoutTextFragment {#text} at (8,0) size 30x19 - text run at (8,0) width 30: "ASS" + LayoutInline {<pseudo:first-letter>} at (0,0) size 8x19 [color=#0000FF] + LayoutTextFragment (anonymous) at (0,0) size 8x19 + text run at (0,0) width 8: "P" + LayoutTextFragment {#text} at (8,0) size 29x19 + text run at (8,0) width 29: "ASS" LayoutNGBlockFlow {P} at (0,182) size 784x20 - LayoutInline {<pseudo:first-letter>} at (0,0) size 9x19 [color=#0000FF] - LayoutTextFragment (anonymous) at (0,0) size 9x19 - text run at (0,0) width 9: "P" - LayoutTextFragment {#text} at (8,0) size 30x19 - text run at (8,0) width 30: "ASS" + LayoutInline {<pseudo:first-letter>} at (0,0) size 8x19 [color=#0000FF] + LayoutTextFragment (anonymous) at (0,0) size 8x19 + text run at (0,0) width 8: "P" + LayoutTextFragment {#text} at (8,0) size 29x19 + text run at (8,0) width 29: "ASS" layer at (8,100) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.png index 6d080119..e86b443 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.txt index 5b4f437..497326032 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-after-float-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 766x39 - LayoutInline {A} at (0,0) size 308x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 308x19 - text run at (51,0) width 308: "https://bugs.webkit.org/show_bug.cgi?id=18818" - LayoutText {#text} at (358,0) size 766x39 - text run at (358,0) width 408: " REGRESSION (3.1.1-TOT): Character order (float:left ordered" + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 767x39 + LayoutInline {A} at (0,0) size 307x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 307x19 + text run at (51,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=18818" + LayoutText {#text} at (358,0) size 767x39 + text run at (358,0) width 409: " REGRESSION (3.1.1-TOT): Character order (float:left ordered" text run at (0,20) width 121: "after the first letter)" LayoutText {#text} at (121,20) size 4x19 text run at (121,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.png index 26bcc0b..eb7a8c1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.txt index 8606c8f..3b78132 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-float-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 775x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=17834" - LayoutText {#text} at (352,0) size 775x39 - text run at (352,0) width 423: " REGRESSION: floated first-letter does not work when included in" + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 774x39 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=17834" + LayoutText {#text} at (352,0) size 774x39 + text run at (352,0) width 422: " REGRESSION: floated first-letter does not work when included in" text run at (0,20) width 31: "table" LayoutText {#text} at (31,20) size 4x19 text run at (31,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-visibility-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-visibility-expected.png index 80d470e..48fce2e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-visibility-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/first-letter-visibility-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-multiline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-multiline-expected.png index 789900c..e15035f5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-multiline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-multiline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-color-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-color-expected.png index 999b90f..da877a6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-color-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-color-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.png index 00d1138..20cf929 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.txt index 85926d5..314cbb0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-offset-expected.txt
@@ -10,7 +10,7 @@ LayoutNGBlockFlow (anonymous) at (0,56) size 784x20 LayoutText {#text} at (0,0) size 110x19 text run at (0,0) width 110: "(Some filler text) " - LayoutInline {A} at (0,0) size 27x19 [color=#0000EE] - LayoutText {#text} at (109,0) size 27x19 - text run at (109,0) width 27: "Test" + LayoutInline {A} at (0,0) size 25x19 [color=#0000EE] + LayoutText {#text} at (110,0) size 25x19 + text run at (110,0) width 25: "Test" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-width-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-width-expected.png index 948aeeb..d30153b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-width-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/focus-ring-outline-width-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-opentype-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-opentype-expected.png index 986378023..4557fcf 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-opentype-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-opentype-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-expected.png index c0ba2f9..49d7923 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-for-locally-installed-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-for-locally-installed-expected.png index 767a65c..952bbe88 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-for-locally-installed-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-synthetic-bold-italic-for-locally-installed-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-weight-matching-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-weight-matching-expected.png index 15fd849..dbd53d9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-weight-matching-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-face-weight-matching-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.png index 6a9e48d..8eedf14 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.txt index 19d9e07..6b07a008 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-shorthand-weight-only-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 716x19 - LayoutInline {A} at (0,0) size 349x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 349x19 - text run at (51,0) width 349: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9341" + LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 348x19 + text run at (51,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9341" LayoutText {#text} at (399,0) size 368x19 text run at (399,0) width 368: " REGRESSION: Repro crash caused by style=\"font:bold\"" - LayoutText {#text} at (766,0) size 5x19 - text run at (766,0) width 5: "." + LayoutText {#text} at (767,0) size 4x19 + text run at (767,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 - LayoutText {#text} at (0,0) size 126x19 - text run at (0,0) width 126: "PASS (didn\x{2019}t crash)" + LayoutText {#text} at (0,0) size 125x19 + text run at (0,0) width 125: "PASS (didn\x{2019}t crash)"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-smoothing-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-smoothing-expected.txt index f9666a67..a703e40 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-smoothing-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font-smoothing-expected.txt
@@ -7,22 +7,22 @@ LayoutText {#text} at (0,0) size 303x22 text run at (0,0) width 303: "Hello. This is absolutely regular text." LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (302,17) size 0x0 + LayoutBR {BR} at (303,17) size 0x0 LayoutInline {SPAN} at (0,0) size 780x22 LayoutText {#text} at (0,23) size 780x22 text run at (0,23) width 780: "Hello. This is text with -webkit-font-smoothing:auto. It should look like absolutely regular text." LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (779,40) size 0x0 + LayoutBR {BR} at (780,40) size 0x0 LayoutInline {SPAN} at (0,0) size 437x22 LayoutText {#text} at (0,46) size 437x22 text run at (0,46) width 437: "Hello. This is text with -webkit-font-smoothing:none." LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (436,63) size 0x0 + LayoutBR {BR} at (437,63) size 0x0 LayoutInline {SPAN} at (0,0) size 486x22 LayoutText {#text} at (0,69) size 486x22 text run at (0,69) width 486: "Hello. This is text with -webkit-font-smoothing:antialiased." LayoutText {#text} at (0,0) size 0x0 - LayoutBR {BR} at (485,86) size 0x0 + LayoutBR {BR} at (486,86) size 0x0 LayoutInline {SPAN} at (0,0) size 716x45 LayoutText {#text} at (0,92) size 716x45 text run at (0,92) width 716: "Hello. This is text with -webkit-font-smoothing:subpixel-antialiased. It should look like"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.png index 31cd022..18766d4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.txt index bcd847b..6825d12 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/font_property_normal-expected.txt
@@ -10,8 +10,8 @@ LayoutText {#text} at (0,0) size 220x36 text run at (0,0) width 220: "24pt italic = 24pt" LayoutNGBlockFlow {P} at (0,121) size 784x37 - LayoutText {#text} at (0,0) size 293x36 - text run at (0,0) width 293: "24pt italic Arial = 24pt" + LayoutText {#text} at (0,0) size 292x36 + text run at (0,0) width 292: "24pt italic Arial = 24pt" LayoutNGBlockFlow {P} at (0,190) size 784x20 LayoutText {#text} at (0,0) size 185x19 text run at (0,0) width 185: "24pt italic 'Arial' = 24pt Arial" @@ -19,11 +19,11 @@ LayoutText {#text} at (0,0) size 105x19 text run at (0,0) width 105: "italic 24pt = fails" LayoutNGBlockFlow {P} at (0,278) size 784x38 - LayoutText {#text} at (0,0) size 455x37 - text run at (0,0) width 455: "italic 24pt Arial = 24pt Arial Italic" + LayoutText {#text} at (0,0) size 453x37 + text run at (0,0) width 453: "italic 24pt Arial = 24pt Arial Italic" LayoutNGBlockFlow {P} at (0,348) size 784x38 - LayoutText {#text} at (0,0) size 468x37 - text run at (0,0) width 468: "italic 24pt 'Arial' = 24pt Arial Italic" + LayoutText {#text} at (0,0) size 467x37 + text run at (0,0) width 467: "italic 24pt 'Arial' = 24pt Arial Italic" LayoutNGBlockFlow {P} at (0,418) size 784x20 LayoutText {#text} at (0,0) size 141x19 text run at (0,0) width 141: "Arial 24pt italic = fails"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/hsl-color-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/hsl-color-expected.txt index f61eccb..e42a575 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/hsl-color-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/hsl-color-expected.txt
@@ -47,8 +47,8 @@ LayoutText {#text} at (0,0) size 639x36 text run at (0,0) width 639: "This should be grey, too: hsl(120, -100%, 50%)" LayoutNGBlockFlow (anonymous) at (0,745.69) size 769x40 - LayoutText {#text} at (0,0) size 754x39 - text run at (0,0) width 754: "Check Hue values that are larger than 360, should be normalized back to a value between 0 and 360. As Hue values are" + LayoutText {#text} at (0,0) size 755x39 + text run at (0,0) width 755: "Check Hue values that are larger than 360, should be normalized back to a value between 0 and 360. As Hue values are" text run at (0,20) width 451: "in degrees, there is no maximum like percentages, they are loop around." LayoutNGBlockFlow {H1} at (0,807.13) size 769x37 [color=#008000] LayoutText {#text} at (0,0) size 661x36
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-default-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-default-expected.png index 37cc99d2..047d1ac 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-default-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-default-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-dynamic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-dynamic-expected.png index c7afadc6..32c7acc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-dynamic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-dynamic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-expected.png index c7afadc6..32c7acc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-composited-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-expected.png index 3957a0a..5ca56204 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/image-orientation/image-orientation-from-image-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/import-rule-regression-11590-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/import-rule-regression-11590-expected.png index 2c28f1f..b30c063 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/import-rule-regression-11590-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/import-rule-regression-11590-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalid-percentage-property-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalid-percentage-property-expected.png index a17e2e7..77d15b3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalid-percentage-property-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalid-percentage-property-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.png index e6fc676..a1dfc14 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.txt index f7bd0e90..08dc6d3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-2-expected.txt
@@ -7,8 +7,8 @@ LayoutInline {A} at (0,0) size 60x19 [color=#0000EE] LayoutText {#text} at (0,0) size 60x19 text run at (0,0) width 60: "bug 7118" - LayoutText {#text} at (59,0) size 355x19 - text run at (59,0) width 355: ": Wrong property values do not get invalidated correctly." + LayoutText {#text} at (60,0) size 354x19 + text run at (60,0) width 354: ": Wrong property values do not get invalidated correctly." LayoutNGBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-3-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-3-expected.png index 0ec0ae1..3f9b575 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-3-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-3-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.png index e6fc676..a1dfc14 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.txt index f7bd0e90..08dc6d3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/invalidation-errors-expected.txt
@@ -7,8 +7,8 @@ LayoutInline {A} at (0,0) size 60x19 [color=#0000EE] LayoutText {#text} at (0,0) size 60x19 text run at (0,0) width 60: "bug 7118" - LayoutText {#text} at (59,0) size 355x19 - text run at (59,0) width 355: ": Wrong property values do not get invalidated correctly." + LayoutText {#text} at (60,0) size 354x19 + text run at (60,0) width 354: ": Wrong property values do not get invalidated correctly." LayoutNGBlockFlow (anonymous) at (0,36) size 784x0 LayoutInline {DIV} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/layerZOrderCrash-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/layerZOrderCrash-expected.txt index 9c9bb3d..c3f2c04 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/layerZOrderCrash-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/layerZOrderCrash-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow (relative positioned) {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 616x19 - text run at (0,0) width 616: "To reproduce this bug outside of DumpRenderTree, click the link below. If broken, we will crash." - LayoutBR {BR} at (615,0) size 0x0 + LayoutText {#text} at (0,0) size 614x19 + text run at (0,0) width 614: "To reproduce this bug outside of DumpRenderTree, click the link below. If broken, we will crash." + LayoutBR {BR} at (614,0) size 0x0 layer at (8,28) size 58x96 LayoutTable (relative positioned) {TABLE} at (0,20) size 58x96 LayoutTableSection {TBODY} at (0,0) size 58x96
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.png index 7e316a7c..47626cb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.txt index 6254d246..2c7e896 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-expected.txt
@@ -4,19 +4,19 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {DIV} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {A} at (0,0) size 121x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 121x19 - text run at (51,0) width 121: "Bugzilla Bug 9934" - LayoutText {#text} at (171,0) size 452x19 - text run at (171,0) width 452: " Selecting text in text field with {line-height:100%} causes it to bounce." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {A} at (0,0) size 120x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 120x19 + text run at (51,0) width 120: "Bugzilla Bug 9934" + LayoutText {#text} at (171,0) size 451x19 + text run at (171,0) width 451: " Selecting text in text field with {line-height:100%} causes it to bounce." LayoutNGBlockFlow {DIV} at (0,20) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutNGBlockFlow {DIV} at (0,42) size 784x40 LayoutText {#text} at (0,0) size 735x39 text run at (0,0) width 735: "Select the text in the text field using horizontal mouse movements, then drag up and down. The text should not move" - text run at (0,20) width 61: "vertically." + text run at (0,20) width 60: "vertically." layer at (10,31) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 LayoutText {#text} at (0,0) size 76x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-overflow-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-overflow-expected.txt index bb9db317..745b3fd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/line-height-overflow-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 785x32804 LayoutNGBlockFlow {BODY} at (8,8) size 769x32788 LayoutNGBlockFlow (anonymous) at (0,0) size 769x20 - LayoutText {#text} at (0,0) size 558x19 - text run at (0,0) width 558: "You should see a large green block below that is 32,768px tall. No red should be visible." + LayoutText {#text} at (0,0) size 557x19 + text run at (0,0) width 557: "You should see a large green block below that is 32,768px tall. No red should be visible." LayoutBR {BR} at (557,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,20) size 769x32768 [bgcolor=#FF0000] LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/link-outside-head-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/link-outside-head-expected.txt index 390b0262..4735b7d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/link-outside-head-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/link-outside-head-expected.txt
@@ -4,6 +4,6 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 562x19 - text run at (0,0) width 562: "You should see a 100x100 green square below. If you see any red then the test has failed." + LayoutText {#text} at (0,0) size 560x19 + text run at (0,0) width 560: "You should see a 100x100 green square below. If you see any red then the test has failed." LayoutNGBlockFlow {DIV} at (0,20) size 100x100 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/list-outline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/list-outline-expected.png index 9b5f25d3..cd90434 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/list-outline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/list-outline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/negative-nth-child-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/negative-nth-child-expected.txt index dd84bad..e1c34c5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/negative-nth-child-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/negative-nth-child-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 438x19 - text run at (0,0) width 438: "There should be only green below. If you see RED the test has failed." + LayoutText {#text} at (0,0) size 437x19 + text run at (0,0) width 437: "There should be only green below. If you see RED the test has failed." LayoutNGBlockFlow {DIV} at (0,20) size 784x16 [bgcolor=#008000] LayoutNGBlockFlow {DIV} at (0,36) size 784x16 [bgcolor=#008000] LayoutNGBlockFlow {DIV} at (0,52) size 784x16 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.png index 21a8daa..b0379d86 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.txt index f3fffff..189a4897 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/nth-child-dynamic-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x582 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 323x19 - text run at (0,0) width 323: "Test :nth-child() when dynamically adding siblings." + LayoutText {#text} at (0,0) size 322x19 + text run at (0,0) width 322: "Test :nth-child() when dynamically adding siblings." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutInline {A} at (0,0) size 305x19 [color=#0000EE] LayoutText {#text} at (0,0) size 305x19 @@ -45,39 +45,39 @@ LayoutText {#text} at (0,0) size 9x19 text run at (0,0) width 9: "P" LayoutNGBlockFlow {DIV} at (10,314) size 764x252 [border: (1px solid #000000)] - LayoutText {#text} at (6,6) size 261x19 - text run at (6,6) width 261: "child 0: PASS: found color rgb(255, 0, 0)" + LayoutText {#text} at (6,6) size 260x19 + text run at (6,6) width 260: "child 0: PASS: found color rgb(255, 0, 0)" LayoutBR {BR} at (266,6) size 0x0 - LayoutText {#text} at (6,26) size 245x19 - text run at (6,26) width 245: "child 1: PASS: found color rgb(0, 0, 0)" + LayoutText {#text} at (6,26) size 244x19 + text run at (6,26) width 244: "child 1: PASS: found color rgb(0, 0, 0)" LayoutBR {BR} at (250,26) size 0x0 - LayoutText {#text} at (6,46) size 245x19 - text run at (6,46) width 245: "child 2: PASS: found color rgb(0, 0, 0)" + LayoutText {#text} at (6,46) size 244x19 + text run at (6,46) width 244: "child 2: PASS: found color rgb(0, 0, 0)" LayoutBR {BR} at (250,46) size 0x0 - LayoutText {#text} at (6,66) size 261x19 - text run at (6,66) width 261: "child 3: PASS: found color rgb(255, 0, 0)" + LayoutText {#text} at (6,66) size 260x19 + text run at (6,66) width 260: "child 3: PASS: found color rgb(255, 0, 0)" LayoutBR {BR} at (266,66) size 0x0 - LayoutText {#text} at (6,86) size 245x19 - text run at (6,86) width 245: "child 4: PASS: found color rgb(0, 0, 0)" + LayoutText {#text} at (6,86) size 244x19 + text run at (6,86) width 244: "child 4: PASS: found color rgb(0, 0, 0)" LayoutBR {BR} at (250,86) size 0x0 - LayoutText {#text} at (6,106) size 245x19 - text run at (6,106) width 245: "child 5: PASS: found color rgb(0, 0, 0)" + LayoutText {#text} at (6,106) size 244x19 + text run at (6,106) width 244: "child 5: PASS: found color rgb(0, 0, 0)" LayoutBR {BR} at (250,106) size 0x0 - LayoutText {#text} at (6,126) size 261x19 - text run at (6,126) width 261: "child 6: PASS: found color rgb(255, 0, 0)" + LayoutText {#text} at (6,126) size 260x19 + text run at (6,126) width 260: "child 6: PASS: found color rgb(255, 0, 0)" LayoutBR {BR} at (266,126) size 0x0 - LayoutText {#text} at (6,146) size 245x19 - text run at (6,146) width 245: "child 7: PASS: found color rgb(0, 0, 0)" + LayoutText {#text} at (6,146) size 244x19 + text run at (6,146) width 244: "child 7: PASS: found color rgb(0, 0, 0)" LayoutBR {BR} at (250,146) size 0x0 - LayoutText {#text} at (6,166) size 245x19 - text run at (6,166) width 245: "child 8: PASS: found color rgb(0, 0, 0)" + LayoutText {#text} at (6,166) size 244x19 + text run at (6,166) width 244: "child 8: PASS: found color rgb(0, 0, 0)" LayoutBR {BR} at (250,166) size 0x0 - LayoutText {#text} at (6,186) size 261x19 - text run at (6,186) width 261: "child 9: PASS: found color rgb(255, 0, 0)" + LayoutText {#text} at (6,186) size 260x19 + text run at (6,186) width 260: "child 9: PASS: found color rgb(255, 0, 0)" LayoutBR {BR} at (266,186) size 0x0 - LayoutText {#text} at (6,206) size 253x19 - text run at (6,206) width 253: "child 10: PASS: found color rgb(0, 0, 0)" + LayoutText {#text} at (6,206) size 252x19 + text run at (6,206) width 252: "child 10: PASS: found color rgb(0, 0, 0)" LayoutBR {BR} at (258,206) size 0x0 - LayoutText {#text} at (6,226) size 282x19 - text run at (6,226) width 282: "div 1: PASS: found color rgb(153, 153, 255)" + LayoutText {#text} at (6,226) size 281x19 + text run at (6,226) width 281: "div 1: PASS: found color rgb(153, 153, 255)" LayoutBR {BR} at (287,226) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.png index 0de55b51..da99e6d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.txt index 293fd9a..d72fe85e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-dynamic-removed-expected.txt
@@ -4,43 +4,43 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x272 LayoutNGBlockFlow {BODY} at (8,16) size 784x248 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 782x39 - text run at (0,0) width 782: "Test passes if each of the orange boxes is sandwiched between two blue boxes and two groups of blue and orange boxes are" + LayoutText {#text} at (0,0) size 781x39 + text run at (0,0) width 781: "Test passes if each of the orange boxes is sandwiched between two blue boxes and two groups of blue and orange boxes are" text run at (0,20) width 390: "inside the big yellow box and the remaining group is below it." layer at (8,72) size 192x192 LayoutNGBlockFlow (relative positioned) {DIV} at (0,56) size 192x192 [bgcolor=#FFFF00] LayoutNGBlockFlow (anonymous) at (0,0) size 192x20 - LayoutInline {DIV} at (0,0) size 65x19 [bgcolor=#0000FF] - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutInline {DIV} at (0,0) size 64x19 [bgcolor=#0000FF] + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutNGBlockFlow (anonymous) at (0,20) size 192x20 LayoutNGBlockFlow {DIV} at (0,0) size 192x20 [bgcolor=#FFA500] - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutNGBlockFlow (anonymous) at (0,40) size 192x20 - LayoutInline {DIV} at (0,0) size 65x19 [bgcolor=#0000FF] + LayoutInline {DIV} at (0,0) size 64x19 [bgcolor=#0000FF] LayoutNGBlockFlow (anonymous) at (0,80) size 192x20 - LayoutInline {DIV} at (0,0) size 65x19 [bgcolor=#0000FF] + LayoutInline {DIV} at (0,0) size 64x19 [bgcolor=#0000FF] LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow (anonymous) at (0,100) size 192x20 LayoutNGBlockFlow {DIV} at (0,0) size 192x20 [bgcolor=#FFA500] - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutNGBlockFlow (anonymous) at (0,120) size 192x20 - LayoutInline {DIV} at (0,0) size 65x19 [bgcolor=#0000FF] - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutInline {DIV} at (0,0) size 64x19 [bgcolor=#0000FF] + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" LayoutText {#text} at (0,0) size 0x0 -layer at (8,304) size 65x19 - LayoutInline (relative positioned) {DIV} at (0,0) size 65x19 - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" +layer at (8,304) size 64x19 + LayoutInline (relative positioned) {DIV} at (0,0) size 64x19 + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" layer at (8,324) size 192x20 LayoutNGBlockFlow (anonymous) (relative positioned) at (0,60) size 192x20 LayoutNGBlockFlow {DIV} at (0,0) size 192x20 [bgcolor=#FFA500] - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" -layer at (8,344) size 65x19 - LayoutInline (relative positioned) {DIV} at (0,0) size 65x19 - LayoutText {#text} at (0,0) size 65x19 - text run at (0,0) width 65: "Filler Text" + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text" +layer at (8,344) size 64x19 + LayoutInline (relative positioned) {DIV} at (0,0) size 64x19 + LayoutText {#text} at (0,0) size 64x19 + text run at (0,0) width 64: "Filler Text"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.png index 875b172..6d7daf3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-nested-with-inline-parent-multiple-descendant-blocks-dynamic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.png index 52ce4f1..b7b5959 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-and-parent-dynamic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.png index 52ce4f1..b7b5959 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-dynamic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-expected.png index 52ce4f1..b7b5959 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-ancestor-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.png index 52ce4f1..b7b5959 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/relative-positioned-block-with-inline-parent-dynamic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.png index 7f478450..f03ba61 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.txt index 3040cde5..83dd2b5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x542 LayoutNGBlockFlow {P} at (0,18) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 646x19 - LayoutInline {A} at (0,0) size 307x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 307x19 - text run at (51,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=22118" - LayoutText {#text} at (357,0) size 340x19 - text run at (357,0) width 340: " Resize corner does not track in transformed elements" - LayoutText {#text} at (696,0) size 5x19 - text run at (696,0) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 644x19 + LayoutInline {A} at (0,0) size 305x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 305x19 + text run at (51,0) width 305: "https://bugs.webkit.org/show_bug.cgi?id=22118" + LayoutText {#text} at (356,0) size 339x19 + text run at (356,0) width 339: " Resize corner does not track in transformed elements" + LayoutText {#text} at (695,0) size 4x19 + text run at (695,0) width 4: "." layer at (8,8) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,0) size 784x2 [border: (1px inset #EEEEEE)] layer at (8,62) size 784x2 clip at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.png index 284e4003..88924268 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.txt index 73f9280..495bee3b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/resize-corner-tracking-transformed-iframe-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,18) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 552x19 - LayoutInline {A} at (0,0) size 300x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 300x19 - text run at (51,0) width 300: "https://bugs.webkit.org/show_bug.cgi?id=9221" + LayoutInline {A} at (0,0) size 299x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 299x19 + text run at (51,0) width 299: "https://bugs.webkit.org/show_bug.cgi?id=9221" LayoutText {#text} at (350,0) size 253x19 text run at (350,0) width 253: " resize property doesn't work on iframes" - LayoutText {#text} at (602,0) size 5x19 - text run at (602,0) width 5: "." + LayoutText {#text} at (603,0) size 4x19 + text run at (603,0) width 4: "." LayoutNGBlockFlow (anonymous) at (0,64) size 784x230 LayoutText {#text} at (0,0) size 0x0 layer at (8,8) size 784x2 clip at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/rtl-ordering-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/rtl-ordering-expected.txt index ce506ea..21f2d6c8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/rtl-ordering-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/rtl-ordering-expected.txt
@@ -10,11 +10,11 @@ LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (212,0) size 348x19 text run at (212,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6334" - LayoutText {#text} at (559,0) size 712x39 - text run at (559,0) width 153: " REGRESSION: <input" - text run at (0,20) width 370: "type=\"button\"> text is reversed on \"visual Hebrew\" pages" - LayoutText {#text} at (369,20) size 5x19 - text run at (369,20) width 5: "." + LayoutText {#text} at (560,0) size 712x39 + text run at (560,0) width 152: " REGRESSION: <input" + text run at (0,20) width 371: "type=\"button\"> text is reversed on \"visual Hebrew\" pages" + LayoutText {#text} at (371,20) size 4x19 + text run at (371,20) width 4: "." LayoutNGBlockFlow {P} at (0,74) size 784x20 LayoutText {#text} at (0,0) size 295x19 text run at (0,0) width 295: "The text on both buttons should like this: \x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/selector-set-attribute-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/selector-set-attribute-expected.png index bc0d17f..95763be 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/selector-set-attribute-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/selector-set-attribute-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-outside-head-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-outside-head-expected.txt index 390b0262..4735b7d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-outside-head-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-outside-head-expected.txt
@@ -4,6 +4,6 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 562x19 - text run at (0,0) width 562: "You should see a 100x100 green square below. If you see any red then the test has failed." + LayoutText {#text} at (0,0) size 560x19 + text run at (0,0) width 560: "You should see a 100x100 green square below. If you see any red then the test has failed." LayoutNGBlockFlow {DIV} at (0,20) size 100x100 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-parsed-outside-head-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-parsed-outside-head-expected.txt index a49ebc7..299ce3a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-parsed-outside-head-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/style-parsed-outside-head-expected.txt
@@ -4,6 +4,6 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 626x19 - text run at (0,0) width 626: "You should see a 100x100 green square below. If you see any red or orange then the test has failed." + LayoutText {#text} at (0,0) size 624x19 + text run at (0,0) width 624: "You should see a 100x100 green square below. If you see any red or orange then the test has failed." LayoutNGBlockFlow {DIV} at (0,20) size 100x100 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.png index 21db03c..3ae482b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.txt index 81139f7..ee6c459 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-align-expected.txt
@@ -7,52 +7,52 @@ LayoutText {#text} at (0,0) size 78x19 text run at (0,0) width 78: "Simple case" LayoutNGBlockFlow {P} at (0,36) size 784x20 - LayoutText {#text} at (0,0) size 63x19 - text run at (0,0) width 63: "LTR Start" + LayoutText {#text} at (0,0) size 62x19 + text run at (0,0) width 62: "LTR Start" LayoutNGBlockFlow {P} at (0,72) size 784x20 - LayoutText {#text} at (724,0) size 60x19 - text run at (724,0) width 60: "LTR End" + LayoutText {#text} at (725,0) size 59x19 + text run at (725,0) width 59: "LTR End" LayoutNGBlockFlow {P} at (0,108) size 784x20 - LayoutText {#text} at (721,0) size 63x19 - text run at (721,0) width 63: "RTL Start" + LayoutText {#text} at (720,0) size 64x19 + text run at (720,0) width 64: "RTL Start" LayoutNGBlockFlow {P} at (0,144) size 784x20 - LayoutText {#text} at (0,0) size 60x19 - text run at (0,0) width 60: "RTL End" + LayoutText {#text} at (0,0) size 61x19 + text run at (0,0) width 61: "RTL End" LayoutNGBlockFlow {H1} at (0,180) size 784x20 LayoutText {#text} at (0,0) size 95x19 text run at (0,0) width 95: "Inherited case" LayoutNGBlockFlow {DIV} at (0,216) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 63x19 - text run at (0,0) width 63: "LTR Start" + LayoutText {#text} at (0,0) size 62x19 + text run at (0,0) width 62: "LTR Start" LayoutNGBlockFlow {DIV} at (0,252) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (724,0) size 60x19 - text run at (724,0) width 60: "LTR End" + LayoutText {#text} at (725,0) size 59x19 + text run at (725,0) width 59: "LTR End" LayoutNGBlockFlow {DIV} at (0,288) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (721,0) size 63x19 - text run at (721,0) width 63: "RTL Start" + LayoutText {#text} at (720,0) size 64x19 + text run at (720,0) width 64: "RTL Start" LayoutNGBlockFlow {DIV} at (0,324) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 60x19 - text run at (0,0) width 60: "RTL End" + LayoutText {#text} at (0,0) size 61x19 + text run at (0,0) width 61: "RTL End" LayoutNGBlockFlow {H1} at (0,360) size 784x20 - LayoutText {#text} at (0,0) size 414x19 - text run at (0,0) width 414: "Inherited case where parent block has opposite directionality." + LayoutText {#text} at (0,0) size 415x19 + text run at (0,0) width 415: "Inherited case where parent block has opposite directionality." LayoutNGBlockFlow {DIV} at (0,396) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 63x19 - text run at (0,0) width 63: "LTR Start" + LayoutText {#text} at (0,0) size 62x19 + text run at (0,0) width 62: "LTR Start" LayoutNGBlockFlow {DIV} at (0,432) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (724,0) size 60x19 - text run at (724,0) width 60: "LTR End" + LayoutText {#text} at (725,0) size 59x19 + text run at (725,0) width 59: "LTR End" LayoutNGBlockFlow {DIV} at (0,468) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (721,0) size 63x19 - text run at (721,0) width 63: "RTL Start" + LayoutText {#text} at (720,0) size 64x19 + text run at (720,0) width 64: "RTL Start" LayoutNGBlockFlow {DIV} at (0,504) size 784x20 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 60x19 - text run at (0,0) width 60: "RTL End" + LayoutText {#text} at (0,0) size 61x19 + text run at (0,0) width 61: "RTL End"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.png index a229e2e..00021ad 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.txt index 112cb0b..5cc64d1c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-ellipsis-bidi-expected.txt
@@ -7,29 +7,29 @@ LayoutText {#text} at (0,0) size 565x19 text run at (0,0) width 565: "Each consecutive pair of lines should look exactly the same apart from the trailing ellipsis." LayoutBR {BR} at (565,0) size 0x0 - LayoutText {#text} at (0,20) size 534x19 - text run at (0,20) width 534: "The ellipsis should appear on the left for the RTL case and on the right for LTR case." - LayoutBR {BR} at (533,20) size 0x0 + LayoutText {#text} at (0,20) size 535x19 + text run at (0,20) width 535: "The ellipsis should appear on the left for the RTL case and on the right for LTR case." + LayoutBR {BR} at (535,20) size 0x0 LayoutBR {BR} at (0,40) size 0x0 - LayoutText {#text} at (0,60) size 61x19 - text run at (0,60) width 61: "RTL text:" + LayoutText {#text} at (0,60) size 62x19 + text run at (0,60) width 62: "RTL text:" LayoutNGBlockFlow (anonymous) at (0,120) size 784x40 LayoutBR {BR} at (0,0) size 0x0 - LayoutText {#text} at (0,20) size 62x19 - text run at (0,20) width 62: "LTR Text" + LayoutText {#text} at (0,20) size 60x19 + text run at (0,20) width 60: "LTR Text" layer at (8,88) size 207x20 LayoutNGBlockFlow {DIV} at (0,80) size 207x20 - LayoutText {#text} at (-98,0) size 306x19 + LayoutText {#text} at (-98,0) size 305x19 text run at (-98,0) width 4: " \x{202C}" text run at (-94,0) width 218: " \x{5D8}\x{5E7}\x{5E1}\x{5D8} \x{5E2}\x{5D1}\x{5E8}\x{5D9} \x{5DC}\x{5D3}\x{5D5}\x{5D2}\x{5DE}\x{5D0} \x{5D8}\x{5E7}\x{5E1}\x{5D8} \x{5E2}\x{5D1}\x{5E8}\x{5D9} \x{5DC}\x{5D3}\x{5D5}\x{5D2}\x{5DE}\x{5D0}" - text run at (123,0) width 80: "English Text" + text run at (124,0) width 79: "English Text" text run at (203,0) width 4: "\x{202B} " layer at (8,108) size 207x20 LayoutNGBlockFlow {DIV} at (0,100) size 207x20 - LayoutText {#text} at (6,0) size 201x19 - text run at (6,0) width 17: "\x{2026}" - text run at (22,0) width 102: " \x{5D8}\x{5E7}\x{5E1}\x{5D8} \x{5E2}\x{5D1}\x{5E8}\x{5D9} \x{5DC}\x{5D3}\x{5D5}\x{5D2}\x{5DE}" - text run at (123,0) width 80: "English Text" + LayoutText {#text} at (7,0) size 200x19 + text run at (7,0) width 16: "\x{2026}" + text run at (23,0) width 101: " \x{5D8}\x{5E7}\x{5E1}\x{5D8} \x{5E2}\x{5D1}\x{5E8}\x{5D9} \x{5DC}\x{5D3}\x{5D5}\x{5D2}\x{5DE}" + text run at (124,0) width 79: "English Text" text run at (203,0) width 4: "\x{202B} " layer at (8,168) size 207x20 LayoutNGBlockFlow {DIV} at (0,160) size 207x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-input-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-input-expected.txt index 0fdbc548..3c53707 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-input-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-overflow-input-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x380 LayoutNGBlockFlow {BODY} at (8,16) size 784x348 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 307x19 - text run at (0,0) width 307: "This test is a basic check for using text-overflow." + LayoutText {#text} at (0,0) size 306x19 + text run at (0,0) width 306: "This test is a basic check for using text-overflow." LayoutNGBlockFlow {P} at (0,36) size 784x108 LayoutText {#text} at (0,0) size 481x19 text run at (0,0) width 481: "Apply \"text-overflow:clip\" to inputs. The following input should be clipped:" - LayoutBR {BR} at (480,0) size 0x0 + LayoutBR {BR} at (481,0) size 0x0 LayoutTextControl {INPUT} at (0,20) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (154,21) size 4x19 text run at (154,21) width 4: " " @@ -47,7 +47,7 @@ LayoutNGBlockFlow {P} at (0,160) size 784x108 LayoutText {#text} at (0,0) size 536x19 text run at (0,0) width 536: "Apply \"text-overflow:ellipsis\" to inputs. The following input should show an ellipsis:" - LayoutBR {BR} at (535,0) size 0x0 + LayoutBR {BR} at (536,0) size 0x0 LayoutTextControl {INPUT} at (0,20) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (154,21) size 4x19 text run at (154,21) width 4: " "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.png index 0d68b974..cefc834 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.txt index b0cbacfc..c8e223a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/text-rendering-expected.txt
@@ -3,27 +3,27 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutInline {SPAN} at (0,0) size 650x139 - LayoutText {#text} at (0,1) size 650x139 - text run at (0,1) width 650: "fin LYAWA (No kerning or" + LayoutInline {SPAN} at (0,0) size 649x139 + LayoutText {#text} at (0,1) size 649x139 + text run at (0,1) width 649: "fin LYAWA (No kerning or" text run at (0,72) width 228: "ligatures)" LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (228,126) size 0x0 - LayoutInline {SPAN} at (0,0) size 650x139 - LayoutText {#text} at (0,143) size 650x139 - text run at (0,143) width 650: "fin LYAWA (No kerning or" + LayoutInline {SPAN} at (0,0) size 649x139 + LayoutText {#text} at (0,143) size 649x139 + text run at (0,143) width 649: "fin LYAWA (No kerning or" text run at (0,214) width 228: "ligatures)" LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (228,268) size 0x0 - LayoutInline {SPAN} at (0,0) size 612x139 - LayoutText {#text} at (0,285) size 612x139 - text run at (0,285) width 612: "fin LYAWA (Kerning and" + LayoutInline {SPAN} at (0,0) size 611x139 + LayoutText {#text} at (0,285) size 611x139 + text run at (0,285) width 611: "fin LYAWA (Kerning and" text run at (0,356) width 228: "ligatures)" LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (228,410) size 0x0 - LayoutInline {SPAN} at (0,0) size 612x139 - LayoutText {#text} at (0,427) size 612x139 - text run at (0,427) width 612: "fin LYAWA (Kerning and" + LayoutInline {SPAN} at (0,0) size 611x139 + LayoutText {#text} at (0,427) size 611x139 + text run at (0,427) width 611: "fin LYAWA (Kerning and" text run at (0,498) width 228: "ligatures)" LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (228,552) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.png index b1aa9a7f..4587b877 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.txt index 2ec3df6..b8da859 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/textCapitalizeEdgeCases-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x572 LayoutNGBlockFlow {P} at (0,0) size 784x60 LayoutText {#text} at (0,0) size 776x59 - text run at (0,0) width 774: "This file tests capitalisation with all sorts of odd things. There is some RTL text, some text with an inlined-div placed inside" + text run at (0,0) width 775: "This file tests capitalisation with all sorts of odd things. There is some RTL text, some text with an inlined-div placed inside" text run at (0,20) width 776: "a word, an image between words as well as a div between words. Each word below should be capitalised, and there should" text run at (0,40) width 232: "be no capitals n the middle of words." LayoutNGBlockFlow {DIV} at (20,80) size 744x120 [border: (5px solid #FF0000)] @@ -19,16 +19,16 @@ text run at (632,0) width 17: "ise" LayoutNGBlockFlow {DIV} at (25,45) size 694x50 LayoutNGBlockFlow (anonymous) at (0,0) size 694x30 - LayoutText {#text} at (0,10) size 30x19 - text run at (0,10) width 30: "A W" - LayoutInline {DIV} at (0,0) size 13x19 - LayoutText {#text} at (29,10) size 13x19 - text run at (29,10) width 13: "or" + LayoutText {#text} at (0,10) size 29x19 + text run at (0,10) width 29: "A W" + LayoutInline {DIV} at (0,0) size 12x19 + LayoutText {#text} at (29,10) size 12x19 + text run at (29,10) width 12: "or" LayoutText {#text} at (41,10) size 43x19 text run at (41,10) width 43: "d With" - LayoutImage {IMG} at (83.63,0) size 25x25 - LayoutText {#text} at (108,10) size 64x19 - text run at (108,10) width 64: "An Image" + LayoutImage {IMG} at (84,0) size 25x25 + LayoutText {#text} at (109,10) size 63x19 + text run at (109,10) width 63: "An Image" LayoutNGBlockFlow {DIV} at (0,30) size 694x0 LayoutNGBlockFlow (anonymous) at (0,30) size 694x20 LayoutText {#text} at (0,0) size 35x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/universal-hover-quirk-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/universal-hover-quirk-expected.png index c5c816d4..5f68a3a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/universal-hover-quirk-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/universal-hover-quirk-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt index 4f97ee765..f889ecee 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt
@@ -16,11 +16,11 @@ LayoutText {#text} at (0,0) size 396x22 text run at (0,0) width 396: "Containing replaced content blocking the ellipsis" LayoutNGBlockFlow {H3} at (0,1486.88) size 769x23 - LayoutText {#text} at (0,0) size 198x22 - text run at (0,0) width 198: "Right-To-Left single line" - LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 LayoutText {#text} at (0,0) size 197x22 - text run at (0,0) width 197: "Right-To-Left Multi line" + text run at (0,0) width 197: "Right-To-Left single line" + LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 + LayoutText {#text} at (0,0) size 196x22 + text run at (0,0) width 196: "Right-To-Left Multi line" LayoutNGBlockFlow {H3} at (0,2230.31) size 769x23 LayoutText {#text} at (0,0) size 343x22 text run at (0,0) width 343: "Right-To-Left containing replaced content"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.txt index cadd1cb..0d27d91 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-justify-expected.txt
@@ -16,11 +16,11 @@ LayoutText {#text} at (0,0) size 396x22 text run at (0,0) width 396: "Containing replaced content blocking the ellipsis" LayoutNGBlockFlow {H3} at (0,1486.88) size 769x23 - LayoutText {#text} at (0,0) size 198x22 - text run at (0,0) width 198: "Right-To-Left single line" - LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 LayoutText {#text} at (0,0) size 197x22 - text run at (0,0) width 197: "Right-To-Left Multi line" + text run at (0,0) width 197: "Right-To-Left single line" + LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 + LayoutText {#text} at (0,0) size 196x22 + text run at (0,0) width 196: "Right-To-Left Multi line" LayoutNGBlockFlow {H3} at (0,2230.31) size 769x23 LayoutText {#text} at (0,0) size 343x22 text run at (0,0) width 343: "Right-To-Left containing replaced content"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.txt index 67663dc..693b51a4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-left-expected.txt
@@ -16,11 +16,11 @@ LayoutText {#text} at (0,0) size 396x22 text run at (0,0) width 396: "Containing replaced content blocking the ellipsis" LayoutNGBlockFlow {H3} at (0,1486.88) size 769x23 - LayoutText {#text} at (0,0) size 198x22 - text run at (0,0) width 198: "Right-To-Left single line" - LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 LayoutText {#text} at (0,0) size 197x22 - text run at (0,0) width 197: "Right-To-Left Multi line" + text run at (0,0) width 197: "Right-To-Left single line" + LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 + LayoutText {#text} at (0,0) size 196x22 + text run at (0,0) width 196: "Right-To-Left Multi line" LayoutNGBlockFlow {H3} at (0,2230.31) size 769x23 LayoutText {#text} at (0,0) size 343x22 text run at (0,0) width 343: "Right-To-Left containing replaced content"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt index 7e2cd5bd..54b227e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt
@@ -16,11 +16,11 @@ LayoutText {#text} at (0,0) size 396x22 text run at (0,0) width 396: "Containing replaced content blocking the ellipsis" LayoutNGBlockFlow {H3} at (0,1486.88) size 769x23 - LayoutText {#text} at (0,0) size 198x22 - text run at (0,0) width 198: "Right-To-Left single line" - LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 LayoutText {#text} at (0,0) size 197x22 - text run at (0,0) width 197: "Right-To-Left Multi line" + text run at (0,0) width 197: "Right-To-Left single line" + LayoutNGBlockFlow {H3} at (0,1858.59) size 769x23 + LayoutText {#text} at (0,0) size 196x22 + text run at (0,0) width 196: "Right-To-Left Multi line" LayoutNGBlockFlow {H3} at (0,2230.31) size 769x23 LayoutText {#text} at (0,0) size 343x22 text run at (0,0) width 343: "Right-To-Left containing replaced content"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/visibility-hit-test-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/visibility-hit-test-expected.txt index 622a47b..9da142e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/visibility-hit-test-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/visibility-hit-test-expected.txt
@@ -7,5 +7,5 @@ LayoutImage {IMG} at (0,0) size 300x300 LayoutText {#text} at (300,285) size 4x19 text run at (300,285) width 4: " " - LayoutText {#text} at (303,285) size 444x19 - text run at (303,285) width 444: "The element at position (100, 100) should be the body. Result: BODY" + LayoutText {#text} at (304,285) size 442x19 + text run at (304,285) width 442: "The element at position (100, 100) should be the body. Result: BODY"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png index a9f7070e..d85a69a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-links-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-links-expected.png index c0427b5..d627106a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-links-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-links-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-simple-underlines-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-simple-underlines-expected.png index b0d58bf4..ce4c560 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-simple-underlines-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-decoration/text-decoration-style-inherit-simple-underlines-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-justify/text-justify-8bits-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-justify/text-justify-8bits-expected.png index 1148090b..0707f8f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-justify/text-justify-8bits-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css3-text/css3-text-justify/text-justify-8bits-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/34176-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/34176-expected.txt new file mode 100644 index 0000000..c2dd201 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/34176-expected.txt
@@ -0,0 +1,452 @@ +layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1566 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 785x1566 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 + LayoutNGBlockFlow {HTML} at (0,0) size 785x1566 + LayoutNGBlockFlow {BODY} at (8,16) size 769x1534 + LayoutNGBlockFlow {P} at (0,0) size 769x60 + LayoutText {#text} at (22,0) size 747x59 + text run at (22,0) width 747: "Test rendering of 3 text runs -- TextRun1 TextRun2 TextRun3, in which TextRun1 and TextRun2's bidi level are 2, and" + text run at (56,20) width 713: "TextRun3's bidi level is 1. TextRun2 and TextRun3 are siblings. But their ancestor (not their parent) is a sibling of" + text run at (103,40) width 666: "TextRun1. The visual order should be TextRun3 TextRun1 TextRun2, not TextRun3 TextRun2 TextRun1." + LayoutNGBlockFlow {P} at (0,94) size 769x20 + LayoutText {#text} at (313,0) size 456x19 + text run at (313,0) width 341: "Pure text. The following 3 lines should all display as \"" + text run at (654,0) width 22: "\x{5E9}\x{5E0}\x{5D1}" + text run at (676,0) width 93: " This is a Test\"" + LayoutBlockFlow {DIV} at (0,130) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (687,0) size 57x19 + text run at (687,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 108x19 + LayoutInline {SPAN} at (0,0) size 108x19 + LayoutText {#text} at (683,0) size 86x19 + text run at (683,0) width 4 RTL: " " + text run at (744,0) width 25: "Test" + LayoutInline {SPAN} at (0,0) size 22x19 + LayoutText {#text} at (661,0) size 22x19 + text run at (661,0) width 22 RTL: "\x{5E9}\x{5E0}\x{5D1}" + LayoutBlockFlow {DIV} at (0,150) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (687,0) size 57x19 + text run at (687,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 108x19 + LayoutInline {SPAN} at (0,0) size 108x19 + LayoutInline {SPAN} at (0,0) size 108x19 + LayoutText {#text} at (683,0) size 86x19 + text run at (683,0) width 4 RTL: " " + text run at (744,0) width 25: "Test" + LayoutInline {SPAN} at (0,0) size 22x19 + LayoutText {#text} at (661,0) size 22x19 + text run at (661,0) width 22 RTL: "\x{5E9}\x{5E0}\x{5D1}" + LayoutNGBlockFlow {DIV} at (0,170) size 769x20 + LayoutText {#text} at (687,0) size 57x19 + text run at (687,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 108x19 + LayoutText {#text} at (683,0) size 86x19 + text run at (683,0) width 4: " " + text run at (744,0) width 25: "Test" + LayoutInline {SPAN} at (0,0) size 22x19 + LayoutText {#text} at (661,0) size 22x19 + text run at (661,0) width 22: "\x{5E9}\x{5E0}\x{5D1}" + LayoutNGBlockFlow {P} at (0,216) size 769x20 + LayoutText {#text} at (323,0) size 446x19 + text run at (323,0) width 446: "Text in <em>. The English text should be displayed as \"This is a Test\"." + LayoutBlockFlow {DIV} at (0,252) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 81x19 + LayoutInline {EM} at (0,0) size 81x19 + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutBlockFlow {DIV} at (0,272) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 81x19 + LayoutInline {EM} at (0,0) size 81x19 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutBlockFlow {DIV} at (0,292) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 108x19 + LayoutInline {EM} at (0,0) size 108x19 + LayoutText {#text} at (684,0) size 85x19 + text run at (684,0) width 4 RTL: " " + text run at (745,0) width 24: "Test" + LayoutInline {SPAN} at (0,0) size 23x19 + LayoutText {#text} at (661,0) size 23x19 + text run at (661,0) width 23 RTL: "\x{5D3}\x{5DE}\x{5D4}" + LayoutNGBlockFlow {DIV} at (0,312) size 769x20 + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 24x19 + LayoutInline {EM} at (0,0) size 24x19 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutNGBlockFlow {DIV} at (0,332) size 769x20 + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 24x19 + LayoutInline {EM} at (0,0) size 24x19 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutNGBlockFlow {P} at (0,378) size 769x20 + LayoutText {#text} at (299,0) size 470x19 + text run at (299,0) width 470: "Text in <strong>. The following lines should all display as \"This is a Test\"." + LayoutBlockFlow {DIV} at (0,414) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 84x19 + LayoutInline {STRONG} at (0,0) size 84x19 + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutBlockFlow {DIV} at (0,434) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 84x19 + LayoutInline {STRONG} at (0,0) size 84x19 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutNGBlockFlow {DIV} at (0,454) size 769x20 + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 27x19 + LayoutInline {STRONG} at (0,0) size 27x19 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutNGBlockFlow {DIV} at (0,474) size 769x20 + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 27x19 + LayoutInline {STRONG} at (0,0) size 27x19 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutNGBlockFlow {P} at (0,520) size 769x20 + LayoutText {#text} at (334,0) size 435x19 + text run at (334,0) width 435: "Text in <i>. The following lines should all display as \"This is a Test\"." + LayoutBlockFlow {DIV} at (0,556) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 81x19 + LayoutInline {I} at (0,0) size 81x19 + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutBlockFlow {DIV} at (0,576) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 81x19 + LayoutInline {I} at (0,0) size 81x19 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutNGBlockFlow {DIV} at (0,596) size 769x20 + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 24x19 + LayoutInline {I} at (0,0) size 24x19 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutNGBlockFlow {DIV} at (0,616) size 769x20 + LayoutText {#text} at (688,0) size 57x19 + text run at (688,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 24x19 + LayoutInline {I} at (0,0) size 24x19 + LayoutText {#text} at (745,0) size 24x19 + text run at (745,0) width 24: "Test" + LayoutNGBlockFlow {P} at (0,662) size 769x20 + LayoutText {#text} at (330,0) size 439x19 + text run at (330,0) width 439: "Text in <b>. The following lines should all display as \"This is a Test\"." + LayoutBlockFlow {DIV} at (0,698) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 84x19 + LayoutInline {B} at (0,0) size 84x19 + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutBlockFlow {DIV} at (0,718) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 84x19 + LayoutInline {B} at (0,0) size 84x19 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutInline {SPAN} at (0,0) size 0x19 + LayoutNGBlockFlow {DIV} at (0,738) size 769x20 + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 27x19 + LayoutInline {B} at (0,0) size 27x19 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutNGBlockFlow {DIV} at (0,758) size 769x20 + LayoutText {#text} at (685,0) size 57x19 + text run at (685,0) width 57: "This is a " + LayoutInline {SPAN} at (0,0) size 27x19 + LayoutInline {B} at (0,0) size 27x19 + LayoutText {#text} at (742,0) size 27x19 + text run at (742,0) width 27: "Test" + LayoutNGBlockFlow (anonymous) at (0,778) size 769x0 + LayoutInline {B} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutNGBlockFlow (anonymous) at (0,786) size 769x748 + LayoutNGBlockFlow {P} at (0,18) size 769x20 + LayoutText {#text} at (101,0) size 668x19 + text run at (101,0) width 668: "Text in <img>, <href>, <em>, <tr>. The following English text should all display as \"This is a Test\"." + LayoutBlockFlow {DIV} at (0,54) size 769x21 [bgcolor=#FF0000] + LayoutText {#text} at (682,1) size 60x19 + text run at (682,1) width 60: "This is a " + LayoutInline {SPAN} at (0,0) size 103x19 + LayoutInline {A} at (0,0) size 103x19 [color=#551A8B] + LayoutText {#text} at (742,1) size 27x19 + text run at (742,1) width 27: "Test" + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutNGBlockFlow {IMG} at (666,0) size 16x16 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutImage (floating) {IMG} at (0,0) size 16x16 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutBlockFlow {DIV} at (0,75) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (682,0) size 60x19 + text run at (682,0) width 60: "This is a " + LayoutInline {SPAN} at (0,0) size 114x19 + LayoutInline {A} at (0,0) size 114x19 [color=#551A8B] + LayoutText {#text} at (678,0) size 91x19 + text run at (678,0) width 4 RTL: " " + text run at (742,0) width 27: "Test" + LayoutInline {SPAN} at (0,0) size 23x19 + LayoutText {#text} at (655,0) size 23x19 + text run at (655,0) width 23 RTL: "\x{5E9}\x{5E0}\x{5D1}" + LayoutBlockFlow {DIV} at (0,95) size 769x20 [bgcolor=#FF0000] + LayoutText {#text} at (684,0) size 60x19 + text run at (684,0) width 60: "This is a " + LayoutInline {SPAN} at (0,0) size 85x19 + LayoutInline {EM} at (0,0) size 85x19 + LayoutText {#text} at (744,0) size 25x19 + text run at (744,0) width 25: "Test" + LayoutInline {A} at (0,0) size 0x19 [color=#551A8B] + LayoutBlockFlow {DIV} at (0,115) size 769x21 [bgcolor=#FF0000] + LayoutText {#text} at (684,1) size 60x19 + text run at (684,1) width 60: "This is a " + LayoutInline {SPAN} at (0,0) size 101x19 + LayoutInline {EM} at (0,0) size 101x19 + LayoutText {#text} at (744,1) size 25x19 + text run at (744,1) width 25: "Test" + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutNGBlockFlow {IMG} at (668,0) size 16x16 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutImage (floating) {IMG} at (0,0) size 16x16 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutNGBlockFlow {DIV} at (0,136) size 769x20 + LayoutText {#text} at (641,0) size 60x19 + text run at (641,0) width 60: "This is a " + LayoutInline {SPAN} at (0,0) size 68x19 + LayoutInline {A} at (0,0) size 68x19 [color=#551A8B] + LayoutText {#text} at (701,0) size 31x19 + text run at (701,0) width 31: "Test " + LayoutInline {SPAN} at (0,0) size 37x19 + LayoutText {#text} at (732,0) size 37x19 + text run at (732,0) width 37: "again" + LayoutNGBlockFlow {DIV} at (0,156) size 769x46 + LayoutNGBlockFlow (anonymous) at (0,0) size 769x20 + LayoutText {#text} at (684,0) size 60x19 + text run at (684,0) width 60: "This is a " + LayoutInline {SPAN} at (0,0) size 25x19 + LayoutInline {EM} at (0,0) size 25x19 + LayoutText {#text} at (744,0) size 25x19 + text run at (744,0) width 25: "Test" + LayoutNGBlockFlow (anonymous) at (0,20) size 769x26 + LayoutTable {TABLE} at (755,0) size 14x26 + LayoutTableSection {TBODY} at (0,0) size 14x26 + LayoutTableRow {TR} at (0,2) size 14x22 + LayoutNGTableCell {TD} at (2,2) size 10x22 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (1,1) size 8x19 + text run at (1,1) width 8: "a" + LayoutNGBlockFlow (anonymous) at (0,46) size 769x0 + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutInline {EM} at (0,0) size 0x0 + LayoutNGBlockFlow {UL} at (0,228) size 769x520 + LayoutNGListItem {LI} at (40,0) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 0: : Success" + LayoutNGListItem {LI} at (40,20) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 1: : Success" + LayoutNGListItem {LI} at (40,40) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 2: : Success" + LayoutNGListItem {LI} at (40,60) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 3: : Success" + LayoutNGListItem {LI} at (40,80) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 4: : Success" + LayoutNGListItem {LI} at (40,100) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 5: : Success" + LayoutNGListItem {LI} at (40,120) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 6: : Success" + LayoutNGListItem {LI} at (40,140) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 7: : Success" + LayoutNGListItem {LI} at (40,160) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 8: : Success" + LayoutNGListItem {LI} at (40,180) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 108x19 + text run at (0,0) width 108: "Test 9: : Success" + LayoutNGListItem {LI} at (40,200) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 10: : Success" + LayoutNGListItem {LI} at (40,220) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 11: : Success" + LayoutNGListItem {LI} at (40,240) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 12: : Success" + LayoutNGListItem {LI} at (40,260) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 13: : Success" + LayoutNGListItem {LI} at (40,280) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 14: : Success" + LayoutNGListItem {LI} at (40,300) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 15: : Success" + LayoutNGListItem {LI} at (40,320) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 16: : Success" + LayoutNGListItem {LI} at (40,340) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 17: : Success" + LayoutNGListItem {LI} at (40,360) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 18: : Success" + LayoutNGListItem {LI} at (40,380) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 19: : Success" + LayoutNGListItem {LI} at (40,400) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 20: : Success" + LayoutNGListItem {LI} at (40,420) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 21: : Success" + LayoutNGListItem {LI} at (40,440) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 22: : Success" + LayoutNGListItem {LI} at (40,460) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 23: : Success" + LayoutNGListItem {LI} at (40,480) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 24: : Success" + LayoutNGListItem {LI} at (40,500) size 729x20 + LayoutNGListMarker (anonymous) at (-18,0) size 10x20 + LayoutText (anonymous) at (0,0) size 10x19 + text run at (0,0) width 10: "\x{2022} " + LayoutText {#text} at (0,0) size 116x19 + text run at (0,0) width 116: "Test 25: : Success" + LayoutNGBlockFlow (anonymous) at (0,1550) size 769x0 + LayoutInline {B} at (0,0) size 0x0 +layer at (8,92) size 769x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,76) size 769x2 [border: (1px inset #EEEEEE)] +layer at (8,214) size 769x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,198) size 769x2 [border: (1px inset #EEEEEE)] +layer at (8,376) size 769x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,360) size 769x2 [border: (1px inset #EEEEEE)] +layer at (8,518) size 769x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,502) size 769x2 [border: (1px inset #EEEEEE)] +layer at (8,660) size 769x2 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,644) size 769x2 [border: (1px inset #EEEEEE)] +layer at (8,802) size 769x2 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,0) size 769x2 [border: (1px inset #EEEEEE)] +layer at (8,1012) size 769x2 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,210) size 769x2 [border: (1px inset #EEEEEE)] +selection start: position 0 of child 0 {#text} of child 14 {DIV} of child 56 {B} of body +selection end: position 4 of child 0 {#text} of child 14 {DIV} of child 56 {B} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/52776-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/52776-expected.txt index d7460486..b08f6cd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/52776-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/52776-expected.txt
@@ -5,12 +5,12 @@ LayoutNGBlockFlow {BODY} at (8,16) size 769x1780 LayoutNGBlockFlow {DIV} at (0,0) size 769x864 LayoutNGBlockFlow {P} at (0,0) size 769x20 - LayoutText {#text} at (683,0) size 86x19 - text run at (683,0) width 86: "Right To Left" + LayoutText {#text} at (684,0) size 85x19 + text run at (684,0) width 85: "Right To Left" LayoutNGBlockFlow {P} at (0,36) size 769x20 - LayoutText {#text} at (444,0) size 325x19 - text run at (444,0) width 5: "." - text run at (448,0) width 321: "Well-formed pair of unicode bidi control characters" + LayoutText {#text} at (445,0) size 324x19 + text run at (445,0) width 4: "." + text run at (449,0) width 320: "Well-formed pair of unicode bidi control characters" LayoutNGBlockFlow {DIV} at (0,72) size 769x20 LayoutText {#text} at (756,0) size 13x19 text run at (756,0) width 0: "\x{202C}" @@ -99,7 +99,7 @@ text run at (762,0) width 7: "\x{202B}c" LayoutNGBlockFlow {P} at (0,688) size 769x20 LayoutText {#text} at (494,0) size 275x19 - text run at (494,0) width 5: "." + text run at (494,0) width 4: "." text run at (498,0) width 271: "Start with different directionality characters" LayoutNGBlockFlow {DIV} at (0,724) size 769x20 LayoutText {#text} at (745,0) size 24x19 @@ -128,11 +128,11 @@ text run at (754,0) width 15: "\x{5D0}\x{5D1}\x{202C}\x{202A}" LayoutNGBlockFlow {DIV} at (0,880) size 769x864 LayoutNGBlockFlow {P} at (0,0) size 769x20 - LayoutText {#text} at (0,0) size 86x19 - text run at (0,0) width 86: "Left To Right" + LayoutText {#text} at (0,0) size 85x19 + text run at (0,0) width 85: "Left To Right" LayoutNGBlockFlow {P} at (0,36) size 769x20 - LayoutText {#text} at (0,0) size 325x19 - text run at (0,0) width 325: "Well-formed pair of unicode bidi control characters." + LayoutText {#text} at (0,0) size 324x19 + text run at (0,0) width 324: "Well-formed pair of unicode bidi control characters." LayoutNGBlockFlow {DIV} at (0,72) size 769x20 LayoutText {#text} at (0,0) size 13x19 text run at (0,0) width 5: "!" @@ -240,7 +240,7 @@ LayoutNGListMarker (anonymous) at (-18,0) size 10x20 LayoutText (anonymous) at (0,0) size 10x19 text run at (0,0) width 10: "\x{2022} " - LayoutText {#text} at (0,0) size 704x19 - text run at (0,0) width 704: "test id=test: the right-most character of rendering result of <PDF>abc<PDF> in RTL block should be c: Success" + LayoutText {#text} at (0,0) size 705x19 + text run at (0,0) width 705: "test id=test: the right-most character of rendering result of <PDF>abc<PDF> in RTL block should be c: Success" selection start: position 3 of child 0 {#text} of child 20 {DIV} of child 1 {DIV} of body selection end: position 4 of child 0 {#text} of child 20 {DIV} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.png index 9de309f..3efd81a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.txt index 15bbf72..bbc3b120 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.txt
@@ -4,25 +4,25 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 654x19 - LayoutInline {A} at (0,0) size 349x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 349x19 - text run at (51,0) width 349: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7761" - LayoutText {#text} at (399,0) size 306x19 - text run at (399,0) width 306: " Tabs in class attribute not treated as whitespace" - LayoutText {#text} at (704,0) size 5x19 - text run at (704,0) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 653x19 + LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 348x19 + text run at (51,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7761" + LayoutText {#text} at (399,0) size 305x19 + text run at (399,0) width 305: " Tabs in class attribute not treated as whitespace" + LayoutText {#text} at (704,0) size 4x19 + text run at (704,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 233x19 text run at (0,0) width 233: "All of the following should be green:" LayoutNGBlockFlow {DIV} at (0,72) size 784x20 [color=#008000] - LayoutText {#text} at (0,0) size 56x19 - text run at (0,0) width 56: "Tab after" + LayoutText {#text} at (0,0) size 55x19 + text run at (0,0) width 55: "Tab after" LayoutNGBlockFlow {DIV} at (0,92) size 784x20 [color=#008000] - LayoutText {#text} at (0,0) size 68x19 - text run at (0,0) width 68: "Tab before" + LayoutText {#text} at (0,0) size 67x19 + text run at (0,0) width 67: "Tab before" LayoutNGBlockFlow {DIV} at (0,112) size 784x20 [color=#008000] LayoutText {#text} at (0,0) size 86x19 text run at (0,0) width 86: "Newline after"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLElement/bdo-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLElement/bdo-expected.txt index 4f9cfed4..14fac2f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLElement/bdo-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLElement/bdo-expected.txt
@@ -4,15 +4,15 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 110x19 - text run at (0,0) width 110: "Tests: the bdo tag" + LayoutText {#text} at (0,0) size 109x19 + text run at (0,0) width 109: "Tests: the bdo tag" LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 328x19 text run at (0,0) width 328: "The bdo element overrides the default text direction." LayoutNGBlockFlow {P} at (0,72) size 784x40 - LayoutText {#text} at (0,0) size 761x39 - text run at (0,0) width 761: "If successful, the first sentence would be backward, and the second sentence regular. There should then be an extra blank" - text run at (0,20) width 697: "line, followed by a line reading only \"A,\" and finally, a sentence where only the word \"umbrella\" is backward." + LayoutText {#text} at (0,0) size 762x39 + text run at (0,0) width 762: "If successful, the first sentence would be backward, and the second sentence regular. There should then be an extra blank" + text run at (0,20) width 696: "line, followed by a line reading only \"A,\" and finally, a sentence where only the word \"umbrella\" is backward." LayoutNGBlockFlow (anonymous) at (0,138) size 784x120 LayoutBR {BR} at (0,0) size 0x0 LayoutInline {BDO} at (0,0) size 221x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLLinkElement/pending-stylesheet-count-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLLinkElement/pending-stylesheet-count-expected.txt index 52a120d..9b7672d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLLinkElement/pending-stylesheet-count-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLLinkElement/pending-stylesheet-count-expected.txt
@@ -10,14 +10,14 @@ LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (104,0) size 348x19 text run at (104,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9252" - LayoutText {#text} at (451,0) size 772x39 - text run at (451,0) width 321: " REGRESSION: Very odd roll-over issues (content" + LayoutText {#text} at (452,0) size 772x39 + text run at (452,0) width 320: " REGRESSION: Very odd roll-over issues (content" text run at (0,20) width 88: "disappearing)" LayoutText {#text} at (88,20) size 4x19 text run at (88,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 243x19 - text run at (0,0) width 243: "There should be a green square below." + LayoutText {#text} at (0,0) size 242x19 + text run at (0,0) width 242: "There should be a green square below." LayoutNGBlockFlow {DIV} at (0,102) size 784x0 LayoutNGBlockFlow {DIV} at (0,102) size 100x100 [bgcolor=#008000] layer at (8,100) size 784x2 clip at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/children-nodes-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/children-nodes-expected.txt index 934b7e8..9b4220c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/children-nodes-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/children-nodes-expected.txt
@@ -7,7 +7,7 @@ LayoutNGBlockFlow {P} at (1,17) size 782x40 LayoutText {#text} at (0,0) size 766x39 text run at (0,0) width 766: "This test verifies that JavaScript returns only direct descendent element nodes in the 'children' collection (an IE extension)." - text run at (0,20) width 697: "We also verify that the 'childNodes' collection contains direct descendent nodes of any type (text, element, etc.)" + text run at (0,20) width 696: "We also verify that the 'childNodes' collection contains direct descendent nodes of any type (text, element, etc.)" LayoutNGBlockFlow {DIV} at (0,74) size 784x100 LayoutNGBlockFlow {DIV} at (0,0) size 784x20 LayoutInline {B} at (0,0) size 23x19 @@ -45,56 +45,56 @@ LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,20) size 377x19 text run at (0,20) width 377: "Results: children.length = 5 (should be 5 DIV nodes below)" - LayoutBR {BR} at (376,20) size 0x0 + LayoutBR {BR} at (377,20) size 0x0 LayoutText {#text} at (0,40) size 113x19 text run at (0,40) width 113: " node: DIV (one)" - LayoutBR {BR} at (112,40) size 0x0 + LayoutBR {BR} at (113,40) size 0x0 LayoutText {#text} at (0,60) size 114x19 text run at (0,60) width 114: " node: DIV (two)" - LayoutBR {BR} at (113,60) size 0x0 + LayoutBR {BR} at (114,60) size 0x0 LayoutText {#text} at (0,80) size 121x19 text run at (0,80) width 121: " node: DIV (three)" - LayoutBR {BR} at (120,80) size 0x0 + LayoutBR {BR} at (121,80) size 0x0 LayoutText {#text} at (0,100) size 116x19 text run at (0,100) width 116: " node: DIV (four)" - LayoutBR {BR} at (115,100) size 0x0 + LayoutBR {BR} at (116,100) size 0x0 LayoutText {#text} at (0,120) size 114x19 text run at (0,120) width 114: " node: DIV (five)" - LayoutBR {BR} at (113,120) size 0x0 + LayoutBR {BR} at (114,120) size 0x0 LayoutBR {BR} at (0,140) size 0x0 - LayoutText {#text} at (0,160) size 326x19 - text run at (0,160) width 326: "childNodes.length = 11 (should be 11 nodes below)" - LayoutBR {BR} at (325,160) size 0x0 + LayoutText {#text} at (0,160) size 327x19 + text run at (0,160) width 327: "childNodes.length = 11 (should be 11 nodes below)" + LayoutBR {BR} at (327,160) size 0x0 LayoutText {#text} at (0,180) size 155x19 text run at (0,180) width 155: " node: #text (undefined)" LayoutBR {BR} at (155,180) size 0x0 LayoutText {#text} at (0,200) size 113x19 text run at (0,200) width 113: " node: DIV (one)" - LayoutBR {BR} at (112,200) size 0x0 + LayoutBR {BR} at (113,200) size 0x0 LayoutText {#text} at (0,220) size 155x19 text run at (0,220) width 155: " node: #text (undefined)" LayoutBR {BR} at (155,220) size 0x0 LayoutText {#text} at (0,240) size 114x19 text run at (0,240) width 114: " node: DIV (two)" - LayoutBR {BR} at (113,240) size 0x0 + LayoutBR {BR} at (114,240) size 0x0 LayoutText {#text} at (0,260) size 155x19 text run at (0,260) width 155: " node: #text (undefined)" LayoutBR {BR} at (155,260) size 0x0 LayoutText {#text} at (0,280) size 121x19 text run at (0,280) width 121: " node: DIV (three)" - LayoutBR {BR} at (120,280) size 0x0 + LayoutBR {BR} at (121,280) size 0x0 LayoutText {#text} at (0,300) size 155x19 text run at (0,300) width 155: " node: #text (undefined)" LayoutBR {BR} at (155,300) size 0x0 LayoutText {#text} at (0,320) size 116x19 text run at (0,320) width 116: " node: DIV (four)" - LayoutBR {BR} at (115,320) size 0x0 + LayoutBR {BR} at (116,320) size 0x0 LayoutText {#text} at (0,340) size 155x19 text run at (0,340) width 155: " node: #text (undefined)" LayoutBR {BR} at (155,340) size 0x0 LayoutText {#text} at (0,360) size 114x19 text run at (0,360) width 114: " node: DIV (five)" - LayoutBR {BR} at (113,360) size 0x0 + LayoutBR {BR} at (114,360) size 0x0 LayoutText {#text} at (0,380) size 155x19 text run at (0,380) width 155: " node: #text (undefined)" LayoutBR {BR} at (155,380) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/focus-contenteditable-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/focus-contenteditable-expected.txt index acd13aa..a9bc4811 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/focus-contenteditable-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/focus-contenteditable-expected.txt
@@ -4,18 +4,18 @@ LayoutNGBlockFlow {HTML} at (0,0) size 785x902 LayoutNGBlockFlow {BODY} at (8,8) size 769x886 LayoutNGBlockFlow (anonymous) at (0,0) size 769x40 - LayoutText {#text} at (0,0) size 493x19 - text run at (0,0) width 493: "This test will try to call focus() on a contenteditable div, and then a normal div." - LayoutBR {BR} at (492,0) size 0x0 - LayoutText {#text} at (0,20) size 372x19 - text run at (0,20) width 372: "The window should scroll to reveal the contenteditable div." + LayoutText {#text} at (0,0) size 491x19 + text run at (0,0) width 491: "This test will try to call focus() on a contenteditable div, and then a normal div." + LayoutBR {BR} at (491,0) size 0x0 + LayoutText {#text} at (0,20) size 371x19 + text run at (0,20) width 371: "The window should scroll to reveal the contenteditable div." LayoutNGBlockFlow {DIV} at (0,40) size 500x800 LayoutBlockFlow {DIV} at (0,840) size 769x26 [border: (3px solid #000000)] LayoutText {#text} at (3,3) size 122x19 text run at (3,3) width 122: "contentEditable div" LayoutNGBlockFlow {DIV} at (0,866) size 769x20 - LayoutText {#text} at (0,0) size 77x19 - text run at (0,0) width 77: "Test Passed." + LayoutText {#text} at (0,0) size 76x19 + text run at (0,0) width 76: "Test Passed." LayoutNGBlockFlow {DIV} at (0,886) size 769x0 caret: position 0 of child 0 {#text} of child 5 {DIV} of body scrolled to 0,282
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/011-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/011-expected.txt new file mode 100644 index 0000000..d9030963 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/011-expected.txt
@@ -0,0 +1,28 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow (anonymous) at (0,0) size 784x40 + LayoutInline {SPAN} at (0,0) size 779x39 + LayoutInline {SPAN} at (0,0) size 779x39 + LayoutText {#text} at (0,0) size 779x39 + text run at (0,0) width 779: "Bug #3810389. Make sure we don't crash manipulating blocks inside inlines. You should see the numbers 1 and 2 vertically" + text run at (0,20) width 147: "stacked below this line." + LayoutNGBlockFlow (anonymous) at (0,40) size 784x20 + LayoutNGBlockFlow {DIV} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 8x19 + text run at (0,0) width 8: "1" + LayoutNGBlockFlow (anonymous) at (0,60) size 784x20 + LayoutInline {SPAN} at (0,0) size 16x19 + LayoutInline {SPAN} at (0,0) size 8x19 + LayoutText {#text} at (0,0) size 8x19 + text run at (0,0) width 8: "2" + LayoutText {#text} at (8,0) size 4x19 + text run at (8,0) width 4: " " + LayoutImage {IMG} at (12,15) size 0x0 + LayoutText {#text} at (12,0) size 4x19 + text run at (12,0) width 4: " " + LayoutText {#text} at (0,0) size 0x0 + LayoutImage {IMG} at (16,15) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/012-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/012-expected.txt new file mode 100644 index 0000000..8e4e145 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/012-expected.txt
@@ -0,0 +1,114 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {H2} at (0,0) size 784x27 + LayoutText {#text} at (0,0) size 219x26 + text run at (0,0) width 219: "Block Collapse Demo" + LayoutNGBlockFlow {P} at (0,46.91) size 784x20 + LayoutText {#text} at (0,0) size 687x19 + text run at (0,0) width 687: "This table below has three hierarchical sections. Collapsing a section should cause those below it to move up." + LayoutNGBlockFlow {P} at (0,82.91) size 784x20 + LayoutText {#text} at (0,0) size 765x19 + text run at (0,0) width 765: "This works on the latest Windows IE and Mozilla Firefox (Win and Mac) but not on Safari 1.2.3 (v125.9) {or 2.0 (146)}." + LayoutNGBlockFlow {P} at (0,118.91) size 784x20 + LayoutText {#text} at (0,0) size 747x19 + text run at (0,0) width 747: "Note that the second section is collapsed when the page opens and expanding it works fine. Just the collapse is broken." + LayoutNGBlockFlow {DIV} at (0,154.91) size 784x157 + LayoutNGBlockFlow {DIV} at (0,10) size 784x21 + LayoutImage {IMG} at (0,0) size 16x16 + LayoutText {#text} at (16,1) size 75x19 + text run at (16,1) width 75: " Block One" + LayoutNGBlockFlow {DIV} at (0,31) size 784x21 + LayoutImage {IMG} at (0,0) size 16x16 + LayoutText {#text} at (16,1) size 76x19 + text run at (16,1) width 76: " Block Two" + LayoutNGBlockFlow {DIV} at (0,52) size 784x21 + LayoutImage {IMG} at (0,0) size 16x16 + LayoutText {#text} at (16,1) size 88x19 + text run at (16,1) width 88: " Block Three" + LayoutNGBlockFlow {DIV} at (0,73) size 784x74 + LayoutTable {TABLE} at (0,0) size 784x74 + LayoutTableSection {TBODY} at (0,0) size 784x74 + LayoutTableRow {TR} at (0,2) size 784x22 + LayoutNGTableCell {TD} at (2,2) size 32x22 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (1,1) size 4x19 + text run at (1,1) width 4: " " + LayoutNGTableCell {TD} at (36,2) size 746x22 [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 65x19 + text run at (1,1) width 65: "This is the" + LayoutTableRow {TR} at (0,26) size 784x22 + LayoutNGTableCell {TD} at (2,26) size 32x22 [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (1,1) size 4x19 + text run at (1,1) width 4: " " + LayoutNGTableCell {TD} at (36,26) size 746x22 [r=1 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 69x19 + text run at (1,1) width 69: "contents of" + LayoutTableRow {TR} at (0,50) size 784x22 + LayoutNGTableCell {TD} at (2,50) size 32x22 [r=2 c=0 rs=1 cs=1] + LayoutText {#text} at (1,1) size 4x19 + text run at (1,1) width 4: " " + LayoutNGTableCell {TD} at (36,50) size 746x22 [r=2 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 74x19 + text run at (1,1) width 74: "block three." +layer at (8,163) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,0) size 784x2 [border: (1px inset #EEEEEE)] +layer at (8,318) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,155) size 784x2 [border: (1px inset #EEEEEE)] +hidden layer at (8,194) size 0x134 + LayoutNGBlockFlow (positioned) {DIV} at (8,193.91) size 0x134 + LayoutTable {TABLE} at (0,0) size 66x134 + LayoutTableSection {TBODY} at (0,0) size 66x134 + LayoutTableRow {TR} at (0,2) size 66x42 + LayoutNGTableCell {TD} at (2,12) size 6x22 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (1,11) size 4x19 + text run at (1,11) width 4: " " + LayoutNGTableCell {TD} at (10,2) size 54x42 [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 42x39 + text run at (1,1) width 42: "This is" + text run at (1,21) width 19: "the" + LayoutTableRow {TR} at (0,46) size 66x42 + LayoutNGTableCell {TD} at (2,56) size 6x22 [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (1,11) size 4x19 + text run at (1,11) width 4: " " + LayoutNGTableCell {TD} at (10,46) size 54x42 [r=1 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 52x39 + text run at (1,1) width 52: "contents" + text run at (1,21) width 13: "of" + LayoutTableRow {TR} at (0,90) size 66x42 + LayoutNGTableCell {TD} at (2,100) size 6x22 [r=2 c=0 rs=1 cs=1] + LayoutText {#text} at (1,11) size 4x19 + text run at (1,11) width 4: " " + LayoutNGTableCell {TD} at (10,90) size 54x42 [r=2 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 35x39 + text run at (1,1) width 35: "block" + text run at (1,21) width 27: "one." +hidden layer at (8,215) size 0x134 + LayoutNGBlockFlow (positioned) {DIV} at (8,214.91) size 0x134 + LayoutTable {TABLE} at (0,0) size 66x134 + LayoutTableSection {TBODY} at (0,0) size 66x134 + LayoutTableRow {TR} at (0,2) size 66x42 + LayoutNGTableCell {TD} at (2,12) size 6x22 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (1,11) size 4x19 + text run at (1,11) width 4: " " + LayoutNGTableCell {TD} at (10,2) size 54x42 [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 42x39 + text run at (1,1) width 42: "This is" + text run at (1,21) width 19: "the" + LayoutTableRow {TR} at (0,46) size 66x42 + LayoutNGTableCell {TD} at (2,56) size 6x22 [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (1,11) size 4x19 + text run at (1,11) width 4: " " + LayoutNGTableCell {TD} at (10,46) size 54x42 [r=1 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 52x39 + text run at (1,1) width 52: "contents" + text run at (1,21) width 13: "of" + LayoutTableRow {TR} at (0,90) size 66x42 + LayoutNGTableCell {TD} at (2,100) size 6x22 [r=2 c=0 rs=1 cs=1] + LayoutText {#text} at (1,11) size 4x19 + text run at (1,11) width 4: " " + LayoutNGTableCell {TD} at (10,90) size 54x42 [r=2 c=1 rs=1 cs=1] + LayoutText {#text} at (1,1) size 35x39 + text run at (1,1) width 35: "block" + text run at (1,21) width 28: "two."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.png index 02a4696..8543fef1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.txt index 30c5db93f8..62e6d898 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/anonymous-block-orphaned-lines-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 566x19 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=12782" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=12782" LayoutText {#text} at (352,0) size 265x19 text run at (352,0) width 265: " Reproducible crash in BidiContext::deref" - LayoutText {#text} at (616,0) size 5x19 - text run at (616,0) width 5: "." + LayoutText {#text} at (617,0) size 4x19 + text run at (617,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 246x19 text run at (0,0) width 246: "No assertion failure means SUCCESS."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/containing-block-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/containing-block-change-expected.txt index a51a016..3487d9a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/containing-block-change-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/containing-block-change-expected.txt
@@ -7,9 +7,9 @@ LayoutText {#text} at (0,0) size 172x19 text run at (0,0) width 172: "This is a regression test for " LayoutInline {I} at (0,0) size 761x39 - LayoutInline {A} at (0,0) size 300x19 [color=#0000EE] - LayoutText {#text} at (172,0) size 300x19 - text run at (172,0) width 300: "http://bugs.webkit.org/show_bug.cgi?id=11672" + LayoutInline {A} at (0,0) size 299x19 [color=#0000EE] + LayoutText {#text} at (172,0) size 299x19 + text run at (172,0) width 299: "http://bugs.webkit.org/show_bug.cgi?id=11672" LayoutText {#text} at (471,0) size 761x39 text run at (471,0) width 290: " REGRESSION (r17068): Repro crash due to" text run at (0,20) width 146: "painting without layout"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png index 04aa61f04..0fa2e5e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt index 3b90481f..7d4c454 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 782x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=14134" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=14134" LayoutText {#text} at (352,0) size 782x39 text run at (352,0) width 430: " REGRESSION (r25353): Whitespace nodes ignored between inline" text run at (0,20) width 55: "list items"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.png index 08f6171..13fb6a8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt index bbff08d..b583b3c9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt
@@ -4,17 +4,17 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 739x39 - LayoutInline {A} at (0,0) size 308x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 308x19 - text run at (51,0) width 308: "https://bugs.webkit.org/show_bug.cgi?id=19278" - LayoutText {#text} at (358,0) size 739x39 - text run at (358,0) width 381: " REGRESSION (r31114-r31132): image float disappears on" - text run at (0,20) width 43: "refresh" - LayoutText {#text} at (42,20) size 5x19 - text run at (42,20) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 737x39 + LayoutInline {A} at (0,0) size 307x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 307x19 + text run at (51,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=19278" + LayoutText {#text} at (358,0) size 737x39 + text run at (358,0) width 379: " REGRESSION (r31114-r31132): image float disappears on" + text run at (0,20) width 44: "refresh" + LayoutText {#text} at (44,20) size 4x19 + text run at (44,20) width 4: "." LayoutNGBlockFlow {DIV} at (0,56) size 784x80 LayoutNGBlockFlow (anonymous) at (0,0) size 784x40 LayoutText {#text} at (0,0) size 259x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-withdrawal-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-withdrawal-expected.txt new file mode 100644 index 0000000..dc9df61 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-withdrawal-expected.txt
@@ -0,0 +1,49 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 578x19 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=12886" + LayoutText {#text} at (352,0) size 277x19 + text run at (352,0) width 277: " Crash with Scriptalicious javascript library" + LayoutText {#text} at (629,0) size 4x19 + text run at (629,0) width 4: "." + LayoutNGBlockFlow {P} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 296x19 + text run at (0,0) width 296: "You should see two purple 100\x{D7}50 rectangles, " + LayoutInline {EM} at (0,0) size 20x19 + LayoutText {#text} at (296,0) size 20x19 + text run at (296,0) width 20: "not" + LayoutText {#text} at (316,0) size 151x19 + text run at (316,0) width 151: " a checkerboard pattern." + LayoutTable {TABLE} at (0,72) size 100x300 + LayoutTableSection {TBODY} at (0,0) size 100x300 + LayoutTableRow {TR} at (0,0) size 100x150 + LayoutNGTableCell {TD} at (0,0) size 50x100 [r=0 c=0 rs=1 cs=1] + LayoutNGBlockFlow {DIV} at (0,0) size 50x100 + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 + LayoutNGBlockFlow (floating) {DIV} at (0,0) size 50x25 + LayoutNGBlockFlow {DIV} at (0,50) size 50x50 + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 [bgcolor=#800080] + LayoutNGTableCell {TD} at (50,0) size 50x100 [r=0 c=1 rs=1 cs=1] + LayoutNGBlockFlow {DIV} at (0,0) size 50x100 + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 + LayoutNGBlockFlow (floating) {DIV} at (0,0) size 50x25 + LayoutNGBlockFlow {DIV} at (0,50) size 50x50 + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 [bgcolor=#800080] + LayoutTableRow {TR} at (0,150) size 100x150 + LayoutNGTableCell {TD} at (0,150) size 50x50 [r=1 c=0 rs=1 cs=1] + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 + LayoutNGBlockFlow {DIV} at (0,0) size 50x0 + LayoutNGBlockFlow (floating) {DIV} at (0,0) size 50x0 + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 [bgcolor=#800080] + LayoutNGTableCell {TD} at (50,150) size 50x50 [r=1 c=1 rs=1 cs=1] + LayoutNGBlockFlow {DIV} at (0,0) size 50x50 [bgcolor=#800080] + LayoutNGBlockFlow {DIV} at (0,372) size 784x200
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insert-before-table-part-in-continuation-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insert-before-table-part-in-continuation-expected.txt new file mode 100644 index 0000000..3dbb1fa --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insert-before-table-part-in-continuation-expected.txt
@@ -0,0 +1,206 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 631x19 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=15362" + LayoutText {#text} at (352,0) size 330x19 + text run at (352,0) width 330: " Safari Crashes when opening a JS TreeGrid widget" + LayoutText {#text} at (682,0) size 4x19 + text run at (682,0) width 4: "." + LayoutNGBlockFlow {P} at (0,36) size 784x80 + LayoutText {#text} at (0,0) size 783x79 + text run at (0,0) width 780: "The test sets up an inline parent with a child that is some kind of table part. The child gets broken off into a continuation and" + text run at (0,20) width 777: "anonymous table parts get created below and/or above the table parts. Then the test tries to insert a new child into the inline," + text run at (0,40) width 783: "specifying the table part as the \"before child\". The resulting render tree should look just like it would look if the parent was a" + text run at (0,60) width 39: "block." + LayoutNGBlockFlow {DIV} at (0,132) size 784x20 + LayoutInline {SPAN} at (0,0) size 229x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutText {#text} at (39,0) size 87x19 + text run at (39,0) width 87: "goes here and" + LayoutTable (anonymous) at (126,0) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutNGTableCell {DIV} at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,152) size 784x20 + LayoutInline {SPAN} at (0,0) size 142x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutTable (anonymous) at (39,0) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutNGTableCell {TD} at (0,0) size 0x0 [r=0 c=0 rs=1 cs=1] + LayoutNGTableCell {DIV} at (0,0) size 103x20 [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,172) size 784x35 + LayoutInline {SPAN} at (0,0) size 142x35 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutTable (anonymous) at (39,15) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow {TR} at (0,0) size 103x0 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutNGTableCell {DIV} at (0,0) size 103x20 [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,207) size 784x20 + LayoutInline {SPAN} at (0,0) size 142x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutTable (anonymous) at (39,0) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutNGTableCell {DIV} at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,227) size 784x40 + LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 + LayoutInline {SPAN} at (0,0) size 39x19 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutNGBlockFlow (anonymous) at (0,20) size 784x0 + LayoutNGBlockFlow {DIV} at (0,0) size 784x0 + LayoutNGBlockFlow (anonymous) at (0,20) size 784x20 + LayoutInline {SPAN} at (0,0) size 103x20 + LayoutTable (anonymous) at (0,0) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutNGTableCell {DIV} at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,267) size 784x20 + LayoutInline {SPAN} at (0,0) size 229x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutText {#text} at (39,0) size 87x19 + text run at (39,0) width 87: "goes here and" + LayoutTable (anonymous) at (126,0) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow {DIV} at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,287) size 784x35 + LayoutInline {SPAN} at (0,0) size 142x35 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutTable (anonymous) at (39,15) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x0 + LayoutNGTableCell {TD} at (0,0) size 103x0 [r=0 c=0 rs=1 cs=1] + LayoutTableRow {DIV} at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,322) size 784x35 + LayoutInline {SPAN} at (0,0) size 142x35 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutTable (anonymous) at (39,15) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow {TR} at (0,0) size 103x0 + LayoutTableRow {DIV} at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,357) size 784x20 + LayoutInline {SPAN} at (0,0) size 142x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutTable (anonymous) at (39,0) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow {DIV} at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,377) size 784x40 + LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 + LayoutInline {SPAN} at (0,0) size 39x19 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutNGBlockFlow (anonymous) at (0,20) size 784x0 + LayoutNGBlockFlow {DIV} at (0,0) size 784x0 + LayoutNGBlockFlow (anonymous) at (0,20) size 784x20 + LayoutInline {SPAN} at (0,0) size 103x20 + LayoutTable (anonymous) at (0,0) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x20 + LayoutTableRow {DIV} at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,417) size 784x20 + LayoutInline {SPAN} at (0,0) size 229x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutText {#text} at (39,0) size 87x19 + text run at (39,0) width 87: "goes here and" + LayoutTable (anonymous) at (126,0) size 103x20 + LayoutTableSection {DIV} at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,437) size 784x35 + LayoutInline {SPAN} at (0,0) size 142x35 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutTable (anonymous) at (39,15) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x0 + LayoutTableRow (anonymous) at (0,0) size 103x0 + LayoutNGTableCell {TD} at (0,0) size 103x0 [r=0 c=0 rs=1 cs=1] + LayoutTableSection {DIV} at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,472) size 784x35 + LayoutInline {SPAN} at (0,0) size 142x35 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutTable (anonymous) at (39,15) size 103x20 + LayoutTableSection (anonymous) at (0,0) size 103x0 + LayoutTableRow {TR} at (0,0) size 103x0 + LayoutTableSection {DIV} at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,507) size 784x20 + LayoutInline {SPAN} at (0,0) size 142x20 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutInline {SPAN} at (0,0) size 0x0 + LayoutTable (anonymous) at (39,0) size 103x20 + LayoutTableSection {DIV} at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here" + LayoutNGBlockFlow {DIV} at (0,527) size 784x40 + LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 + LayoutInline {SPAN} at (0,0) size 39x19 + LayoutText {#text} at (0,0) size 39x19 + text run at (0,0) width 39: "Text..." + LayoutNGBlockFlow (anonymous) at (0,20) size 784x0 + LayoutNGBlockFlow {DIV} at (0,0) size 784x0 + LayoutNGBlockFlow (anonymous) at (0,20) size 784x20 + LayoutInline {SPAN} at (0,0) size 103x20 + LayoutTable (anonymous) at (0,0) size 103x20 + LayoutTableSection {DIV} at (0,0) size 103x20 + LayoutTableRow (anonymous) at (0,0) size 103x20 + LayoutTableCell (anonymous) at (0,0) size 103x20 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 103x19 + text run at (0,0) width 103: "...continues here"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/noninlinebadness-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/noninlinebadness-expected.txt new file mode 100644 index 0000000..721ab0c8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/noninlinebadness-expected.txt
@@ -0,0 +1,12 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {DIV} at (0,0) size 784x240 + LayoutNGBlockFlow (floating) {DIV} at (0,0) size 200x200 + LayoutNGBlockFlow {DIV} at (0,0) size 200x200 [bgcolor=#00FF00] + LayoutNGBlockFlow (anonymous) at (0,200) size 784x40 + LayoutText {#text} at (0,0) size 723x39 + text run at (0,0) width 723: "This text should be underneath a 200x200 lime float. We are making sure that the code that wraps inline children in" + text run at (0,20) width 608: "anonymous blocks does the right thing when blocks are inserted in between a float and an inline."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/outerHTML-doc-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/outerHTML-doc-expected.txt new file mode 100644 index 0000000..4f5a47f7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/outerHTML-doc-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 47x19 + text run at (0,0) width 47: "test for " + LayoutInline {A} at (0,0) size 56x19 [color=#0000EE] + LayoutText {#text} at (47,0) size 56x19 + text run at (47,0) width 56: "4110775" + LayoutText {#text} at (103,0) size 473x19 + text run at (103,0) width 473: " Crash will occur when double-clicking outerHTML link on W3 DOM test" + LayoutNGBlockFlow {P} at (0,36) size 784x0 + LayoutNGBlockFlow {DIV} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 584x19 + text run at (0,0) width 584: "This test passed. We don't support outerHTML on the document object. Neither does WinIE."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/staticY-marking-parents-regression-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/staticY-marking-parents-regression-expected.txt new file mode 100644 index 0000000..c97a3cfe --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/staticY-marking-parents-regression-expected.txt
@@ -0,0 +1,38 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 723x39 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=12818" + LayoutText {#text} at (352,0) size 723x39 + text run at (352,0) width 371: " REGRESSION (r19148): shacknews.com does not render" + text run at (0,20) width 68: "completely" + LayoutText {#text} at (68,20) size 4x19 + text run at (68,20) width 4: "." + LayoutNGBlockFlow {P} at (0,56) size 784x20 + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "There should be a green square to the left of the text." + LayoutNGBlockFlow {DIV} at (0,92) size 100x100 [bgcolor=#008000] + LayoutNGBlockFlow {DIV} at (0,192) size 784x20 + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" +layer at (8,100) size 792x140 + LayoutNGBlockFlow (positioned) {DIV} at (8,100) size 792x140 + LayoutNGBlockFlow {DIV} at (100,0) size 692x140 + LayoutNGBlockFlow {DIV} at (0,0) size 692x140 + LayoutText {#text} at (0,0) size 687x139 + text run at (0,0) width 667: "Curabitur pretium, quam quis semper malesuada, est libero feugiat libero, vel fringilla orci nibh sed neque." + text run at (0,20) width 675: "Quisque eu nulla non nisi molestie accumsan. Etiam tellus urna, laoreet ac, laoreet non, suscipit sed, sapien." + text run at (0,40) width 671: "Phasellus vehicula, sem at posuere vehicula, augue nibh molestie nisl, nec ullamcorper lacus ante vulputate" + text run at (0,60) width 673: "pede. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris viverra" + text run at (0,80) width 687: "augue vitae purus. Morbi sed sem. Donec dui nisi, ultrices non, pretium quis, hendrerit non, est. Donec tellus." + text run at (0,100) width 685: "Donec eget dui id eros pharetra rutrum. Suspendisse sodales lectus sit amet nulla. Morbi tortor arcu, convallis" + text run at (0,120) width 245: "blandit, elementum eu, aliquet a, tellus." +layer at (108,100) size 0x0 + LayoutNGBlockFlow (positioned) {DIV} at (100,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/view-overflow-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/view-overflow-expected.txt new file mode 100644 index 0000000..f3baae7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/view-overflow-expected.txt
@@ -0,0 +1,22 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 637x19 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13145" + LayoutText {#text} at (352,0) size 336x19 + text run at (352,0) width 336: " Regression: Scrollbar not resizing after display none" + LayoutText {#text} at (688,0) size 4x19 + text run at (688,0) width 4: "." + LayoutNGBlockFlow {P} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 312x19 + text run at (0,0) width 312: "The window should not have a vertical scroll bar." +layer at (8,100) size 100x100 + LayoutNGBlockFlow (positioned) {DIV} at (8,100) size 100x100 + LayoutNGBlockFlow {DIV} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/encoding/xmacroman-encoding-test-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/encoding/xmacroman-encoding-test-expected.txt new file mode 100644 index 0000000..4256b474 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/encoding/xmacroman-encoding-test-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 761x19 + text run at (0,0) width 761: "This tests the use of xmacroman as content type. You should not see any \"garbage\" characters if xmacroman is supported" + LayoutNGBlockFlow (anonymous) at (0,36) size 784x60 + LayoutText {#text} at (0,0) size 82x19 + text run at (0,0) width 82: "apostrophe: \x{2019}" + LayoutBR {BR} at (82,0) size 0x0 + LayoutText {#text} at (0,20) size 67x19 + text run at (0,20) width 67: "ellipsis: \x{2026}" + LayoutBR {BR} at (67,20) size 0x0 + LayoutText {#text} at (0,40) size 77x19 + text run at (0,40) width 77: "em-dash: \x{2014}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/nested-window-event-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/nested-window-event-expected.txt new file mode 100644 index 0000000..d043b2b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/nested-window-event-expected.txt
@@ -0,0 +1,2 @@ +This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes. +PASS
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/001-expected.png new file mode 100644 index 0000000..b0f5dd0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/001-expected.txt index ececd07..b1bf6658 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/001-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {H1} at (0,0) size 784x37 - LayoutText {#text} at (0,0) size 230x36 - text run at (0,0) width 230: "Min-Width Tests" + LayoutText {#text} at (0,0) size 231x36 + text run at (0,0) width 231: "Min-Width Tests" LayoutTable {TABLE} at (0,58.44) size 784x86 [border: (2px outset #808080)] LayoutTableSection {TBODY} at (2,2) size 780x82 LayoutTableRow {TR} at (0,0) size 780x82
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.png index 3349309..c180eef 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.txt index 425fb9a8..8c57d40 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/006-expected.txt
@@ -5,9 +5,9 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {DIV} at (0,0) size 784x75.59 [border: (5px solid #000000)] LayoutFieldset {FIELDSET} at (7,5) size 770x65.59 [border: (10px groove #FF0000)] - LayoutNGBlockFlow {LEGEND} at (42,0) size 121.89x20 - LayoutText {#text} at (2,0) size 118x19 - text run at (2,0) width 118: "Test without forms" + LayoutNGBlockFlow {LEGEND} at (42,0) size 121x20 + LayoutText {#text} at (2,0) size 117x19 + text run at (2,0) width 117: "Test without forms" LayoutNGBlockFlow {DIV} at (22,25.59) size 726x20 - LayoutText {#text} at (0,0) size 275x19 - text run at (0,0) width 275: "A DIV inside a fieldset, not related to forms" + LayoutText {#text} at (0,0) size 276x19 + text run at (0,0) width 276: "A DIV inside a fieldset, not related to forms"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/007-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/007-expected.txt index 8940708..6c855ef 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/007-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/007-expected.txt
@@ -15,11 +15,11 @@ text run at (0,20) width 80: "Hello world." LayoutText {#text} at (119,45) size 4x20 text run at (119,45) width 4: " " - LayoutFieldset {FIELDSET} at (125,20) size 116.89x57.59 [border: (2px groove #C0C0C0)] - LayoutNGBlockFlow {LEGEND} at (14,0) size 88.59x20 - LayoutText {#text} at (2,0) size 85x19 - text run at (2,0) width 85: "Number Two" - LayoutNGBlockFlow (anonymous) at (14,25.59) size 88.89x20 + LayoutFieldset {FIELDSET} at (125,20) size 116x57.59 [border: (2px groove #C0C0C0)] + LayoutNGBlockFlow {LEGEND} at (14,0) size 88x20 + LayoutText {#text} at (2,0) size 84x19 + text run at (2,0) width 84: "Number Two" + LayoutNGBlockFlow (anonymous) at (14,25.59) size 88x20 LayoutText {#text} at (0,0) size 80x19 text run at (0,0) width 80: "Hello world." LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/basic-buttons-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/basic-buttons-expected.txt index d462e4c8..e1348166 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/basic-buttons-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/basic-buttons-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x355 LayoutNGBlockFlow {BODY} at (8,8) size 784x339 LayoutNGBlockFlow (anonymous) at (0,0) size 784x80 - LayoutText {#text} at (0,0) size 533x19 - text run at (0,0) width 533: "Tests for basic button rendering. Creates a table with seven columns and seven rows." + LayoutText {#text} at (0,0) size 532x19 + text run at (0,0) width 532: "Tests for basic button rendering. Creates a table with seven columns and seven rows." LayoutBR {BR} at (532,0) size 0x0 LayoutText {#text} at (0,20) size 507x19 text run at (0,20) width 507: "Creates two different types of buttons, one with an image (a red dot) and another" - LayoutBR {BR} at (506,20) size 0x0 - LayoutText {#text} at (0,40) size 644x19 - text run at (0,40) width 644: "with text (\"foo\") and then uses six different paddings to make sure each of the buttons render properly." + LayoutBR {BR} at (507,20) size 0x0 + LayoutText {#text} at (0,40) size 643x19 + text run at (0,40) width 643: "with text (\"foo\") and then uses six different paddings to make sure each of the buttons render properly." LayoutBR {BR} at (643,40) size 0x0 LayoutBR {BR} at (0,60) size 0x0 LayoutTable {TABLE} at (0,80) size 684x259
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-sizes-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-sizes-expected.txt index 5c42f93..7fb26149 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-sizes-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-sizes-expected.txt
@@ -3,109 +3,109 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutButton {BUTTON} at (0,8) size 40.45x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 24.45x6 + LayoutButton {BUTTON} at (0,8) size 41x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 25x6 LayoutText {#text} at (0,0) size 25x6 text run at (0,0) width 25: "Test Button" - LayoutText {#text} at (40,1) size 5x19 - text run at (40,1) width 5: " " - LayoutButton {BUTTON} at (44.45,8) size 46.34x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 30.34x6 + LayoutText {#text} at (41,1) size 4x19 + text run at (41,1) width 4: " " + LayoutButton {BUTTON} at (45,8) size 47x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 31x6 LayoutText {#text} at (0,0) size 31x6 text run at (0,0) width 31: "Test Button" - LayoutText {#text} at (90,1) size 5x19 - text run at (90,1) width 5: " " - LayoutButton {BUTTON} at (94.80,7) size 52.23x13 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 36.23x7 + LayoutText {#text} at (92,1) size 4x19 + text run at (92,1) width 4: " " + LayoutButton {BUTTON} at (96,7) size 53x13 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 37x7 LayoutText {#text} at (0,0) size 37x7 text run at (0,0) width 37: "Test Button" - LayoutText {#text} at (147,1) size 5x19 - text run at (147,1) width 5: " " - LayoutButton {BUTTON} at (151.03,5) size 53.13x16 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 37.13x10 + LayoutText {#text} at (149,1) size 4x19 + text run at (149,1) width 4: " " + LayoutButton {BUTTON} at (153,5) size 54x16 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 38x10 LayoutText {#text} at (0,0) size 38x10 text run at (0,0) width 38: "Test Button" - LayoutText {#text} at (204,1) size 5x19 - text run at (204,1) width 5: " " - LayoutButton {BUTTON} at (208.16,4) size 64.02x18 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 48.02x12 - LayoutText {#text} at (0,0) size 48x12 - text run at (0,0) width 48: "Test Button" - LayoutText {#text} at (272,1) size 5x19 - text run at (272,1) width 5: " " - LayoutButton {BUTTON} at (276.17,3) size 68.91x19 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 52.91x13 - LayoutText {#text} at (0,0) size 53x13 - text run at (0,0) width 53: "Test Button" - LayoutText {#text} at (345,1) size 5x19 - text run at (345,1) width 5: " " - LayoutButton {BUTTON} at (349.08,2) size 70.78x20 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 54.78x14 - LayoutText {#text} at (0,0) size 55x14 - text run at (0,0) width 55: "Test Button" - LayoutText {#text} at (419,1) size 5x19 - text run at (419,1) width 5: " " - LayoutButton {INPUT} at (423.86,0) size 82.53x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 66.53x16 - LayoutText {#text} at (0,0) size 67x16 - text run at (0,0) width 67: "Test Button" - LayoutText {#text} at (506,1) size 5x19 - text run at (506,1) width 5: " " - LayoutButton {BUTTON} at (510.39,1) size 75.67x21 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 59.67x15 - LayoutText {#text} at (0,0) size 60x15 - text run at (0,0) width 60: "Test Button" - LayoutText {#text} at (586,1) size 5x19 - text run at (586,1) width 5: " " - LayoutButton {BUTTON} at (590.06,0) size 82.56x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 66.56x16 - LayoutText {#text} at (0,0) size 67x16 - text run at (0,0) width 67: "Test Button" - LayoutText {#text} at (672,1) size 5x19 - text run at (672,1) width 5: " " - LayoutButton {BUTTON} at (676.63,0) size 87.45x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 71.45x16 - LayoutText {#text} at (0,0) size 72x16 - text run at (0,0) width 72: "Test Button" + LayoutText {#text} at (207,1) size 4x19 + text run at (207,1) width 4: " " + LayoutButton {BUTTON} at (211,4) size 65x18 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 49x12 + LayoutText {#text} at (0,0) size 49x12 + text run at (0,0) width 49: "Test Button" + LayoutText {#text} at (276,1) size 4x19 + text run at (276,1) width 4: " " + LayoutButton {BUTTON} at (280,3) size 68x19 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 52x13 + LayoutText {#text} at (0,0) size 52x13 + text run at (0,0) width 52: "Test Button" + LayoutText {#text} at (348,1) size 4x19 + text run at (348,1) width 4: " " + LayoutButton {BUTTON} at (352,2) size 70x20 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 54x14 + LayoutText {#text} at (0,0) size 54x14 + text run at (0,0) width 54: "Test Button" + LayoutText {#text} at (422,1) size 4x19 + text run at (422,1) width 4: " " + LayoutButton {INPUT} at (426,0) size 82x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 66x16 + LayoutText {#text} at (0,0) size 66x16 + text run at (0,0) width 66: "Test Button" + LayoutText {#text} at (508,1) size 4x19 + text run at (508,1) width 4: " " + LayoutButton {BUTTON} at (512,1) size 75x21 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 59x15 + LayoutText {#text} at (0,0) size 59x15 + text run at (0,0) width 59: "Test Button" + LayoutText {#text} at (587,1) size 4x19 + text run at (587,1) width 4: " " + LayoutButton {BUTTON} at (591,0) size 82x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 66x16 + LayoutText {#text} at (0,0) size 66x16 + text run at (0,0) width 66: "Test Button" + LayoutText {#text} at (673,1) size 4x19 + text run at (673,1) width 4: " " + LayoutButton {BUTTON} at (677,0) size 87x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 71x16 + LayoutText {#text} at (0,0) size 71x16 + text run at (0,0) width 71: "Test Button" LayoutText {#text} at (0,0) size 0x0 - LayoutButton {BUTTON} at (0,27) size 89.34x23 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 73.34x17 - LayoutText {#text} at (0,0) size 74x17 - text run at (0,0) width 74: "Test Button" - LayoutText {#text} at (89,29) size 5x19 - text run at (89,29) width 5: " " - LayoutButton {BUTTON} at (93.34,26) size 95.23x25 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 79.23x19 - LayoutText {#text} at (0,0) size 80x18 - text run at (0,0) width 80: "Test Button" - LayoutText {#text} at (188,29) size 5x19 - text run at (188,29) width 5: " " - LayoutButton {BUTTON} at (192.58,26) size 100.13x26 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 84.13x20 - LayoutText {#text} at (0,0) size 85x19 - text run at (0,0) width 85: "Test Button" - LayoutText {#text} at (292,29) size 5x19 - text run at (292,29) width 5: " " - LayoutButton {BUTTON} at (296.70,24) size 106.02x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 90.02x22 + LayoutButton {BUTTON} at (0,27) size 89x23 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 73x17 + LayoutText {#text} at (0,0) size 73x17 + text run at (0,0) width 73: "Test Button" + LayoutText {#text} at (89,29) size 4x19 + text run at (89,29) width 4: " " + LayoutButton {BUTTON} at (93,26) size 95x25 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 79x19 + LayoutText {#text} at (0,0) size 79x18 + text run at (0,0) width 79: "Test Button" + LayoutText {#text} at (188,29) size 4x19 + text run at (188,29) width 4: " " + LayoutButton {BUTTON} at (192,26) size 100x26 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 84x20 + LayoutText {#text} at (0,0) size 84x19 + text run at (0,0) width 84: "Test Button" + LayoutText {#text} at (292,29) size 4x19 + text run at (292,29) width 4: " " + LayoutButton {BUTTON} at (296,24) size 106x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 90x22 LayoutText {#text} at (0,0) size 90x21 text run at (0,0) width 90: "Test Button" - LayoutText {#text} at (402,29) size 5x19 - text run at (402,29) width 5: " " - LayoutButton {BUTTON} at (406.72,23) size 112.91x29 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 96.91x23 + LayoutText {#text} at (402,29) size 4x19 + text run at (402,29) width 4: " " + LayoutButton {BUTTON} at (406,23) size 113x29 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 97x23 LayoutText {#text} at (0,0) size 97x22 text run at (0,0) width 97: "Test Button" - LayoutText {#text} at (519,29) size 5x19 - text run at (519,29) width 5: " " - LayoutButton {BUTTON} at (523.63,22) size 116.80x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 100.80x24 + LayoutText {#text} at (519,29) size 4x19 + text run at (519,29) width 4: " " + LayoutButton {BUTTON} at (523,22) size 117x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 101x24 LayoutText {#text} at (0,0) size 101x23 text run at (0,0) width 101: "Test Button" - LayoutText {#text} at (640,29) size 5x19 - text run at (640,29) width 5: " " - LayoutButton {BUTTON} at (644.42,22) size 123.69x31 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 107.69x25 + LayoutText {#text} at (640,29) size 4x19 + text run at (640,29) width 4: " " + LayoutButton {BUTTON} at (644,22) size 124x31 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 108x25 LayoutText {#text} at (0,0) size 108x24 text run at (0,0) width 108: "Test Button" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.png index 01ea6df5..a127416 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.txt index f3640d8..8907b01 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button-text-transform-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 744x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=15181" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=15181" LayoutText {#text} at (352,0) size 744x39 text run at (352,0) width 392: " text-transform: uppercase not working in input (submit, reset," text run at (0,20) width 104: "button) elements"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button/button-inner-block-reuse-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button/button-inner-block-reuse-expected.txt index 0875623..93eea79 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button/button-inner-block-reuse-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/button/button-inner-block-reuse-expected.txt
@@ -6,15 +6,15 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 207x19 text run at (0,0) width 207: "This tests for regressions against " - LayoutInline {I} at (0,0) size 783x39 + LayoutInline {I} at (0,0) size 784x39 LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (207,0) size 348x19 text run at (207,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8420" - LayoutText {#text} at (554,0) size 783x39 - text run at (554,0) width 229: " iExploder(#12): Assertion failure in" + LayoutText {#text} at (555,0) size 784x39 + text run at (555,0) width 229: " iExploder(#12): Assertion failure in" text run at (0,20) width 236: "RenderContainer::removeChildNode" - LayoutText {#text} at (235,20) size 5x19 - text run at (235,20) width 5: "." + LayoutText {#text} at (236,20) size 4x19 + text run at (236,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x40 LayoutText {#text} at (0,0) size 703x39 text run at (0,0) width 703: "In the render tree, the button should have only one child, an anonymous block wrapping all of the button's other"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png index 990d68e5..496feac 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.png index 9394812..3b75fc8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.txt index c1e39ed..880b677 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/color/input-appearance-color-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {H3} at (0,0) size 784x23 - LayoutText {#text} at (0,0) size 163x22 - text run at (0,0) width 163: "Default Appearance" + LayoutText {#text} at (0,0) size 162x22 + text run at (0,0) width 162: "Default Appearance" LayoutNGBlockFlow (anonymous) at (0,41.72) size 784x43 LayoutText {#text} at (0,0) size 284x19 text run at (0,0) width 284: "List color controls have different appearance." - LayoutBR {BR} at (283,0) size 0x0 + LayoutBR {BR} at (284,0) size 0x0 LayoutBlockFlow {INPUT} at (0,20) size 44x23 [bgcolor=#DDDDDD] [border: (1px solid #A9A9A9)] LayoutFlexibleBox {DIV} at (3,2) size 38x19 LayoutBlockFlow {DIV} at (2,4) size 34x11 [bgcolor=#000000] [border: (1px solid #777777)] @@ -23,7 +23,7 @@ LayoutNGBlockFlow (anonymous) at (0,145.16) size 784x43 LayoutText {#text} at (0,0) size 577x19 text run at (0,0) width 577: "List color controls have different sizes depending on font sizes. Normal color controls don't." - LayoutBR {BR} at (576,0) size 0x0 + LayoutBR {BR} at (577,0) size 0x0 LayoutBlockFlow {INPUT} at (0,20) size 44x23 [bgcolor=#DDDDDD] [border: (1px solid #A9A9A9)] LayoutFlexibleBox {DIV} at (3,2) size 38x19 LayoutBlockFlow {DIV} at (2,4) size 34x11 [bgcolor=#00FF00] [border: (1px solid #777777)] @@ -54,8 +54,8 @@ LayoutBlockFlow {DIV} at (8,4) size 50x11 [bgcolor=#00FF00] [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {H3} at (0,206.88) size 784x23 - LayoutText {#text} at (0,0) size 123x22 - text run at (0,0) width 123: "Various Colors" + LayoutText {#text} at (0,0) size 122x22 + text run at (0,0) width 122: "Various Colors" LayoutNGBlockFlow (anonymous) at (0,248.59) size 784x23 LayoutBlockFlow {INPUT} at (0,0) size 44x23 [bgcolor=#DDDDDD] [border: (1px solid #A9A9A9)] LayoutFlexibleBox {DIV} at (3,2) size 38x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/control-clip-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/control-clip-expected.txt index 8911342..1b481894 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/control-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/control-clip-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 228x19 - text run at (0,0) width 228: "Tests that buttons clip their contents." + LayoutText {#text} at (0,0) size 227x19 + text run at (0,0) width 227: "Tests that buttons clip their contents." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 763x19 text run at (0,0) width 763: "Each button below should have a yellow border and a black dashed outline. Contents should overflow the yellow border."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datalist/input-appearance-range-with-padding-with-datalist-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datalist/input-appearance-range-with-padding-with-datalist-expected.png index 9c6c9d1..f73390c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datalist/input-appearance-range-with-padding-with-datalist-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datalist/input-appearance-range-with-padding-with-datalist-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/date/date-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/date/date-appearance-basic-expected.png index 97279a0..5565a87 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/date/date-appearance-basic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/date/date-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datetimelocal/datetimelocal-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datetimelocal/datetimelocal-appearance-basic-expected.png index 57f9a6d..2cd9840 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datetimelocal/datetimelocal-appearance-basic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/datetimelocal/datetimelocal-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/floating-textfield-relayout-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/floating-textfield-relayout-expected.txt index 9917ebca..6300024 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/floating-textfield-relayout-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/floating-textfield-relayout-expected.txt
@@ -10,11 +10,11 @@ LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (104,0) size 348x19 text run at (104,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9316" - LayoutText {#text} at (451,0) size 750x39 - text run at (451,0) width 299: " REGRESSION: text field width shrinks on first" + LayoutText {#text} at (452,0) size 750x39 + text run at (452,0) width 298: " REGRESSION: text field width shrinks on first" text run at (0,20) width 59: "keystroke" - LayoutText {#text} at (58,20) size 5x19 - text run at (58,20) width 5: "." + LayoutText {#text} at (59,20) size 4x19 + text run at (59,20) width 4: "." layer at (8,64) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,56) size 784x2 [border: (1px inset #EEEEEE)] layer at (8,74) size 784x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.png index 9b407a5f..8c5e89c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.txt index a14ca2a..f58f3f6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/form-element-geometry-expected.txt
@@ -101,8 +101,8 @@ LayoutNGTableCell {TD} at (396,2) size 185x42 [r=0 c=3 rs=1 cs=1] LayoutNGBlockFlow {DIV} at (1,1) size 183x40 [border: (2px solid #0000FF)] LayoutNGBlockFlow {H2} at (0,341.16) size 784x27 - LayoutText {#text} at (0,0) size 199x26 - text run at (0,0) width 199: "Baseline Alignment" + LayoutText {#text} at (0,0) size 198x26 + text run at (0,0) width 198: "Baseline Alignment" LayoutNGBlockFlow {DIV} at (0,388.06) size 784x28 LayoutInline {FONT} at (0,0) size 205x27 LayoutText {#text} at (0,0) size 43x27
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/formmove-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/formmove-expected.txt index 71d1dbe..6bc533a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/formmove-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/formmove-expected.txt
@@ -5,24 +5,24 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {FORM} at (0,0) size 784x21 LayoutBlockFlow {INPUT} at (5,3) size 13x13 - LayoutText {#text} at (21,1) size 33x19 - text run at (21,1) width 33: "Two " - LayoutBlockFlow {INPUT} at (58.89,3) size 13x13 - LayoutText {#text} at (74,1) size 38x19 - text run at (74,1) width 38: "Three" + LayoutText {#text} at (21,1) size 32x19 + text run at (21,1) width 32: "Two " + LayoutBlockFlow {INPUT} at (58,3) size 13x13 + LayoutText {#text} at (74,1) size 37x19 + text run at (74,1) width 37: "Three" LayoutNGBlockFlow {FORM} at (0,37) size 784x21 LayoutBlockFlow {INPUT} at (5,3) size 13x13 LayoutText {#text} at (21,1) size 31x19 text run at (21,1) width 31: "One " LayoutBlockFlow {INPUT} at (57,3) size 13x13 - LayoutText {#text} at (73,1) size 33x19 - text run at (73,1) width 33: "Two " - LayoutBlockFlow {INPUT} at (110.89,3) size 13x13 - LayoutText {#text} at (126,1) size 42x19 - text run at (126,1) width 42: "Three " - LayoutBlockFlow {INPUT} at (172.89,3) size 13x13 - LayoutText {#text} at (188,1) size 28x19 - text run at (188,1) width 28: "One" + LayoutText {#text} at (73,1) size 32x19 + text run at (73,1) width 32: "Two " + LayoutBlockFlow {INPUT} at (110,3) size 13x13 + LayoutText {#text} at (126,1) size 41x19 + text run at (126,1) width 41: "Three " + LayoutBlockFlow {INPUT} at (172,3) size 13x13 + LayoutText {#text} at (188,1) size 27x19 + text run at (188,1) width 27: "One" LayoutNGBlockFlow (anonymous) at (0,74) size 784x40 LayoutText {#text} at (0,0) size 766x39 text run at (0,0) width 766: "The count of the # of elements in form 1 should be 2 and in form 2 should be 4. The count in form 1 is 2, and the count in"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image-border-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image-border-expected.txt index 1caf0a1c..bfe657b1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image-border-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image-border-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 768x39 - text run at (0,0) width 768: "The first empty image box below should have the default grey \"no border\" border. The second should have a 1-pixel solid" - text run at (0,20) width 312: "black border. They should be the same otherwise." + LayoutText {#text} at (0,0) size 769x39 + text run at (0,0) width 769: "The first empty image box below should have the default grey \"no border\" border. The second should have a 1-pixel solid" + text run at (0,20) width 313: "black border. They should be the same otherwise." LayoutNGBlockFlow (anonymous) at (0,56) size 784x55 LayoutText {#text} at (0,35) size 53x19 text run at (0,35) width 53: "border:0"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image/image-alt-text-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image/image-alt-text-expected.png index b362c6a..22d1c33 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image/image-alt-text-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/image/image-alt-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-button-sizes-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-button-sizes-expected.txt index a0b0432..fd83f423 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-button-sizes-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-button-sizes-expected.txt
@@ -3,103 +3,103 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutButton {INPUT} at (0,9) size 40.45x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 24.45x6 + LayoutButton {INPUT} at (0,9) size 41x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 25x6 LayoutText {#text} at (0,0) size 25x6 text run at (0,0) width 25: "Test Button" - LayoutText {#text} at (40,2) size 5x19 - text run at (40,2) width 5: " " - LayoutButton {INPUT} at (44.45,9) size 46.34x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 30.34x6 + LayoutText {#text} at (41,2) size 4x19 + text run at (41,2) width 4: " " + LayoutButton {INPUT} at (45,9) size 47x12 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 31x6 LayoutText {#text} at (0,0) size 31x6 text run at (0,0) width 31: "Test Button" - LayoutText {#text} at (90,2) size 5x19 - text run at (90,2) width 5: " " - LayoutButton {INPUT} at (94.80,8) size 52.23x13 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 36.23x7 + LayoutText {#text} at (92,2) size 4x19 + text run at (92,2) width 4: " " + LayoutButton {INPUT} at (96,8) size 53x13 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 37x7 LayoutText {#text} at (0,0) size 37x7 text run at (0,0) width 37: "Test Button" - LayoutText {#text} at (147,2) size 5x19 - text run at (147,2) width 5: " " - LayoutButton {INPUT} at (151.03,6) size 53.13x16 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 37.13x10 + LayoutText {#text} at (149,2) size 4x19 + text run at (149,2) width 4: " " + LayoutButton {INPUT} at (153,6) size 54x16 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 38x10 LayoutText {#text} at (0,0) size 38x10 text run at (0,0) width 38: "Test Button" - LayoutText {#text} at (204,2) size 5x19 - text run at (204,2) width 5: " " - LayoutButton {INPUT} at (208.16,5) size 64.02x18 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 48.02x12 - LayoutText {#text} at (0,0) size 48x12 - text run at (0,0) width 48: "Test Button" - LayoutText {#text} at (272,2) size 5x19 - text run at (272,2) width 5: " " - LayoutButton {INPUT} at (276.17,4) size 68.91x19 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 52.91x13 - LayoutText {#text} at (0,0) size 53x13 - text run at (0,0) width 53: "Test Button" - LayoutText {#text} at (345,2) size 5x19 - text run at (345,2) width 5: " " - LayoutButton {INPUT} at (349.08,3) size 70.78x20 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 54.78x14 - LayoutText {#text} at (0,0) size 55x14 - text run at (0,0) width 55: "Test Button" - LayoutText {#text} at (419,2) size 5x19 - text run at (419,2) width 5: " " - LayoutButton {INPUT} at (423.86,2) size 75.67x21 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 59.67x15 - LayoutText {#text} at (0,0) size 60x15 - text run at (0,0) width 60: "Test Button" - LayoutText {#text} at (499,2) size 5x19 - text run at (499,2) width 5: " " - LayoutButton {INPUT} at (503.53,1) size 82.56x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 66.56x16 - LayoutText {#text} at (0,0) size 67x16 - text run at (0,0) width 67: "Test Button" - LayoutText {#text} at (586,2) size 5x19 - text run at (586,2) width 5: " " - LayoutButton {INPUT} at (590.09,1) size 87.45x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 71.45x16 - LayoutText {#text} at (0,0) size 72x16 - text run at (0,0) width 72: "Test Button" - LayoutText {#text} at (677,2) size 5x19 - text run at (677,2) width 5: " " - LayoutButton {INPUT} at (681.55,0) size 89.34x23 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 73.34x17 - LayoutText {#text} at (0,0) size 74x17 - text run at (0,0) width 74: "Test Button" + LayoutText {#text} at (207,2) size 4x19 + text run at (207,2) width 4: " " + LayoutButton {INPUT} at (211,5) size 65x18 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 49x12 + LayoutText {#text} at (0,0) size 49x12 + text run at (0,0) width 49: "Test Button" + LayoutText {#text} at (276,2) size 4x19 + text run at (276,2) width 4: " " + LayoutButton {INPUT} at (280,4) size 68x19 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 52x13 + LayoutText {#text} at (0,0) size 52x13 + text run at (0,0) width 52: "Test Button" + LayoutText {#text} at (348,2) size 4x19 + text run at (348,2) width 4: " " + LayoutButton {INPUT} at (352,3) size 70x20 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 54x14 + LayoutText {#text} at (0,0) size 54x14 + text run at (0,0) width 54: "Test Button" + LayoutText {#text} at (422,2) size 4x19 + text run at (422,2) width 4: " " + LayoutButton {INPUT} at (426,2) size 75x21 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 59x15 + LayoutText {#text} at (0,0) size 59x15 + text run at (0,0) width 59: "Test Button" + LayoutText {#text} at (501,2) size 4x19 + text run at (501,2) width 4: " " + LayoutButton {INPUT} at (505,1) size 82x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 66x16 + LayoutText {#text} at (0,0) size 66x16 + text run at (0,0) width 66: "Test Button" + LayoutText {#text} at (587,2) size 4x19 + text run at (587,2) width 4: " " + LayoutButton {INPUT} at (591,1) size 87x22 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 71x16 + LayoutText {#text} at (0,0) size 71x16 + text run at (0,0) width 71: "Test Button" + LayoutText {#text} at (678,2) size 4x19 + text run at (678,2) width 4: " " + LayoutButton {INPUT} at (682,0) size 89x23 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 73x17 + LayoutText {#text} at (0,0) size 73x17 + text run at (0,0) width 73: "Test Button" LayoutText {#text} at (0,0) size 0x0 - LayoutButton {INPUT} at (0,27) size 95.23x25 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 79.23x19 - LayoutText {#text} at (0,0) size 80x18 - text run at (0,0) width 80: "Test Button" - LayoutText {#text} at (95,30) size 5x19 - text run at (95,30) width 5: " " - LayoutButton {INPUT} at (99.23,27) size 100.13x26 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 84.13x20 - LayoutText {#text} at (0,0) size 85x19 - text run at (0,0) width 85: "Test Button" - LayoutText {#text} at (199,30) size 5x19 - text run at (199,30) width 5: " " - LayoutButton {INPUT} at (203.36,25) size 106.02x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 90.02x22 + LayoutButton {INPUT} at (0,27) size 95x25 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 79x19 + LayoutText {#text} at (0,0) size 79x18 + text run at (0,0) width 79: "Test Button" + LayoutText {#text} at (95,30) size 4x19 + text run at (95,30) width 4: " " + LayoutButton {INPUT} at (99,27) size 100x26 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 84x20 + LayoutText {#text} at (0,0) size 84x19 + text run at (0,0) width 84: "Test Button" + LayoutText {#text} at (199,30) size 4x19 + text run at (199,30) width 4: " " + LayoutButton {INPUT} at (203,25) size 106x28 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 90x22 LayoutText {#text} at (0,0) size 90x21 text run at (0,0) width 90: "Test Button" - LayoutText {#text} at (309,30) size 5x19 - text run at (309,30) width 5: " " - LayoutButton {INPUT} at (313.38,24) size 112.91x29 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 96.91x23 + LayoutText {#text} at (309,30) size 4x19 + text run at (309,30) width 4: " " + LayoutButton {INPUT} at (313,24) size 113x29 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 97x23 LayoutText {#text} at (0,0) size 97x22 text run at (0,0) width 97: "Test Button" - LayoutText {#text} at (426,30) size 5x19 - text run at (426,30) width 5: " " - LayoutButton {INPUT} at (430.28,23) size 116.80x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 100.80x24 + LayoutText {#text} at (426,30) size 4x19 + text run at (426,30) width 4: " " + LayoutButton {INPUT} at (430,23) size 117x30 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 101x24 LayoutText {#text} at (0,0) size 101x23 text run at (0,0) width 101: "Test Button" - LayoutText {#text} at (547,30) size 5x19 - text run at (547,30) width 5: " " - LayoutButton {INPUT} at (551.08,23) size 123.69x31 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] - LayoutNGBlockFlow (anonymous) at (8,3) size 107.69x25 + LayoutText {#text} at (547,30) size 4x19 + text run at (547,30) width 4: " " + LayoutButton {INPUT} at (551,23) size 124x31 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0)] + LayoutNGBlockFlow (anonymous) at (8,3) size 108x25 LayoutText {#text} at (0,0) size 108x24 text run at (0,0) width 108: "Test Button" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-type-text-min-width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-type-text-min-width-expected.txt index 5605230..886a4d7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-type-text-min-width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-type-text-min-width-expected.txt
@@ -3,10 +3,10 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 768x39 - text run at (0,0) width 768: "This test checks if correct min width is applied to \"input type=text\". To match IE and Firefox, the input field below should" + LayoutText {#text} at (0,0) size 767x39 + text run at (0,0) width 767: "This test checks if correct min width is applied to \"input type=text\". To match IE and Firefox, the input field below should" text run at (0,20) width 615: "show \"1987\", with the 7 slightly truncated. See https://bugs.webkit.org/show_bug.cgi?id=15312 ." - LayoutBR {BR} at (614,20) size 0x0 + LayoutBR {BR} at (615,20) size 0x0 LayoutTextControl {INPUT} at (0,40) size 40x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0 layer at (10,51) size 36x16 scrollWidth 43
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-value-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-value-expected.txt index afddb24..bd0ace4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-value-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/input-value-expected.txt
@@ -8,8 +8,8 @@ text run at (0,0) width 784: "Results that match WinIE are two columns on the right that say \"after\" every time, except for the last row which should have" text run at (0,20) width 158: "nothing in either column." LayoutNGBlockFlow {P} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 712x19 - text run at (0,0) width 712: "Results that match Gecko are like WinIE, but with \"before\" for the attribute in the first two rows and the last row." + LayoutText {#text} at (0,0) size 711x19 + text run at (0,0) width 711: "Results that match Gecko are like WinIE, but with \"before\" for the attribute in the first two rows and the last row." LayoutNGBlockFlow {FORM} at (0,102) size 784x376 LayoutTable {TABLE} at (0,0) size 758x376 LayoutTableSection {THEAD} at (0,0) size 758x26
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/month/month-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/month/month-appearance-basic-expected.png index 0513366..e93710d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/month/month-appearance-basic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/month/month-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/negativeLineHeight-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/negativeLineHeight-expected.txt index a08d31d..8a63bc0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/negativeLineHeight-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/negativeLineHeight-expected.txt
@@ -8,8 +8,8 @@ text run at (0,0) width 666: "The textarea below should have standard line-height because textareas should ignore negative line-heights" LayoutBR {BR} at (666,0) size 0x0 LayoutNGBlockFlow {P} at (0,36) size 784x240 - LayoutText {#text} at (0,0) size 86x19 - text run at (0,0) width 86: "TEXTAREA" + LayoutText {#text} at (0,0) size 85x19 + text run at (0,0) width 85: "TEXTAREA" LayoutBR {BR} at (85,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (400,205) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt index 642651f..a44c3f50 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/number/number-appearance-spinbutton-disabled-readonly-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 782x19 - text run at (0,0) width 782: "Test appearances of spin buttons. Disabled state and read-only state should have appearances different from the normal state." + LayoutText {#text} at (0,0) size 781x19 + text run at (0,0) width 781: "Test appearances of spin buttons. Disabled state and read-only state should have appearances different from the normal state." LayoutNGBlockFlow {DIV} at (0,36) size 784x30 LayoutInline {LABEL} at (0,0) size 313x30 LayoutTextControl {INPUT} at (0,0) size 229x30 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/plaintext-mode-2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/plaintext-mode-2-expected.png index 0da669f..34d94a0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/plaintext-mode-2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/plaintext-mode-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.png index 4b0a1f13..5438a9d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.txt index eed1a22..ef84d5a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/range/slider-thumb-shared-style-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 709x19 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=13800" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13800" LayoutText {#text} at (352,0) size 408x19 text run at (352,0) width 408: " REGRESSION: Moving a slider moves another unrelated slider" - LayoutText {#text} at (759,0) size 5x19 - text run at (759,0) width 5: "." + LayoutText {#text} at (760,0) size 4x19 + text run at (760,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 282x19 text run at (0,0) width 282: "The first slider\x{2019}s thumb should be on the left."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.png index 149851f..b0f3974 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.txt index 87814262..07c0e2c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-rtl-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 697x19 - LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 301x19 - text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=11916" - LayoutText {#text} at (351,0) size 397x19 - text run at (351,0) width 397: " REGRESSION (SearchField): RTL search fields are mixed up" - LayoutText {#text} at (747,0) size 5x19 - text run at (747,0) width 5: "." + LayoutInline {A} at (0,0) size 299x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 299x19 + text run at (51,0) width 299: "http://bugs.webkit.org/show_bug.cgi?id=11916" + LayoutText {#text} at (350,0) size 398x19 + text run at (350,0) width 398: " REGRESSION (SearchField): RTL search fields are mixed up" + LayoutText {#text} at (748,0) size 4x19 + text run at (748,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x66 LayoutTextControl {INPUT} at (0,0) size 156x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutFlexibleBox {DIV} at (3,3) size 150x16 @@ -30,8 +30,8 @@ LayoutBlockFlow {DIV} at (12,0) size 138x16 LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (0,118) size 784x20 - LayoutText {#text} at (0,0) size 38x19 - text run at (0,0) width 38: "PASS" + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS" layer at (23,47) size 138x16 LayoutBlockFlow {DIV} at (0,0) size 138x16 LayoutText {#text} at (12,0) size 126x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-vertical-alignment-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-vertical-alignment-expected.txt index 8b3156a4..bef36075a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-vertical-alignment-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/search/search-vertical-alignment-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 752x39 - text run at (0,0) width 752: "Test that search field text is vertically centered if the search field is taller than the text. In each of the following pairs of a" + LayoutText {#text} at (0,0) size 751x39 + text run at (0,0) width 751: "Test that search field text is vertically centered if the search field is taller than the text. In each of the following pairs of a" text run at (0,20) width 581: "search field and a text field, the vertical position of the text should be the same in both fields." LayoutNGBlockFlow {P} at (0,56) size 784x45 LayoutTextControl {INPUT} at (0,0) size 156x45 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] @@ -33,28 +33,28 @@ LayoutText {#text} at (0,0) size 0x0 layer at (11,79) size 137x16 LayoutBlockFlow {DIV} at (0,0) size 137x16 - LayoutText {#text} at (0,0) size 25x16 - text run at (0,0) width 25: "Text" + LayoutText {#text} at (0,0) size 24x16 + text run at (0,0) width 24: "Text" layer at (170,79) size 150x16 LayoutBlockFlow {DIV} at (2,14.50) size 150x16 - LayoutText {#text} at (0,0) size 25x16 - text run at (0,0) width 25: "Text" + LayoutText {#text} at (0,0) size 24x16 + text run at (0,0) width 24: "Text" layer at (11,127) size 137x16 backgroundClip at (11,129) size 137x12 clip at (11,129) size 137x12 LayoutBlockFlow {DIV} at (0,0) size 137x16 - LayoutText {#text} at (0,0) size 25x16 - text run at (0,0) width 25: "Text" + LayoutText {#text} at (0,0) size 24x16 + text run at (0,0) width 24: "Text" layer at (170,127) size 150x16 backgroundClip at (170,129) size 150x12 clip at (170,129) size 150x12 LayoutBlockFlow {DIV} at (2,0) size 150x16 - LayoutText {#text} at (0,0) size 25x16 - text run at (0,0) width 25: "Text" + LayoutText {#text} at (0,0) size 24x16 + text run at (0,0) width 24: "Text" layer at (11,163) size 137x16 backgroundClip at (11,167) size 137x8 clip at (11,167) size 137x8 LayoutBlockFlow {DIV} at (0,0) size 137x16 - LayoutText {#text} at (0,0) size 25x16 - text run at (0,0) width 25: "Text" + LayoutText {#text} at (0,0) size 24x16 + text run at (0,0) width 24: "Text" layer at (170,163) size 150x16 backgroundClip at (170,167) size 150x8 clip at (170,167) size 150x8 LayoutBlockFlow {DIV} at (2,-2) size 150x16 - LayoutText {#text} at (0,0) size 25x16 - text run at (0,0) width 25: "Text" + LayoutText {#text} at (0,0) size 24x16 + text run at (0,0) width 24: "Text" layer at (149,82) size 9x9 transparent LayoutBlockFlow {DIV} at (138,3.50) size 9x9 layer at (149,131) size 9x9 transparent
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select-popup/popup-menu-appearance-zoom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select-popup/popup-menu-appearance-zoom-expected.png index 37998c6..c5fb786 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select-popup/popup-menu-appearance-zoom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select-popup/popup-menu-appearance-zoom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label01-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label01-expected.txt index f987572..4465129a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label01-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label01-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 672x19 - text run at (0,0) width 672: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'" + LayoutText {#text} at (0,0) size 671x19 + text run at (0,0) width 671: "In the selection list below, the text 'The label for this element is \"1\"' should appear, and not the character '1'" LayoutBR {BR} at (671,0) size 0x0 LayoutMenuList {SELECT} at (0,20) size 200x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 198x18
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label02-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label02-expected.txt index fbd603b9..abd8fcf 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label02-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label02-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 299x19 - text run at (0,0) width 299: "With the label empty, the enclosing text is used." + LayoutText {#text} at (0,0) size 298x19 + text run at (0,0) width 298: "With the label empty, the enclosing text is used." LayoutBR {BR} at (298,0) size 0x0 LayoutMenuList {SELECT} at (0,20) size 324x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 322x18
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label05-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label05-expected.txt index 01f917c4..c6262264 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label05-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label05-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 667x19 - text run at (0,0) width 667: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box." + LayoutText {#text} at (0,0) size 666x19 + text run at (0,0) width 666: "In the list box below, the text \"This text should appear\" should be shown as the first entry into the list box." LayoutBR {BR} at (666,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 157x87 clip at (9,29) size 140x85
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label06-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label06-expected.txt index 09c6963..0024183 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label06-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/HTMLOptionElement_label06-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 718x19 text run at (0,0) width 718: "The select item below has a label specified, and no enclosed text. There should be no text shown in the select box." - LayoutBR {BR} at (717,0) size 0x0 + LayoutBR {BR} at (718,0) size 0x0 LayoutMenuList {SELECT} at (0,20) size 22x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 20x18 LayoutText (anonymous) at (4,1) size 4x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/basic-selects-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/basic-selects-expected.txt index 5a55629..55ad6c51 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/basic-selects-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/basic-selects-expected.txt
@@ -100,20 +100,20 @@ text run at (236,211) width 8: "b" LayoutBR {BR} at (244,211) size 0x0 LayoutBR {BR} at (1,237) size 0x0 - LayoutText {#text} at (1,260) size 480x19 - text run at (1,260) width 480: "Height larger than font-size, button should grow, text baseline should center:" - LayoutMenuList {SELECT} at (480.67,255) size 40x30 [bgcolor=#DDDDDD] [border: (1px solid #A9A9A9)] + LayoutText {#text} at (1,260) size 479x19 + text run at (1,260) width 479: "Height larger than font-size, button should grow, text baseline should center:" + LayoutMenuList {SELECT} at (480,255) size 40x30 [bgcolor=#DDDDDD] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,6) size 38x18 LayoutText (anonymous) at (4,1) size 18x16 text run at (4,1) width 18: "foo" - LayoutText {#text} at (520,260) size 8x19 - text run at (520,260) width 8: "a" - LayoutMenuList {SELECT} at (527.67,255) size 40x30 [color=#808080] [bgcolor=#DDDDDD] [border: (1px solid #A9A9A9)] + LayoutText {#text} at (520,260) size 7x19 + text run at (520,260) width 7: "a" + LayoutMenuList {SELECT} at (527,255) size 40x30 [color=#808080] [bgcolor=#DDDDDD] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,6) size 38x18 LayoutText (anonymous) at (4,1) size 4x16 text run at (4,1) width 4: " " - LayoutText {#text} at (567,260) size 9x19 - text run at (567,260) width 9: "b" + LayoutText {#text} at (567,260) size 8x19 + text run at (567,260) width 8: "b" LayoutBR {BR} at (575,260) size 0x0 LayoutBR {BR} at (1,283) size 0x0 LayoutText {#text} at (1,301) size 486x19 @@ -161,7 +161,7 @@ LayoutBR {BR} at (222,433) size 0x0 LayoutText {#text} at (1,461) size 286x19 text run at (1,461) width 286: "Styled select control with large border-radius:" - LayoutBR {BR} at (286,461) size 0x0 + LayoutBR {BR} at (287,461) size 0x0 LayoutMenuList {SELECT} at (1,479) size 221x40 [bgcolor=#33CCFF] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (11,11) size 199x18 LayoutText (anonymous) at (4,1) size 78x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/disabled-select-change-index-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/disabled-select-change-index-expected.txt index 699a3ff..6e2d870 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/disabled-select-change-index-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/disabled-select-change-index-expected.txt
@@ -5,81 +5,81 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutMenuList {SELECT} at (0,0) size 58x20 [color=#808080] [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 56x18 - LayoutText (anonymous) at (4,1) size 35x16 - text run at (4,1) width 35: "PASS" + LayoutText (anonymous) at (4,1) size 36x16 + text run at (4,1) width 36: "PASS" LayoutBR {BR} at (58,15) size 0x0 LayoutMenuList {SELECT} at (0,20) size 58x20 [color=#808080] [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 56x18 - LayoutText (anonymous) at (4,1) size 35x16 - text run at (4,1) width 35: "PASS" + LayoutText (anonymous) at (4,1) size 36x16 + text run at (4,1) width 36: "PASS" LayoutBR {BR} at (58,35) size 0x0 LayoutMenuList {SELECT} at (0,40) size 58x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 56x18 - LayoutText (anonymous) at (4,1) size 35x16 - text run at (4,1) width 35: "PASS" + LayoutText (anonymous) at (4,1) size 36x16 + text run at (4,1) width 36: "PASS" LayoutBR {BR} at (58,55) size 0x0 LayoutMenuList {SELECT} at (0,60) size 58x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 56x18 - LayoutText (anonymous) at (4,1) size 35x16 - text run at (4,1) width 35: "PASS" + LayoutText (anonymous) at (4,1) size 36x16 + text run at (4,1) width 36: "PASS" LayoutBR {BR} at (58,75) size 0x0 - LayoutBR {BR} at (56,112) size 0x0 - LayoutBR {BR} at (56,148) size 0x0 - LayoutBR {BR} at (56,184) size 0x0 - LayoutBR {BR} at (56,220) size 0x0 - LayoutText {#text} at (0,224) size 485x19 - text run at (0,224) width 485: "PASS: sel1 correctly set to selectedIndex 1 by sel1.options[1].selected = true." + LayoutBR {BR} at (57,112) size 0x0 + LayoutBR {BR} at (57,148) size 0x0 + LayoutBR {BR} at (57,184) size 0x0 + LayoutBR {BR} at (57,220) size 0x0 + LayoutText {#text} at (0,224) size 484x19 + text run at (0,224) width 484: "PASS: sel1 correctly set to selectedIndex 1 by sel1.options[1].selected = true." LayoutBR {BR} at (484,224) size 0x0 - LayoutText {#text} at (0,244) size 437x19 - text run at (0,244) width 437: "PASS: sel2 correctly set to selectedIndex 1 by sel2.selectedIndex = 1." + LayoutText {#text} at (0,244) size 436x19 + text run at (0,244) width 436: "PASS: sel2 correctly set to selectedIndex 1 by sel2.selectedIndex = 1." LayoutBR {BR} at (436,244) size 0x0 - LayoutText {#text} at (0,264) size 485x19 - text run at (0,264) width 485: "PASS: sel3 correctly set to selectedIndex 1 by sel3.options[1].selected = true." + LayoutText {#text} at (0,264) size 484x19 + text run at (0,264) width 484: "PASS: sel3 correctly set to selectedIndex 1 by sel3.options[1].selected = true." LayoutBR {BR} at (484,264) size 0x0 - LayoutText {#text} at (0,284) size 437x19 - text run at (0,284) width 437: "PASS: sel4 correctly set to selectedIndex 1 by sel4.selectedIndex = 1." + LayoutText {#text} at (0,284) size 436x19 + text run at (0,284) width 436: "PASS: sel4 correctly set to selectedIndex 1 by sel4.selectedIndex = 1." LayoutBR {BR} at (436,284) size 0x0 - LayoutText {#text} at (0,304) size 485x19 - text run at (0,304) width 485: "PASS: sel5 correctly set to selectedIndex 1 by sel5.options[1].selected = true." + LayoutText {#text} at (0,304) size 484x19 + text run at (0,304) width 484: "PASS: sel5 correctly set to selectedIndex 1 by sel5.options[1].selected = true." LayoutBR {BR} at (484,304) size 0x0 - LayoutText {#text} at (0,324) size 437x19 - text run at (0,324) width 437: "PASS: sel6 correctly set to selectedIndex 1 by sel6.selectedIndex = 1." + LayoutText {#text} at (0,324) size 436x19 + text run at (0,324) width 436: "PASS: sel6 correctly set to selectedIndex 1 by sel6.selectedIndex = 1." LayoutBR {BR} at (436,324) size 0x0 - LayoutText {#text} at (0,344) size 485x19 - text run at (0,344) width 485: "PASS: sel7 correctly set to selectedIndex 1 by sel7.options[1].selected = true." + LayoutText {#text} at (0,344) size 484x19 + text run at (0,344) width 484: "PASS: sel7 correctly set to selectedIndex 1 by sel7.options[1].selected = true." LayoutBR {BR} at (484,344) size 0x0 - LayoutText {#text} at (0,364) size 437x19 - text run at (0,364) width 437: "PASS: sel8 correctly set to selectedIndex 1 by sel8.selectedIndex = 1." + LayoutText {#text} at (0,364) size 436x19 + text run at (0,364) width 436: "PASS: sel8 correctly set to selectedIndex 1 by sel8.selectedIndex = 1." LayoutBR {BR} at (436,364) size 0x0 -layer at (8,88) size 56x36 clip at (9,89) size 39x34 - LayoutListBox {SELECT} at (0,80) size 56.02x36 [color=#808080] [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] - LayoutBlockFlow {OPTION} at (1,1) size 39.02x17 +layer at (8,88) size 57x36 clip at (9,89) size 40x34 + LayoutListBox {SELECT} at (0,80) size 57x36 [color=#808080] [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] + LayoutBlockFlow {OPTION} at (1,1) size 40x17 LayoutText {#text} at (2,0) size 28x16 text run at (2,0) width 28: "FAIL" - LayoutBlockFlow {OPTION} at (1,18) size 39.02x17 [bgcolor=#999999] - LayoutText {#text} at (2,0) size 35x16 - text run at (2,0) width 35: "PASS" -layer at (8,124) size 56x36 clip at (9,125) size 39x34 - LayoutListBox {SELECT} at (0,116) size 56.02x36 [color=#808080] [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] - LayoutBlockFlow {OPTION} at (1,1) size 39.02x17 + LayoutBlockFlow {OPTION} at (1,18) size 40x17 [bgcolor=#999999] + LayoutText {#text} at (2,0) size 36x16 + text run at (2,0) width 36: "PASS" +layer at (8,124) size 57x36 clip at (9,125) size 40x34 + LayoutListBox {SELECT} at (0,116) size 57x36 [color=#808080] [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] + LayoutBlockFlow {OPTION} at (1,1) size 40x17 LayoutText {#text} at (2,0) size 28x16 text run at (2,0) width 28: "FAIL" - LayoutBlockFlow {OPTION} at (1,18) size 39.02x17 [bgcolor=#999999] - LayoutText {#text} at (2,0) size 35x16 - text run at (2,0) width 35: "PASS" -layer at (8,160) size 56x36 clip at (9,161) size 39x34 - LayoutListBox {SELECT} at (0,152) size 56.02x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] - LayoutBlockFlow {OPTION} at (1,1) size 39.02x17 + LayoutBlockFlow {OPTION} at (1,18) size 40x17 [bgcolor=#999999] + LayoutText {#text} at (2,0) size 36x16 + text run at (2,0) width 36: "PASS" +layer at (8,160) size 57x36 clip at (9,161) size 40x34 + LayoutListBox {SELECT} at (0,152) size 57x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] + LayoutBlockFlow {OPTION} at (1,1) size 40x17 LayoutText {#text} at (2,0) size 28x16 text run at (2,0) width 28: "FAIL" - LayoutBlockFlow {OPTION} at (1,18) size 39.02x17 [color=#808080] [bgcolor=#999999] - LayoutText {#text} at (2,0) size 35x16 - text run at (2,0) width 35: "PASS" -layer at (8,196) size 56x36 clip at (9,197) size 39x34 - LayoutListBox {SELECT} at (0,188) size 56.02x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] - LayoutBlockFlow {OPTION} at (1,1) size 39.02x17 + LayoutBlockFlow {OPTION} at (1,18) size 40x17 [color=#808080] [bgcolor=#999999] + LayoutText {#text} at (2,0) size 36x16 + text run at (2,0) width 36: "PASS" +layer at (8,196) size 57x36 clip at (9,197) size 40x34 + LayoutListBox {SELECT} at (0,188) size 57x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] + LayoutBlockFlow {OPTION} at (1,1) size 40x17 LayoutText {#text} at (2,0) size 28x16 text run at (2,0) width 28: "FAIL" - LayoutBlockFlow {OPTION} at (1,18) size 39.02x17 [color=#808080] [bgcolor=#999999] - LayoutText {#text} at (2,0) size 35x16 - text run at (2,0) width 35: "PASS" + LayoutBlockFlow {OPTION} at (1,18) size 40x17 [color=#808080] [bgcolor=#999999] + LayoutText {#text} at (2,0) size 36x16 + text run at (2,0) width 36: "PASS"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.png index 6ced729..e566843 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.txt index 09c2dca..daf490a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/listbox-scrollbar-incremental-load-expected.txt
@@ -4,14 +4,14 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 764x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=13500" - LayoutText {#text} at (352,0) size 764x39 - text run at (352,0) width 412: " REGRESSION: Listbox scrollbar does not reflect actual scrolled" + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 765x39 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13500" + LayoutText {#text} at (352,0) size 765x39 + text run at (352,0) width 413: " REGRESSION: Listbox scrollbar does not reflect actual scrolled" text run at (0,20) width 319: "position when selected option is added after layout" LayoutText {#text} at (319,20) size 4x19 text run at (319,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-basic-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-basic-expected.txt index 34d1de2..8b6119e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-basic-expected.txt
@@ -330,8 +330,8 @@ LayoutText {#text} at (2,0) size 44x16 text run at (2,0) width 44: "Item 10" LayoutBlockFlow {OPTION} at (1,171) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 43x16 - text run at (2,0) width 43: "Item 11" + LayoutText {#text} at (2,0) size 44x16 + text run at (2,0) width 44: "Item 11" LayoutBlockFlow {OPTION} at (1,188) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 44x16 text run at (2,0) width 44: "Item 12" @@ -627,35 +627,35 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 109" LayoutBlockFlow {OPTION} at (1,1854) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 110" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 110" LayoutBlockFlow {OPTION} at (1,1871) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 50x16 text run at (2,0) width 50: "Item 111" LayoutBlockFlow {OPTION} at (1,1888) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 112" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 112" LayoutBlockFlow {OPTION} at (1,1905) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 113" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 113" LayoutBlockFlow {OPTION} at (1,1922) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 114" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 114" LayoutBlockFlow {OPTION} at (1,1939) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 115" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 115" LayoutBlockFlow {OPTION} at (1,1956) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 116" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 116" LayoutBlockFlow {OPTION} at (1,1973) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 117" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 117" LayoutBlockFlow {OPTION} at (1,1990) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 118" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 118" LayoutBlockFlow {OPTION} at (1,2007) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 119" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 119" LayoutBlockFlow {OPTION} at (1,2024) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 120" @@ -930,8 +930,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 210" LayoutBlockFlow {OPTION} at (1,3571) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 211" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 211" LayoutBlockFlow {OPTION} at (1,3588) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 212" @@ -1230,8 +1230,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 310" LayoutBlockFlow {OPTION} at (1,5271) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 311" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 311" LayoutBlockFlow {OPTION} at (1,5288) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 312" @@ -1530,8 +1530,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 410" LayoutBlockFlow {OPTION} at (1,6971) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 411" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 411" LayoutBlockFlow {OPTION} at (1,6988) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 412" @@ -1830,8 +1830,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 510" LayoutBlockFlow {OPTION} at (1,8671) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 511" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 511" LayoutBlockFlow {OPTION} at (1,8688) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 512" @@ -2130,8 +2130,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 610" LayoutBlockFlow {OPTION} at (1,10371) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 611" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 611" LayoutBlockFlow {OPTION} at (1,10388) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 612" @@ -2430,8 +2430,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 710" LayoutBlockFlow {OPTION} at (1,12071) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 711" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 711" LayoutBlockFlow {OPTION} at (1,12088) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 712" @@ -2730,8 +2730,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 810" LayoutBlockFlow {OPTION} at (1,13771) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 811" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 811" LayoutBlockFlow {OPTION} at (1,13788) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 812" @@ -3030,8 +3030,8 @@ LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 910" LayoutBlockFlow {OPTION} at (1,15471) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 50x16 - text run at (2,0) width 50: "Item 911" + LayoutText {#text} at (2,0) size 51x16 + text run at (2,0) width 51: "Item 911" LayoutBlockFlow {OPTION} at (1,15488) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 51x16 text run at (2,0) width 51: "Item 912" @@ -3330,8 +3330,8 @@ LayoutText {#text} at (2,0) size 58x16 text run at (2,0) width 58: "Item 1010" LayoutBlockFlow {OPTION} at (1,17171) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1011" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1011" LayoutBlockFlow {OPTION} at (1,17188) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 58x16 text run at (2,0) width 58: "Item 1012" @@ -3597,35 +3597,35 @@ LayoutText {#text} at (2,0) size 58x16 text run at (2,0) width 58: "Item 1099" LayoutBlockFlow {OPTION} at (1,18684) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1100" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1100" LayoutBlockFlow {OPTION} at (1,18701) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1101" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1101" LayoutBlockFlow {OPTION} at (1,18718) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1102" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1102" LayoutBlockFlow {OPTION} at (1,18735) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1103" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1103" LayoutBlockFlow {OPTION} at (1,18752) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1104" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1104" LayoutBlockFlow {OPTION} at (1,18769) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1105" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1105" LayoutBlockFlow {OPTION} at (1,18786) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1106" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1106" LayoutBlockFlow {OPTION} at (1,18803) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1107" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1107" LayoutBlockFlow {OPTION} at (1,18820) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1108" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1108" LayoutBlockFlow {OPTION} at (1,18837) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1109" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1109" LayoutBlockFlow {OPTION} at (1,18854) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 57x16 text run at (2,0) width 57: "Item 1110" @@ -3657,245 +3657,245 @@ LayoutText {#text} at (2,0) size 57x16 text run at (2,0) width 57: "Item 1119" LayoutBlockFlow {OPTION} at (1,19024) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1120" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1120" LayoutBlockFlow {OPTION} at (1,19041) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1121" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1121" LayoutBlockFlow {OPTION} at (1,19058) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1122" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1122" LayoutBlockFlow {OPTION} at (1,19075) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1123" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1123" LayoutBlockFlow {OPTION} at (1,19092) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1124" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1124" LayoutBlockFlow {OPTION} at (1,19109) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1125" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1125" LayoutBlockFlow {OPTION} at (1,19126) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1126" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1126" LayoutBlockFlow {OPTION} at (1,19143) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1127" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1127" LayoutBlockFlow {OPTION} at (1,19160) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1128" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1128" LayoutBlockFlow {OPTION} at (1,19177) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1129" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1129" LayoutBlockFlow {OPTION} at (1,19194) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1130" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1130" LayoutBlockFlow {OPTION} at (1,19211) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1131" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1131" LayoutBlockFlow {OPTION} at (1,19228) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1132" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1132" LayoutBlockFlow {OPTION} at (1,19245) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1133" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1133" LayoutBlockFlow {OPTION} at (1,19262) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1134" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1134" LayoutBlockFlow {OPTION} at (1,19279) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1135" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1135" LayoutBlockFlow {OPTION} at (1,19296) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1136" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1136" LayoutBlockFlow {OPTION} at (1,19313) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1137" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1137" LayoutBlockFlow {OPTION} at (1,19330) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1138" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1138" LayoutBlockFlow {OPTION} at (1,19347) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1139" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1139" LayoutBlockFlow {OPTION} at (1,19364) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1140" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1140" LayoutBlockFlow {OPTION} at (1,19381) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1141" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1141" LayoutBlockFlow {OPTION} at (1,19398) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1142" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1142" LayoutBlockFlow {OPTION} at (1,19415) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1143" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1143" LayoutBlockFlow {OPTION} at (1,19432) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1144" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1144" LayoutBlockFlow {OPTION} at (1,19449) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1145" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1145" LayoutBlockFlow {OPTION} at (1,19466) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1146" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1146" LayoutBlockFlow {OPTION} at (1,19483) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1147" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1147" LayoutBlockFlow {OPTION} at (1,19500) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1148" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1148" LayoutBlockFlow {OPTION} at (1,19517) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1149" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1149" LayoutBlockFlow {OPTION} at (1,19534) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1150" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1150" LayoutBlockFlow {OPTION} at (1,19551) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1151" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1151" LayoutBlockFlow {OPTION} at (1,19568) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1152" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1152" LayoutBlockFlow {OPTION} at (1,19585) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1153" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1153" LayoutBlockFlow {OPTION} at (1,19602) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1154" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1154" LayoutBlockFlow {OPTION} at (1,19619) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1155" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1155" LayoutBlockFlow {OPTION} at (1,19636) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1156" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1156" LayoutBlockFlow {OPTION} at (1,19653) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1157" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1157" LayoutBlockFlow {OPTION} at (1,19670) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1158" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1158" LayoutBlockFlow {OPTION} at (1,19687) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1159" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1159" LayoutBlockFlow {OPTION} at (1,19704) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1160" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1160" LayoutBlockFlow {OPTION} at (1,19721) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1161" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1161" LayoutBlockFlow {OPTION} at (1,19738) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1162" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1162" LayoutBlockFlow {OPTION} at (1,19755) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1163" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1163" LayoutBlockFlow {OPTION} at (1,19772) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1164" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1164" LayoutBlockFlow {OPTION} at (1,19789) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1165" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1165" LayoutBlockFlow {OPTION} at (1,19806) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1166" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1166" LayoutBlockFlow {OPTION} at (1,19823) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1167" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1167" LayoutBlockFlow {OPTION} at (1,19840) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1168" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1168" LayoutBlockFlow {OPTION} at (1,19857) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1169" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1169" LayoutBlockFlow {OPTION} at (1,19874) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1170" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1170" LayoutBlockFlow {OPTION} at (1,19891) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1171" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1171" LayoutBlockFlow {OPTION} at (1,19908) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1172" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1172" LayoutBlockFlow {OPTION} at (1,19925) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1173" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1173" LayoutBlockFlow {OPTION} at (1,19942) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1174" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1174" LayoutBlockFlow {OPTION} at (1,19959) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1175" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1175" LayoutBlockFlow {OPTION} at (1,19976) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1176" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1176" LayoutBlockFlow {OPTION} at (1,19993) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1177" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1177" LayoutBlockFlow {OPTION} at (1,20010) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1178" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1178" LayoutBlockFlow {OPTION} at (1,20027) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1179" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1179" LayoutBlockFlow {OPTION} at (1,20044) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1180" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1180" LayoutBlockFlow {OPTION} at (1,20061) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1181" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1181" LayoutBlockFlow {OPTION} at (1,20078) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1182" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1182" LayoutBlockFlow {OPTION} at (1,20095) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1183" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1183" LayoutBlockFlow {OPTION} at (1,20112) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1184" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1184" LayoutBlockFlow {OPTION} at (1,20129) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1185" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1185" LayoutBlockFlow {OPTION} at (1,20146) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1186" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1186" LayoutBlockFlow {OPTION} at (1,20163) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1187" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1187" LayoutBlockFlow {OPTION} at (1,20180) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1188" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1188" LayoutBlockFlow {OPTION} at (1,20197) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1189" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1189" LayoutBlockFlow {OPTION} at (1,20214) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1190" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1190" LayoutBlockFlow {OPTION} at (1,20231) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1191" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1191" LayoutBlockFlow {OPTION} at (1,20248) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1192" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1192" LayoutBlockFlow {OPTION} at (1,20265) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1193" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1193" LayoutBlockFlow {OPTION} at (1,20282) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1194" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1194" LayoutBlockFlow {OPTION} at (1,20299) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1195" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1195" LayoutBlockFlow {OPTION} at (1,20316) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1196" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1196" LayoutBlockFlow {OPTION} at (1,20333) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1197" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1197" LayoutBlockFlow {OPTION} at (1,20350) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1198" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1198" LayoutBlockFlow {OPTION} at (1,20367) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1199" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1199" LayoutBlockFlow {OPTION} at (1,20384) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 58x16 text run at (2,0) width 58: "Item 1200" @@ -3930,8 +3930,8 @@ LayoutText {#text} at (2,0) size 58x16 text run at (2,0) width 58: "Item 1210" LayoutBlockFlow {OPTION} at (1,20571) size 183x17 [color=#323232] [bgcolor=#C8C8C8] - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Item 1211" + LayoutText {#text} at (2,0) size 58x16 + text run at (2,0) width 58: "Item 1211" LayoutBlockFlow {OPTION} at (1,20588) size 183x17 [color=#323232] [bgcolor=#C8C8C8] LayoutText {#text} at (2,0) size 58x16 text run at (2,0) width 58: "Item 1212"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.png index 14a717a..af750e9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.txt index 0f98b00..2c527ae 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-none-expected.txt
@@ -6,18 +6,18 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 117x19 text run at (0,0) width 117: "Rendering test for " - LayoutInline {I} at (0,0) size 780x39 - LayoutInline {A} at (0,0) size 407x19 [color=#0000EE] - LayoutText {#text} at (117,0) size 407x19 - text run at (117,0) width 407: "https://bugs.chromium.org/p/chromium/issues/detail?id=626278" - LayoutText {#text} at (523,0) size 780x39 - text run at (523,0) width 257: " Regression: HTML Select's text appears" + LayoutInline {I} at (0,0) size 782x39 + LayoutInline {A} at (0,0) size 408x19 [color=#0000EE] + LayoutText {#text} at (117,0) size 408x19 + text run at (117,0) width 408: "https://bugs.chromium.org/p/chromium/issues/detail?id=626278" + LayoutText {#text} at (525,0) size 782x39 + text run at (525,0) width 257: " Regression: HTML Select's text appears" text run at (0,20) width 231: "chopped if appearance is set to none" LayoutText {#text} at (231,20) size 4x19 text run at (231,20) width 4: "." LayoutNGBlockFlow (anonymous) at (0,56) size 784x42 - LayoutMenuList {SELECT} at (0,0) size 27x42 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] - LayoutNGBlockFlow (anonymous) at (1,1) size 25x40 - LayoutText (anonymous) at (0,12) size 25x16 - text run at (0,12) width 25: "Test" + LayoutMenuList {SELECT} at (0,0) size 26x42 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] + LayoutNGBlockFlow (anonymous) at (1,1) size 24x40 + LayoutText (anonymous) at (0,12) size 24x16 + text run at (0,12) width 24: "Test" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-rtl-expected.txt index f3f6b42..ec8e944 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-rtl-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-appearance-rtl-expected.txt
@@ -67,8 +67,8 @@ text run at (4,1) width 91 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (0,347) size 784x20 - LayoutText {#text} at (0,0) size 694x19 - text run at (0,0) width 694: "Verify that the alignment and writing direction of each selected item matches the one below the pop-up button." + LayoutText {#text} at (0,0) size 693x19 + text run at (0,0) width 693: "Verify that the alignment and writing direction of each selected item matches the one below the pop-up button." layer at (8,268) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,252) size 784x2 [border: (1px inset #EEEEEE)] layer at (8,345) size 784x2 clip at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-clip-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-clip-expected.txt index 6bb8415..10ae8ad 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-clip-expected.txt
@@ -10,8 +10,8 @@ LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] LayoutText {#text} at (117,0) size 301x19 text run at (117,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=15156" - LayoutText {#text} at (417,0) size 766x39 - text run at (417,0) width 349: " REGRESSION (r24594-r24668): The bottom of styled" + LayoutText {#text} at (418,0) size 766x39 + text run at (418,0) width 348: " REGRESSION (r24594-r24668): The bottom of styled" text run at (0,20) width 215: "<select> button text is clipped out" LayoutText {#text} at (215,20) size 4x19 text run at (215,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-deselect-update-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-deselect-update-expected.txt index 4b56911..e363bf9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-deselect-update-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-deselect-update-expected.txt
@@ -3,10 +3,10 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 72x19 - text run at (0,0) width 72: "Test result: " - LayoutMenuList {SELECT} at (71.89,0) size 58x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] + LayoutText {#text} at (0,0) size 71x19 + text run at (0,0) width 71: "Test result: " + LayoutMenuList {SELECT} at (71,0) size 58x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 56x18 - LayoutText (anonymous) at (4,1) size 35x16 - text run at (4,1) width 35: "PASS" + LayoutText (anonymous) at (4,1) size 36x16 + text run at (4,1) width 36: "PASS" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-narrow-width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-narrow-width-expected.txt index 5d070b1f..c96776f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-narrow-width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-narrow-width-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 498x19 - text run at (0,0) width 498: "This tests that select elements with a narrow width (1px) are rendered correctly." + LayoutText {#text} at (0,0) size 497x19 + text run at (0,0) width 497: "This tests that select elements with a narrow width (1px) are rendered correctly." LayoutBR {BR} at (497,0) size 0x0 LayoutMenuList {SELECT} at (0,20) size 2x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 20x18
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.png index f6c553c..9e44d26 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.txt index f73f7ee..f4c8749 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/menulist-option-wrap-expected.txt
@@ -4,25 +4,25 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 574x19 - LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 301x19 - text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=11362" - LayoutText {#text} at (351,0) size 274x19 - text run at (351,0) width 274: " Native popup with size=\"1\" wraps options" - LayoutText {#text} at (624,0) size 5x19 - text run at (624,0) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 572x19 + LayoutInline {A} at (0,0) size 299x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 299x19 + text run at (51,0) width 299: "http://bugs.webkit.org/show_bug.cgi?id=11362" + LayoutText {#text} at (350,0) size 273x19 + text run at (350,0) width 273: " Native popup with size=\"1\" wraps options" + LayoutText {#text} at (623,0) size 4x19 + text run at (623,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 35x19 text run at (0,0) width 35: "With " - LayoutInline {TT} at (0,0) size 65x16 - LayoutText {#text} at (34,3) size 65x16 - text run at (34,3) width 65: "size=\"1\"" - LayoutText {#text} at (98,0) size 9x19 - text run at (98,0) width 9: ": " - LayoutMenuList {SELECT} at (106.36,1) size 100x18 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] + LayoutInline {TT} at (0,0) size 64x16 + LayoutText {#text} at (35,3) size 64x16 + text run at (35,3) width 64: "size=\"1\"" + LayoutText {#text} at (99,0) size 8x19 + text run at (99,0) width 8: ": " + LayoutMenuList {SELECT} at (107,1) size 100x18 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 98x16 LayoutText (anonymous) at (0,0) size 189x16 text run at (0,0) width 189: "Very long option that does not fit" @@ -30,12 +30,12 @@ LayoutNGBlockFlow {P} at (0,72) size 784x20 LayoutText {#text} at (0,0) size 55x19 text run at (0,0) width 55: "Without " - LayoutInline {TT} at (0,0) size 33x16 - LayoutText {#text} at (54,3) size 33x16 - text run at (54,3) width 33: "size" - LayoutText {#text} at (86,0) size 9x19 - text run at (86,0) width 9: ": " - LayoutMenuList {SELECT} at (94.36,1) size 100x18 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] + LayoutInline {TT} at (0,0) size 32x16 + LayoutText {#text} at (55,3) size 32x16 + text run at (55,3) width 32: "size" + LayoutText {#text} at (87,0) size 8x19 + text run at (87,0) width 8: ": " + LayoutMenuList {SELECT} at (95,1) size 100x18 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 98x16 LayoutText (anonymous) at (0,0) size 189x16 text run at (0,0) width 189: "Very long option that does not fit"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-index-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-index-expected.txt index 1722da4..599a033 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-index-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-index-expected.txt
@@ -8,8 +8,8 @@ text run at (0,0) width 741: "This test makes sure we don't crash when trying to get the index of an option element that has no corresponding select" text run at (0,20) width 53: "element." LayoutNGBlockFlow {DIV} at (0,40) size 784x40 - LayoutText {#text} at (0,0) size 77x19 - text run at (0,0) width 77: "Test Passed." + LayoutText {#text} at (0,0) size 76x19 + text run at (0,0) width 76: "Test Passed." LayoutBR {BR} at (76,0) size 0x0 LayoutText {#text} at (0,20) size 370x19 text run at (0,20) width 370: "Index for option element with no corresponding select is: 0"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.png index bbe17bd..036dd32 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.txt index 1c8ae448..6d4238b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-script-expected.txt
@@ -3,14 +3,14 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 340x19 - text run at (0,0) width 340: "TEST PASSED: If the popup menu only says \"Text\"." - LayoutBR {BR} at (339,0) size 0x0 - LayoutText {#text} at (0,20) size 419x19 - text run at (0,20) width 419: "TEST FAILED: If the popup menu says \"document.write('Text')\"." - LayoutBR {BR} at (418,20) size 0x0 - LayoutMenuList {SELECT} at (0,40) size 47x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] - LayoutNGBlockFlow (anonymous) at (1,1) size 45x18 - LayoutText (anonymous) at (4,1) size 25x16 - text run at (4,1) width 25: "Text" + LayoutText {#text} at (0,0) size 338x19 + text run at (0,0) width 338: "TEST PASSED: If the popup menu only says \"Text\"." + LayoutBR {BR} at (338,0) size 0x0 + LayoutText {#text} at (0,20) size 417x19 + text run at (0,20) width 417: "TEST FAILED: If the popup menu says \"document.write('Text')\"." + LayoutBR {BR} at (417,20) size 0x0 + LayoutMenuList {SELECT} at (0,40) size 46x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] + LayoutNGBlockFlow (anonymous) at (1,1) size 44x18 + LayoutText (anonymous) at (4,1) size 24x16 + text run at (4,1) width 24: "Text" LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.png index 86d5350..67d69464 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.txt index c28ffeb..ab16b51 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.txt
@@ -7,9 +7,9 @@ LayoutText {#text} at (0,0) size 403x19 text run at (0,0) width 403: "All of these selects should have the same amount of whitespace." LayoutNGBlockFlow (anonymous) at (0,36) size 784x282 - LayoutText {#text} at (0,51) size 70x19 - text run at (0,51) width 70: "Five Tabs: " - LayoutBR {BR} at (147,51) size 0x0 + LayoutText {#text} at (0,51) size 69x19 + text run at (0,51) width 69: "Five Tabs: " + LayoutBR {BR} at (146,51) size 0x0 LayoutBR {BR} at (0,71) size 0x0 LayoutText {#text} at (0,142) size 84x19 text run at (0,142) width 84: "Five Spaces: " @@ -23,28 +23,28 @@ text run at (4,1) width 73: "Five Spaces" LayoutBR {BR} at (393,182) size 0x0 LayoutBR {BR} at (0,202) size 0x0 - LayoutText {#text} at (0,222) size 284x19 - text run at (0,222) width 284: "Five Tabs (with leading/trailing whitespace): " - LayoutMenuList {SELECT} at (283.59,222) size 79x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] - LayoutNGBlockFlow (anonymous) at (1,1) size 77x18 - LayoutText (anonymous) at (4,1) size 57x16 - text run at (4,1) width 57: "Five Tabs" - LayoutBR {BR} at (362,222) size 0x0 + LayoutText {#text} at (0,222) size 283x19 + text run at (0,222) width 283: "Five Tabs (with leading/trailing whitespace): " + LayoutMenuList {SELECT} at (283,222) size 78x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] + LayoutNGBlockFlow (anonymous) at (1,1) size 76x18 + LayoutText (anonymous) at (4,1) size 56x16 + text run at (4,1) width 56: "Five Tabs" + LayoutBR {BR} at (361,222) size 0x0 LayoutBR {BR} at (0,242) size 0x0 LayoutText {#text} at (0,262) size 126x19 text run at (0,262) width 126: "Mixed Whitespace: " - LayoutMenuList {SELECT} at (125.72,262) size 79x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] - LayoutNGBlockFlow (anonymous) at (1,1) size 77x18 - LayoutText (anonymous) at (4,1) size 57x16 - text run at (4,1) width 57: "Five Tabs" + LayoutMenuList {SELECT} at (126,262) size 78x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] + LayoutNGBlockFlow (anonymous) at (1,1) size 76x18 + LayoutText (anonymous) at (4,1) size 56x16 + text run at (4,1) width 56: "Five Tabs" LayoutText {#text} at (0,0) size 0x0 -layer at (78,44) size 77x70 clip at (79,45) size 60x68 - LayoutListBox {SELECT} at (69.59,0) size 77.53x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] - LayoutBlockFlow {OPTION} at (1,1) size 60.53x17 - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Five Tabs" -layer at (92,135) size 78x70 clip at (93,136) size 61x68 - LayoutListBox {SELECT} at (84,91) size 77.53x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] - LayoutBlockFlow {OPTION} at (1,1) size 60.53x17 - LayoutText {#text} at (2,0) size 57x16 - text run at (2,0) width 57: "Five Tabs" +layer at (77,44) size 77x70 clip at (78,45) size 60x68 + LayoutListBox {SELECT} at (69,0) size 77x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] + LayoutBlockFlow {OPTION} at (1,1) size 60x17 + LayoutText {#text} at (2,0) size 56x16 + text run at (2,0) width 56: "Five Tabs" +layer at (92,135) size 77x70 clip at (93,136) size 60x68 + LayoutListBox {SELECT} at (84,91) size 77x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] + LayoutBlockFlow {OPTION} at (1,1) size 60x17 + LayoutText {#text} at (2,0) size 56x16 + text run at (2,0) width 56: "Five Tabs"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-text-clip-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-text-clip-expected.txt index 731c45f5..4fed28c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-text-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-text-clip-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x600 LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 - LayoutText {#text} at (0,0) size 697x19 - text run at (0,0) width 697: "This tests that the option text is clipped properly, and doesn't spill over into the arrow part of the popup control." + LayoutText {#text} at (0,0) size 696x19 + text run at (0,0) width 696: "This tests that the option text is clipped properly, and doesn't spill over into the arrow part of the popup control." LayoutBR {BR} at (696,0) size 0x0 LayoutMenuList {SELECT} at (0,20) size 150x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 148x18
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.png index 1da9857..12f74b4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.txt index e734718..0a229d90 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-change-listbox-size-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 784x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=12986" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=12986" LayoutText {#text} at (352,0) size 784x39 text run at (352,0) width 432: " REGRESSION(NativeListBox): Listboxes not updated when resized" text run at (0,20) width 77: "dynamically"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.png index 1302801..13af574 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.txt index 9793cd4..fbf8ad7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-disabled-appearance-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 653x19 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=12345" - LayoutText {#text} at (352,0) size 352x19 - text run at (352,0) width 352: " REGRESSION: Disabled pop-up text is not grayed out" - LayoutText {#text} at (703,0) size 5x19 - text run at (703,0) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 652x19 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=12345" + LayoutText {#text} at (352,0) size 351x19 + text run at (352,0) width 351: " REGRESSION: Disabled pop-up text is not grayed out" + LayoutText {#text} at (703,0) size 4x19 + text run at (703,0) width 4: "." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutMenuList {SELECT} at (0,0) size 162x20 [color=#808080] [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 160x18
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.png index 2cfc56c8..708c90f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.txt index c856f33..a9eec3df 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-display-none-style-resolve-expected.txt
@@ -4,17 +4,17 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 770x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=13896" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13896" LayoutText {#text} at (352,0) size 770x39 text run at (352,0) width 418: " REGRESSION (NativePopup): Reproductible crasher on Google" text run at (0,20) width 123: "Coop control panel" - LayoutText {#text} at (122,20) size 5x19 - text run at (122,20) width 5: "." + LayoutText {#text} at (123,20) size 4x19 + text run at (123,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 180x19 text run at (0,0) width 180: "No crash means SUCCESS."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.png index 6ef7662..c80bd18 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.txt index dfc0149..665d26d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-item-background-clip-expected.txt
@@ -4,12 +4,12 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " LayoutInline {I} at (0,0) size 771x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=12364" + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=12364" LayoutText {#text} at (352,0) size 771x39 text run at (352,0) width 419: " REGRESSSION (NativeListBox): Selected option's background is" text run at (0,20) width 158: "not clipped to the list box"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-multiple-rtl-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-multiple-rtl-expected.png index 7b1eb531..67baf6f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-multiple-rtl-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-multiple-rtl-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-visual-hebrew-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-visual-hebrew-expected.txt index 251f31a..823f7810 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-visual-hebrew-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-visual-hebrew-expected.txt
@@ -7,8 +7,8 @@ LayoutText {#text} at (0,0) size 619x19 text run at (0,0) width 619: "This tests that native pop-ups are rendered in logical order even in visually-ordered Hebrew pages." LayoutNGBlockFlow {P} at (0,54) size 784x20 - LayoutText {#text} at (0,0) size 381x19 - text run at (0,0) width 381: "Text on the pop-up and in the list should look like this: \x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}" + LayoutText {#text} at (0,0) size 380x19 + text run at (0,0) width 380: "Text on the pop-up and in the list should look like this: \x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}" LayoutNGBlockFlow (anonymous) at (0,90) size 784x20 LayoutMenuList {SELECT} at (0,0) size 53x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)] LayoutNGBlockFlow (anonymous) at (1,1) size 51x18
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.png index 6fa6d25..17bd314 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.txt index dc2c3580..3d6cd27 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/select-writing-direction-natural-expected.txt
@@ -4,22 +4,22 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 709x39 - LayoutInline {A} at (0,0) size 302x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 302x19 - text run at (51,0) width 302: "http://bugs.webkit.org/show_bug.cgi?id=13775" - LayoutText {#text} at (352,0) size 709x39 - text run at (352,0) width 357: " REGRESSION: Popup button text should use \"natural\"" + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 708x39 + LayoutInline {A} at (0,0) size 301x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 301x19 + text run at (51,0) width 301: "http://bugs.webkit.org/show_bug.cgi?id=13775" + LayoutText {#text} at (352,0) size 708x39 + text run at (352,0) width 356: " REGRESSION: Popup button text should use \"natural\"" text run at (0,20) width 324: "directionality to match the items in the popup menu" - LayoutText {#text} at (323,20) size 5x19 - text run at (323,20) width 5: "." + LayoutText {#text} at (324,20) size 4x19 + text run at (324,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 659x19 - text run at (0,0) width 506: "In all of the popup buttons below, the letter A should be on the left and the letter " - text run at (505,0) width 9: "\x{5D0}" - text run at (513,0) width 146: " should be on the right." + LayoutText {#text} at (0,0) size 658x19 + text run at (0,0) width 505: "In all of the popup buttons below, the letter A should be on the left and the letter " + text run at (505,0) width 8: "\x{5D0}" + text run at (513,0) width 145: " should be on the right." LayoutNGBlockFlow {DIV} at (0,92) size 784x40 LayoutNGBlockFlow {DIV} at (0,0) size 784x20 LayoutMenuList {SELECT} at (0,0) size 70x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.png index 6c29362..57aaac0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.txt index a8ee665..bc25a411 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/targeted-frame-submission-expected.txt
@@ -10,9 +10,9 @@ text run at (0,0) width 26: "form" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,38) size 784x40 - LayoutText {#text} at (0,0) size 760x39 - text run at (0,0) width 760: "This tests Targeted frame submission works. If the test is successful, the text \"SUCCESS\" should be shown in the iframe" - text run at (0,20) width 42: "below." + LayoutText {#text} at (0,0) size 759x39 + text run at (0,0) width 759: "This tests Targeted frame submission works. If the test is successful, the text \"SUCCESS\" should be shown in the iframe" + text run at (0,20) width 41: "below." LayoutNGBlockFlow (anonymous) at (0,78) size 784x154 LayoutText {#text} at (0,0) size 0x0 layer at (8,86) size 304x154
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-disabled-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-disabled-expected.txt index 99253ef8..2abde2a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-disabled-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-disabled-expected.txt
@@ -10,5 +10,5 @@ LayoutText {#text} at (0,0) size 0x0 layer at (10,31) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 - LayoutText {#text} at (0,0) size 73x16 - text run at (0,0) width 73: "Test Passed" + LayoutText {#text} at (0,0) size 72x16 + text run at (0,0) width 72: "Test Passed"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.png index dc6b7b08..1735267 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.txt index 90762f2..b191c27 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-focus-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 754x19 - text run at (0,0) width 754: "This test uses the new text field to test focus() and blur() and to make sure that onFocus and onBlur events fire correctly." + LayoutText {#text} at (0,0) size 753x19 + text run at (0,0) width 753: "This test uses the new text field to test focus() and blur() and to make sure that onFocus and onBlur events fire correctly." LayoutNGBlockFlow {P} at (0,36) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (154,1) size 4x19 @@ -14,21 +14,21 @@ LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,74) size 784x80 LayoutBR {BR} at (0,0) size 0x0 - LayoutText {#text} at (0,20) size 320x19 - text run at (0,20) width 320: "Test Passed. Text field 1's onFocus event has fired." - LayoutBR {BR} at (319,20) size 0x0 - LayoutText {#text} at (0,40) size 310x19 - text run at (0,40) width 310: "Test Passed. Text field 1's onBlur event has fired." - LayoutBR {BR} at (309,40) size 0x0 - LayoutText {#text} at (0,60) size 320x19 - text run at (0,60) width 320: "Test Passed. Text field 2's onFocus event has fired." + LayoutText {#text} at (0,20) size 318x19 + text run at (0,20) width 318: "Test Passed. Text field 1's onFocus event has fired." + LayoutBR {BR} at (318,20) size 0x0 + LayoutText {#text} at (0,40) size 308x19 + text run at (0,40) width 308: "Test Passed. Text field 1's onBlur event has fired." + LayoutBR {BR} at (308,40) size 0x0 + LayoutText {#text} at (0,60) size 318x19 + text run at (0,60) width 318: "Test Passed. Text field 2's onFocus event has fired." LayoutNGBlockFlow {P} at (0,170) size 784x0 layer at (10,47) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 - LayoutText {#text} at (0,0) size 90x16 - text run at (0,0) width 90: "My Text Field 1" + LayoutText {#text} at (0,0) size 89x16 + text run at (0,0) width 89: "My Text Field 1" layer at (168,47) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 - LayoutText {#text} at (0,0) size 90x16 - text run at (0,0) width 90: "My Text Field 2" + LayoutText {#text} at (0,0) size 89x16 + text run at (0,0) width 89: "My Text Field 2" caret: position 0 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 3 {INPUT} of child 1 {P} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-preventDefault-expected.txt index 0da16221..350b798 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-preventDefault-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-preventDefault-expected.txt
@@ -13,7 +13,7 @@ LayoutText {#text} at (0,0) size 138x16 text run at (0,0) width 138: "No caret should be here" layer at (10,70) size 323x40 - LayoutNGBlockFlow (positioned) {DIV} at (10,70) size 322.72x40 + LayoutNGBlockFlow (positioned) {DIV} at (10,70) size 323x40 LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,20) size 323x19 text run at (0,20) width 323: "mousedown on target [object HTMLInputElement]"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-readonly-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-readonly-expected.txt index d9c40e9..bda9e4a0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-readonly-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-readonly-expected.txt
@@ -10,6 +10,6 @@ LayoutText {#text} at (0,0) size 0x0 layer at (10,31) size 150x16 LayoutBlockFlow {DIV} at (2,3) size 150x16 - LayoutText {#text} at (0,0) size 73x16 - text run at (0,0) width 73: "Test Passed" + LayoutText {#text} at (0,0) size 72x16 + text run at (0,0) width 72: "Test Passed" caret: position 0 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 2 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-selection-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-selection-expected.txt index 679aff4..526cbb2a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-selection-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-appearance-selection-expected.txt
@@ -11,64 +11,64 @@ LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,74) size 769x540 LayoutBR {BR} at (0,0) size 0x0 - LayoutText {#text} at (0,20) size 196x19 - text run at (0,20) width 196: "Test 1: setSelectionRange(0, 0)" + LayoutText {#text} at (0,20) size 195x19 + text run at (0,20) width 195: "Test 1: setSelectionRange(0, 0)" LayoutBR {BR} at (195,20) size 0x0 LayoutText {#text} at (0,40) size 47x19 text run at (0,40) width 47: "Passed." LayoutBR {BR} at (47,40) size 0x0 LayoutBR {BR} at (0,60) size 0x0 - LayoutText {#text} at (0,80) size 160x19 - text run at (0,80) width 160: "Test 2: selectionEnd = 17" + LayoutText {#text} at (0,80) size 159x19 + text run at (0,80) width 159: "Test 2: selectionEnd = 17" LayoutBR {BR} at (159,80) size 0x0 LayoutText {#text} at (0,100) size 47x19 text run at (0,100) width 47: "Passed." LayoutBR {BR} at (47,100) size 0x0 LayoutBR {BR} at (0,120) size 0x0 - LayoutText {#text} at (0,140) size 155x19 - text run at (0,140) width 155: "Test 3: selectionStart = 1" + LayoutText {#text} at (0,140) size 154x19 + text run at (0,140) width 154: "Test 3: selectionStart = 1" LayoutBR {BR} at (154,140) size 0x0 LayoutText {#text} at (0,160) size 47x19 text run at (0,160) width 47: "Passed." LayoutBR {BR} at (47,160) size 0x0 LayoutBR {BR} at (0,180) size 0x0 - LayoutText {#text} at (0,200) size 204x19 - text run at (0,200) width 204: "Test 4: setSelectionRange(10, 3)" + LayoutText {#text} at (0,200) size 203x19 + text run at (0,200) width 203: "Test 4: setSelectionRange(10, 3)" LayoutBR {BR} at (203,200) size 0x0 LayoutText {#text} at (0,220) size 47x19 text run at (0,220) width 47: "Passed." LayoutBR {BR} at (47,220) size 0x0 LayoutBR {BR} at (0,240) size 0x0 - LayoutText {#text} at (0,260) size 152x19 - text run at (0,260) width 152: "Test 5: selectionEnd = 2" + LayoutText {#text} at (0,260) size 151x19 + text run at (0,260) width 151: "Test 5: selectionEnd = 2" LayoutBR {BR} at (151,260) size 0x0 LayoutText {#text} at (0,280) size 47x19 text run at (0,280) width 47: "Passed." LayoutBR {BR} at (47,280) size 0x0 LayoutBR {BR} at (0,300) size 0x0 - LayoutText {#text} at (0,320) size 196x19 - text run at (0,320) width 196: "Test 6: setSelectionRange(5, 4)" + LayoutText {#text} at (0,320) size 195x19 + text run at (0,320) width 195: "Test 6: setSelectionRange(5, 4)" LayoutBR {BR} at (195,320) size 0x0 LayoutText {#text} at (0,340) size 47x19 text run at (0,340) width 47: "Passed." LayoutBR {BR} at (47,340) size 0x0 LayoutBR {BR} at (0,360) size 0x0 - LayoutText {#text} at (0,380) size 206x19 - text run at (0,380) width 206: "Test 7: setSelectionRange(-5, -4)" + LayoutText {#text} at (0,380) size 205x19 + text run at (0,380) width 205: "Test 7: setSelectionRange(-5, -4)" LayoutBR {BR} at (205,380) size 0x0 LayoutText {#text} at (0,400) size 47x19 text run at (0,400) width 47: "Passed." LayoutBR {BR} at (47,400) size 0x0 LayoutBR {BR} at (0,420) size 0x0 - LayoutText {#text} at (0,440) size 209x19 - text run at (0,440) width 209: "Test 8: setSelectionRange(-5, 80)" + LayoutText {#text} at (0,440) size 208x19 + text run at (0,440) width 208: "Test 8: setSelectionRange(-5, 80)" LayoutBR {BR} at (208,440) size 0x0 LayoutText {#text} at (0,460) size 47x19 text run at (0,460) width 47: "Passed." LayoutBR {BR} at (47,460) size 0x0 LayoutBR {BR} at (0,480) size 0x0 - LayoutText {#text} at (0,500) size 204x19 - text run at (0,500) width 204: "Test 9: setSelectionRange(3, 12)" + LayoutText {#text} at (0,500) size 203x19 + text run at (0,500) width 203: "Test 9: setSelectionRange(3, 12)" LayoutBR {BR} at (203,500) size 0x0 LayoutText {#text} at (0,520) size 47x19 text run at (0,520) width 47: "Passed."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-readonly-autoscroll-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-readonly-autoscroll-expected.txt new file mode 100644 index 0000000..bc1335bf --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-readonly-autoscroll-expected.txt
@@ -0,0 +1,29 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {A} at (0,0) size 68x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 68x19 + text run at (51,0) width 68: "bug 11534" + LayoutText {#text} at (119,0) size 4x19 + text run at (119,0) width 4: "." + LayoutNGBlockFlow {P} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "Readonly text fields don't scroll when selecting content." + LayoutNGBlockFlow (anonymous) at (0,72) size 784x22 + LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGBlockFlow {DIV} at (0,94) size 784x20 + LayoutText {#text} at (0,0) size 87x19 + text run at (0,0) width 87: "ScrollLeft: 17" + LayoutBR {BR} at (87,0) size 0x0 +layer at (10,83) size 150x16 scrollX 17.00 scrollWidth 167 + LayoutBlockFlow {DIV} at (2,3) size 150x16 + LayoutText {#text} at (0,0) size 167x16 + text run at (0,0) width 167: "abcdefghijklmnopqrstuvwxyz" +selection start: position 1 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of body +selection end: position 26 of child 0 {#text} of child 0 {DIV} of {#document-fragment} of child 5 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-table-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-table-expected.txt index 64ecdd8..100ac1c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-table-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-table-expected.txt
@@ -7,16 +7,16 @@ LayoutText {#text} at (0,0) size 246x19 text run at (0,0) width 246: "This tests minMaxWidth for text fields." LayoutNGBlockFlow {P} at (0,36) size 769x20 - LayoutText {#text} at (0,0) size 69x19 - text run at (0,0) width 69: "Test case 1" + LayoutText {#text} at (0,0) size 68x19 + text run at (0,0) width 68: "Test case 1" LayoutTable {TABLE} at (0,72) size 118x40 [border: (3px solid #0000FF)] LayoutTableSection {TBODY} at (3,3) size 112x34 LayoutTableRow {TR} at (0,2) size 112x30 LayoutNGTableCell {TD} at (2,2) size 108x30 [border: (3px solid #FF0000)] [r=0 c=0 rs=1 cs=1] LayoutTextControl {INPUT} at (4,4) size 100x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutNGBlockFlow {P} at (0,128) size 769x20 - LayoutText {#text} at (0,0) size 69x19 - text run at (0,0) width 69: "Test case 2" + LayoutText {#text} at (0,0) size 68x19 + text run at (0,0) width 68: "Test case 2" LayoutTable {TABLE} at (0,164) size 166x72 [border: (3px solid #0000FF)] LayoutTableSection {TBODY} at (3,3) size 160x66 LayoutTableRow {TR} at (0,2) size 160x30 @@ -32,8 +32,8 @@ LayoutNGTableCell {TD} at (50,34) size 108x30 [border: (3px solid #FF0000)] [r=1 c=1 rs=1 cs=1] LayoutTextControl {INPUT} at (4,4) size 100x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutNGBlockFlow {P} at (0,252) size 769x20 - LayoutText {#text} at (0,0) size 69x19 - text run at (0,0) width 69: "Test case 3" + LayoutText {#text} at (0,0) size 68x19 + text run at (0,0) width 68: "Test case 3" LayoutTable {TABLE} at (0,288) size 54x80 [border: (3px solid #0000FF)] LayoutTableSection {TBODY} at (3,3) size 48x74 LayoutTableRow {TR} at (0,2) size 48x70 @@ -43,8 +43,8 @@ text run at (4,24) width 32: "30px" LayoutTextControl {INPUT} at (4,44) size 30x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutNGBlockFlow {P} at (0,384) size 769x20 - LayoutText {#text} at (0,0) size 69x19 - text run at (0,0) width 69: "Test case 4" + LayoutText {#text} at (0,0) size 68x19 + text run at (0,0) width 68: "Test case 4" LayoutTable {TABLE} at (0,420) size 218x70 [border: (3px solid #0000FF)] LayoutTableSection {TBODY} at (3,3) size 212x64 LayoutTableRow {TR} at (0,2) size 212x30 @@ -56,16 +56,16 @@ LayoutText {#text} at (0,0) size 40x19 text run at (0,0) width 40: "200px" LayoutNGBlockFlow {P} at (0,506) size 769x20 - LayoutText {#text} at (0,0) size 69x19 - text run at (0,0) width 69: "Test case 5" + LayoutText {#text} at (0,0) size 68x19 + text run at (0,0) width 68: "Test case 5" LayoutTable {TABLE} at (0,542) size 88x40 [border: (3px solid #0000FF)] LayoutTableSection {TBODY} at (3,3) size 82x34 LayoutTableRow {TR} at (0,2) size 82x30 LayoutNGTableCell {TD} at (2,2) size 78x30 [border: (3px solid #FF0000)] [r=0 c=0 rs=1 cs=1] LayoutTextControl {INPUT} at (4,4) size 70x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutNGBlockFlow {P} at (0,598) size 769x20 - LayoutText {#text} at (0,0) size 69x19 - text run at (0,0) width 69: "Test case 6" + LayoutText {#text} at (0,0) size 68x19 + text run at (0,0) width 68: "Test case 6" LayoutTable {TABLE} at (0,634) size 172x70 [border: (3px solid #0000FF)] LayoutTableSection {TBODY} at (3,3) size 166x64 LayoutTableRow {TR} at (0,2) size 166x30
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-focus-ring-expected.txt index 9679c8f..c5dd3fc7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-focus-ring-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 779x39 text run at (0,0) width 779: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for a text input" - text run at (0,20) width 567: "element. This test PASSED if a focus ring is drawn around the text input element (below)." + text run at (0,20) width 566: "element. This test PASSED if a focus ring is drawn around the text input element (below)." LayoutNGBlockFlow (anonymous) at (0,56) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-outline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-outline-expected.txt index d4461c9..2d78015 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-outline-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-outline-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 550x19 text run at (0,0) width 550: "This tests that a negative outline-offset won't get in the way of a cursor in a text control." - LayoutBR {BR} at (549,0) size 0x0 + LayoutBR {BR} at (550,0) size 0x0 LayoutTextControl {INPUT} at (0,20) size 227x28 [bgcolor=#FFFFFF] [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 layer at (9,30) size 225x24 scrollWidth 547
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.png index f8f7559..ee0f098 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.txt index f3ac001b..557488af 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/basic-textareas-quirks-expected.txt
@@ -10,96 +10,96 @@ LayoutNGBlockFlow {DIV} at (1,15) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (193,24) size 14x16 - text run at (193,24) width 14: " B" + LayoutText {#text} at (194,24) size 13x16 + text run at (194,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,55) size 350x14 LayoutText {#text} at (0,-1) size 77x16 text run at (0,-1) width 77: "Plain textarea" LayoutNGBlockFlow {DIV} at (1,69) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (193,24) size 14x16 - text run at (193,24) width 14: " B" + LayoutText {#text} at (194,24) size 13x16 + text run at (194,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,109) size 350x14 LayoutText {#text} at (0,-1) size 97x16 text run at (0,-1) width 97: "Disabled textarea" LayoutNGBlockFlow {DIV} at (1,123) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (193,24) size 14x16 - text run at (193,24) width 14: " B" + LayoutText {#text} at (194,24) size 13x16 + text run at (194,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,163) size 350x14 LayoutText {#text} at (0,-1) size 123x16 text run at (0,-1) width 123: "style=\"padding:10px\"" LayoutNGBlockFlow {DIV} at (1,177) size 352x58 [border: (1px solid #FF0000)] LayoutText {#text} at (1,42) size 14x16 text run at (1,42) width 14: "A " - LayoutText {#text} at (211,42) size 14x16 - text run at (211,42) width 14: " B" + LayoutText {#text} at (212,42) size 13x16 + text run at (212,42) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,235) size 350x14 LayoutText {#text} at (0,-1) size 116x16 text run at (0,-1) width 116: "style=\"padding:0px\"" LayoutNGBlockFlow {DIV} at (1,249) size 352x38 [border: (1px solid #FF0000)] LayoutText {#text} at (1,22) size 14x16 text run at (1,22) width 14: "A " - LayoutText {#text} at (191,22) size 14x16 - text run at (191,22) width 14: " B" + LayoutText {#text} at (192,22) size 13x16 + text run at (192,22) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,287) size 350x14 LayoutText {#text} at (0,-1) size 118x16 text run at (0,-1) width 118: "style=\"margin:10px\"" LayoutNGBlockFlow {DIV} at (1,301) size 352x60 [border: (1px solid #FF0000)] LayoutText {#text} at (1,44) size 14x16 text run at (1,44) width 14: "A " - LayoutText {#text} at (213,44) size 14x16 - text run at (213,44) width 14: " B" + LayoutText {#text} at (214,44) size 13x16 + text run at (214,44) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,361) size 350x14 LayoutText {#text} at (0,-1) size 111x16 text run at (0,-1) width 111: "style=\"margin:0px\"" LayoutNGBlockFlow {DIV} at (1,375) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (193,24) size 14x16 - text run at (193,24) width 14: " B" + LayoutText {#text} at (194,24) size 13x16 + text run at (194,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,415) size 350x14 LayoutText {#text} at (0,-1) size 37x16 text run at (0,-1) width 37: "cols=3" LayoutNGBlockFlow {DIV} at (1,429) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (57,24) size 14x16 - text run at (57,24) width 14: " B" + LayoutText {#text} at (58,24) size 13x16 + text run at (58,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,469) size 350x14 LayoutText {#text} at (0,-1) size 42x16 text run at (0,-1) width 42: "rows=3" LayoutNGBlockFlow {DIV} at (1,483) size 352x56 [border: (1px solid #FF0000)] LayoutText {#text} at (1,40) size 14x16 text run at (1,40) width 14: "A " - LayoutText {#text} at (193,40) size 14x16 - text run at (193,40) width 14: " B" + LayoutText {#text} at (194,40) size 13x16 + text run at (194,40) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,539) size 350x14 LayoutText {#text} at (0,-1) size 44x16 text run at (0,-1) width 44: "cols=10" LayoutNGBlockFlow {DIV} at (1,553) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (113,24) size 14x16 - text run at (113,24) width 14: " B" + LayoutText {#text} at (114,24) size 13x16 + text run at (114,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,593) size 350x14 LayoutText {#text} at (0,-1) size 49x16 text run at (0,-1) width 49: "rows=10" LayoutNGBlockFlow {DIV} at (1,607) size 352x168 [border: (1px solid #FF0000)] LayoutText {#text} at (1,152) size 14x16 text run at (1,152) width 14: "A " - LayoutText {#text} at (193,152) size 14x16 - text run at (193,152) width 14: " B" + LayoutText {#text} at (194,152) size 13x16 + text run at (194,152) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,775) size 350x14 LayoutText {#text} at (0,-1) size 83x16 text run at (0,-1) width 83: "cols=5 rows=4" LayoutNGBlockFlow {DIV} at (1,789) size 352x72 [border: (1px solid #FF0000)] LayoutText {#text} at (1,56) size 14x16 text run at (1,56) width 14: "A " - LayoutText {#text} at (73,56) size 14x16 - text run at (73,56) width 14: " B" + LayoutText {#text} at (74,56) size 13x16 + text run at (74,56) width 13: " B" LayoutNGBlockFlow (floating) {DIV} at (352,0) size 352x1046 [border: (1px solid #FF0000)] LayoutNGBlockFlow (anonymous) at (1,1) size 350x14 LayoutText {#text} at (0,-1) size 110x16 @@ -107,127 +107,127 @@ LayoutNGBlockFlow {DIV} at (1,15) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (74,24) size 14x16 - text run at (74,24) width 14: " B" + LayoutText {#text} at (75,24) size 13x16 + text run at (75,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,55) size 350x14 LayoutText {#text} at (0,-1) size 191x16 text run at (0,-1) width 191: "style=\"width:60px;padding:20px\"" LayoutNGBlockFlow {DIV} at (1,69) size 352x78 [border: (1px solid #FF0000)] LayoutText {#text} at (1,62) size 14x16 text run at (1,62) width 14: "A " - LayoutText {#text} at (74,62) size 14x16 - text run at (74,62) width 14: " B" + LayoutText {#text} at (75,62) size 13x16 + text run at (75,62) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,147) size 350x14 LayoutText {#text} at (0,-1) size 170x16 text run at (0,-1) width 170: "style=\"width:60px;padding:0\"" LayoutNGBlockFlow {DIV} at (1,161) size 352x38 [border: (1px solid #FF0000)] LayoutText {#text} at (1,22) size 14x16 text run at (1,22) width 14: "A " - LayoutText {#text} at (74,22) size 14x16 - text run at (74,22) width 14: " B" + LayoutText {#text} at (75,22) size 13x16 + text run at (75,22) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,199) size 350x14 LayoutText {#text} at (0,-1) size 113x16 text run at (0,-1) width 113: "style=\"height:60px\"" LayoutNGBlockFlow {DIV} at (1,213) size 352x64 [border: (1px solid #FF0000)] LayoutText {#text} at (1,48) size 14x16 text run at (1,48) width 14: "A " - LayoutText {#text} at (193,48) size 14x16 - text run at (193,48) width 14: " B" + LayoutText {#text} at (194,48) size 13x16 + text run at (194,48) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,277) size 350x14 LayoutText {#text} at (0,-1) size 181x16 text run at (0,-1) width 181: "style=\"width:60px;height:60px\"" LayoutNGBlockFlow {DIV} at (1,291) size 352x64 [border: (1px solid #FF0000)] LayoutText {#text} at (1,48) size 14x16 text run at (1,48) width 14: "A " - LayoutText {#text} at (74,48) size 14x16 - text run at (74,48) width 14: " B" + LayoutText {#text} at (75,48) size 13x16 + text run at (75,48) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,355) size 350x14 LayoutText {#text} at (0,-1) size 139x16 text run at (0,-1) width 139: "style=\"overflow:hidden\"" LayoutNGBlockFlow {DIV} at (1,369) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (193,24) size 14x16 - text run at (193,24) width 14: " B" + LayoutText {#text} at (194,24) size 13x16 + text run at (194,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,409) size 350x14 LayoutText {#text} at (0,-1) size 132x16 text run at (0,-1) width 132: "style=\"overflow:scroll\"" LayoutNGBlockFlow {DIV} at (1,423) size 352x55 [border: (1px solid #FF0000)] LayoutText {#text} at (1,39) size 14x16 text run at (1,39) width 14: "A " - LayoutText {#text} at (193,39) size 14x16 - text run at (193,39) width 14: " B" + LayoutText {#text} at (194,39) size 13x16 + text run at (194,39) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,478) size 350x14 LayoutText {#text} at (0,-1) size 278x16 text run at (0,-1) width 278: "style=\"overflow:hidden;width:60px;height:60px\"" LayoutNGBlockFlow {DIV} at (1,492) size 352x64 [border: (1px solid #FF0000)] LayoutText {#text} at (1,48) size 14x16 text run at (1,48) width 14: "A " - LayoutText {#text} at (74,48) size 14x16 - text run at (74,48) width 14: " B" + LayoutText {#text} at (75,48) size 13x16 + text run at (75,48) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,556) size 350x14 LayoutText {#text} at (0,-1) size 271x16 text run at (0,-1) width 271: "style=\"overflow:scroll;width:60px;height:60px\"" LayoutNGBlockFlow {DIV} at (1,570) size 352x64 [border: (1px solid #FF0000)] LayoutText {#text} at (1,48) size 14x16 text run at (1,48) width 14: "A " - LayoutText {#text} at (74,48) size 14x16 - text run at (74,48) width 14: " B" + LayoutText {#text} at (75,48) size 13x16 + text run at (75,48) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,634) size 350x14 LayoutText {#text} at (0,-1) size 222x16 text run at (0,-1) width 222: "cols=5 style=\"width:60px;height:60px\"" LayoutNGBlockFlow {DIV} at (1,648) size 352x64 [border: (1px solid #FF0000)] LayoutText {#text} at (1,48) size 14x16 text run at (1,48) width 14: "A " - LayoutText {#text} at (74,48) size 14x16 - text run at (74,48) width 14: " B" + LayoutText {#text} at (75,48) size 13x16 + text run at (75,48) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,712) size 350x14 LayoutText {#text} at (0,-1) size 227x16 text run at (0,-1) width 227: "rows=4 style=\"width:60px;height:60px\"" LayoutNGBlockFlow {DIV} at (1,726) size 352x64 [border: (1px solid #FF0000)] LayoutText {#text} at (1,48) size 14x16 text run at (1,48) width 14: "A " - LayoutText {#text} at (74,48) size 14x16 - text run at (74,48) width 14: " B" + LayoutText {#text} at (75,48) size 13x16 + text run at (75,48) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,790) size 350x14 LayoutText {#text} at (0,-1) size 268x16 text run at (0,-1) width 268: "cols=5 rows=4 style=\"width:60px;height:60px\"" LayoutNGBlockFlow {DIV} at (1,804) size 352x64 [border: (1px solid #FF0000)] LayoutText {#text} at (1,48) size 14x16 text run at (1,48) width 14: "A " - LayoutText {#text} at (74,48) size 14x16 - text run at (74,48) width 14: " B" + LayoutText {#text} at (75,48) size 13x16 + text run at (75,48) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,868) size 350x14 LayoutText {#text} at (0,-1) size 65x16 text run at (0,-1) width 65: "wrap=\"off\"" LayoutNGBlockFlow {DIV} at (1,882) size 352x55 [border: (1px solid #FF0000)] LayoutText {#text} at (1,39) size 14x16 text run at (1,39) width 14: "A " - LayoutText {#text} at (193,39) size 14x16 - text run at (193,39) width 14: " B" + LayoutText {#text} at (194,39) size 13x16 + text run at (194,39) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,937) size 350x14 LayoutText {#text} at (0,-1) size 73x16 text run at (0,-1) width 73: "wrap=\"hard\"" LayoutNGBlockFlow {DIV} at (1,951) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (193,24) size 14x16 - text run at (193,24) width 14: " B" + LayoutText {#text} at (194,24) size 13x16 + text run at (194,24) width 13: " B" LayoutNGBlockFlow (anonymous) at (1,991) size 350x14 LayoutText {#text} at (0,-1) size 69x16 text run at (0,-1) width 69: "wrap=\"soft\"" LayoutNGBlockFlow {DIV} at (1,1005) size 352x40 [border: (1px solid #FF0000)] LayoutText {#text} at (1,24) size 14x16 text run at (1,24) width 14: "A " - LayoutText {#text} at (193,24) size 14x16 - text run at (193,24) width 14: " B" -layer at (23,24) size 179x36 clip at (24,25) size 177x34 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] + LayoutText {#text} at (194,24) size 13x16 + text run at (194,24) width 13: " B" +layer at (24,24) size 179x36 clip at (25,25) size 177x34 + LayoutTextControl {TEXTAREA} at (15,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x16 LayoutText {#text} at (0,0) size 136x16 text run at (0,0) width 136: "Lorem ipsum dolor" -layer at (23,78) size 179x36 clip at (24,79) size 162x34 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,78) size 179x36 clip at (25,79) size 162x34 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (15,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -238,8 +238,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (23,132) size 179x36 clip at (24,133) size 162x34 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x36 [color=#545454] [bgcolor=#EBEBE4] [border: (1px solid #A9A9A9)] +layer at (24,132) size 179x36 clip at (25,133) size 162x34 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (15,1) size 179x36 [color=#545454] [bgcolor=#EBEBE4] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -250,8 +250,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (23,186) size 197x54 clip at (24,187) size 180x52 scrollHeight 100 - LayoutTextControl {TEXTAREA} at (14.23,1) size 197x54 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,186) size 197x54 clip at (25,187) size 180x52 scrollHeight 100 + LayoutTextControl {TEXTAREA} at (15,1) size 197x54 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (11,11) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -262,8 +262,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (23,258) size 177x34 clip at (24,259) size 160x32 scrollHeight 80 - LayoutTextControl {TEXTAREA} at (14.23,1) size 177x34 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,258) size 177x34 clip at (25,259) size 160x32 scrollHeight 80 + LayoutTextControl {TEXTAREA} at (15,1) size 177x34 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (1,1) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -274,8 +274,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (33,320) size 179x36 clip at (34,321) size 162x34 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (24.23,11) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (34,320) size 179x36 clip at (35,321) size 162x34 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (25,11) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -286,8 +286,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (23,384) size 179x36 clip at (24,385) size 162x34 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,384) size 179x36 clip at (25,385) size 162x34 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (15,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -298,8 +298,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (23,438) size 43x36 clip at (24,439) size 26x34 scrollHeight 370 - LayoutTextControl {TEXTAREA} at (14.23,1) size 43x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,438) size 43x36 clip at (25,439) size 26x34 scrollHeight 370 + LayoutTextControl {TEXTAREA} at (15,1) size 43x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 24x368 LayoutText {#text} at (0,0) size 24x368 text run at (0,0) width 24: "Lor" @@ -330,8 +330,8 @@ text run at (0,336) width 24: "stu" text run at (0,352) width 8: "v" text run at (8,352) width 8: " " -layer at (23,492) size 179x52 clip at (24,493) size 162x50 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x52 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,492) size 179x52 clip at (25,493) size 162x50 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (15,1) size 179x52 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -342,8 +342,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (23,562) size 99x36 clip at (24,563) size 82x34 scrollHeight 146 - LayoutTextControl {TEXTAREA} at (14.23,1) size 99x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,562) size 99x36 clip at (25,563) size 82x34 scrollHeight 146 + LayoutTextControl {TEXTAREA} at (15,1) size 99x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 80x144 LayoutText {#text} at (0,0) size 80x144 text run at (0,0) width 40: "Lorem" @@ -360,8 +360,8 @@ text run at (0,112) width 80: "klmnopqrst" text run at (0,128) width 16: "uv" text run at (16,128) width 8: " " -layer at (23,616) size 179x164 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x164 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,616) size 179x164 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 + LayoutTextControl {TEXTAREA} at (15,1) size 179x164 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x80 LayoutText {#text} at (0,0) size 168x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -372,8 +372,8 @@ text run at (0,48) width 168: "abcdefghijklmnopqrstu" text run at (0,64) width 8: "v" text run at (8,64) width 8: " " -layer at (23,798) size 59x68 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 - LayoutTextControl {TEXTAREA} at (14.23,1) size 59x68 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (24,798) size 59x68 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 + LayoutTextControl {TEXTAREA} at (15,1) size 59x68 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 40x224 LayoutText {#text} at (0,0) size 40x224 text run at (0,0) width 40: "Lorem" @@ -395,8 +395,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,24) size 60x36 clip at (376,25) size 43x34 scrollHeight 226 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,24) size 60x36 clip at (377,25) size 43x34 scrollHeight 226 + LayoutTextControl {TEXTAREA} at (15,1) size 60x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 41x224 LayoutText {#text} at (0,0) size 41x224 text run at (0,0) width 40: "Lorem" @@ -418,8 +418,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,78) size 60x74 clip at (376,79) size 43x72 scrollHeight 1128 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x74 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,78) size 60x74 clip at (377,79) size 43x72 scrollHeight 1128 + LayoutTextControl {TEXTAREA} at (15,1) size 60x74 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (21,21) size 3x1088 LayoutText {#text} at (0,0) size 8x1088 text run at (0,0) width 8: "L" @@ -490,8 +490,8 @@ text run at (0,1040) width 8: "u" text run at (0,1056) width 8: "v" text run at (0,1072) width 3: " " -layer at (375,170) size 60x34 clip at (376,171) size 43x32 scrollHeight 224 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x34 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,170) size 60x34 clip at (377,171) size 43x32 scrollHeight 224 + LayoutTextControl {TEXTAREA} at (15,1) size 60x34 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (1,1) size 43x224 LayoutText {#text} at (0,0) size 43x224 text run at (0,0) width 40: "Lorem" @@ -513,8 +513,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,222) size 179x60 clip at (376,223) size 162x58 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,222) size 179x60 clip at (377,223) size 162x58 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (15,1) size 179x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -525,8 +525,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (375,300) size 60x60 clip at (376,301) size 43x58 scrollHeight 226 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,300) size 60x60 clip at (377,301) size 43x58 scrollHeight 226 + LayoutTextControl {TEXTAREA} at (15,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 41x224 LayoutText {#text} at (0,0) size 41x224 text run at (0,0) width 40: "Lorem" @@ -548,8 +548,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,378) size 179x36 clip at (376,379) size 177x34 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,378) size 179x36 clip at (377,379) size 177x34 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (15,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x80 LayoutText {#text} at (0,0) size 168x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -560,8 +560,8 @@ text run at (0,48) width 168: "abcdefghijklmnopqrstu" text run at (0,64) width 8: "v" text run at (8,64) width 8: " " -layer at (375,432) size 179x51 clip at (376,433) size 162x34 scrollHeight 82 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x51 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,432) size 179x51 clip at (377,433) size 162x34 scrollHeight 82 + LayoutTextControl {TEXTAREA} at (15,1) size 179x51 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x80 LayoutText {#text} at (0,0) size 160x80 text run at (0,0) width 136: "Lorem ipsum dolor" @@ -572,8 +572,8 @@ text run at (0,48) width 160: "abcdefghijklmnopqrst" text run at (0,64) width 16: "uv" text run at (16,64) width 8: " " -layer at (375,501) size 60x60 clip at (376,502) size 58x58 scrollHeight 178 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,501) size 60x60 clip at (377,502) size 58x58 scrollHeight 178 + LayoutTextControl {TEXTAREA} at (15,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 56x176 LayoutText {#text} at (0,0) size 56x176 text run at (0,0) width 40: "Lorem" @@ -592,8 +592,8 @@ text run at (0,144) width 56: "opqrstu" text run at (0,160) width 8: "v" text run at (8,160) width 8: " " -layer at (375,579) size 60x60 backgroundClip at (375,579) size 60x21 clip at (376,580) size 43x20 scrollHeight 226 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,579) size 60x60 backgroundClip at (376,579) size 60x21 clip at (377,580) size 43x20 scrollHeight 226 + LayoutTextControl {TEXTAREA} at (15,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 41x224 LayoutText {#text} at (0,0) size 41x224 text run at (0,0) width 40: "Lorem" @@ -615,8 +615,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,657) size 60x60 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,657) size 60x60 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 + LayoutTextControl {TEXTAREA} at (15,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 41x224 LayoutText {#text} at (0,0) size 41x224 text run at (0,0) width 40: "Lorem" @@ -638,8 +638,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,735) size 60x60 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,735) size 60x60 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 + LayoutTextControl {TEXTAREA} at (15,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 41x224 LayoutText {#text} at (0,0) size 41x224 text run at (0,0) width 40: "Lorem" @@ -661,8 +661,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,813) size 60x60 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 - LayoutTextControl {TEXTAREA} at (14.23,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,813) size 60x60 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 226 + LayoutTextControl {TEXTAREA} at (15,1) size 60x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 41x224 LayoutText {#text} at (0,0) size 41x224 text run at (0,0) width 40: "Lorem" @@ -684,8 +684,8 @@ text run at (0,192) width 40: "pqrst" text run at (0,208) width 16: "uv" text run at (16,208) width 8: " " -layer at (375,891) size 179x51 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollWidth 290 scrollHeight 258 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x51 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,891) size 179x51 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollWidth 290 scrollHeight 258 + LayoutTextControl {TEXTAREA} at (15,1) size 179x51 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x256 LayoutText {#text} at (0,0) size 288x240 text run at (0,0) width 8: " " @@ -719,8 +719,8 @@ text run at (0,224) width 288: "This is a text area with wrap=\"soft\"" text run at (288,224) width 0: " " LayoutBR {BR} at (0,240) size 0x16 -layer at (375,960) size 179x36 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 482 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,960) size 179x36 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 482 + LayoutTextControl {TEXTAREA} at (15,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x480 LayoutText {#text} at (0,0) size 160x464 text run at (0,0) width 8: " " @@ -782,8 +782,8 @@ text run at (0,448) width 128: "with wrap=\"soft\"" text run at (128,448) width 0: " " LayoutBR {BR} at (0,464) size 0x16 -layer at (375,1014) size 179x36 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 482 - LayoutTextControl {TEXTAREA} at (14.23,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] +layer at (376,1014) size 179x36 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0 scrollHeight 482 + LayoutTextControl {TEXTAREA} at (15,1) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 160x480 LayoutText {#text} at (0,0) size 160x464 text run at (0,0) width 8: " "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/reset-textarea-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/reset-textarea-expected.txt index 8d1faae..5d3d15b0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/reset-textarea-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/reset-textarea-expected.txt
@@ -17,14 +17,14 @@ LayoutText {#text} at (0,0) size 354x19 text run at (0,0) width 354: "This test verifies that textarea controls are properly reset." LayoutBR {BR} at (354,0) size 0x0 - LayoutText {#text} at (0,20) size 469x19 - text run at (0,20) width 469: "You should see two element IDs below, and the word \"SUCCESS\" twice:" - LayoutBR {BR} at (468,20) size 0x0 - LayoutText {#text} at (0,40) size 170x19 - text run at (0,40) width 170: "noDefaultText: SUCCESS" + LayoutText {#text} at (0,20) size 467x19 + text run at (0,20) width 467: "You should see two element IDs below, and the word \"SUCCESS\" twice:" + LayoutBR {BR} at (467,20) size 0x0 + LayoutText {#text} at (0,40) size 169x19 + text run at (0,40) width 169: "noDefaultText: SUCCESS" LayoutBR {BR} at (169,40) size 0x0 - LayoutText {#text} at (0,60) size 175x19 - text run at (0,60) width 175: "hasDefaultText: SUCCESS" + LayoutText {#text} at (0,60) size 174x19 + text run at (0,60) width 174: "hasDefaultText: SUCCESS" layer at (8,8) size 179x36 clip at (9,9) size 177x34 LayoutTextControl {TEXTAREA} at (0,0) size 179x36 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)] LayoutBlockFlow {DIV} at (3,3) size 175x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textAreaLineHeight-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textAreaLineHeight-expected.txt index c0d716a..94b4959 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textAreaLineHeight-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textAreaLineHeight-expected.txt
@@ -8,14 +8,14 @@ text run at (0,0) width 269: "line-height settings not reflected in textarea" LayoutBR {BR} at (269,0) size 0x0 LayoutNGBlockFlow {P} at (0,36) size 769x271 - LayoutText {#text} at (0,0) size 86x19 - text run at (0,0) width 86: "TEXTAREA" + LayoutText {#text} at (0,0) size 85x19 + text run at (0,0) width 85: "TEXTAREA" LayoutBR {BR} at (85,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (406,211) size 0x0 LayoutBR {BR} at (0,231) size 0x0 - LayoutText {#text} at (0,251) size 151x19 - text run at (0,251) width 151: "PARAGRAPH - works" + LayoutText {#text} at (0,251) size 150x19 + text run at (0,251) width 150: "PARAGRAPH - works" LayoutNGBlockFlow {P} at (0,323) size 402x202 [border: (1px dotted #C0C0C0)] LayoutText {#text} at (1,19) size 382x69 text run at (1,19) width 382: "Demo text here that wraps a bit and should demonstrate" @@ -24,7 +24,7 @@ LayoutBR {BR} at (0,0) size 0x0 LayoutText {#text} at (0,20) size 81x19 text run at (0,20) width 81: "DIV - works" - LayoutBR {BR} at (80,20) size 0x0 + LayoutBR {BR} at (81,20) size 0x0 LayoutNGBlockFlow {DIV} at (0,578.33) size 402x202 [border: (1px dotted #C0C0C0)] LayoutText {#text} at (1,19) size 382x69 text run at (1,19) width 382: "Demo text here that wraps a bit and should demonstrate" @@ -32,21 +32,21 @@ LayoutNGBlockFlow (anonymous) at (0,780.33) size 769x437 LayoutBR {BR} at (0,0) size 0x0 LayoutBR {BR} at (0,20) size 0x0 - LayoutText {#text} at (0,40) size 123x19 - text run at (0,40) width 123: "Un-Styled Textarea" + LayoutText {#text} at (0,40) size 122x19 + text run at (0,40) width 122: "Un-Styled Textarea" LayoutBR {BR} at (122,40) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (181,83) size 0x0 LayoutBR {BR} at (0,103) size 0x0 - LayoutText {#text} at (0,123) size 213x19 - text run at (0,123) width 213: "Totally Blank Un-Styled Textarea" - LayoutBR {BR} at (212,123) size 0x0 + LayoutText {#text} at (0,123) size 211x19 + text run at (0,123) width 211: "Totally Blank Un-Styled Textarea" + LayoutBR {BR} at (211,123) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutBR {BR} at (181,166) size 0x0 LayoutBR {BR} at (0,186) size 0x0 - LayoutText {#text} at (0,206) size 211x19 - text run at (0,206) width 211: "Totally Blank STYLED Textarea" - LayoutBR {BR} at (210,206) size 0x0 + LayoutText {#text} at (0,206) size 209x19 + text run at (0,206) width 209: "Totally Blank STYLED Textarea" + LayoutBR {BR} at (209,206) size 0x0 LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {P} at (0,1233.33) size 769x0 layer at (8,64) size 406x206 clip at (9,65) size 404x204
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-focus-ring-expected.txt index 2e9b1b6..412b0a42 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-focus-ring-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x79 LayoutNGBlockFlow {HTML} at (0,0) size 800x79 LayoutNGBlockFlow {BODY} at (8,8) size 784x63 - LayoutText {#text} at (0,0) size 565x19 - text run at (0,0) width 565: "Test passes if a focus ring is visible around text area when focused and scrolled to bottom." + LayoutText {#text} at (0,0) size 564x19 + text run at (0,0) width 564: "Test passes if a focus ring is visible around text area when focused and scrolled to bottom." LayoutBR {BR} at (564,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 181x38 clip at (9,29) size 164x36 scrollY 48.00 scrollHeight 84
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-mask-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-mask-expected.txt index 2b631b42..77ede296 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-mask-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-scrolled-mask-expected.txt
@@ -3,8 +3,8 @@ layer at (0,0) size 800x79 LayoutNGBlockFlow {HTML} at (0,0) size 800x79 LayoutNGBlockFlow {BODY} at (8,8) size 784x63 - LayoutText {#text} at (0,0) size 532x19 - text run at (0,0) width 532: "Test passes if the textarea's gray background and text are masked off to a 10x10 rect." + LayoutText {#text} at (0,0) size 531x19 + text run at (0,0) width 531: "Test passes if the textarea's gray background and text are masked off to a 10x10 rect." LayoutBR {BR} at (531,0) size 0x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,28) size 181x38 clip at (9,29) size 164x36 transparent scrollY 48.00 scrollHeight 84
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-width-expected.txt index e29d65f8..cf36508d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/textarea/textarea-width-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {DIV} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 777x39 - text run at (0,0) width 777: "This text area should be drawn with a reasonable width. To match IE, using GDI fonts it should wrap at 66 characters (after" + LayoutText {#text} at (0,0) size 776x39 + text run at (0,0) width 776: "This text area should be drawn with a reasonable width. To match IE, using GDI fonts it should wrap at 66 characters (after" text run at (0,20) width 532: "the X in the third set of digits). See https://bugs.webkit.org/show_bug.cgi?id=15312." LayoutNGBlockFlow (anonymous) at (0,40) size 784x264 LayoutBR {BR} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/time/time-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/time/time-appearance-basic-expected.png index cc924f950..d017c6ee 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/time/time-appearance-basic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/time/time-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/validation-bubble-appearance-rtl-ui-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/validation-bubble-appearance-rtl-ui-expected.png index e52e63c..511d16c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/validation-bubble-appearance-rtl-ui-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/validation-bubble-appearance-rtl-ui-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/visual-hebrew-text-field-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/visual-hebrew-text-field-expected.txt index 21a50bd..391b79cc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/visual-hebrew-text-field-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/visual-hebrew-text-field-expected.txt
@@ -10,14 +10,14 @@ LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (212,0) size 348x19 text run at (212,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8076" - LayoutText {#text} at (559,0) size 770x39 - text run at (559,0) width 211: " REGRESSION: native text fields" - text run at (0,20) width 249: "are reversed on \"visual Hebrew\" pages" - LayoutText {#text} at (248,20) size 5x19 - text run at (248,20) width 5: "." + LayoutText {#text} at (560,0) size 770x39 + text run at (560,0) width 210: " REGRESSION: native text fields" + text run at (0,20) width 250: "are reversed on \"visual Hebrew\" pages" + LayoutText {#text} at (250,20) size 4x19 + text run at (250,20) width 4: "." LayoutNGBlockFlow {P} at (0,74) size 784x20 - LayoutText {#text} at (0,0) size 272x19 - text run at (0,0) width 272: "Text in the field should look like this: \x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}" + LayoutText {#text} at (0,0) size 271x19 + text run at (0,0) width 271: "Text in the field should look like this: \x{5E8}\x{5D5}\x{5EA}\x{5E4}\x{5DB}" LayoutNGBlockFlow (anonymous) at (0,110) size 784x22 LayoutTextControl {INPUT} at (0,0) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)] LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/week/week-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/week/week-appearance-basic-expected.png index 69f5d5d9..af4de22 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/week/week-appearance-basic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/week/week-appearance-basic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/frameset-style-recalc-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/frameset-style-recalc-expected.txt new file mode 100644 index 0000000..279ba68 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/frameset-style-recalc-expected.txt
@@ -0,0 +1,36 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutFrameSet {FRAMESET} at (0,0) size 800x600 +layer at (0,0) size 800x200 + LayoutFrame {FRAME} at (0,0) size 800x200 + layer at (0,0) size 800x200 + LayoutView at (0,0) size 800x200 + layer at (0,0) size 800x200 + LayoutNGBlockFlow {HTML} at (0,0) size 800x200 + LayoutNGBlockFlow {BODY} at (8,8) size 784x176 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 720x39 + LayoutInline {A} at (0,0) size 307x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 307x19 + text run at (51,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=19348" + LayoutText {#text} at (358,0) size 720x39 + text run at (358,0) width 362: " REGRESSION (r34193): Setting the size of a frame with" + text run at (0,20) width 299: "javascript document.body.row no longer works" + LayoutText {#text} at (299,20) size 4x19 + text run at (299,20) width 4: "." + LayoutNGBlockFlow {P} at (0,56) size 784x20 + LayoutText {#text} at (0,0) size 204x19 + text run at (0,0) width 204: "This frame should be 200px tall." + layer at (0,100) size 100x100 + LayoutNGBlockFlow (positioned) {DIV} at (0,100) size 100x100 [bgcolor=#008000] +layer at (0,206) size 800x394 + LayoutFrame {FRAME} at (0,206) size 800x394 + layer at (0,0) size 800x394 + LayoutView at (0,0) size 800x394 + layer at (0,0) size 800x394 + LayoutNGBlockFlow {HTML} at (0,0) size 800x394 + LayoutNGBlockFlow {BODY} at (8,8) size 784x378
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/onlyCommentInIFrame-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/onlyCommentInIFrame-expected.txt new file mode 100644 index 0000000..277efcbf --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/onlyCommentInIFrame-expected.txt
@@ -0,0 +1,39 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutText {#text} at (0,0) size 780x59 + text run at (0,0) width 780: "The documents in the src attributes of the iframes below only contain comments. This test is for a bug where we would only" + text run at (0,20) width 769: "construct LayoutViews for such iframes. We need to propery construct an empty frame instead, so the LayoutView should" + text run at (0,40) width 565: "have a LayoutBlockFlow and LayoutBlockFlow below it in the dump of the RenderTree." + LayoutBR {BR} at (565,40) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutBR {BR} at (788,59) size 0x0 + LayoutBR {BR} at (0,74) size 0x0 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,68) size 788x14 + LayoutIFrame {IFRAME} at (0,60) size 788x14 [border: (2px inset #EEEEEE)] + layer at (0,0) size 784x10 + LayoutView at (0,0) size 784x10 + layer at (0,0) size 784x10 + LayoutNGBlockFlow {HTML} at (0,0) size 784x10 + LayoutNGBlockFlow {BODY} at (8,8) size 768x0 +layer at (8,102) size 788x14 + LayoutIFrame {IFRAME} at (0,94) size 788x14 [border: (2px inset #EEEEEE)] + layer at (0,0) size 784x10 clip at (0,0) size 769x10 scrollHeight 172 + LayoutView at (0,0) size 784x10 + layer at (0,0) size 769x172 backgroundClip at (0,0) size 769x10 clip at (0,0) size 769x10 + LayoutNGBlockFlow {html} at (0,0) size 769x171.88 + LayoutNGBlockFlow {body} at (8,16) size 753x139.88 + LayoutNGBlockFlow {parsererror} at (16,0) size 721x139.88 [bgcolor=#FFDDDD] [border: (2px solid #CC7777)] + LayoutNGBlockFlow {h3} at (18,20.72) size 685x23 + LayoutText {#text} at (0,0) size 324x22 + text run at (0,0) width 324: "This page contains the following errors:" + LayoutNGBlockFlow {div} at (18,62.44) size 685x15 + LayoutText {#text} at (0,0) size 490x15 + text run at (0,0) width 490: "error on line 1 at column 15: Extra content at the end of the document" + text run at (490,0) width 0: " " + LayoutNGBlockFlow {h3} at (18,96.16) size 685x23 + LayoutText {#text} at (0,0) size 427x22 + text run at (0,0) width 427: "Below is a rendering of the page up to the first error."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/br-text-decoration-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/br-text-decoration-expected.png index fdfcbaf6..4c379f19 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/br-text-decoration-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/br-text-decoration-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/drawStyledEmptyInlines-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/drawStyledEmptyInlines-expected.png index 2ca4f83..74296ed1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/drawStyledEmptyInlines-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/drawStyledEmptyInlines-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/emptyInlinesWithinLists-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/emptyInlinesWithinLists-expected.png index 2ac01f3..8fe2ad8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/emptyInlinesWithinLists-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/emptyInlinesWithinLists-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/inline-borders-with-bidi-override-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/inline-borders-with-bidi-override-expected.png index e078b81..e5abe397 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/inline-borders-with-bidi-override-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/inline-borders-with-bidi-override-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/nested-top-alignment-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/nested-top-alignment-expected.png new file mode 100644 index 0000000..a141797 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/nested-top-alignment-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/003-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/003-expected.txt index 737518f..4812e8c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/003-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/003-expected.txt
@@ -20,8 +20,8 @@ LayoutInline {I} at (0,0) size 67x19 LayoutText {#text} at (0,0) size 67x19 text run at (0,0) width 67: "Italic only." - LayoutText {#text} at (66,0) size 37x19 - text run at (66,0) width 37: " Plain" + LayoutText {#text} at (67,0) size 36x19 + text run at (67,0) width 36: " Plain" LayoutNGBlockFlow {P} at (0,108) size 784x20 LayoutText {#text} at (0,0) size 126x19 text run at (0,0) width 126: "I should not be red. " @@ -40,10 +40,10 @@ LayoutInline {I} at (0,0) size 93x19 LayoutText {#text} at (0,0) size 93x19 text run at (0,0) width 93: "Italic and red. " - LayoutText {#text} at (92,0) size 31x19 - text run at (92,0) width 31: "Red." - LayoutText {#text} at (122,0) size 127x19 - text run at (122,0) width 127: " I should not be red." + LayoutText {#text} at (93,0) size 30x19 + text run at (93,0) width 30: "Red." + LayoutText {#text} at (123,0) size 126x19 + text run at (123,0) width 126: " I should not be red." LayoutNGBlockFlow (anonymous) at (0,180) size 784x20 LayoutInline {B} at (0,0) size 131x19 LayoutText {#text} at (0,0) size 36x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/012-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/012-expected.txt index 2ac257044..b731298f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/012-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/012-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {CENTER} at (0,0) size 784x20 - LayoutInline {FONT} at (0,0) size 296x19 - LayoutText {#text} at (244,0) size 296x19 - text run at (244,0) width 296: "You should see a 100x100 green Image below." + LayoutInline {FONT} at (0,0) size 294x19 + LayoutText {#text} at (245,0) size 294x19 + text run at (245,0) width 294: "You should see a 100x100 green Image below." LayoutNGBlockFlow (anonymous) at (0,20) size 784x100 LayoutInline {FONT} at (0,0) size 100x100 LayoutNGBlockFlow {IMG} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/016-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/016-expected.txt index 1731da2..0a6d458 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/016-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/016-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 732x19 - text run at (0,0) width 732: "You should see two 100x100 green squares with black borders below. If you see only one square, the test has failed." + LayoutText {#text} at (0,0) size 730x19 + text run at (0,0) width 730: "You should see two 100x100 green squares with black borders below. If you see only one square, the test has failed." LayoutNGBlockFlow {P} at (0,36) size 784x104 LayoutNGBlockFlow {IMG} at (0,0) size 104x104 [bgcolor=#008000] [border: (2px solid #000000)] layer at (10,46) size 100x100 clip at (11,47) size 98x98
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/021-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/021-expected.txt new file mode 100644 index 0000000..6eab0d4d --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/invalid/021-expected.txt
@@ -0,0 +1,23 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 266x19 + text run at (0,0) width 266: "All the text below should be part of a link." + LayoutNGBlockFlow (anonymous) at (0,36) size 784x40 + LayoutInline {NOBR} at (0,0) size 25x19 + LayoutInline {A} at (0,0) size 25x19 [color=#0000EE] + LayoutText {#text} at (0,0) size 25x19 + text run at (0,0) width 25: "Test" + LayoutInline {A} at (0,0) size 61x19 [color=#0000EE] + LayoutText {#text} at (25,0) size 61x19 + text run at (25,0) width 61: " more test" + LayoutBR {BR} at (86,15) size 0x0 + LayoutWordBreak {WBR} at (0,20) size 0x0 + text run at (0,20) width 0: "\x{200B}" + LayoutInline {A} at (0,0) size 86x19 [color=#0000EE] + LayoutText {#text} at (0,20) size 86x19 + text run at (0,20) width 86: "Test more test" + LayoutBR {BR} at (86,20) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.png index aef3b9a..7985cad8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.txt index 266a9ae..7e2cfe5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/inline-dirty-z-order-lists-expected.txt
@@ -4,20 +4,20 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 52x19 - text run at (0,0) width 52: "Test for " - LayoutInline {I} at (0,0) size 770x39 - LayoutInline {A} at (0,0) size 308x19 [color=#0000EE] - LayoutText {#text} at (51,0) size 308x19 - text run at (51,0) width 308: "https://bugs.webkit.org/show_bug.cgi?id=23848" - LayoutText {#text} at (358,0) size 770x39 - text run at (358,0) width 412: " REGRESSION: Crash when mouse cursor moves over a link on" - text run at (0,20) width 121: "www.opportuno.de" - LayoutText {#text} at (120,20) size 5x19 - text run at (120,20) width 5: "." + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 769x39 + LayoutInline {A} at (0,0) size 307x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 307x19 + text run at (51,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=23848" + LayoutText {#text} at (358,0) size 769x39 + text run at (358,0) width 411: " REGRESSION: Crash when mouse cursor moves over a link on" + text run at (0,20) width 120: "www.opportuno.de" + LayoutText {#text} at (120,20) size 4x19 + text run at (120,20) width 4: "." LayoutNGBlockFlow {P} at (0,56) size 784x20 - LayoutText {#text} at (0,0) size 735x19 - text run at (0,0) width 735: "This tests that changing the z-index of an inline correctly invalidates its layer\x{2019}s and its stacking context\x{2019}s z-index lists." + LayoutText {#text} at (0,0) size 736x19 + text run at (0,0) width 736: "This tests that changing the z-index of an inline correctly invalidates its layer\x{2019}s and its stacking context\x{2019}s z-index lists." LayoutNGBlockFlow (anonymous) at (0,92) size 784x0 LayoutText {#text} at (0,0) size 0x0 layer at (8,100) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.png index f21c0d4..55168be 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.txt index 6ea75d2..0be221d1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/normal-flow-hit-test-expected.txt
@@ -4,11 +4,11 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x325 LayoutNGBlockFlow {BODY} at (8,16) size 784x301 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 58x19 - text run at (0,0) width 58: "Tests for " - LayoutInline {A} at (0,0) size 306x19 [color=#0000EE] - LayoutText {#text} at (57,0) size 306x19 - text run at (57,0) width 306: "https://bugs.webkit.org/show_bug.cgi?id=24552" + LayoutText {#text} at (0,0) size 57x19 + text run at (0,0) width 57: "Tests for " + LayoutInline {A} at (0,0) size 305x19 [color=#0000EE] + LayoutText {#text} at (57,0) size 305x19 + text run at (57,0) width 305: "https://bugs.webkit.org/show_bug.cgi?id=24552" LayoutNGBlockFlow (anonymous) at (0,36) size 784x125 LayoutText {#text} at (120,105) size 4x19 text run at (120,105) width 4: " " @@ -17,7 +17,7 @@ text run at (124,105) width 61: "Link here" LayoutText {#text} at (0,0) size 0x0 LayoutNGBlockFlow {DIV} at (0,281) size 784x20 - LayoutText {#text} at (0,0) size 168x19 - text run at (0,0) width 168: "Found link node, so PASS" + LayoutText {#text} at (0,0) size 167x19 + text run at (0,0) width 167: "Found link node, so PASS" layer at (18,62) size 100x100 LayoutNGBlockFlow {DIV} at (10,10) size 100x100 [bgcolor=#808080]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-outline-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-outline-expected.txt new file mode 100644 index 0000000..6a00b3da --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-outline-expected.txt
@@ -0,0 +1,21 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 763x39 + LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 348x19 + text run at (51,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9193" + LayoutText {#text} at (399,0) size 763x39 + text run at (399,0) width 364: " REGRESSION: setting an opacity on an element with an" + text run at (0,20) width 314: "outline causes the outline to disappear completely" + LayoutText {#text} at (314,20) size 4x19 + text run at (314,20) width 4: "." +layer at (8,64) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,56) size 784x2 [border: (1px inset #EEEEEE)] +layer at (8,74) size 100x100 transparent + LayoutNGBlockFlow {DIV} at (0,66) size 100x100 [bgcolor=#C0C0C0]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.png index 2391e2ba..d070ae2b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.txt index cc64e9b..92ad37e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/opacity-transforms-expected.txt
@@ -8,8 +8,8 @@ LayoutText {#text} at (0,0) size 305x19 text run at (0,0) width 305: "https://bugs.webkit.org/show_bug.cgi?id=22026" LayoutNGBlockFlow {P} at (0,36) size 784x20 - LayoutText {#text} at (0,0) size 650x19 - text run at (0,0) width 650: "Test that elements with transform and opacity on a parent are not clipped. You should see no red below." + LayoutText {#text} at (0,0) size 648x19 + text run at (0,0) width 648: "Test that elements with transform and opacity on a parent are not clipped. You should see no red below." layer at (150,200) size 100x100 LayoutNGBlockFlow (positioned) {DIV} at (150,200) size 100x100 [bgcolor=#FF0000] layer at (100,150) size 100x100 transparent
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/overflow-hidden-rounded-corners-occlusion-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/overflow-hidden-rounded-corners-occlusion-expected.txt index c28556b..537c392 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/overflow-hidden-rounded-corners-occlusion-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/overflow-hidden-rounded-corners-occlusion-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x156 LayoutNGBlockFlow {BODY} at (8,8) size 784x140 LayoutNGBlockFlow (anonymous) at (0,0) size 784x40 - LayoutText {#text} at (0,0) size 506x19 - text run at (0,0) width 506: "Test that verifies that rounded corners with overflow:hidden composite correctly." - LayoutBR {BR} at (505,0) size 0x0 + LayoutText {#text} at (0,0) size 504x19 + text run at (0,0) width 504: "Test that verifies that rounded corners with overflow:hidden composite correctly." + LayoutBR {BR} at (504,0) size 0x0 LayoutText {#text} at (0,20) size 640x19 text run at (0,20) width 640: "This page should show a green box with rounded corners on top of a yellow box with square corners." LayoutNGBlockFlow {DIV} at (0,40) size 100x100 [bgcolor=#FFFF00]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/remove-only-this-layer-update-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/remove-only-this-layer-update-expected.txt new file mode 100644 index 0000000..63c542b0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/layers/remove-only-this-layer-update-expected.txt
@@ -0,0 +1,18 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (0,100) size 800x500 + LayoutNGBlockFlow {DIV} at (100,0) size 600x100 + LayoutNGBlockFlow (anonymous) at (0,200) size 800x40 + LayoutText {#text} at (0,0) size 778x39 + text run at (0,0) width 778: "You should see a 100x100 green rect at 100x100 above with the word PASS. There should be no red on this page. This is a" + text run at (0,20) width 383: "test case for https://bugs.webkit.org/show_bug.cgi?id=25252" +layer at (100,100) size 100x100 + LayoutNGBlockFlow (positioned) {DIV} at (100,100) size 100x100 [bgcolor=#FF0000] + LayoutText {#text} at (0,0) size 34x19 + text run at (0,0) width 34: "FAIL" +layer at (100,100) size 100x100 + LayoutNGBlockFlow (relative positioned) {DIV} at (0,0) size 100x100 [bgcolor=#008000] + LayoutText {#text} at (0,0) size 37x19 + text run at (0,0) width 37: "PASS"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/007-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/007-expected.png index 4d3c912..fc57a132 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/007-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/007-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/big-list-marker-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/big-list-marker-expected.png index 50498fb..1b515e9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/big-list-marker-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/big-list-marker-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/marker-image-error-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/marker-image-error-expected.png index aef7eba..97875cf 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/marker-image-error-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/marker-image-error-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ol-display-types-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ol-display-types-expected.png index e76b170..5762682b9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ol-display-types-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ol-display-types-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ordered-list-with-no-ol-tag-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ordered-list-with-no-ol-tag-expected.png index da0c202..c515328 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ordered-list-with-no-ol-tag-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/ordered-list-with-no-ol-tag-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/scrolled-marker-paint-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/scrolled-marker-paint-expected.png index dc7029b4..be3da4c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/scrolled-marker-paint-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/lists/scrolled-marker-paint-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/float-in-relpositioned-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/float-in-relpositioned-expected.png index e68c78d..e15fb93f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/float-in-relpositioned-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/float-in-relpositioned-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/hit-test-overflow-controls-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/hit-test-overflow-controls-expected.png index 60331c8..78310c3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/hit-test-overflow-controls-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/hit-test-overflow-controls-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/position-fixed-transform-clipping-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/position-fixed-transform-clipping-expected.png index 08b1a6a..c406ffb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/position-fixed-transform-clipping-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/position-fixed-transform-clipping-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/scrollbar-position-update-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/scrollbar-position-update-expected.png index 19f25a1..661b095 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/scrollbar-position-update-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/overflow/scrollbar-position-update-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/parser/xhtml-alternate-entities-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/parser/xhtml-alternate-entities-expected.txt new file mode 100644 index 0000000..bf1f58e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/parser/xhtml-alternate-entities-expected.txt
@@ -0,0 +1,24 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x192 + LayoutNGBlockFlow {html} at (0,0) size 800x191.88 + LayoutNGBlockFlow {parsererror} at (16,16) size 768x139.88 [bgcolor=#FFDDDD] [border: (2px solid #CC7777)] + LayoutNGBlockFlow {h3} at (18,20.72) size 732x23 + LayoutText {#text} at (0,0) size 324x22 + text run at (0,0) width 324: "This page contains the following errors:" + LayoutNGBlockFlow {div} at (18,62.44) size 732x15 + LayoutText {#text} at (0,0) size 385x15 + text run at (0,0) width 385: "error on line 4 at column 13: Entity 'fnof' not defined" + text run at (385,0) width 0: " " + LayoutNGBlockFlow {h3} at (18,96.16) size 732x23 + LayoutText {#text} at (0,0) size 427x22 + text run at (0,0) width 427: "Below is a rendering of the page up to the first error." + LayoutNGBlockFlow (anonymous) at (0,171.88) size 800x20 + LayoutInline {h1} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {p} at (0,0) size 487x19 + LayoutInline {font} at (0,0) size 487x19 + LayoutText {#text} at (0,0) size 487x19 + text run at (0,0) width 487: "This should be the only line on this page. You should see a parse error above." + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/reflections/inline-crash-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/reflections/inline-crash-expected.txt new file mode 100644 index 0000000..167c08f --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/reflections/inline-crash-expected.txt
@@ -0,0 +1,26 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {I} at (0,0) size 654x19 + LayoutInline {A} at (0,0) size 307x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 307x19 + text run at (51,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=19525" + LayoutText {#text} at (358,0) size 347x19 + text run at (358,0) width 347: " -webkit-box-reflect in hyperlink causes webkit to crash" + LayoutText {#text} at (705,0) size 4x19 + text run at (705,0) width 4: "." + LayoutNGBlockFlow {P} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 176x19 + text run at (0,0) width 176: "Because it is an inline flow, " + LayoutInline {SPAN} at (0,0) size 55x19 + LayoutText {#text} at (176,0) size 55x19 + text run at (176,0) width 55: "this span" + LayoutText {#text} at (231,0) size 441x19 + text run at (231,0) width 441: " should not have a reflection, and selecting it should not cause a crash." +selection start: position 0 of child 0 {#text} of child 1 {SPAN} of child 2 {P} of body +selection end: position 9 of child 0 {#text} of child 1 {SPAN} of child 2 {P} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/reflections/reflection-overflow-hidden-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/reflections/reflection-overflow-hidden-expected.txt new file mode 100644 index 0000000..f75f37c --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/reflections/reflection-overflow-hidden-expected.txt
@@ -0,0 +1,29 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x140 layerType: background only +layer at (50,100) size 400x50 + LayoutNGBlockFlow (positioned) zI: -1 {DIV} at (50,100) size 400x50 [bgcolor=#FF0000] +layer at (50,250) size 400x50 + LayoutNGBlockFlow (positioned) zI: -1 {DIV} at (50,250) size 400x50 [bgcolor=#FF0000] +layer at (0,0) size 800x140 layerType: foreground only + LayoutNGBlockFlow {HTML} at (0,0) size 800x140 + LayoutNGBlockFlow {BODY} at (50,50) size 700x40 + LayoutNGBlockFlow {P} at (0,0) size 700x40 + LayoutInline {A} at (0,0) size 305x19 [color=#0000EE] + LayoutText {#text} at (0,0) size 305x19 + text run at (0,0) width 305: "https://bugs.webkit.org/show_bug.cgi?id=22570" + LayoutText {#text} at (305,0) size 693x39 + text run at (305,0) width 388: ". Test for reflection painting on overflow:hidden element. You" + text run at (0,20) width 186: "should not see any red below." +layer at (50,100) size 400x200 + LayoutNGBlockFlow (positioned) {DIV} at (50,100) size 400x200 +layer at (50,100) size 400x200 + LayoutNGBlockFlow (relative positioned) {DIV} at (0,0) size 400x200 +layer at (50,100) size 400x50 + LayoutNGBlockFlow (positioned) {DIV} at (0,0) size 400x50 [bgcolor=#008000] + LayoutText {#text} at (0,0) size 24x19 + text run at (0,0) width 24: "Top" +layer at (50,250) size 400x50 + LayoutNGBlockFlow (positioned) {DIV} at (0,150) size 400x50 [bgcolor=#008000] + LayoutText {#text} at (0,0) size 47x19 + text run at (0,0) width 47: "Bottom"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-resize-width-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-resize-width-expected.png index c686efa0..ca9d613 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-resize-width-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-resize-width-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-solid-color-with-alpha-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-solid-color-with-alpha-expected.png index b8afe489..929c4e6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-solid-color-with-alpha-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-solid-color-with-alpha-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-in-table-cell-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-in-table-cell-expected.png index 6faba5e..744c9a0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-in-table-cell-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-in-table-cell-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-transform-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-transform-expected.png index 9c81b4f..170a6df 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-transform-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/selection-rect-transform-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/ruby-inline-table-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/ruby-inline-table-expected.txt index d01334c..9d35bea 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/ruby-inline-table-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/ruby-inline-table-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow (anonymous) at (0,0) size 784x60 - LayoutText {#text} at (0,0) size 781x39 - text run at (0,0) width 781: "Test that <ruby> rendered as inline-table (or somesuch) is not affected by ruby rendering. Both <div> below should look the" + LayoutText {#text} at (0,0) size 780x39 + text run at (0,0) width 780: "Test that <ruby> rendered as inline-table (or somesuch) is not affected by ruby rendering. Both <div> below should look the" text run at (0,20) width 36: "same." LayoutBR {BR} at (36,20) size 0x0 LayoutBR {BR} at (0,40) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/rubyDOM-remove-text2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/rubyDOM-remove-text2-expected.txt index cf6a395e..39c6656 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/rubyDOM-remove-text2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/rubyDOM-remove-text2-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 732x19 - text run at (0,0) width 732: "The following is a test for DOM manipulation within <ruby>: Removing a ruby base object, leaving the base empty." + LayoutText {#text} at (0,0) size 731x19 + text run at (0,0) width 731: "The following is a test for DOM manipulation within <ruby>: Removing a ruby base object, leaving the base empty." LayoutNGBlockFlow {P} at (0,36) size 784x20 LayoutText {#text} at (0,0) size 436x19 text run at (0,0) width 436: "Both lines should look identical (the first line is the one manipulated)." @@ -15,28 +15,28 @@ LayoutNGBlockFlow {P} at (0,128) size 784x20 LayoutText {#text} at (0,0) size 155x19 text run at (0,0) width 155: "<ruby> is defined in the " - LayoutRuby (inline) {RUBY} at (0,0) size 9x20 - LayoutRubyRun (anonymous) at (155,17) size 113.83x0 - LayoutRubyText {RT} at (0,-12) size 113.83x12 + LayoutRuby (inline) {RUBY} at (0,0) size 8x20 + LayoutRubyRun (anonymous) at (155,17) size 114x0 + LayoutRubyText {RT} at (0,-12) size 114x12 LayoutText {#text} at (0,0) size 114x12 text run at (0,0) width 114: "Hyper-text Markup Language" - LayoutRubyRun (anonymous) at (268.83,0) size 8x20 + LayoutRubyRun (anonymous) at (269,0) size 8x20 LayoutRubyBase (anonymous) at (0,0) size 8x20 LayoutText {#text} at (0,0) size 8x19 text run at (0,0) width 8: "5" - LayoutText {#text} at (276,0) size 37x19 - text run at (276,0) width 37: " spec." + LayoutText {#text} at (277,0) size 36x19 + text run at (277,0) width 36: " spec." LayoutNGBlockFlow {P} at (0,164) size 784x20 LayoutText {#text} at (0,0) size 155x19 text run at (0,0) width 155: "<ruby> is defined in the " - LayoutRuby (inline) {RUBY} at (0,0) size 9x20 - LayoutRubyRun (anonymous) at (155,17) size 113.83x0 - LayoutRubyText {RT} at (0,-12) size 113.83x12 + LayoutRuby (inline) {RUBY} at (0,0) size 8x20 + LayoutRubyRun (anonymous) at (155,17) size 114x0 + LayoutRubyText {RT} at (0,-12) size 114x12 LayoutText {#text} at (0,0) size 114x12 text run at (0,0) width 114: "Hyper-text Markup Language" - LayoutRubyRun (anonymous) at (268.83,0) size 8x20 + LayoutRubyRun (anonymous) at (269,0) size 8x20 LayoutRubyBase (anonymous) at (0,0) size 8x20 LayoutText {#text} at (0,0) size 8x19 text run at (0,0) width 8: "5" - LayoutText {#text} at (276,0) size 37x19 - text run at (276,0) width 37: " spec." + LayoutText {#text} at (277,0) size 36x19 + text run at (277,0) width 36: " spec."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/018-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/018-expected.txt index f458eee1..de00e1c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/018-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/018-expected.txt
@@ -9,27 +9,27 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (674,0) size 30x19 text run at (674,0) width 30: "here" - LayoutText {#text} at (703,0) size 744x39 - text run at (703,0) width 41: ") or its" + LayoutText {#text} at (704,0) size 744x39 + text run at (704,0) width 40: ") or its" text run at (0,20) width 157: "whitespace background, " LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (157,20) size 30x19 text run at (157,20) width 30: "here" - LayoutText {#text} at (186,20) size 5x19 - text run at (186,20) width 5: ":" + LayoutText {#text} at (187,20) size 4x19 + text run at (187,20) width 4: ":" LayoutNGBlockFlow {ADDRESS} at (0,56) size 784x20 LayoutText {#text} at (0,0) size 161x19 text run at (0,0) width 161: "The background color of " - LayoutInline {A} at (0,0) size 115x19 [color=#0000EE] - LayoutText {#text} at (160,0) size 81x19 - text run at (160,0) width 81: "this anchor (" - LayoutInline {STRONG} at (0,0) size 30x19 - LayoutText {#text} at (240,0) size 30x19 - text run at (240,0) width 30: "here" - LayoutText {#text} at (269,0) size 6x19 - text run at (269,0) width 6: ")" - LayoutText {#text} at (274,0) size 387x19 - text run at (274,0) width 387: " should turn to green when the pointing device hovers over it." + LayoutInline {A} at (0,0) size 114x19 [color=#0000EE] + LayoutText {#text} at (161,0) size 80x19 + text run at (161,0) width 80: "this anchor (" + LayoutInline {STRONG} at (0,0) size 29x19 + LayoutText {#text} at (241,0) size 29x19 + text run at (241,0) width 29: "here" + LayoutText {#text} at (270,0) size 5x19 + text run at (270,0) width 5: ")" + LayoutText {#text} at (275,0) size 387x19 + text run at (275,0) width 387: " should turn to green when the pointing device hovers over it." LayoutTable {TABLE} at (0,76) size 308x221 LayoutTableSection {TBODY} at (0,0) size 308x221 LayoutTableRow {TR} at (0,5) size 308x22 @@ -62,8 +62,8 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (41,1) size 30x19 text run at (41,1) width 30: "here" - LayoutText {#text} at (70,1) size 10x19 - text run at (70,1) width 10: ")." + LayoutText {#text} at (71,1) size 9x19 + text run at (71,1) width 9: ")." LayoutNGTableCell {TD} at (204,69) size 99x2 [r=2 c=2 rs=1 cs=1] LayoutTableRow {TR} at (0,86) size 308x22 LayoutNGTableCell {TD} at (5,86) size 100x22 [r=3 c=0 rs=1 cs=1] @@ -110,8 +110,8 @@ LayoutInline {STRONG} at (0,0) size 30x19 LayoutText {#text} at (65,1) size 30x19 text run at (65,1) width 30: "here" - LayoutText {#text} at (94,1) size 5x19 - text run at (94,1) width 5: "," + LayoutText {#text} at (95,1) size 4x19 + text run at (95,1) width 4: "," LayoutNGTableCell {TD} at (110,204) size 89x2 [r=7 c=1 rs=1 cs=1] LayoutNGTableCell {TD} at (204,194) size 99x22 [r=7 c=2 rs=1 cs=1] LayoutText {#text} at (1,1) size 71x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/021-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/021-expected.txt new file mode 100644 index 0000000..8c360ac --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/021-expected.txt
@@ -0,0 +1,32 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x184 + LayoutNGBlockFlow {HTML} at (0,0) size 800x184 + LayoutNGBlockFlow {BODY} at (8,16) size 784x152 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 755x19 + text run at (0,0) width 755: "This paragraph should be unstyled. The background of the following paragraph should become green when you follow " + LayoutInline {A} at (0,0) size 777x39 [color=#0000EE] + LayoutText {#text} at (755,0) size 777x39 + text run at (755,0) width 22: "this" + text run at (0,20) width 24: "link" + LayoutText {#text} at (24,20) size 4x19 + text run at (24,20) width 4: "." + LayoutNGBlockFlow {P} at (0,56) size 784x40 + LayoutText {#text} at (0,0) size 739x19 + text run at (0,0) width 739: "This paragraph should initially be unstyled. It should become green when you select the link above. When you select " + LayoutInline {A} at (0,0) size 761x39 [color=#0000EE] + LayoutText {#text} at (739,0) size 761x39 + text run at (739,0) width 22: "this" + text run at (0,20) width 24: "link" + LayoutText {#text} at (24,20) size 636x19 + text run at (24,20) width 636: ", it should return to being unstyled and the background of the paragraph below should become green." + LayoutNGBlockFlow {P} at (0,112) size 784x40 + LayoutText {#text} at (0,0) size 745x19 + text run at (0,0) width 745: "This paragraph should initially be unstyled. It should become green when you select the link above. When you follow " + LayoutInline {A} at (0,0) size 767x39 [color=#0000EE] + LayoutText {#text} at (745,0) size 767x39 + text run at (745,0) width 22: "this" + text run at (0,20) width 24: "link" + LayoutText {#text} at (24,20) size 357x19 + text run at (24,20) width 357: ", the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/034-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/034-expected.txt index 80f42f8..1d88c5d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/034-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/034-expected.txt
@@ -8,11 +8,11 @@ LayoutText {#text} at (0,0) size 188x19 text run at (0,0) width 188: "This div contains 3 addresses:" LayoutNGBlockFlow {ADDRESS} at (16,20) size 768x20 [bgcolor=#00FF00] - LayoutText {#text} at (0,0) size 329x19 - text run at (0,0) width 329: "A first address that should have a green background" + LayoutText {#text} at (0,0) size 331x19 + text run at (0,0) width 331: "A first address that should have a green background" LayoutNGBlockFlow {ADDRESS} at (16,56) size 768x20 - LayoutText {#text} at (0,0) size 271x19 - text run at (0,0) width 271: "A second address with normal background" + LayoutText {#text} at (0,0) size 272x19 + text run at (0,0) width 272: "A second address with normal background" LayoutNGBlockFlow {ADDRESS} at (16,92) size 768x20 - LayoutText {#text} at (0,0) size 256x19 - text run at (0,0) width 256: "A third address with normal background" + LayoutText {#text} at (0,0) size 258x19 + text run at (0,0) width 258: "A third address with normal background"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/066-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/066-expected.txt new file mode 100644 index 0000000..8c360ac --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/066-expected.txt
@@ -0,0 +1,32 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x184 + LayoutNGBlockFlow {HTML} at (0,0) size 800x184 + LayoutNGBlockFlow {BODY} at (8,16) size 784x152 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 755x19 + text run at (0,0) width 755: "This paragraph should be unstyled. The background of the following paragraph should become green when you follow " + LayoutInline {A} at (0,0) size 777x39 [color=#0000EE] + LayoutText {#text} at (755,0) size 777x39 + text run at (755,0) width 22: "this" + text run at (0,20) width 24: "link" + LayoutText {#text} at (24,20) size 4x19 + text run at (24,20) width 4: "." + LayoutNGBlockFlow {P} at (0,56) size 784x40 + LayoutText {#text} at (0,0) size 739x19 + text run at (0,0) width 739: "This paragraph should initially be unstyled. It should become green when you select the link above. When you select " + LayoutInline {A} at (0,0) size 761x39 [color=#0000EE] + LayoutText {#text} at (739,0) size 761x39 + text run at (739,0) width 22: "this" + text run at (0,20) width 24: "link" + LayoutText {#text} at (24,20) size 636x19 + text run at (24,20) width 636: ", it should return to being unstyled and the background of the paragraph below should become green." + LayoutNGBlockFlow {P} at (0,112) size 784x40 + LayoutText {#text} at (0,0) size 745x19 + text run at (0,0) width 745: "This paragraph should initially be unstyled. It should become green when you select the link above. When you follow " + LayoutInline {A} at (0,0) size 767x39 [color=#0000EE] + LayoutText {#text} at (745,0) size 767x39 + text run at (745,0) width 22: "this" + text run at (0,20) width 24: "link" + LayoutText {#text} at (24,20) size 357x19 + text run at (24,20) width 357: ", the three paragraphs should all return to being unstyled."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/unqualified-hover-strict-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/unqualified-hover-strict-expected.txt index 2b73ba90..2beb0860 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/unqualified-hover-strict-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/selectors/unqualified-hover-strict-expected.txt
@@ -7,5 +7,5 @@ LayoutText {#text} at (0,0) size 453x22 text run at (0,0) width 453: "Test of unqualifed :hover selector in strict parsing mode" LayoutNGBlockFlow {P} at (0,41.72) size 784x20 - LayoutText {#text} at (0,0) size 690x19 - text run at (0,0) width 690: "Moving the mouse anywhere over the document should result in the background color being changed to grey." + LayoutText {#text} at (0,0) size 689x19 + text run at (0,0) width 689: "Moving the mouse anywhere over the document should result in the background color being changed to grey."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/100-percent-cell-width-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/100-percent-cell-width-expected.png index 9f61442..c8d225a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/100-percent-cell-width-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/100-percent-cell-width-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/generated-caption-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/generated-caption-expected.png index c0c813e..c2477c0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/generated-caption-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/generated-caption-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-before-anonymous-ancestors-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-before-anonymous-ancestors-expected.png index d64f2f6..127db486 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-before-anonymous-ancestors-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-before-anonymous-ancestors-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-cell-before-form-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-cell-before-form-expected.png index 9832a89..a393d0e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-cell-before-form-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-cell-before-form-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-row-before-form-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-row-before-form-expected.png index 9832a89..a393d0e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-row-before-form-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/insert-row-before-form-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/prepend-in-anonymous-table-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/prepend-in-anonymous-table-expected.png index 65cca00..b9948c8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/prepend-in-anonymous-table-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/prepend-in-anonymous-table-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/row-height-recalc-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/row-height-recalc-expected.png index 58c12f11..c504345 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/row-height-recalc-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/row-height-recalc-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/stale-grid-crash-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/stale-grid-crash-expected.png index 51fdef57..804ce62 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/stale-grid-crash-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/stale-grid-crash-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atomic-inline-before-ellipsis-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atomic-inline-before-ellipsis-expected.png index 575882d..676483e07 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atomic-inline-before-ellipsis-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atomic-inline-before-ellipsis-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atsui-spacing-features-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atsui-spacing-features-expected.png index e2a4fe4..621cc8bd 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atsui-spacing-features-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/atsui-spacing-features-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/002-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/002-expected.png index e207a8a..b20c61f5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/002-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/007-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/007-expected.png index ed69b740..fc3848d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/007-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/007-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/009-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/009-expected.png index 89052cd..0196f54 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/009-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/009-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/013-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/013-expected.png index de4726cc..296047f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/013-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/013-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/015-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/015-expected.png index 3271244..5f36149 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/015-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/015-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/generic-family-changes-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/generic-family-changes-expected.png index f4a5127..6da9f08 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/generic-family-changes-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/basic/generic-family-changes-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/bidi-img-alt-text-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/bidi-img-alt-text-expected.png index ba26bea..10c55c46 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/bidi-img-alt-text-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/bidi-img-alt-text-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/break-word-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/break-word-expected.png index 08ed306..3c1de53 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/break-word-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/break-word-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-boundaries-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-boundaries-expected.png index 87cec1d5..349d64a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-boundaries-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-boundaries-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-preserve-nbsp-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-preserve-nbsp-expected.png index 81f1d50..3492612 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-preserve-nbsp-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/capitalize-preserve-nbsp-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/cg-fallback-bolding-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/cg-fallback-bolding-expected.png index f2830235..e1c270d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/cg-fallback-bolding-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/cg-fallback-bolding-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/color-emoji-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/color-emoji-expected.png index 5c66c24..9881404 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/color-emoji-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/color-emoji-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/drawBidiText-expected.png index a442dba..7a8de5c2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/drawBidiText-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/drawBidiText-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-at-edge-of-ltr-text-in-rtl-flow-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-at-edge-of-ltr-text-in-rtl-flow-expected.png index 0792523..e3e37e3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-at-edge-of-ltr-text-in-rtl-flow-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-at-edge-of-ltr-text-in-rtl-flow-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-expected.png index 4b76efb2..27144e07 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png index 21e357bf..6911adff 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fake-italic-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fake-italic-expected.png index 5d7e489..ff412bc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fake-italic-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fake-italic-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fallback-for-custom-font-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fallback-for-custom-font-expected.png index cb5c9617b..e5faad7e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fallback-for-custom-font-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/fallback-for-custom-font-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-features/caps-native-synthesis-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-features/caps-native-synthesis-expected.png index b9c86e3..e80dc37 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-features/caps-native-synthesis-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-features/caps-native-synthesis-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-initial-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-initial-expected.png index 6dcbb73a..977c5b6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-initial-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-initial-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-ligature-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-ligature-letter-spacing-expected.txt index a44677b2..e0825d0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-ligature-letter-spacing-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-ligature-letter-spacing-expected.txt
@@ -1,7 +1,7 @@ This is a testharness.js-based test. Harness Error. harness_status.status = 1 , harness_status.message = 1 duplicate test name: "Ligature expected not to be applied due to letter spacing." -FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.5625 but got 140 -FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.5625 but got 140 +FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 288 but got 140 +FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 288 but got 140 PASS Non-ligature font feature expected to be applied despite letter spacing. Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-expected.png index 9cdd4bd2..c09efc5a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-variant-expected.png index 3b35f56..bb0bca6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-variant-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-stretch-variant-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/in-rendered-text-rtl-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/in-rendered-text-rtl-expected.png index f5a9ff02..6f5593a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/in-rendered-text-rtl-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/in-rendered-text-rtl-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-AN-after-empty-run-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-AN-after-empty-run-expected.png index e932f76..c7cd283 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-AN-after-empty-run-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-AN-after-empty-run-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-CS-after-AN-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-CS-after-AN-expected.png index 54ad07b..179b150 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-CS-after-AN-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-CS-after-AN-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-CSS-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-CSS-expected.png index 74a0422..de3e3477e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-CSS-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-CSS-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-HTML-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-HTML-expected.png index 42fd31eb..2d7caf9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-HTML-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-HTML-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-formatting-characters-expected.png index 347de86b..cea1c7a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-formatting-characters-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-LDB-2-formatting-characters-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-ignored-for-first-child-inline-expected.png index 247ac90..9ba8668 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-ignored-for-first-child-inline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-ignored-for-first-child-inline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-innertext-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-innertext-expected.png index 63898bef..4ec9f18 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-innertext-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-innertext-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-linebreak-001-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-linebreak-001-expected.png index d1557ea..35066b6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-linebreak-001-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-linebreak-001-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-listbox-atsui-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-listbox-atsui-expected.png index 2e53890..cd19f068 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-listbox-atsui-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-listbox-atsui-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-mirror-he-ar-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-mirror-he-ar-expected.png index e64dbec1..62cf1ab 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-mirror-he-ar-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-mirror-he-ar-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png index 90fd352..a50e010b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/complex-character-based-fallback-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/complex-character-based-fallback-expected.png index 270913b..d6fecf45 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/complex-character-based-fallback-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/complex-character-based-fallback-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/danda-space-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/danda-space-expected.png index 516876b..084d459 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/danda-space-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/danda-space-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/thai-baht-space-expected.png index 6b72de1..c9bffb9d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/thai-baht-space-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/thai-baht-space-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/unicode-bidi-plaintext-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/unicode-bidi-plaintext-expected.png index 212528c..a5888af6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/unicode-bidi-plaintext-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/unicode-bidi-plaintext-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/vertical-text-glyph-test-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/vertical-text-glyph-test-expected.png index ead39011..d2493eb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/vertical-text-glyph-test-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/international/vertical-text-glyph-test-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/midword-break-after-breakable-char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/midword-break-after-breakable-char-expected.png index 7a92222f..c4d6097 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/midword-break-after-breakable-char-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/midword-break-after-breakable-char-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/reset-emptyRun-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/reset-emptyRun-expected.png index b9fc3ca..8af17a98 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/reset-emptyRun-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/reset-emptyRun-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-kerning-and-ligatures-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-kerning-and-ligatures-expected.png index abbc745..c222271 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-kerning-and-ligatures-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-kerning-and-ligatures-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-partial-selection-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-partial-selection-expected.png index 022c6fb..8c3a504 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-partial-selection-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/atsui-partial-selection-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/delete-hard-break-character-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/delete-hard-break-character-expected.png index b37b9eb..a27d6546 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/delete-hard-break-character-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/delete-hard-break-character-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-at-edge-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-at-edge-expected.png index dbc43a5..b5f14e0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-at-edge-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-at-edge-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-expected.png index 5d5480f67..6bc9cf8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/justified-selection-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/should-use-atsui-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/should-use-atsui-expected.png index 2789bff..d22c3730 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/should-use-atsui-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/selection/should-use-atsui-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/shaping/same-script-different-lang-expected.png index 285c42a5..939b2b4ac 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/shaping/same-script-different-lang-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/shaping/same-script-different-lang-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/stroking-decorations-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/stroking-decorations-expected.png index 3031625..c1a9368 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/stroking-decorations-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/stroking-decorations-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/text-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/text-letter-spacing-expected.png index f6f701d..4955d65 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/text-letter-spacing-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/text-letter-spacing-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/wbr-in-pre-crash-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/wbr-in-pre-crash-expected.png index 05b1115..0dbe5254 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/wbr-in-pre-crash-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/wbr-in-pre-crash-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/028-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/028-expected.png index 7a35f15096..6ad9204 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/028-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/028-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/pre-wrap-last-char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/pre-wrap-last-char-expected.png index 2ebbb74..82fc693 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/pre-wrap-last-char-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/whitespace/pre-wrap-last-char-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-run-rounding-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-run-rounding-expected.png index 81c6f45..b46bb212 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-run-rounding-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-run-rounding-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-soft-hyphen-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-soft-hyphen-expected.png index bd67e64..0e1eeea9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-soft-hyphen-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-break-soft-hyphen-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-space-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-space-expected.png index e8832d9..e16314b2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-space-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/word-space-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-cyr-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-cyr-expected.txt index 0651f23..42c0fa44 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-cyr-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-cyr-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 316x19 text run at (0,0) width 316: "CHARACTERS IN XSLT: \x{414}\x{43E}\x{431}\x{430}\x{432}\x{43B}\x{435}\x{43D}\x{43D}\x{44B}\x{439} \x{442}\x{435}\x{43A}\x{441}\x{442}" - LayoutBR {BR} at (315,0) size 0x0 + LayoutBR {BR} at (316,0) size 0x0 LayoutBR {BR} at (0,20) size 0x0 LayoutText {#text} at (0,40) size 224x19 text run at (0,40) width 224: "SOURCE XML: \x{418}\x{441}\x{445}\x{43E}\x{434}\x{43D}\x{44B}\x{439} \x{442}\x{435}\x{43A}\x{441}\x{442}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-expected.txt index 9299261..cf1b326e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 258x19 text run at (0,0) width 258: "CHARACTERS IN XSLT: \x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}" - LayoutBR {BR} at (257,0) size 0x0 + LayoutBR {BR} at (258,0) size 0x0 LayoutBR {BR} at (0,20) size 0x0 LayoutText {#text} at (0,40) size 316x19 text run at (0,40) width 316: "SOURCE XML: \x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16-expected.txt index 9299261..cf1b326e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 258x19 text run at (0,0) width 258: "CHARACTERS IN XSLT: \x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}" - LayoutBR {BR} at (257,0) size 0x0 + LayoutBR {BR} at (258,0) size 0x0 LayoutBR {BR} at (0,20) size 0x0 LayoutText {#text} at (0,40) size 316x19 text run at (0,40) width 316: "SOURCE XML: \x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16to16-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16to16-expected.txt index 9299261..cf1b326e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16to16-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-enc16to16-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutText {#text} at (0,0) size 258x19 text run at (0,0) width 258: "CHARACTERS IN XSLT: \x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}" - LayoutBR {BR} at (257,0) size 0x0 + LayoutBR {BR} at (258,0) size 0x0 LayoutBR {BR} at (0,20) size 0x0 LayoutText {#text} at (0,40) size 316x19 text run at (0,40) width 316: "SOURCE XML: \x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}\x{E9}"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-relative-path-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-relative-path-expected.txt new file mode 100644 index 0000000..4c18dfb6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xsl/xslt-relative-path-expected.txt
@@ -0,0 +1,14 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 509x19 + text run at (0,0) width 509: "Here is an attempt to extract the string \"Hello, Webkit!\" from the file findme.xml:" + LayoutNGBlockFlow {P} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 375x19 + text run at (0,0) width 375: "using document('file:resources/findme.xml'): Hello, Webkit!" + LayoutNGBlockFlow {P} at (0,72) size 784x20 + LayoutText {#text} at (0,0) size 351x19 + text run at (0,0) width 351: "using document('resources/findme.xml'): Hello, Webkit!"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/document_metadata/head-link-style-href-check-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/document_metadata/head-link-style-href-check-expected.txt new file mode 100644 index 0000000..26c6f014 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/document_metadata/head-link-style-href-check-expected.txt
@@ -0,0 +1,37 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x292 + LayoutNGBlockFlow {HTML} at (0,0) size 800x292 + LayoutNGBlockFlow {BODY} at (8,16) size 784x268 + LayoutNGBlockFlow {P} at (0,0) size 784x80 + LayoutText {#text} at (0,0) size 782x79 + text run at (0,0) width 782: "This is a test to check if the loading of a stylesheet is properly cancelled (count of pending style sheets is decremented) when" + text run at (0,20) width 779: "its link tag is changed through the DOM after the link tag is appended to the document. When the div with style is moved, it" + text run at (0,40) width 775: "appears on the screen if the style was loaded properly, and doesn't appear when there are out-standing stylesheets according" + text run at (0,60) width 146: "to the DocLoader. See " + LayoutInline {A} at (0,0) size 32x19 [color=#0000EE] + LayoutText {#text} at (146,60) size 32x19 + text run at (146,60) width 32: "6999" + LayoutNGBlockFlow {P} at (0,96) size 784x20 + LayoutInline {SPAN} at (0,0) size 32x19 [color=#FF0000] + LayoutText {#text} at (0,0) size 32x19 + text run at (0,0) width 32: "Fails" + LayoutText {#text} at (32,0) size 52x19 + text run at (32,0) width 52: " if there " + LayoutInline {SPAN} at (0,0) size 31x19 [color=#FF0000] + LayoutText {#text} at (84,0) size 31x19 + text run at (84,0) width 31: "is no" + LayoutText {#text} at (115,0) size 151x19 + text run at (115,0) width 151: " pink box on the screen." + LayoutNGBlockFlow {P} at (0,132) size 784x20 + LayoutInline {SPAN} at (0,0) size 43x19 [color=#008000] + LayoutText {#text} at (0,0) size 43x19 + text run at (0,0) width 43: "Passes" + LayoutText {#text} at (43,0) size 52x19 + text run at (43,0) width 52: " if there " + LayoutInline {SPAN} at (0,0) size 10x19 [color=#008000] + LayoutText {#text} at (95,0) size 10x19 + text run at (95,0) width 10: "is" + LayoutText {#text} at (105,0) size 162x19 + text run at (105,0) width 162: " a pink box on the screen." + LayoutNGBlockFlow {DIV} at (0,168) size 100x100 [bgcolor=#FFCCFF]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/tabular_data/table_createcaption-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/tabular_data/table_createcaption-expected.txt new file mode 100644 index 0000000..06514ac3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/tabular_data/table_createcaption-expected.txt
@@ -0,0 +1,88 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 265x19 + text run at (0,0) width 265: "Tests: the TABLE.createCaption() method" + LayoutBR {BR} at (265,0) size 0x0 + LayoutNGBlockFlow {P} at (0,36) size 784x60 + LayoutText {#text} at (0,0) size 73x19 + text run at (0,0) width 73: "Conditions:" + LayoutBR {BR} at (73,0) size 0x0 + LayoutText {#text} at (0,20) size 783x39 + text run at (0,20) width 783: "If no caption exists, the method should create an empty caption, add it to the table, and return a pointer to it. If a caption does" + text run at (0,40) width 285: "exist, the method should return a pointer to it." + LayoutNGBlockFlow {P} at (0,112) size 784x40 + LayoutText {#text} at (0,0) size 324x19 + text run at (0,0) width 324: "If successful, the first table should have the caption " + LayoutInline {B} at (0,0) size 43x19 + LayoutText {#text} at (324,0) size 43x19 + text run at (324,0) width 43: "Fruity" + LayoutText {#text} at (367,0) size 293x19 + text run at (367,0) width 293: ", and the second table should have the caption " + LayoutInline {B} at (0,0) size 73x19 + LayoutText {#text} at (660,0) size 73x19 + text run at (660,0) width 73: "Vegetabley" + LayoutText {#text} at (733,0) size 777x39 + text run at (733,0) width 44: ". Upon" + text run at (0,20) width 584: "failure, the first table will have no caption, and the second table will have the caption Things." + LayoutTable {TABLE} at (0,178) size 109x102 [border: (1px outset #808080)] + LayoutBlockFlow {CAPTION} at (0,0) size 109x20 + LayoutInline {B} at (0,0) size 43x19 + LayoutText {#text} at (33,0) size 43x19 + text run at (33,0) width 43: "Fruity" + LayoutTableSection {TBODY} at (1,21) size 107x80 + LayoutTableRow {TR} at (0,2) size 107x24 + LayoutNGTableCell {TH} at (2,2) size 52x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (8,2) size 36x19 + text run at (8,2) width 36: "Fruit" + LayoutNGTableCell {TH} at (56,2) size 49x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (5,2) size 39x19 + text run at (5,2) width 39: "Color" + LayoutTableRow {TR} at (0,28) size 107x24 + LayoutNGTableCell {TD} at (2,28) size 52x24 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 48x19 + text run at (2,2) width 48: "Banana" + LayoutNGTableCell {TD} at (56,28) size 49x24 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 45x19 + text run at (2,2) width 45: "Yellow" + LayoutTableRow {TR} at (0,54) size 107x24 + LayoutNGTableCell {TD} at (2,54) size 52x24 [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 39x19 + text run at (2,2) width 39: "Grape" + LayoutNGTableCell {TD} at (56,54) size 49x24 [border: (1px inset #808080)] [r=2 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 41x19 + text run at (2,2) width 41: "Purple" + LayoutNGBlockFlow (anonymous) at (0,280) size 784x20 + LayoutBR {BR} at (0,0) size 0x0 + LayoutTable {TABLE} at (0,300) size 129x102 [border: (1px outset #808080)] + LayoutBlockFlow {CAPTION} at (0,0) size 129x20 + LayoutInline {B} at (0,0) size 73x19 + LayoutText {#text} at (28,0) size 73x19 + text run at (28,0) width 73: "Vegetabley" + LayoutTableSection {TBODY} at (1,21) size 127x80 + LayoutTableRow {TR} at (0,2) size 127x24 + LayoutNGTableCell {TH} at (2,2) size 70x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 66x19 + text run at (2,2) width 66: "Vegetable" + LayoutNGTableCell {TH} at (74,2) size 51x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (6,2) size 39x19 + text run at (6,2) width 39: "Color" + LayoutTableRow {TR} at (0,28) size 127x24 + LayoutNGTableCell {TD} at (2,28) size 70x24 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 40x19 + text run at (2,2) width 40: "Carrot" + LayoutNGTableCell {TD} at (74,28) size 51x24 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 47x19 + text run at (2,2) width 47: "Orange" + LayoutTableRow {TR} at (0,54) size 127x24 + LayoutNGTableCell {TD} at (2,54) size 70x24 [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 66x19 + text run at (2,2) width 66: "Cucumber" + LayoutNGTableCell {TD} at (74,54) size 51x24 [border: (1px inset #808080)] [r=2 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 39x19 + text run at (2,2) width 39: "Green" +layer at (8,176) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,168) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/tabular_data/td_colspan_rendering-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/tabular_data/td_colspan_rendering-expected.txt new file mode 100644 index 0000000..8d273bb1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/tabular_data/td_colspan_rendering-expected.txt
@@ -0,0 +1,102 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 165x19 + text run at (0,0) width 165: "Tests: the colspan attribute" + LayoutBR {BR} at (165,0) size 0x0 + LayoutNGBlockFlow {P} at (0,36) size 784x80 + LayoutText {#text} at (0,0) size 73x19 + text run at (0,0) width 73: "Conditions:" + LayoutBR {BR} at (73,0) size 0x0 + LayoutText {#text} at (0,20) size 772x59 + text run at (0,20) width 772: "The colSpan attribute specifies the number of columns spanned by the current cell. The default value of this attribute is one" + text run at (0,40) width 767: "(\"1\"). The value zero (\"0\") means that the cell spans all columns from the current column to the last column of the column" + text run at (0,60) width 317: "group (COLGROUP) in which the cell is defined." + LayoutNGBlockFlow {P} at (0,132) size 784x60 + LayoutText {#text} at (0,0) size 782x59 + text run at (0,0) width 759: "The first table tests the default value of one, and an input of 7, which is within the normal range of expect input. The first" + text run at (0,20) width 782: "column in the first row should span only column \"one\" and the second cell should span all of the other columns. The second" + text run at (0,40) width 520: "table tests the zero value. \"Just A\" should span \"A\" and \"Just B\" should span \"B.\"" + LayoutNGBlockFlow (anonymous) at (0,218) size 784x20 + LayoutBR {BR} at (0,0) size 0x0 + LayoutTable {TABLE} at (0,238) size 270x76 [border: (1px outset #808080)] + LayoutBlockFlow {CAPTION} at (0,0) size 270x20 + LayoutText {#text} at (28,0) size 214x19 + text run at (28,0) width 214: "Testing Default and Regular Input" + LayoutTableSection {TBODY} at (1,21) size 268x54 + LayoutTableRow {TR} at (0,2) size 268x24 + LayoutNGTableCell {TD} at (2,2) size 32x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 28x19 + text run at (2,2) width 28: "First" + LayoutNGTableCell {TD} at (36,2) size 230x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=7] + LayoutText {#text} at (2,2) size 75x19 + text run at (2,2) width 75: "All the Rest" + LayoutTableRow {TR} at (0,28) size 268x24 + LayoutNGTableCell {TD} at (2,28) size 32x24 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 23x19 + text run at (2,2) width 23: "one" + LayoutNGTableCell {TD} at (36,28) size 28x24 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 24x19 + text run at (2,2) width 24: "two" + LayoutNGTableCell {TD} at (66,28) size 35x24 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1] + LayoutText {#text} at (2,2) size 31x19 + text run at (2,2) width 31: "three" + LayoutNGTableCell {TD} at (103,28) size 30x24 [border: (1px inset #808080)] [r=1 c=3 rs=1 cs=1] + LayoutText {#text} at (2,2) size 26x19 + text run at (2,2) width 26: "four" + LayoutNGTableCell {TD} at (135,28) size 28x24 [border: (1px inset #808080)] [r=1 c=4 rs=1 cs=1] + LayoutText {#text} at (2,2) size 24x19 + text run at (2,2) width 24: "five" + LayoutNGTableCell {TD} at (165,28) size 22x24 [border: (1px inset #808080)] [r=1 c=5 rs=1 cs=1] + LayoutText {#text} at (2,2) size 18x19 + text run at (2,2) width 18: "six" + LayoutNGTableCell {TD} at (189,28) size 40x24 [border: (1px inset #808080)] [r=1 c=6 rs=1 cs=1] + LayoutText {#text} at (2,2) size 36x19 + text run at (2,2) width 36: "seven" + LayoutNGTableCell {TD} at (231,28) size 35x24 [border: (1px inset #808080)] [r=1 c=7 rs=1 cs=1] + LayoutText {#text} at (2,2) size 31x19 + text run at (2,2) width 31: "eight" + LayoutNGBlockFlow (anonymous) at (0,314) size 784x20 + LayoutBR {BR} at (0,0) size 0x0 + LayoutTable {TABLE} at (0,334) size 197x76 [border: (1px outset #808080)] + LayoutBlockFlow {CAPTION} at (0,0) size 197x20 + LayoutText {#text} at (16,0) size 165x19 + text run at (16,0) width 165: "Testing Zero Special Case" + LayoutTableSection {TBODY} at (1,21) size 195x54 + LayoutTableRow {TR} at (0,2) size 195x24 + LayoutNGTableCell {TD} at (2,2) size 44x24 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 40x19 + text run at (2,2) width 40: "Just A" + LayoutNGTableCell {TD} at (48,2) size 43x24 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 39x19 + text run at (2,2) width 39: "Just B" + LayoutTableRow {TR} at (0,28) size 195x24 + LayoutNGTableCell {TD} at (2,28) size 44x24 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] + LayoutText {#text} at (2,2) size 12x19 + text run at (2,2) width 12: "A" + LayoutNGTableCell {TD} at (48,28) size 43x24 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] + LayoutText {#text} at (2,2) size 11x19 + text run at (2,2) width 11: "B" + LayoutNGTableCell {TD} at (93,28) size 15x24 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1] + LayoutText {#text} at (2,2) size 11x19 + text run at (2,2) width 11: "C" + LayoutNGTableCell {TD} at (110,28) size 16x24 [border: (1px inset #808080)] [r=1 c=3 rs=1 cs=1] + LayoutText {#text} at (2,2) size 12x19 + text run at (2,2) width 12: "D" + LayoutNGTableCell {TD} at (128,28) size 14x24 [border: (1px inset #808080)] [r=1 c=4 rs=1 cs=1] + LayoutText {#text} at (2,2) size 10x19 + text run at (2,2) width 10: "E" + LayoutNGTableCell {TD} at (144,28) size 13x24 [border: (1px inset #808080)] [r=1 c=5 rs=1 cs=1] + LayoutText {#text} at (2,2) size 9x19 + text run at (2,2) width 9: "F" + LayoutNGTableCell {TD} at (159,28) size 16x24 [border: (1px inset #808080)] [r=1 c=6 rs=1 cs=1] + LayoutText {#text} at (2,2) size 12x19 + text run at (2,2) width 12: "G" + LayoutNGTableCell {TD} at (177,28) size 16x24 [border: (1px inset #808080)] [r=1 c=7 rs=1 cs=1] + LayoutText {#text} at (2,2) size 12x19 + text run at (2,2) width 12: "H" +layer at (8,216) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,208) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/text_level_semantics/font-weight-bold-for-b-and-strong-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/text_level_semantics/font-weight-bold-for-b-and-strong-expected.txt index 33ddc03..9ee4601 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/text_level_semantics/font-weight-bold-for-b-and-strong-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/html/text_level_semantics/font-weight-bold-for-b-and-strong-expected.txt
@@ -22,6 +22,6 @@ LayoutText {#text} at (0,0) size 159x19 text run at (0,0) width 159: "Should be equally bold." LayoutNGBlockFlow {P} at (0,144) size 784x40 - LayoutText {#text} at (0,0) size 775x39 - text run at (0,0) width 775: "The HTML5 spec says that b and strong should render as font-weight: bold, not font-weight: bolder. The text above should" + LayoutText {#text} at (0,0) size 776x39 + text run at (0,0) width 776: "The HTML5 spec says that b and strong should render as font-weight: bold, not font-weight: bolder. The text above should" text run at (0,20) width 213: "all render with the same boldness."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/misc/iframe404-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/misc/iframe404-expected.txt new file mode 100644 index 0000000..2c91839 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/misc/iframe404-expected.txt
@@ -0,0 +1,45 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {A} at (0,0) size 60x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 60x19 + text run at (51,0) width 60: "bug 8121" + LayoutText {#text} at (111,0) size 289x19 + text run at (111,0) width 289: ": REGRESSION: 404s are not displayed and " + LayoutInline {A} at (0,0) size 60x19 [color=#0000EE] + LayoutText {#text} at (400,0) size 60x19 + text run at (400,0) width 60: "bug 7739" + LayoutText {#text} at (460,0) size 770x39 + text run at (460,0) width 310: ": REGRESSION: Assertion failure loading acid2" + text run at (0,20) width 296: "test in -[WebCoreFrameBridge installInFrame:]" + LayoutNGBlockFlow {P} at (0,56) size 784x40 + LayoutText {#text} at (0,0) size 774x39 + text run at (0,0) width 774: "Here is an invalid iframe. It should contain a 404 error message, not any green fallback text. Note this will only work if this" + text run at (0,20) width 149: "page is fetched via http." + LayoutNGBlockFlow (anonymous) at (0,112) size 784x184 + LayoutText {#text} at (0,0) size 0x0 + LayoutNGBlockFlow {P} at (0,312) size 784x20 + LayoutText {#text} at (0,0) size 487x19 + text run at (0,0) width 487: "Here is an invalid object. It should be rendered with some green fallback text." + LayoutNGBlockFlow (anonymous) at (0,348) size 784x20 + LayoutInline {OBJECT} at (0,0) size 77x19 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {SPAN} at (0,0) size 77x19 [color=#008000] + LayoutText {#text} at (0,0) size 77x19 + text run at (0,0) width 77: "fallback text" + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,120) size 553x184 + LayoutIFrame {IFRAME} at (0,0) size 552.80x184 [border: (2px inset #EEEEEE)] + layer at (0,0) size 549x180 + LayoutView at (0,0) size 549x180 + layer at (0,0) size 549x180 + LayoutNGBlockFlow {HTML} at (0,0) size 549x180 + LayoutNGBlockFlow {BODY} at (8,8) size 533x164 + LayoutText {#text} at (0,0) size 364x19 + text run at (0,0) width 364: "This 404 error was intentionally generated by a test script."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/uri/css-href-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/uri/css-href-expected.txt new file mode 100644 index 0000000..5ebc74b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/uri/css-href-expected.txt
@@ -0,0 +1,24 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x576 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {A} at (0,0) size 67x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 67x19 + text run at (51,0) width 67: "bug 11141" + LayoutText {#text} at (118,0) size 341x19 + text run at (118,0) width 341: ": CSS '@import' doesn't respect HTML Base element." + LayoutNGBlockFlow {P} at (0,36) size 784x20 [color=#008000] + LayoutText {#text} at (0,0) size 163x19 + text run at (0,0) width 163: "This text should be green." + LayoutNGBlockFlow {P} at (0,72) size 784x60 + LayoutText {#text} at (0,0) size 770x59 + text run at (0,0) width 761: "If it is red, the css has been loaded relative to the document. If it is black, no stylesheet has been rendered, if it is rendered" + text run at (0,20) width 770: "green, the stylesheet has been rendered correctly from the HREF attribute of the Base element in the HEAD section of this" + text run at (0,40) width 66: "document." + LayoutNGBlockFlow {P} at (0,148) size 784x20 [color=#008000] + LayoutText {#text} at (0,0) size 192x19 + text run at (0,0) width 192: "This text should also be green."
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-repeat-space-padding-box-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-repeat-space-padding-box-expected.txt index d8aed85..86b1ef1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-repeat-space-padding-box-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-repeat-space-padding-box-expected.txt
@@ -4,7 +4,7 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x438.39 LayoutNGBlockFlow {BODY} at (8,16) size 784x414.39 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 302x19 - text run at (0,0) width 302: "Test passes if there is no red visible on the page." + LayoutText {#text} at (0,0) size 301x19 + text run at (0,0) width 301: "Test passes if there is no red visible on the page." LayoutNGBlockFlow {DIV} at (0,36) size 378.39x378.39 [border: (25px double #000000)] LayoutNGBlockFlow {DIV} at (0,35.39) size 378.39x378.39 [border: (25px double #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-size-002-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-size-002-expected.txt index 4a6ed57..1ac8783b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-size-002-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/background-size-002-expected.txt
@@ -4,7 +4,7 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x160 LayoutNGBlockFlow {BODY} at (8,16) size 784x136 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 302x19 - text run at (0,0) width 302: "Test passes if there is no red visible on the page." + LayoutText {#text} at (0,0) size 301x19 + text run at (0,0) width 301: "Test passes if there is no red visible on the page." LayoutNGBlockFlow {DIV} at (0,36) size 100x100 LayoutNGBlockFlow {DIV} at (0,36) size 50x50 [bgcolor=#000000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-clip-002-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-clip-002-expected.txt index f54a557..8aa42dc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-clip-002-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-clip-002-expected.txt
@@ -4,7 +4,7 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x200 LayoutNGBlockFlow {BODY} at (8,16) size 784x176 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 302x19 - text run at (0,0) width 302: "Test passes if there is no red visible on the page." + LayoutText {#text} at (0,0) size 301x19 + text run at (0,0) width 301: "Test passes if there is no red visible on the page." LayoutNGBlockFlow {DIV} at (0,36) size 140x140 [bgcolor=#FF0000] [border: (10px solid #000000)] LayoutNGBlockFlow {DIV} at (20,56) size 100x100 [bgcolor=#000000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001-expected.txt index 5bc4157..c6c27a44 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-three-values-001-expected.txt
@@ -4,7 +4,7 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x290.38 LayoutNGBlockFlow {BODY} at (8,16) size 784x266.38 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 511x19 - text run at (0,0) width 511: "Test passes if the box has rounded corners and there is no red visible on the page." + LayoutText {#text} at (0,0) size 510x19 + text run at (0,0) width 510: "Test passes if the box has rounded corners and there is no red visible on the page." LayoutNGBlockFlow {DIV} at (0,36) size 230.38x230.38 [border: (19.19px solid #FF0000)] LayoutNGBlockFlow {DIV} at (0,35.98) size 230.38x230.38 [border: (19.19px solid #008000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001-expected.txt index 5bc4157..c6c27a44 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/border-radius-with-two-values-001-expected.txt
@@ -4,7 +4,7 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x290.38 LayoutNGBlockFlow {BODY} at (8,16) size 784x266.38 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 511x19 - text run at (0,0) width 511: "Test passes if the box has rounded corners and there is no red visible on the page." + LayoutText {#text} at (0,0) size 510x19 + text run at (0,0) width 510: "Test passes if the box has rounded corners and there is no red visible on the page." LayoutNGBlockFlow {DIV} at (0,36) size 230.38x230.38 [border: (19.19px solid #FF0000)] LayoutNGBlockFlow {DIV} at (0,35.98) size 230.38x230.38 [border: (19.19px solid #008000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/box-shadow-002-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/box-shadow-002-expected.txt index d05c705..bdef279 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/box-shadow-002-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/bordersbackgrounds/box-shadow-002-expected.txt
@@ -4,7 +4,7 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x180 LayoutNGBlockFlow {BODY} at (8,16) size 784x156 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 302x19 - text run at (0,0) width 302: "Test passes if there is no red visible on the page." + LayoutText {#text} at (0,0) size 301x19 + text run at (0,0) width 301: "Test passes if there is no red visible on the page." LayoutNGBlockFlow {DIV} at (40,36) size 120x120 [bgcolor=#FF0000] LayoutNGBlockFlow {DIV} at (0,36) size 100x100 [bgcolor=#000000]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-002-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-002-expected.png index 76b08471..b441555b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-002-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-002-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-003-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-003-expected.png index 8173f205..20de7bb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-003-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-003-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-010-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-010-expected.png index d507450c..3b884f6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-010-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/ietestcenter/css3/text/textshadow-010-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-css-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-css-expected.png index 5b9308cb..302d1848 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-css-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-css-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-expected.png index 14aa9f7..9139d2f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-image-document-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-image-document-expected.png index b86fd2d..e2728d48 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-image-document-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/exif-orientation-image-document-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-expected.txt index d4eb00d..deb1d8c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 724x39 text run at (0,0) width 724: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an" - text run at (0,20) width 623: "imagemap. This test PASSED if a focus ring is drawn around the <area> in the imagemap (below)." + text run at (0,20) width 622: "imagemap. This test PASSED if a focus ring is drawn around the <area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,56) size 784x133 LayoutInline {MAP} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.png index 9ddf108..a2bc1a4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.txt index 31c4984f..b5fcfcf 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 776x39 text run at (0,0) width 776: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area>." - text run at (0,20) width 641: "This test PASSED if a green-colored focus ring is drawn around the <area> in the imagemap (below)." + text run at (0,20) width 640: "This test PASSED if a green-colored focus ring is drawn around the <area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,56) size 784x133 LayoutInline {MAP} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt index cc52415..8fc1865 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x60 - LayoutText {#text} at (0,0) size 768x59 + LayoutText {#text} at (0,0) size 767x59 text run at (0,0) width 762: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that the focus ring color for an <area>" - text run at (0,20) width 768: "can be explicitly inherited from <map>. This test PASSED if a green-colored focus ring is drawn around the <area> in the" + text run at (0,20) width 767: "can be explicitly inherited from <map>. This test PASSED if a green-colored focus ring is drawn around the <area> in the" text run at (0,40) width 122: "imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,76) size 784x133 LayoutInline {MAP} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.txt index b12b951..8a11621 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-outline-color-not-inherited-from-map-expected.txt
@@ -12,7 +12,7 @@ text run at (207,20) width 467: "section 18.4 \"Dynamic outlines: the 'outline' property\" of the CSS2.1 spec" LayoutText {#text} at (674,20) size 735x39 text run at (674,20) width 61: ". This test" - text run at (0,40) width 566: "FAILED if a red-colored focus ring is drawn around the <area> in the imagemap (below)." + text run at (0,40) width 565: "FAILED if a red-colored focus ring is drawn around the <area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,76) size 784x133 LayoutInline {MAP} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zero-outline-width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zero-outline-width-expected.txt index c2f98e33..9d21392c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zero-outline-width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zero-outline-width-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x60 LayoutText {#text} at (0,0) size 748x59 text run at (0,0) width 748: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is not drawn for an" - text run at (0,20) width 737: "<area> with a 0px outline-width. This test PASSED if no red focus ring is drawn around the <area> in the imagemap" + text run at (0,20) width 736: "<area> with a 0px outline-width. This test PASSED if no red focus ring is drawn around the <area> in the imagemap" text run at (0,40) width 53: "(below)." LayoutNGBlockFlow (anonymous) at (0,76) size 784x128 LayoutInline {MAP} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zoom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zoom-expected.png index a887b57..1144003 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zoom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-focus-ring-zoom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-overflowing-circle-focus-ring-expected.txt index 8c3ecb2..18cd54d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-overflowing-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x60 LayoutText {#text} at (0,0) size 763x59 text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" - text run at (0,20) width 743: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the" + text run at (0,20) width 742: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the" text run at (0,40) width 209: "<area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,76) size 784x133 LayoutInline {MAP} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-polygon-focus-ring-expected.txt index 9d16e0f9..8fe081bc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-polygon-focus-ring-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 763x39 text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" - text run at (0,20) width 763: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." + text run at (0,20) width 762: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,56) size 784x133 LayoutInline {MAP} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/pixel-crack-image-background-webkit-transform-scale-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/pixel-crack-image-background-webkit-transform-scale-expected.txt index 1254042..9661e68 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/pixel-crack-image-background-webkit-transform-scale-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/pixel-crack-image-background-webkit-transform-scale-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 732x19 - text run at (0,0) width 732: "Test pixel cracks when background sprite is transformed with scale. Need to run pixel test to verify if it is successful." + LayoutText {#text} at (0,0) size 731x19 + text run at (0,0) width 731: "Test pixel cracks when background sprite is transformed with scale. Need to run pixel test to verify if it is successful." layer at (12,72) size 16x16 LayoutNGBlockFlow (positioned) {DIV} at (12,72) size 16x16 layer at (24,72) size 16x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/media/video-layer-crash-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/media/video-layer-crash-expected.txt index b7686a9..0d379923 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/media/video-layer-crash-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/media/video-layer-crash-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 359x19 - text run at (0,0) width 359: "Test dynamic removal of transformed and reflected video" + LayoutText {#text} at (0,0) size 358x19 + text run at (0,0) width 358: "Test dynamic removal of transformed and reflected video" LayoutNGBlockFlow (anonymous) at (0,36) size 784x342 LayoutText {#text} at (0,0) size 4x19 text run at (0,0) width 4: " "
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/media/video-replaces-poster-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/media/video-replaces-poster-expected.txt new file mode 100644 index 0000000..e16920d2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/media/video-replaces-poster-expected.txt
@@ -0,0 +1,25 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x355 + LayoutNGBlockFlow {HTML} at (0,0) size 800x355 + LayoutNGBlockFlow {BODY} at (8,16) size 784x331 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 51x19 + text run at (0,0) width 51: "Test for " + LayoutInline {A} at (0,0) size 305x19 [color=#0000EE] + LayoutText {#text} at (51,0) size 305x19 + text run at (51,0) width 305: "https://bugs.webkit.org/show_bug.cgi?id=34966" + LayoutText {#text} at (356,0) size 4x19 + text run at (356,0) width 4: "." + LayoutBR {BR} at (360,0) size 0x0 + LayoutText {#text} at (0,20) size 203x19 + text run at (0,20) width 203: "You should see the video below." + LayoutNGBlockFlow (anonymous) at (0,56) size 784x275 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,72) size 480x270 + LayoutVideo {VIDEO} at (0,0) size 480x270 +layer at (8,72) size 480x270 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 480x270 + LayoutNGBlockFlow {DIV} at (0,238) size 480x32 +layer at (8,72) size 480x228 + LayoutFlexibleBox (relative positioned) {DIV} at (0,0) size 480x228
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/filters/clip-filter-overflow-clip-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/filters/clip-filter-overflow-clip-expected.txt index dab687a..b705416 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/filters/clip-filter-overflow-clip-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/filters/clip-filter-overflow-clip-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow (anonymous) at (0,0) size 784x80 LayoutText {#text} at (0,0) size 489x19 text run at (0,0) width 489: "This test verifies CSS clip, filter, and overflow clip are applied in the order of:" - LayoutBR {BR} at (488,0) size 0x0 + LayoutBR {BR} at (489,0) size 0x0 LayoutText {#text} at (0,20) size 418x19 text run at (0,20) width 418: "output <-- clip <-- filter <-- overflow clip <-- normal-flow contents" LayoutBR {BR} at (418,20) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-expected.txt index a475297..2818370 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-expected.txt
@@ -6,15 +6,15 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 226x19 text run at (0,0) width 226: "This is a test for regressions against " - LayoutInline {I} at (0,0) size 761x39 + LayoutInline {I} at (0,0) size 762x39 LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (226,0) size 348x19 text run at (226,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8056" - LayoutText {#text} at (573,0) size 761x39 - text run at (573,0) width 188: " Flexible boxes do not repaint" + LayoutText {#text} at (574,0) size 762x39 + text run at (574,0) width 188: " Flexible boxes do not repaint" text run at (0,20) width 238: "their top, left and children's overflows" - LayoutText {#text} at (237,20) size 5x19 - text run at (237,20) width 5: "." + LayoutText {#text} at (238,20) size 4x19 + text run at (238,20) width 4: "." LayoutNGBlockFlow {DIV} at (0,66) size 784x100 LayoutDeprecatedFlexibleBox {DIV} at (10,10) size 80x80 [bgcolor=#FFFF00] LayoutNGBlockFlow {DIV} at (-10,-10) size 100x100 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-horizontal-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-horizontal-expected.txt index a475297..2818370 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-horizontal-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/flexible-box-overflow-horizontal-expected.txt
@@ -6,15 +6,15 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 226x19 text run at (0,0) width 226: "This is a test for regressions against " - LayoutInline {I} at (0,0) size 761x39 + LayoutInline {I} at (0,0) size 762x39 LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (226,0) size 348x19 text run at (226,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8056" - LayoutText {#text} at (573,0) size 761x39 - text run at (573,0) width 188: " Flexible boxes do not repaint" + LayoutText {#text} at (574,0) size 762x39 + text run at (574,0) width 188: " Flexible boxes do not repaint" text run at (0,20) width 238: "their top, left and children's overflows" - LayoutText {#text} at (237,20) size 5x19 - text run at (237,20) width 5: "." + LayoutText {#text} at (238,20) size 4x19 + text run at (238,20) width 4: "." LayoutNGBlockFlow {DIV} at (0,66) size 784x100 LayoutDeprecatedFlexibleBox {DIV} at (10,10) size 80x80 [bgcolor=#FFFF00] LayoutNGBlockFlow {DIV} at (-10,-10) size 100x100 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/inline-block-overflow-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/inline-block-overflow-expected.txt index 0ce27da..01a9eaa 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/inline-block-overflow-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/overflow/inline-block-overflow-expected.txt
@@ -4,16 +4,16 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 322x19 - text run at (0,0) width 322: "This is a repaint test of inline blocks with overflow." + LayoutText {#text} at (0,0) size 321x19 + text run at (0,0) width 321: "This is a repaint test of inline blocks with overflow." LayoutNGBlockFlow (anonymous) at (0,46) size 784x20 LayoutInline {SPAN} at (0,0) size 198x20 LayoutText {#text} at (0,0) size 98x19 text run at (0,0) width 98: "Here comes an " LayoutNGBlockFlow {SPAN} at (98,0) size 100x20 [bgcolor=#C0C0C0] - LayoutText {#text} at (0,0) size 92x39 + LayoutText {#text} at (0,0) size 91x39 text run at (0,0) width 74: "inline block" - text run at (0,20) width 92: "with overflow." + text run at (0,20) width 91: "with overflow." LayoutText {#text} at (0,0) size 0x0 layer at (8,44) size 784x2 clip at (0,0) size 0x0 LayoutNGBlockFlow {HR} at (0,36) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-expected.txt index 87ece8f..022d02e49 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-expected.txt
@@ -6,14 +6,14 @@ LayoutNGBlockFlow {P} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 172x19 text run at (0,0) width 172: "This is a regression test for " - LayoutInline {I} at (0,0) size 595x19 + LayoutInline {I} at (0,0) size 596x19 LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (172,0) size 348x19 text run at (172,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7301" - LayoutText {#text} at (519,0) size 248x19 - text run at (519,0) width 248: " Text shadow does not repaint correctly" - LayoutText {#text} at (766,0) size 5x19 - text run at (766,0) width 5: "." + LayoutText {#text} at (520,0) size 248x19 + text run at (520,0) width 248: " Text shadow does not repaint correctly" + LayoutText {#text} at (768,0) size 4x19 + text run at (768,0) width 4: "." LayoutNGBlockFlow {DIV} at (30,68) size 724x21 LayoutInline {SPAN} at (0,0) size 202x20 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 202x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-horizontal-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-horizontal-expected.txt index 87ece8f..022d02e49 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-horizontal-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/text-shadow-horizontal-expected.txt
@@ -6,14 +6,14 @@ LayoutNGBlockFlow {P} at (0,0) size 784x20 LayoutText {#text} at (0,0) size 172x19 text run at (0,0) width 172: "This is a regression test for " - LayoutInline {I} at (0,0) size 595x19 + LayoutInline {I} at (0,0) size 596x19 LayoutInline {A} at (0,0) size 348x19 [color=#0000EE] LayoutText {#text} at (172,0) size 348x19 text run at (172,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7301" - LayoutText {#text} at (519,0) size 248x19 - text run at (519,0) width 248: " Text shadow does not repaint correctly" - LayoutText {#text} at (766,0) size 5x19 - text run at (766,0) width 5: "." + LayoutText {#text} at (520,0) size 248x19 + text run at (520,0) width 248: " Text shadow does not repaint correctly" + LayoutText {#text} at (768,0) size 4x19 + text run at (768,0) width 4: "." LayoutNGBlockFlow {DIV} at (30,68) size 724x21 LayoutInline {SPAN} at (0,0) size 202x20 [bgcolor=#C0C0C0] LayoutText {#text} at (0,0) size 202x20
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/markers/suggestion-marker-basic-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/markers/suggestion-marker-basic-expected.txt index 4b3645b3..616b6ed2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/markers/suggestion-marker-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/markers/suggestion-marker-basic-expected.txt
@@ -34,8 +34,8 @@ text run at (113,0) width 85: "AcrossNodes" LayoutNGBlockFlow (floating) {DIV} at (0,0) size 331x452 LayoutNGBlockFlow {P} at (0,16) size 331x20 - LayoutText {#text} at (0,0) size 30x19 - text run at (0,0) width 30: "LTR" + LayoutText {#text} at (0,0) size 29x19 + text run at (0,0) width 29: "LTR" LayoutBlockFlow {DIV} at (0,52) size 331x20 LayoutText {#text} at (0,0) size 52x19 text run at (0,0) width 52: "markAll" @@ -83,8 +83,8 @@ LayoutText {#text} at (0,0) size 262x19 text run at (0,0) width 262: "overridingSpellingMarkerIntersectingEnd" LayoutBlockFlow {DIV} at (0,332) size 331x20 - LayoutText {#text} at (0,0) size 253x19 - text run at (0,0) width 253: "notOverridingSpellingMarkersTouching" + LayoutText {#text} at (0,0) size 252x19 + text run at (0,0) width 252: "notOverridingSpellingMarkersTouching" LayoutBlockFlow {DIV} at (0,352) size 331x20 LayoutText {#text} at (0,0) size 274x19 text run at (0,0) width 274: "overridingCompositionMarkerAtBeginning" @@ -98,5 +98,5 @@ LayoutText {#text} at (0,0) size 291x19 text run at (0,0) width 291: "overridingCompositionMarkerIntersectingEnd" LayoutBlockFlow {DIV} at (0,432) size 331x20 - LayoutText {#text} at (0,0) size 282x19 - text run at (0,0) width 282: "notOverridingCompositionMarkersTouching" + LayoutText {#text} at (0,0) size 281x19 + text run at (0,0) width 281: "notOverridingCompositionMarkersTouching"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/plugins/embed-attributes-style-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/plugins/embed-attributes-style-expected.txt new file mode 100644 index 0000000..d2f72f1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/plugins/embed-attributes-style-expected.txt
@@ -0,0 +1,27 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 760x39 + text run at (0,0) width 760: "This page tests using attributes to set style on embed elements. Previous versions of WebKit supported valign and border," + text run at (0,20) width 493: "which didn't match IE and FF. The only special support should be for 'hidden.'" + LayoutNGBlockFlow {DIV} at (0,66) size 784x0 + LayoutNGBlockFlow {DIV} at (0,66) size 784x105 + LayoutText {#text} at (50,85) size 122x19 + text run at (50,85) width 122: " valign top attribute" + LayoutNGBlockFlow {DIV} at (0,171) size 784x105 + LayoutText {#text} at (50,85) size 128x19 + text run at (50,85) width 128: " border 5px attribute" + LayoutNGBlockFlow {DIV} at (0,276) size 784x107 + LayoutText {#text} at (52,87) size 102x19 + text run at (52,87) width 102: " hidden attribute" +layer at (8,64) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {HR} at (0,56) size 784x2 [border: (1px inset #EEEEEE)] +layer at (8,74) size 50x100 + LayoutEmbeddedObject (relative positioned) {EMBED} at (0,0) size 50x100 +layer at (8,179) size 50x100 + LayoutEmbeddedObject (relative positioned) {EMBED} at (0,0) size 50x100 +layer at (8,284) size 52x102 + LayoutEmbeddedObject (relative positioned) {EMBED} at (0,0) size 52x102 [border: (1px dashed #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/W3C-SVG-1.1/text-align-05-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/W3C-SVG-1.1/text-align-05-b-expected.png index 4e115bb..a20216fb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/W3C-SVG-1.1/text-align-05-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/W3C-SVG-1.1/text-align-05-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/absolute-sized-svg-in-xhtml-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/absolute-sized-svg-in-xhtml-expected.txt new file mode 100644 index 0000000..7fe8995 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/absolute-sized-svg-in-xhtml-expected.txt
@@ -0,0 +1,23 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x105 + LayoutNGBlockFlow {html} at (0,0) size 800x105 + LayoutInline {body} at (0,0) size 224x104 + LayoutText {#text} at (0,0) size 0x0 + LayoutInline {h1} at (0,0) size 53x19 + LayoutText {#text} at (0,85) size 53x19 + text run at (0,85) width 53: "Test 123" + LayoutText {#text} at (53,85) size 4x19 + text run at (53,85) width 4: " " + LayoutSVGRoot {svg} at (57,0) size 100x100 + LayoutSVGText {text} at (0,-15) size 191x19 contains 1 chunk(s) + LayoutSVGInlineText {#text} at (0,-15) size 191x19 + chunk 1 text run 1 at (0.00,0.00) startOffset 0 endOffset 29 width 191.00: "You should see an error above" + LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] + LayoutText {#text} at (157,85) size 4x19 + text run at (157,85) width 4: " " + LayoutInline {h1} at (0,0) size 63x19 + LayoutText {#text} at (161,85) size 63x19 + text run at (161,85) width 63: "Test ABC" + LayoutText {#text} at (0,0) size 0x0 + LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/getsvgdocument-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/getsvgdocument-expected.txt new file mode 100644 index 0000000..4efa5f6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/getsvgdocument-expected.txt
@@ -0,0 +1,33 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (8,8) size 784x584 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 765x39 + text run at (0,0) width 765: "This tests to see if HTMLEmbedElement.getSVGDocument() and HTMLObjectElement.getSVGDocument() work. You" + text run at (0,20) width 300: "should see SUCCESS printed twice below this:" + LayoutNGBlockFlow (anonymous) at (0,56) size 784x60 + LayoutBR {BR} at (85,20) size 0x0 + LayoutBR {BR} at (0,20) size 0x0 + LayoutText {#text} at (0,0) size 0x0 +layer at (8,64) size 85x20 + LayoutEmbeddedObject {EMBED} at (0,0) size 85x20 + layer at (0,0) size 85x20 + LayoutView at (0,0) size 85x20 + layer at (0,0) size 85x20 + LayoutSVGRoot {svg} at (0,0) size 85x20 + LayoutSVGRect {rect} at (0,0) size 85x20 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=85.00] [height=20.00] + LayoutSVGText {text} at (5,1) size 71x19 contains 1 chunk(s) + LayoutSVGInlineText {#text} at (5,1) size 71x19 + chunk 1 text run 1 at (5.00,16.00) startOffset 0 endOffset 7 width 71.00: "SUCCESS" +layer at (8,104) size 85x20 + LayoutEmbeddedObject {OBJECT} at (0,40) size 85x20 + layer at (0,0) size 85x20 + LayoutView at (0,0) size 85x20 + layer at (0,0) size 85x20 + LayoutSVGRoot {svg} at (0,0) size 85x20 + LayoutSVGRect {rect} at (0,0) size 85x20 [fill={[type=SOLID] [color=#008000]}] [x=0.00] [y=0.00] [width=85.00] [height=20.00] + LayoutSVGText {text} at (5,1) size 71x19 contains 1 chunk(s) + LayoutSVGInlineText {#text} at (5,1) size 71x19 + chunk 1 text run 1 at (5.00,16.00) startOffset 0 endOffset 7 width 71.00: "SUCCESS"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/image-rescale-scroll-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/image-rescale-scroll-expected.txt index c0f8193..73b3728 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/image-rescale-scroll-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/image-rescale-scroll-expected.txt
@@ -7,9 +7,9 @@ LayoutText {#text} at (0,0) size 542x19 text run at (0,0) width 542: "This test verifies correct repaint of scrolled/re-painted-after-uncovering, scaled images." LayoutNGBlockFlow {P} at (0,36) size 784x40 - LayoutText {#text} at (0,0) size 755x39 - text run at (0,0) width 755: "If successful, the image below extends past the bottom of the window, with no white bar occluding the part of the image" - text run at (0,20) width 238: "adjacent to the bottom of the window." + LayoutText {#text} at (0,0) size 754x39 + text run at (0,0) width 754: "If successful, the image below extends past the bottom of the window, with no white bar occluding the part of the image" + text run at (0,20) width 237: "adjacent to the bottom of the window." layer at (50,580) size 160x105 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600 LayoutImage (positioned) {IMG} at (50,580) size 160x105 layer at (0,600) size 300x10 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/marker-orient-auto-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/marker-orient-auto-expected.txt index b907849e..1ed5a2b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/marker-orient-auto-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/marker-orient-auto-expected.txt
@@ -5,7 +5,7 @@ LayoutNGBlockFlow {BODY} at (8,8) size 784x545 LayoutText {#text} at (0,0) size 779x39 text run at (0,0) width 779: "Test for wkbug.com/112054. This test passes if the green star has orange markers pointing outside only and the blue star has" - text run at (0,20) width 229: "orange markers pointing inside only." + text run at (0,20) width 228: "orange markers pointing inside only." LayoutBR {BR} at (228,20) size 0x0 LayoutSVGRoot {svg} at (0,40) size 500x500 LayoutSVGResourceMarker {marker} [id="marker"] [markerUnits=strokeWidth] [ref at (0,0)] [angle=auto]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt index 77fafdf..215e6db 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/pattern-userSpaceOnUse-userToBaseTransform-expected.txt
@@ -16,9 +16,9 @@ LayoutText {#text} at (202,327) size 4x19 text run at (202,327) width 4: " " LayoutSVGRoot {svg} at (206,40) size 202x302 - LayoutSVGText {text} at (5,265) size 80.44x19 contains 1 chunk(s) - LayoutSVGInlineText {#text} at (5,265) size 80.44x19 - chunk 1 text run 1 at (5.00,280.00) startOffset 0 endOffset 11 width 80.44: "+Transforms" + LayoutSVGText {text} at (5,265) size 81x19 contains 1 chunk(s) + LayoutSVGInlineText {#text} at (5,265) size 81x19 + chunk 1 text run 1 at (5.00,280.00) startOffset 0 endOffset 11 width 81.00: "+Transforms" LayoutSVGContainer {g} at (0,0) size 100x100 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,100.00)}] LayoutSVGRect {rect} at (0,0) size 100x50 [fill={[type=SOLID] [color=#FF0000]}] [x=0.00] [y=0.00] [width=100.00] [height=50.00] LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=PATTERN] [id="pattern"]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/svg-float-border-padding-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/svg-float-border-padding-expected.txt new file mode 100644 index 0000000..1216a6a6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/custom/svg-float-border-padding-expected.txt
@@ -0,0 +1,26 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x526 + LayoutNGBlockFlow {html} at (0,0) size 800x526 + LayoutNGBlockFlow {body} at (8,8) size 784x502 + LayoutNGBlockFlow (anonymous) at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 637x19 + text run at (0,0) width 637: "The two blocks should look identical. One uses an SVG, and the other just uses a normal HTML div." + LayoutNGBlockFlow {p} at (0,36) size 784x20 + LayoutText {#text} at (0,0) size 354x19 + text run at (0,0) width 354: "There should be a red, white and blue pattern below this" + LayoutSVGRoot (floating) {svg} at (10,82) size 140x140 + LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] + LayoutNGBlockFlow {p} at (0,232) size 784x20 + LayoutText {#text} at (0,0) size 353x19 + text run at (0,0) width 353: "There should be a red, white and blue pattern above this" + LayoutNGBlockFlow {p} at (0,286) size 784x20 + LayoutText {#text} at (0,0) size 354x19 + text run at (0,0) width 354: "There should be a red, white and blue pattern below this" + LayoutNGBlockFlow (floating) {div} at (10,332) size 140x140 [border: (10px solid #FF0000)] + LayoutNGBlockFlow {div} at (20,20) size 100x100 [bgcolor=#0000FF] + LayoutNGBlockFlow {p} at (0,482) size 784x20 + LayoutText {#text} at (0,0) size 353x19 + text run at (0,0) width 353: "There should be a red, white and blue pattern above this" +layer at (8,276) size 784x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {hr} at (0,268) size 784x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/hixie/mixed/006-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/hixie/mixed/006-expected.txt index 01a95cc..74bee037 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/hixie/mixed/006-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/hixie/mixed/006-expected.txt
@@ -15,5 +15,5 @@ text run at (0,20) width 199: "below with no red on this page." layer at (8,8) size 200x200 backgroundClip at (8,208) size 200x200 clip at (8,208) size 200x200 LayoutNGBlockFlow (positioned) {div} at (0,-200) size 200x200 [color=#FFFF00] [bgcolor=#FF0000] - LayoutText {#text} at (0,0) size 35x19 - text run at (0,0) width 35: "FAIL" + LayoutText {#text} at (0,0) size 34x19 + text run at (0,0) width 34: "FAIL"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/text/text-selection-align-05-b-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/text/text-selection-align-05-b-expected.png index ce86e3c..973876b6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/text/text-selection-align-05-b-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/text/text-selection-align-05-b-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt new file mode 100644 index 0000000..efcadcf66 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-img-preserveAspectRatio-support-1-expected.txt
@@ -0,0 +1,164 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x348 + LayoutNGBlockFlow {HTML} at (0,0) size 800x348.09 + LayoutNGBlockFlow {BODY} at (5.55,5.55) size 788.91x337 + LayoutTable {TABLE} at (0,0) size 464x337 + LayoutTableSection {TBODY} at (0,0) size 464x337 + LayoutTableRow {TR} at (0,1) size 464x15 + LayoutNGTableCell {TH} at (1,1) size 65x15.38 [bgcolor=#DDDD99] [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (6,0) size 53x15 + text run at (6,0) width 53: "viewBox?" + LayoutNGTableCell {TH} at (67,1) size 112x15.38 [bgcolor=#DDDD99] [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (1,0) size 110x15 + text run at (1,0) width 110: "preserve\x{AD}Aspect\x{AD}Ratio" + LayoutNGTableCell {TH} at (180,1) size 141x15.38 [bgcolor=#DDDD99] [r=0 c=2 rs=1 cs=1] + LayoutText {#text} at (54,0) size 33x15 + text run at (54,0) width 33: "<img>" + LayoutNGTableCell {TH} at (322,1) size 141x15.38 [bgcolor=#DDDD99] [r=0 c=3 rs=1 cs=1] + LayoutText {#text} at (48,0) size 45x15 + text run at (48,0) width 45: "<object>" + LayoutTableRow {TR} at (0,17) size 464x39 + LayoutNGTableCell {TH} at (1,89) size 65x15.38 [bgcolor=#DDDD99] [r=1 c=0 rs=4 cs=1] + LayoutText {#text} at (1,72) size 63x15 + text run at (1,72) width 63: "No viewBox" + LayoutNGTableCell {TH} at (67,36) size 112x1.38 [bgcolor=#DDDD99] [r=1 c=1 rs=1 cs=1] + LayoutNGTableCell {TD} at (180,17) size 141x39.09 [r=1 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,17) size 141x39.09 [r=1 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 + LayoutTableRow {TR} at (0,57) size 464x39 + LayoutNGTableCell {TH} at (67,69) size 112x15.38 [bgcolor=#DDDD99] [r=2 c=1 rs=1 cs=1] + LayoutText {#text} at (42,12) size 28x15 + text run at (42,12) width 28: "none" + LayoutNGTableCell {TD} at (180,57) size 141x39.09 [r=2 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,57) size 141x39.09 [r=2 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 + LayoutTableRow {TR} at (0,97) size 464x39 + LayoutNGTableCell {TH} at (67,109) size 112x15.38 [bgcolor=#DDDD99] [r=3 c=1 rs=1 cs=1] + LayoutText {#text} at (43,12) size 26x15 + text run at (43,12) width 26: "meet" + LayoutNGTableCell {TD} at (180,97) size 141x39.09 [r=3 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,97) size 141x39.09 [r=3 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 + LayoutTableRow {TR} at (0,137) size 464x39 + LayoutNGTableCell {TH} at (67,149) size 112x15.38 [bgcolor=#DDDD99] [r=4 c=1 rs=1 cs=1] + LayoutText {#text} at (44,12) size 24x15 + text run at (44,12) width 24: "slice" + LayoutNGTableCell {TD} at (180,137) size 141x39.09 [r=4 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,137) size 141x39.09 [r=4 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 + LayoutTableRow {TR} at (0,177) size 464x39 + LayoutNGTableCell {TH} at (1,249) size 65x15.38 [bgcolor=#DDDD99] [r=5 c=0 rs=4 cs=1] + LayoutText {#text} at (10,72) size 45x15 + text run at (10,72) width 45: "viewBox" + LayoutNGTableCell {TH} at (67,196) size 112x1.38 [bgcolor=#DDDD99] [r=5 c=1 rs=1 cs=1] + LayoutNGTableCell {TD} at (180,177) size 141x39.09 [r=5 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,177) size 141x39.09 [r=5 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 + LayoutTableRow {TR} at (0,217) size 464x39 + LayoutNGTableCell {TH} at (67,229) size 112x15.38 [bgcolor=#DDDD99] [r=6 c=1 rs=1 cs=1] + LayoutText {#text} at (42,12) size 28x15 + text run at (42,12) width 28: "none" + LayoutNGTableCell {TD} at (180,217) size 141x39.09 [r=6 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,217) size 141x39.09 [r=6 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 + LayoutTableRow {TR} at (0,257) size 464x39 + LayoutNGTableCell {TH} at (67,269) size 112x15.38 [bgcolor=#DDDD99] [r=7 c=1 rs=1 cs=1] + LayoutText {#text} at (43,12) size 26x15 + text run at (43,12) width 26: "meet" + LayoutNGTableCell {TD} at (180,257) size 141x39.09 [r=7 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,257) size 141x39.09 [r=7 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 + LayoutTableRow {TR} at (0,297) size 464x39 + LayoutNGTableCell {TH} at (67,309) size 112x15.38 [bgcolor=#DDDD99] [r=8 c=1 rs=1 cs=1] + LayoutText {#text} at (44,12) size 24x15 + text run at (44,12) width 24: "slice" + LayoutNGTableCell {TD} at (180,297) size 141x39.09 [r=8 c=2 rs=1 cs=1] + LayoutImage {IMG} at (0.69,0.69) size 138.88x34.72 [border: (1.38px dashed #800000)] + LayoutText {#text} at (0,0) size 0x0 + LayoutNGTableCell {TD} at (322,297) size 141x39.09 [r=8 c=3 rs=1 cs=1] + LayoutText {#text} at (0,0) size 0x0 +layer at (328,23) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGEllipse {circle} at (0,0) size 220x220 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [cx=110.00] [cy=110.00] [r=110.00] +layer at (328,63) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGContainer {g} at (162.86,403.79) size 362.86x362.86 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}] + LayoutSVGPath {path} at (162.86,403.79) size 362.86x362.86 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 A 181.429 181.429 0 1 1 162.857 585.219 A 181.429 181.429 0 1 1 525.714 585.219 Z"] +layer at (328,103) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGContainer {g} at (162.86,403.79) size 362.86x362.86 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}] + LayoutSVGPath {path} at (162.86,403.79) size 362.86x362.86 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 A 181.429 181.429 0 1 1 162.857 585.219 A 181.429 181.429 0 1 1 525.714 585.219 Z"] +layer at (328,143) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGContainer {g} at (162.86,403.79) size 362.86x362.86 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}] + LayoutSVGPath {path} at (162.86,403.79) size 362.86x362.86 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 A 181.429 181.429 0 1 1 162.857 585.219 A 181.429 181.429 0 1 1 525.714 585.219 Z"] +layer at (328,183) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGContainer {g} at (162.86,403.79) size 362.86x362.86 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}] + LayoutSVGPath {path} at (162.86,403.79) size 362.86x362.86 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 A 181.429 181.429 0 1 1 162.857 585.219 A 181.429 181.429 0 1 1 525.714 585.219 Z"] +layer at (328,223) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGContainer {g} at (162.86,403.79) size 362.86x362.86 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}] + LayoutSVGPath {path} at (162.86,403.79) size 362.86x362.86 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 A 181.429 181.429 0 1 1 162.857 585.219 A 181.429 181.429 0 1 1 525.714 585.219 Z"] +layer at (328,263) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGContainer {g} at (162.86,403.79) size 362.86x362.86 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}] + LayoutSVGPath {path} at (162.86,403.79) size 362.86x362.86 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 A 181.429 181.429 0 1 1 162.857 585.219 A 181.429 181.429 0 1 1 525.714 585.219 Z"] +layer at (328,303) size 139x34 + LayoutEmbeddedObject {OBJECT} at (0.69,0.69) size 138.88x34.72 [border: (0.69px dashed #008000)] + layer at (0,0) size 133x29 + LayoutView at (0,0) size 133x29 + layer at (0,0) size 133x29 + LayoutSVGRoot {svg} at (0,0) size 133x29 + LayoutSVGHiddenContainer {defs} at (0,0) size 0x0 + LayoutSVGContainer {g} at (162.86,403.79) size 362.86x362.86 [transform={m=((1.00,0.00)(0.00,1.00)) t=(-162.36,-403.29)}] + LayoutSVGPath {path} at (162.86,403.79) size 362.86x362.86 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#D9BB7A] [fill rule=EVEN-ODD]}] [data="M 525.714 585.219 A 181.429 181.429 0 1 1 162.857 585.219 A 181.429 181.429 0 1 1 525.714 585.219 Z"]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-svg-float-border-padding-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-svg-float-border-padding-expected.txt new file mode 100644 index 0000000..b57e7c5e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-svg-float-border-padding-expected.txt
@@ -0,0 +1,27 @@ +layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 775 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 785x775 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 + LayoutNGBlockFlow {html} at (0,0) size 785x775.28 + LayoutNGBlockFlow {body} at (11.52,11.52) size 761.97x740.73 + LayoutNGBlockFlow (anonymous) at (0,0) size 761.97x54 + LayoutText {#text} at (0,0) size 758x53 + text run at (0,0) width 758: "The two blocks should look identical. One uses an SVG, and the other just uses a" + text run at (0,27) width 177: "normal HTML div." + LayoutNGBlockFlow {p} at (0,77.03) size 761.97x27 + LayoutText {#text} at (0,0) size 524x26 + text run at (0,0) width 524: "There should be a red, white and blue pattern below this" + LayoutSVGRoot (floating) {svg} at (14.39,141.45) size 201.56x201.56 + LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] + LayoutNGBlockFlow {p} at (0,357.41) size 761.97x27 + LayoutText {#text} at (0,0) size 523x26 + text run at (0,0) width 523: "There should be a red, white and blue pattern above this" + LayoutNGBlockFlow {p} at (0,433.34) size 761.97x27 + LayoutText {#text} at (0,0) size 524x26 + text run at (0,0) width 524: "There should be a red, white and blue pattern below this" + LayoutNGBlockFlow (floating) {div} at (14.39,497.77) size 201.58x201.58 [border: (14.39px solid #FF0000)] + LayoutNGBlockFlow {div} at (28.78,28.78) size 144x144 [bgcolor=#0000FF] + LayoutNGBlockFlow {p} at (0,713.73) size 761.97x27 + LayoutText {#text} at (0,0) size 523x26 + text run at (0,0) width 523: "There should be a red, white and blue pattern above this" +layer at (12,419) size 762x3 backgroundClip at (12,419) size 761x3 clip at (0,0) size 0x0 + LayoutNGBlockFlow {hr} at (0,407.44) size 761.97x2.88 [border: (1.44px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt new file mode 100644 index 0000000..37b8a83 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/page/zoom-svg-through-object-with-override-size-expected.txt
@@ -0,0 +1,36 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x377 + LayoutNGBlockFlow {HTML} at (0,0) size 800x376.69 + LayoutNGBlockFlow {BODY} at (5.55,5.55) size 788.91x365.59 + LayoutText {#text} at (0,0) size 0x0 + LayoutBR {BR} at (348,337) size 0x0 + LayoutText {#text} at (0,351) size 234x15 + text run at (0,351) width 234: "The image of Tux should fill the entire red square." +layer at (6,6) size 349x349 + LayoutEmbeddedObject {OBJECT} at (0,0) size 348.59x348.59 [border: (0.69px solid #FF0000)] + layer at (0,0) size 347x347 + LayoutView at (0,0) size 347x347 + layer at (0,0) size 347x347 + LayoutSVGRoot {svg} at (0,0) size 347x347 + LayoutSVGContainer {g} at (-0.07,-0.09) size 107.20x126.71 + LayoutSVGContainer {g} at (-0.07,-0.09) size 107.20x126.71 + LayoutSVGResourceLinearGradient {linearGradient} [id="XMLID_1_"] [gradientUnits=userSpaceOnUse] [stops=( #FFFFFF@0.00 #000000@1.00 )] [start=(2.84,9.24)] [end=(26.34,35.24)] + LayoutSVGPath {path} at (14.52,-0.09) size 82.49x122.47 [fill={[type=LINEAR-GRADIENT] [id="XMLID_1_"] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 96.658 84.788 C 95.021 91.534 86.719 105.601 82.313 111.808 C 77.91 118.033 78.448 123.634 70.292 121.456 C 62.17 119.261 59.876 119.671 51.492 120.161 C 43.139 120.651 44.957 119.917 39.717 122.257 C 34.524 124.616 17.052 93.712 15.627 87.966 C 14.252 82.218 13.58 82.903 17.199 76.683 C 20.817 70.476 21.325 64.334 26.124 56.801 C 30.906 49.235 36.424 45.402 36.031 39.622 C 34.477 18.183 33.233 7.474 42.748 2.51 C 51.819 -2.188 59.384 0.612 62.383 2.217 C 63.678 2.922 66.298 4.248 68.264 6.604 C 70.21 8.915 71.98 12.403 72.963 16.825 C 75.01 25.668 72.127 22.736 74.438 32.872 C 76.714 42.994 81.349 47.956 86.999 55.947 C 92.647 63.958 98.543 77.157 96.658 84.788 Z"] + LayoutSVGContainer {g} at (38.30,17.59) size 26.44x15.37 + LayoutSVGPath {path} at (38.30,18.47) size 8.71x14.29 [fill={[type=SOLID] [color=#FFFFFF] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 45.074 19.969 C 43.959 18.429 42.175 18.348 41.062 18.562 C 40.423 18.66 39.571 19.479 39.015 20.691 C 38.638 21.508 38.342 22.542 38.31 23.639 C 38.244 26.553 38.491 27.682 39.162 29.664 C 39.948 31.989 41.88 33.201 43.323 32.629 C 44.814 32.038 44.862 32.088 45.845 29.927 C 46.646 28.272 47.038 27.422 47.006 24.899 C 47.005 22.426 46.236 21.575 45.074 19.969 Z"] + LayoutSVGPath {path} at (52.12,17.59) size 12.62x15.37 [fill={[type=SOLID] [color=#FFFFFF] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 63.332 21.001 C 61.762 18.232 60.877 17.791 58.617 17.611 C 55.145 17.317 53.523 19.738 52.77 21.476 C 51.951 23.356 52.115 23.096 52.164 25.471 C 52.213 27.976 52.984 29.007 53.835 30.579 C 54.704 32.102 58.24 32.971 58.666 32.954 C 62.383 32.56 63.693 31.119 64.364 28.615 C 64.97 26.389 64.987 23.916 63.332 21.001 Z"] + LayoutSVGPath {path} at (39.63,22.54) size 5.25x8.06 [fill={[type=SOLID] [color=#000000] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 41.928 22.542 C 42.682 22.542 43.616 23.048 44.057 23.703 C 44.532 24.376 44.876 25.326 44.876 26.39 C 44.876 27.979 44.712 29.731 43.762 30.272 C 43.468 30.451 42.829 30.6 42.452 30.6 C 41.601 30.6 41.536 30.059 40.732 29.241 C 40.471 28.946 39.653 27.505 39.653 26.311 C 39.653 25.574 39.472 24.507 40.127 23.559 C 40.571 22.868 41.143 22.542 41.928 22.542 Z"] + LayoutSVGPath {path} at (41.63,23.65) size 2.27x4 [fill={[type=SOLID] [color=#999999] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 43.616 24.556 C 43.188 23.639 42.026 23.425 41.733 23.867 C 41.438 24.325 41.815 24.766 42.47 25.717 C 43.14 26.732 42.895 27.846 43.665 27.601 C 43.958 27.502 44.026 25.488 43.616 24.556 Z"] + LayoutSVGPath {path} at (55.03,22.44) size 6.71x8.10 [fill={[type=SOLID] [color=#000000] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 58.37 22.443 C 60.238 22.443 61.319 24.112 61.695 26.241 C 61.841 27.208 61.615 28.321 61.023 29.09 C 60.353 29.976 59.158 30.532 58.191 30.532 C 57.273 30.532 56.242 30.68 55.7 29.927 C 55.145 29.156 55.03 27.453 55.03 26.241 C 55.03 24.883 55.424 23.916 56.109 23.145 C 56.636 22.573 57.585 22.443 58.37 22.443 Z"] + LayoutSVGPath {path} at (58.17,23.13) size 2.54x2.74 [fill={[type=SOLID] [color=#999999] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 60.042 23.949 C 59.384 23.212 58.83 22.982 58.485 23.212 C 57.813 23.654 58.355 24.032 58.959 24.702 C 59.353 25.128 59.55 26.128 60.206 25.799 C 61.041 25.34 60.746 24.734 60.042 23.949 Z"] + LayoutSVGPath {path} at (24.69,37.06) size 53.50x77.11 [fill={[type=SOLID] [color=#FFFFFF] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 78.171 82.167 C 78.171 77.009 77.58 71.753 76.387 67.902 C 75.305 64.284 73.569 61.763 72.078 58.488 C 69.099 51.967 69.246 49.036 66.606 44.877 C 63.579 40.062 65.068 36.868 61.056 37.065 C 56.045 37.344 52.016 44.206 47.283 44.403 C 44.057 44.534 38.965 35.508 38.834 39.243 C 38.735 42.421 38.899 42.371 38.899 45.45 C 38.899 47.497 37.965 47.644 35.934 50.756 C 34.885 52.378 34.066 54.146 33.428 55.932 C 33.035 56.996 32.658 58.109 32.364 59.207 C 32.233 59.746 32.02 60.32 31.888 60.861 C 30.873 64.611 27.255 69.212 26.418 72.946 C 25.568 76.663 24.585 79.04 24.7 84.016 C 24.831 88.995 24.88 87.571 26.386 88.797 C 27.876 90.041 29.415 91.205 31.775 93.285 C 34.248 95.447 39.404 99.213 40.095 100.377 C 40.848 101.572 40.814 104.242 40.373 105.107 C 39.93 105.959 36.031 106.42 36.048 106.42 C 36.031 106.42 39.455 111.135 40.126 111.805 C 40.765 112.446 43.532 115.541 54.832 113.444 C 57.831 112.881 60.509 111.794 62.876 110.442 C 62.925 110.415 62.974 110.389 63.022 110.362 C 63.109 110.315 63.196 110.27 63.278 110.223 C 63.502 110.108 63.721 109.989 63.936 109.868 C 63.969 109.847 64.004 109.831 64.039 109.813 C 65.407 109.059 66.574 108.208 67.43 107.272 C 68.241 106.602 68.999 105.917 69.704 105.241 C 74.307 100.753 71.979 99.46 72.569 97.2 C 73.437 93.958 76.269 92.745 76.909 89.077 C 76.991 88.554 77.155 88.159 77.63 87.389 C 78.351 86.296 78.171 84.149 78.171 82.167 Z"] + LayoutSVGResourceLinearGradient {linearGradient} [id="XMLID_2_"] [gradientUnits=userSpaceOnUse] [stops=( #FFA700@0.00 #FFFF00@0.69 )] [start=(54.99,39.65)] [end=(41.91,26.22)] + LayoutSVGPath {path} at (37.93,27.35) size 26.57x17.89 [fill={[type=LINEAR-GRADIENT] [id="XMLID_2_"]}] [data="M 57.177 30.008 C 56.209 29.681 55.474 29.255 54.408 28.468 C 53.278 27.635 50.804 27.174 48.986 27.404 C 47.71 27.552 46.908 27.422 45.678 28.044 C 44.336 28.749 42.404 30.304 41.34 31.238 C 39.308 33.005 37.868 33.727 37.933 35.937 C 37.982 38.016 39.702 39.607 41.537 41.08 C 43.37 42.604 44.926 44.486 46.04 44.879 C 47.202 45.305 49.217 45.224 50.659 45.224 C 53.869 45.224 58.027 41.179 60.354 40.474 C 63.25 39.558 64.267 37.984 64.496 34.497 C 64.692 31.565 60.434 31.072 57.177 30.008 Z"] + LayoutSVGResourceLinearGradient {linearGradient} [id="XMLID_3_"] [gradientUnits=userSpaceOnUse] [stops=( #FFA700@0.00 #FFFF00@0.69 )] [start=(89.48,113.08)] [end=(65.41,88.33)] + LayoutSVGPath {path} at (69.51,88.40) size 37.61x38.17 [fill={[type=LINEAR-GRADIENT] [id="XMLID_3_"]}] [data="M 107.124 107.241 C 107.149 106.339 106.798 105.737 106.318 105.284 C 105.836 104.819 105.218 104.507 104.715 104.227 C 104.565 104.137 104.379 104.018 104.172 103.879 C 102.514 102.756 99.404 100.137 97.773 97.529 C 96.658 95.744 98.25 92.843 96.708 90.617 C 95.793 89.275 94.17 89.847 93.909 89.847 C 93.647 89.847 92.222 92.322 91.665 93.04 C 91.059 93.776 89.455 95.071 88.308 95.792 C 87.177 96.513 86.278 96.905 83.854 96.743 C 81.43 96.528 80.726 95.727 79.956 95.071 C 79.186 94.399 78.418 93.891 78.58 92.268 C 78.696 91.147 78.824 90.252 78.726 89.647 C 78.718 89.551 78.702 89.459 78.668 89.372 L 78.667 89.366 C 78.663 89.356 78.657 89.348 78.654 89.341 L 78.65 89.333 L 78.645 89.327 L 78.644 89.321 C 78.638 89.309 78.633 89.3 78.633 89.3 C 78.624 89.28 78.618 89.267 78.612 89.255 C 78.599 89.235 78.592 89.212 78.579 89.192 L 78.578 89.19 L 78.576 89.186 L 78.572 89.182 L 78.57 89.178 L 78.569 89.176 L 78.567 89.172 C 78.565 89.17 78.564 89.17 78.564 89.17 L 78.561 89.164 L 78.559 89.162 C 78.559 89.162 78.558 89.16 78.557 89.158 L 78.555 89.156 C 78.524 89.111 78.49 89.066 78.448 89.027 C 77.941 88.504 77.204 88.404 75.615 88.404 C 74.044 88.404 73.732 88.455 72.405 89.304 C 71.653 89.747 71.602 92.695 71.602 96.167 C 71.602 98.917 71.636 102.013 71.391 104.519 C 70.819 110.332 69.621 113.755 69.522 117.505 C 69.408 121.271 70.668 123.794 71.798 124.794 C 72.945 125.808 74.599 126.577 78.3 126.577 C 81.985 126.577 84.294 125.757 86.718 123.335 C 88.291 121.765 89.943 120.306 94.759 117.013 C 98.576 114.411 104.323 111.56 105.469 110.413 C 105.819 110.054 106.356 109.706 106.723 108.987 C 106.946 108.563 107.105 108.005 107.124 107.241 Z"] + LayoutSVGResourceLinearGradient {linearGradient} [id="XMLID_4_"] [gradientUnits=userSpaceOnUse] [stops=( #FFA700@0.00 #FFFF00@0.69 )] [start=(29.61,119.31)] [end=(-6.89,84.81)] + LayoutSVGPath {path} at (-0.07,85.93) size 41.78x40.69 [fill={[type=LINEAR-GRADIENT] [id="XMLID_4_"]}] [data="M 41.699 117.28 C 41.635 112.628 38.637 111.235 35.23 105.866 C 31.841 100.475 31.301 99.495 29.041 95.925 C 26.781 92.402 22.327 85.999 19.772 85.935 C 17.742 85.886 16.595 86.966 15.334 88.259 C 15.274 88.322 15.214 88.388 15.154 88.46 C 13.924 89.86 12.412 92.89 10.273 94.437 C 8.046 96.041 2.396 95.892 0.955 97.775 C -0.452 99.658 1.005 102.394 0.989 107.437 C 0.989 109.599 0.611 111.236 0.367 112.548 C 0.343 112.657 0.318 112.763 0.295 112.868 C 0.29 112.882 0.289 112.897 0.284 112.913 C 0.16 113.386 0.064 113.788 0.002 114.142 C -0.099 114.697 -0.103 115.124 0.023 115.513 C 0.05 115.597 0.082 115.683 0.119 115.765 C 0.147 115.833 0.179 115.902 0.213 115.97 C 0.217 115.98 0.22 115.991 0.227 116.001 L 0.228 116.007 C 0.294 116.187 0.376 116.364 0.482 116.544 C 0.538 116.636 0.595 116.724 0.657 116.808 C 1.939 118.718 4.261 119.292 15.417 121.619 C 21.641 122.914 27.502 126.256 31.45 126.582 C 35.396 126.877 36.232 125.566 38.64 123.437 C 41.011 121.292 41.781 121.962 41.699 117.28 Z"] + LayoutSVGContainer {g} at (78.42,84.89) size 15.13x6.43 + LayoutSVGPath {path} at (78.42,84.89) size 6.13x3.84 [fill={[type=SOLID] [color=#4D4D4D] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 82.495 85.034 C 81.004 85.229 80.005 85.999 79.415 86.704 C 78.842 87.358 78.202 88.311 78.498 88.604 C 78.772 88.879 79.025 88.653 79.279 88.317 C 79.302 88.29 79.324 88.26 79.348 88.231 C 79.438 88.131 79.526 88.012 79.615 87.887 C 79.638 87.86 79.663 87.83 79.685 87.799 C 79.728 87.748 79.771 87.695 79.816 87.639 C 79.842 87.61 79.865 87.578 79.891 87.545 C 79.931 87.502 79.969 87.455 80.01 87.404 C 80.536 86.97 81.37 86.082 83.033 86.082 C 84.721 86.082 84.59 86.031 84.524 85.377 C 84.475 84.772 83.969 84.821 82.495 85.034 Z"] + LayoutSVGPath {path} at (85.21,85) size 8.34x6.31 [fill={[type=SOLID] [color=#4D4D4D] [fill rule=EVEN-ODD]}] [clip rule=EVEN-ODD] [data="M 90.503 85.853 C 89.061 85.314 88.014 85.066 86.751 85.017 C 85.064 84.935 85.213 85.361 85.213 85.361 C 85.213 86.148 86.834 86.429 88.358 86.656 C 89.881 86.867 91.091 87.164 91.157 88.752 C 91.241 90.326 90.848 91.438 91.536 91.309 C 93.023 91.028 93.565 89.424 93.549 88.688 C 93.548 87.933 92.451 86.608 90.503 85.853 Z"]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/text/zoom-svg-float-border-padding-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/text/zoom-svg-float-border-padding-expected.txt new file mode 100644 index 0000000..03a7604 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/zoom/text/zoom-svg-float-border-padding-expected.txt
@@ -0,0 +1,27 @@ +layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 630 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 785x630 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 + LayoutNGBlockFlow {html} at (0,0) size 785x630.19 + LayoutNGBlockFlow {body} at (8,8) size 769x599.16 + LayoutNGBlockFlow (anonymous) at (0,0) size 769x54 + LayoutText {#text} at (0,0) size 758x53 + text run at (0,0) width 758: "The two blocks should look identical. One uses an SVG, and the other just uses a" + text run at (0,27) width 177: "normal HTML div." + LayoutNGBlockFlow {p} at (0,77.03) size 769x27 + LayoutText {#text} at (0,0) size 524x26 + text run at (0,0) width 524: "There should be a red, white and blue pattern below this" + LayoutSVGRoot (floating) {svg} at (10,137.06) size 140x140 + LayoutSVGRect {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#0000FF]}] [x=0.00] [y=0.00] [width=100.00] [height=100.00] + LayoutNGBlockFlow {p} at (0,287.06) size 769x27 + LayoutText {#text} at (0,0) size 523x26 + text run at (0,0) width 523: "There should be a red, white and blue pattern above this" + LayoutNGBlockFlow {p} at (0,362.13) size 769x27 + LayoutText {#text} at (0,0) size 524x26 + text run at (0,0) width 524: "There should be a red, white and blue pattern below this" + LayoutNGBlockFlow (floating) {div} at (10,422.16) size 140x140 [border: (10px solid #FF0000)] + LayoutNGBlockFlow {div} at (20,20) size 100x100 [bgcolor=#0000FF] + LayoutNGBlockFlow {p} at (0,572.16) size 769x27 + LayoutText {#text} at (0,0) size 523x26 + text run at (0,0) width 523: "There should be a red, white and blue pattern above this" +layer at (8,345) size 769x2 clip at (0,0) size 0x0 + LayoutNGBlockFlow {hr} at (0,337.09) size 769x2 [border: (1px inset #EEEEEE)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17130-2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17130-2-expected.png index e8ef170..a822be0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17130-2-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17130-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17138-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17138-expected.png index eb2c5c41..3143df93 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17138-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug17138-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug20804-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug20804-expected.png index 239e88f..d4f41c2 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug20804-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug20804-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug43854-2-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug43854-2-expected.png new file mode 100644 index 0000000..ab69693 --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug43854-2-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug8411-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug8411-expected.png index a77eb147..62928d0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug8411-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/bugs/bug8411-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_center-expected.png index 02431a0..80151ea 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_justify-expected.png index e036e7b8..59787c1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_left-expected.png index 20b1d8f3..af41a871 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_right-expected.png index e1c03ad4..2c12bb58 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_baseline-expected.png index 70b419d..c7ac8c9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_baseline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_baseline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_bottom-expected.png index af284ba..c43b9670 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_middle-expected.png index fcb1c98..1698b01 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_middle-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_middle-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_top-expected.png index 9432152..15e691d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_center-expected.png index 9cafe58..e7958231 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_left-expected.png index 3be2d2dd..44a93e9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_right-expected.png index da930f96..3e99272c3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_center-expected.png index 679429b3..d220099 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_left-expected.png index 78ddfee..253ae55 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_right-expected.png index bf6561f..485293e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_center-expected.png index 0419fd6a5..c583b9e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_char-expected.png index d855188..83bf924b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_char-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_char-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_justify-expected.png index fd3dc08..e599ae6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_left-expected.png index ee690cc6..618fc83 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_right-expected.png index 6cab134..1d8807be 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_baseline-expected.png index 31ecba4..02f7f61 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_baseline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_baseline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_bottom-expected.png index 7b67775d..5d2f1b5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_middle-expected.png index 0951406..508f88d6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_middle-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_middle-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_top-expected.png index 4a04add6..3338a55 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_bottom-expected.png index 1f135b8b..0adb7d4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_top-expected.png index 5ea98fc..bf5ff78 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_center-expected.png index 39c5b78..b9036c6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_char-expected.png index 510b1b1..4f7b3a7 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_char-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_char-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_justify-expected.png index a2139fb..bab593a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_left-expected.png index 27340fe..3996af8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_right-expected.png index f5d6804..e2dda60 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_baseline-expected.png index 383e85ed..e1ce4698 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_baseline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_baseline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_bottom-expected.png index 778542d..66708b1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_middle-expected.png index 5f91a7e7..d1eff6a3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_middle-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_middle-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_top-expected.png index 8f2f2a1c..bfc9f22 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_bottom-expected.png index 29cc072d..da71859 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_top-expected.png index 474b93f..2d71dde 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_center-expected.png index 59391d9..082c425 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_char-expected.png index 1ef37ae..477f060 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_char-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_char-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_justify-expected.png index cd81153..ed310b4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_left-expected.png index f7260c3..e55a5fc4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_right-expected.png index 0689818..1e14433 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_bottom-expected.png index 588d84c..ab11fcb 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_top-expected.png index 111aeaa..68bd5e8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_bottom-expected.png index 7fa88a6c..34bd4ff6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_top-expected.png index 43ada16..2e3a3b8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_baseline-expected.png index 4585423..a409449 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_baseline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_baseline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_bottom-expected.png index 2d995fb..9dd906a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_middle-expected.png index 1f68879..2dd1a1e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_middle-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_middle-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_top-expected.png index 0aecb1e..9ab345d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_baseline-expected.png index 37449a35..a4512e16 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_baseline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_baseline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_bottom-expected.png index ae62453f..8630ec3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_middle-expected.png index 1787b3e..43e69a4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_middle-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_middle-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_top-expected.png index 8c41de5906..90cf17be 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_center-expected.png index 2cdbd72..3623219a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_char-expected.png index 2bd1c9f07845..ca2dfb6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_char-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_char-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_justify-expected.png index 53f0fdc..d1bc76f9 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_left-expected.png index 4e58908a..7a9a0e8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_right-expected.png index 7ab43ae..35b76d5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_baseline-expected.png index b802e9c..8d30586 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_baseline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_baseline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_bottom-expected.png index f9217f8a..8ccf399 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_middle-expected.png index 81c289bf8..575a520d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_middle-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_middle-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_top-expected.png index bd29bbf..8e66951 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_align_justify-expected.png index 1f2ad7f..e996a391 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_bottom-expected.png index d1ccccb..c6a12aa 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_top-expected.png index 98f3c07..38c354a 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_center-expected.png index fd4c37a9..d7af80f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_center-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_center-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_char-expected.png index 27b4d22..e029767 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_char-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_char-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_justify-expected.png index defac0b..f6c72f4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_left-expected.png index 0981c81..a276f7f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_left-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_left-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_right-expected.png index ccb5c3aa..cc506a8 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_right-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_right-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_baseline-expected.png index 902e2f2..1d8fea1 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_baseline-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_baseline-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_bottom-expected.png index 5affe381..c07a5ee 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_middle-expected.png index 2f2f412..691eb06 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_middle-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_middle-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_top-expected.png index 4abc03a..b010f1e 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_bottom-expected.png index 82fa708..a2519fba 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_top-expected.png index 756c32c..3ba6074 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_align_justify-expected.png index 41b34485..84ecc73 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_bottom-expected.png index c675d66..72369a26 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_top-expected.png index e71d993c..6af1882 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_align_justify-expected.png index 2d4fcdb..5fa3550 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_align_justify-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_align_justify-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_bottom-expected.png index e69ab38..a879a105 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_bottom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_bottom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_top-expected.png index 57516f1..a888b6e3 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_top-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_top-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/other/wa_table_tr_align-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/other/wa_table_tr_align-expected.png index 10c35d8..cece42e0 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/other/wa_table_tr_align-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/other/wa_table_tr_align-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla_expected_failures/other/test4-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla_expected_failures/other/test4-expected.png index 2232dee..8eaa471 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla_expected_failures/other/test4-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla_expected_failures/other/test4-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/general/perspective-units-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/general/perspective-units-expected.txt new file mode 100644 index 0000000..dd3b317e --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/general/perspective-units-expected.txt
@@ -0,0 +1,32 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x581 + LayoutNGBlockFlow {HTML} at (0,0) size 800x581 + LayoutNGBlockFlow {BODY} at (8,16) size 784x557 + LayoutNGBlockFlow {P} at (0,0) size 784x20 + LayoutText {#text} at (0,0) size 501x19 + text run at (0,0) width 501: "-webkit-perspective should take units. All four should look qualitatively similar." + LayoutNGBlockFlow (anonymous) at (0,36) size 784x521 + LayoutText {#text} at (242,157) size 4x19 + text run at (242,157) width 4: " " + LayoutText {#text} at (488,157) size 4x19 + text run at (488,157) width 4: " " + LayoutText {#text} at (0,0) size 0x0 + LayoutBR {BR} at (734,157) size 0x0 + LayoutText {#text} at (0,0) size 0x0 +layer at (28,62) size 202x152 + LayoutNGBlockFlow {DIV} at (20,10) size 202x152 [border: (1px solid #000000)] +layer at (29,63) size 200x150 + LayoutNGBlockFlow {DIV} at (1,1) size 200x150 [bgcolor=#0000FF] +layer at (274,62) size 202x152 + LayoutNGBlockFlow {DIV} at (266,10) size 202x152 [border: (1px solid #000000)] +layer at (275,63) size 200x150 + LayoutNGBlockFlow {DIV} at (1,1) size 200x150 [bgcolor=#0000FF] +layer at (520,62) size 202x152 + LayoutNGBlockFlow {DIV} at (512,10) size 202x152 [border: (1px solid #000000)] +layer at (521,63) size 200x150 + LayoutNGBlockFlow {DIV} at (1,1) size 200x150 [bgcolor=#0000FF] +layer at (48,249) size 404x304 + LayoutNGBlockFlow {DIV} at (40,197) size 404x304 [border: (2px solid #000000)] +layer at (50,251) size 400x300 + LayoutNGBlockFlow {DIV} at (2,2) size 400x300 [bgcolor=#0000FF]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt index 63ea9de..7d25ca52 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt
@@ -13,26 +13,26 @@ LayoutNGBlockFlow {DIV} at (512,20) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 layer at (30,500) size 312x100 - LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 312.25x100 - LayoutInline {SPAN} at (0,0) size 313x19 [color=#008000] - LayoutText {#text} at (0,0) size 313x19 - text run at (0,0) width 313: "PASS: event at (120, 128) hit box4 at offset (1, 1)" + LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 312x100 + LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] + LayoutText {#text} at (0,0) size 312x19 + text run at (0,0) width 312: "PASS: event at (120, 128) hit box4 at offset (1, 1)" LayoutBR {BR} at (312,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,20) size 305x19 - text run at (0,20) width 305: "PASS: event at (336, 87) hit box7 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,20) size 304x19 + text run at (0,20) width 304: "PASS: event at (336, 87) hit box7 at offset (1, 1)" LayoutBR {BR} at (304,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,40) size 305x19 - text run at (0,40) width 305: "PASS: event at (348, 86) hit box8 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,40) size 304x19 + text run at (0,40) width 304: "PASS: event at (348, 86) hit box8 at offset (1, 1)" LayoutBR {BR} at (304,55) size 0x0 LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] LayoutText {#text} at (0,60) size 312x19 text run at (0,60) width 312: "PASS: event at (582, 87) hit box11 at offset (1, 1)" - LayoutBR {BR} at (311,75) size 0x0 - LayoutInline {SPAN} at (0,0) size 313x19 [color=#008000] - LayoutText {#text} at (0,80) size 313x19 - text run at (0,80) width 313: "PASS: event at (594, 86) hit box12 at offset (1, 1)" + LayoutBR {BR} at (312,75) size 0x0 + LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] + LayoutText {#text} at (0,80) size 312x19 + text run at (0,80) width 312: "PASS: event at (594, 86) hit box12 at offset (1, 1)" LayoutBR {BR} at (312,95) size 0x0 layer at (42,42) size 140x140 LayoutNGBlockFlow {DIV} at (21,21) size 140x140 [bgcolor=#DDDDDD] [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-3-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-3-expected.txt index 7d5c258..d313725 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-3-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-3-expected.txt
@@ -4,22 +4,22 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 layer at (30,500) size 339x80 - LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 339.25x80 - LayoutInline {SPAN} at (0,0) size 300x19 [color=#008000] - LayoutText {#text} at (0,0) size 300x19 - text run at (0,0) width 300: "PASS: event at (158, 83) hit card at offset (2, 2)" + LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 339x80 + LayoutInline {SPAN} at (0,0) size 299x19 [color=#008000] + LayoutText {#text} at (0,0) size 299x19 + text run at (0,0) width 299: "PASS: event at (158, 83) hit card at offset (2, 2)" LayoutBR {BR} at (299,15) size 0x0 LayoutInline {SPAN} at (0,0) size 323x19 [color=#008000] LayoutText {#text} at (0,20) size 323x19 text run at (0,20) width 323: "PASS: event at (309, 112) hit card at offset (198, 2)" - LayoutBR {BR} at (322,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 324x19 [color=#008000] - LayoutText {#text} at (0,40) size 324x19 - text run at (0,40) width 324: "PASS: event at (158, 338) hit card at offset (2, 198)" + LayoutBR {BR} at (323,35) size 0x0 + LayoutInline {SPAN} at (0,0) size 323x19 [color=#008000] + LayoutText {#text} at (0,40) size 323x19 + text run at (0,40) width 323: "PASS: event at (158, 338) hit card at offset (2, 198)" LayoutBR {BR} at (323,55) size 0x0 - LayoutInline {SPAN} at (0,0) size 340x19 [color=#008000] - LayoutText {#text} at (0,60) size 340x19 - text run at (0,60) width 340: "PASS: event at (309, 308) hit card at offset (198, 198)" + LayoutInline {SPAN} at (0,0) size 339x19 [color=#008000] + LayoutText {#text} at (0,60) size 339x19 + text run at (0,60) width 339: "PASS: event at (309, 308) hit card at offset (198, 198)" LayoutBR {BR} at (339,75) size 0x0 layer at (8,8) size 402x402 LayoutNGBlockFlow (positioned) {DIV} at (8,8) size 402x402 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-coplanar-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-coplanar-expected.txt index 26992e7..1416b1f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-coplanar-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-coplanar-expected.txt
@@ -10,22 +10,22 @@ LayoutText {#text} at (0,0) size 366x19 text run at (0,0) width 366: "When hit-testing coplanar elements, document order wins." layer at (30,400) size 304x80 - LayoutNGBlockFlow (positioned) {DIV} at (30,400) size 304.25x80 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,0) size 297x19 - text run at (0,0) width 297: "PASS: event at (44, 44) hit box1 at offset (1, 1)" + LayoutNGBlockFlow (positioned) {DIV} at (30,400) size 304x80 + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,0) size 296x19 + text run at (0,0) width 296: "PASS: event at (44, 44) hit box1 at offset (1, 1)" LayoutBR {BR} at (296,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,20) size 297x19 - text run at (0,20) width 297: "PASS: event at (70, 59) hit box2 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,20) size 296x19 + text run at (0,20) width 296: "PASS: event at (70, 59) hit box2 at offset (1, 1)" LayoutBR {BR} at (296,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,40) size 305x19 - text run at (0,40) width 305: "PASS: event at (70, 101) hit box3 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,40) size 304x19 + text run at (0,40) width 304: "PASS: event at (70, 101) hit box3 at offset (1, 1)" LayoutBR {BR} at (304,55) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,60) size 305x19 - text run at (0,60) width 305: "PASS: event at (70, 144) hit box4 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,60) size 304x19 + text run at (0,60) width 304: "PASS: event at (70, 144) hit box4 at offset (1, 1)" LayoutBR {BR} at (304,75) size 0x0 layer at (42,42) size 260x260 LayoutNGBlockFlow (relative positioned) {DIV} at (21,21) size 260x260 [bgcolor=#DDDDDD] [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt index b3b1bae..1ccaec4 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt
@@ -21,36 +21,36 @@ LayoutNGBlockFlow {DIV} at (41,41) size 300x300 [border: (1px solid #000000)] LayoutNGBlockFlow {DIV} at (61,61) size 90x90 [bgcolor=#0000FF] layer at (30,650) size 344x160 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 - LayoutNGBlockFlow (positioned) {DIV} at (30,650) size 344.25x160 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,0) size 297x19 - text run at (0,0) width 297: "PASS: event at (45, 45) hit box1 at offset (2, 2)" + LayoutNGBlockFlow (positioned) {DIV} at (30,650) size 344x160 + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,0) size 296x19 + text run at (0,0) width 296: "PASS: event at (45, 45) hit box1 at offset (2, 2)" LayoutBR {BR} at (296,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,20) size 297x19 - text run at (0,20) width 297: "PASS: event at (54, 44) hit box2 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,20) size 296x19 + text run at (0,20) width 296: "PASS: event at (54, 44) hit box2 at offset (1, 1)" LayoutBR {BR} at (296,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,40) size 305x19 - text run at (0,40) width 305: "PASS: event at (104, 93) hit box3 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,40) size 304x19 + text run at (0,40) width 304: "PASS: event at (104, 93) hit box3 at offset (1, 1)" LayoutBR {BR} at (304,55) size 0x0 - LayoutInline {SPAN} at (0,0) size 313x19 [color=#008000] - LayoutText {#text} at (0,60) size 313x19 - text run at (0,60) width 313: "PASS: event at (175, 137) hit box4 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] + LayoutText {#text} at (0,60) size 312x19 + text run at (0,60) width 312: "PASS: event at (175, 137) hit box4 at offset (1, 1)" LayoutBR {BR} at (312,75) size 0x0 - LayoutInline {SPAN} at (0,0) size 329x19 [color=#008000] - LayoutText {#text} at (0,80) size 329x19 - text run at (0,80) width 329: "PASS: event at (167, 528) hit box4 at offset (1, 295)" + LayoutInline {SPAN} at (0,0) size 328x19 [color=#008000] + LayoutText {#text} at (0,80) size 328x19 + text run at (0,80) width 328: "PASS: event at (167, 528) hit box4 at offset (1, 295)" LayoutBR {BR} at (328,95) size 0x0 - LayoutInline {SPAN} at (0,0) size 313x19 [color=#008000] - LayoutText {#text} at (0,100) size 313x19 - text run at (0,100) width 313: "PASS: event at (227, 197) hit box5 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] + LayoutText {#text} at (0,100) size 312x19 + text run at (0,100) width 312: "PASS: event at (227, 197) hit box5 at offset (1, 1)" LayoutBR {BR} at (312,115) size 0x0 - LayoutInline {SPAN} at (0,0) size 345x19 [color=#008000] - LayoutText {#text} at (0,120) size 345x19 - text run at (0,120) width 345: "PASS: event at (539, 569) hit box7 at offset (295, 295)" + LayoutInline {SPAN} at (0,0) size 344x19 [color=#008000] + LayoutText {#text} at (0,120) size 344x19 + text run at (0,120) width 344: "PASS: event at (539, 569) hit box7 at offset (295, 295)" LayoutBR {BR} at (344,135) size 0x0 - LayoutInline {SPAN} at (0,0) size 329x19 [color=#008000] - LayoutText {#text} at (0,140) size 329x19 - text run at (0,140) width 329: "PASS: event at (431, 441) hit box8 at offset (85, 85)" + LayoutInline {SPAN} at (0,0) size 328x19 [color=#008000] + LayoutText {#text} at (0,140) size 328x19 + text run at (0,140) width 328: "PASS: event at (431, 441) hit box8 at offset (85, 85)" LayoutBR {BR} at (328,155) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-expected.txt index 3c72010..64e23c6 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-expected.txt
@@ -4,42 +4,42 @@ LayoutNGBlockFlow {HTML} at (0,0) size 785x600 LayoutNGBlockFlow {BODY} at (0,0) size 785x600 [border: (1px solid #000000)] layer at (30,500) size 336x180 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 - LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 336.25x180 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,0) size 297x19 - text run at (0,0) width 297: "PASS: event at (44, 44) hit box1 at offset (1, 1)" + LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 336x180 + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,0) size 296x19 + text run at (0,0) width 296: "PASS: event at (44, 44) hit box1 at offset (1, 1)" LayoutBR {BR} at (296,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,20) size 297x19 - text run at (0,20) width 297: "PASS: event at (69, 55) hit box2 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,20) size 296x19 + text run at (0,20) width 296: "PASS: event at (69, 55) hit box2 at offset (1, 1)" LayoutBR {BR} at (296,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 329x19 [color=#008000] - LayoutText {#text} at (0,40) size 329x19 - text run at (0,40) width 329: "PASS: event at (165, 182) hit box2 at offset (95, 95)" + LayoutInline {SPAN} at (0,0) size 328x19 [color=#008000] + LayoutText {#text} at (0,40) size 328x19 + text run at (0,40) width 328: "PASS: event at (165, 182) hit box2 at offset (95, 95)" LayoutBR {BR} at (328,55) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,60) size 305x19 - text run at (0,60) width 305: "PASS: event at (333, 79) hit box7 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,60) size 304x19 + text run at (0,60) width 304: "PASS: event at (333, 79) hit box7 at offset (1, 1)" LayoutBR {BR} at (304,75) size 0x0 - LayoutInline {SPAN} at (0,0) size 313x19 [color=#008000] - LayoutText {#text} at (0,80) size 313x19 - text run at (0,80) width 313: "PASS: event at (87, 325) hit box10 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] + LayoutText {#text} at (0,80) size 312x19 + text run at (0,80) width 312: "PASS: event at (87, 325) hit box10 at offset (1, 1)" LayoutBR {BR} at (312,95) size 0x0 - LayoutInline {SPAN} at (0,0) size 337x19 [color=#008000] - LayoutText {#text} at (0,100) size 337x19 - text run at (0,100) width 337: "PASS: event at (196, 467) hit box10 at offset (97, 97)" + LayoutInline {SPAN} at (0,0) size 336x19 [color=#008000] + LayoutText {#text} at (0,100) size 336x19 + text run at (0,100) width 336: "PASS: event at (196, 467) hit box10 at offset (97, 97)" LayoutBR {BR} at (336,115) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,120) size 321x19 - text run at (0,120) width 321: "PASS: event at (333, 325) hit box13 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,120) size 320x19 + text run at (0,120) width 320: "PASS: event at (333, 325) hit box13 at offset (1, 1)" LayoutBR {BR} at (320,135) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,140) size 321x19 - text run at (0,140) width 321: "PASS: event at (353, 352) hit box14 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,140) size 320x19 + text run at (0,140) width 320: "PASS: event at (353, 352) hit box14 at offset (1, 1)" LayoutBR {BR} at (320,155) size 0x0 - LayoutInline {SPAN} at (0,0) size 337x19 [color=#008000] - LayoutText {#text} at (0,160) size 337x19 - text run at (0,160) width 337: "PASS: event at (472, 507) hit box14 at offset (96, 96)" + LayoutInline {SPAN} at (0,0) size 336x19 [color=#008000] + LayoutText {#text} at (0,160) size 336x19 + text run at (0,160) width 336: "PASS: event at (472, 507) hit box14 at offset (96, 96)" LayoutBR {BR} at (336,175) size 0x0 layer at (21,21) size 202x202 LayoutNGBlockFlow (positioned) {DIV} at (21,21) size 202x202 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt index 83e839c1..1c4cea36 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt
@@ -15,43 +15,43 @@ text run at (242,474) width 4: " " LayoutNGBlockFlow {DIV} at (266,267) size 202x202 [border: (1px solid #000000)] LayoutText {#text} at (0,0) size 0x0 -layer at (30,500) size 496x180 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 - LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 495.81x180 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,0) size 297x19 - text run at (0,0) width 297: "PASS: event at (48, 48) hit box1 at offset (5, 5)" +layer at (30,500) size 495x180 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 + LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 495x180 + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,0) size 296x19 + text run at (0,0) width 296: "PASS: event at (48, 48) hit box1 at offset (5, 5)" LayoutBR {BR} at (296,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,20) size 297x19 - text run at (0,20) width 297: "PASS: event at (70, 41) hit box2 at offset (2, 2)" + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,20) size 296x19 + text run at (0,20) width 296: "PASS: event at (70, 41) hit box2 at offset (2, 2)" LayoutBR {BR} at (296,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 329x19 [color=#008000] - LayoutText {#text} at (0,40) size 329x19 - text run at (0,40) width 329: "PASS: event at (185, 164) hit box2 at offset (96, 96)" + LayoutInline {SPAN} at (0,0) size 328x19 [color=#008000] + LayoutText {#text} at (0,40) size 328x19 + text run at (0,40) width 328: "PASS: event at (185, 164) hit box2 at offset (96, 96)" LayoutBR {BR} at (328,55) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,60) size 305x19 - text run at (0,60) width 305: "PASS: event at (338, 64) hit box7 at offset (2, 2)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,60) size 304x19 + text run at (0,60) width 304: "PASS: event at (338, 64) hit box7 at offset (2, 2)" LayoutBR {BR} at (304,75) size 0x0 - LayoutInline {SPAN} at (0,0) size 488x19 [color=#FF0000] - LayoutText {#text} at (0,80) size 488x19 - text run at (0,80) width 488: "FAIL: event at (92, 310) expected to hit box10 at (2, 2) but hit box10 at (2, 1)" + LayoutInline {SPAN} at (0,0) size 487x19 [color=#FF0000] + LayoutText {#text} at (0,80) size 487x19 + text run at (0,80) width 487: "FAIL: event at (92, 310) expected to hit box10 at (2, 2) but hit box10 at (2, 1)" LayoutBR {BR} at (487,95) size 0x0 - LayoutInline {SPAN} at (0,0) size 337x19 [color=#008000] - LayoutText {#text} at (0,100) size 337x19 - text run at (0,100) width 337: "PASS: event at (217, 444) hit box10 at offset (95, 95)" + LayoutInline {SPAN} at (0,0) size 336x19 [color=#008000] + LayoutText {#text} at (0,100) size 336x19 + text run at (0,100) width 336: "PASS: event at (217, 444) hit box10 at offset (95, 95)" LayoutBR {BR} at (336,115) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,120) size 321x19 - text run at (0,120) width 321: "PASS: event at (337, 309) hit box13 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,120) size 320x19 + text run at (0,120) width 320: "PASS: event at (337, 309) hit box13 at offset (1, 1)" LayoutBR {BR} at (320,135) size 0x0 - LayoutInline {SPAN} at (0,0) size 496x19 [color=#FF0000] - LayoutText {#text} at (0,140) size 496x19 - text run at (0,140) width 496: "FAIL: event at (360, 334) expected to hit box14 at (1, 1) but hit box14 at (1, 0)" + LayoutInline {SPAN} at (0,0) size 495x19 [color=#FF0000] + LayoutText {#text} at (0,140) size 495x19 + text run at (0,140) width 495: "FAIL: event at (360, 334) expected to hit box14 at (1, 1) but hit box14 at (1, 0)" LayoutBR {BR} at (495,155) size 0x0 - LayoutInline {SPAN} at (0,0) size 337x19 [color=#008000] - LayoutText {#text} at (0,160) size 337x19 - text run at (0,160) width 337: "PASS: event at (500, 484) hit box14 at offset (95, 95)" + LayoutInline {SPAN} at (0,0) size 336x19 [color=#008000] + LayoutText {#text} at (0,160) size 336x19 + text run at (0,160) width 336: "PASS: event at (500, 484) hit box14 at offset (95, 95)" LayoutBR {BR} at (336,175) size 0x0 layer at (42,42) size 140x140 LayoutNGBlockFlow {DIV} at (21,21) size 140x140 [bgcolor=#DDDDDD] [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt index f956455..9173b9ec 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
@@ -9,23 +9,23 @@ LayoutText {#text} at (0,0) size 602x19 text run at (0,0) width 602: "The green overlay is translated in Z by 100px, so should hit test in front relative to the blue box." layer at (30,400) size 343x80 - LayoutNGBlockFlow (positioned) {DIV} at (30,400) size 342.66x80 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,0) size 321x19 - text run at (0,0) width 321: "PASS: event at (285, 50) hit box2 at offset (197, 1)" + LayoutNGBlockFlow (positioned) {DIV} at (30,400) size 343x80 + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,0) size 320x19 + text run at (0,0) width 320: "PASS: event at (285, 50) hit box2 at offset (197, 1)" LayoutBR {BR} at (320,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,20) size 321x19 - text run at (0,20) width 321: "PASS: event at (174, 108) hit box3 at offset (50, 2)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,20) size 320x19 + text run at (0,20) width 320: "PASS: event at (174, 108) hit box3 at offset (50, 2)" LayoutBR {BR} at (320,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 328x19 [color=#008000] - LayoutText {#text} at (0,40) size 328x19 - text run at (0,40) width 328: "PASS: event at (61, 50) hit overlay at offset (39, 28)" + LayoutInline {SPAN} at (0,0) size 327x19 [color=#008000] + LayoutText {#text} at (0,40) size 327x19 + text run at (0,40) width 327: "PASS: event at (61, 50) hit overlay at offset (39, 28)" LayoutBR {BR} at (327,55) size 0x0 LayoutInline {SPAN} at (0,0) size 343x19 [color=#008000] LayoutText {#text} at (0,60) size 343x19 text run at (0,60) width 343: "PASS: event at (119, 108) hit overlay at offset (97, 86)" - LayoutBR {BR} at (342,75) size 0x0 + LayoutBR {BR} at (343,75) size 0x0 layer at (21,21) size 302x302 LayoutNGBlockFlow (relative positioned) {DIV} at (20,20) size 302x302 [border: (1px solid #000000)] layer at (42,42) size 260x260
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt index 9c51c523..f98875b 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt
@@ -4,74 +4,74 @@ LayoutNGBlockFlow {HTML} at (0,0) size 785x600 LayoutNGBlockFlow {BODY} at (0,0) size 785x600 [border: (1px solid #000000)] layer at (30,500) size 336x340 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600 - LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 336.25x340 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,0) size 297x19 - text run at (0,0) width 297: "PASS: event at (44, 44) hit box1 at offset (1, 1)" + LayoutNGBlockFlow (positioned) {DIV} at (30,500) size 336x340 + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,0) size 296x19 + text run at (0,0) width 296: "PASS: event at (44, 44) hit box1 at offset (1, 1)" LayoutBR {BR} at (296,15) size 0x0 - LayoutInline {SPAN} at (0,0) size 297x19 [color=#008000] - LayoutText {#text} at (0,20) size 297x19 - text run at (0,20) width 297: "PASS: event at (74, 68) hit box2 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 296x19 [color=#008000] + LayoutText {#text} at (0,20) size 296x19 + text run at (0,20) width 296: "PASS: event at (74, 68) hit box2 at offset (1, 1)" LayoutBR {BR} at (296,35) size 0x0 - LayoutInline {SPAN} at (0,0) size 329x19 [color=#008000] - LayoutText {#text} at (0,40) size 329x19 - text run at (0,40) width 329: "PASS: event at (157, 164) hit box2 at offset (97, 97)" + LayoutInline {SPAN} at (0,0) size 328x19 [color=#008000] + LayoutText {#text} at (0,40) size 328x19 + text run at (0,40) width 328: "PASS: event at (157, 164) hit box2 at offset (97, 97)" LayoutBR {BR} at (328,55) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,60) size 305x19 - text run at (0,60) width 305: "PASS: event at (320, 68) hit box4 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,60) size 304x19 + text run at (0,60) width 304: "PASS: event at (320, 68) hit box4 at offset (1, 1)" LayoutBR {BR} at (304,75) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,80) size 305x19 - text run at (0,80) width 305: "PASS: event at (336, 87) hit box5 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,80) size 304x19 + text run at (0,80) width 304: "PASS: event at (336, 87) hit box5 at offset (1, 1)" LayoutBR {BR} at (304,95) size 0x0 - LayoutInline {SPAN} at (0,0) size 305x19 [color=#008000] - LayoutText {#text} at (0,100) size 305x19 - text run at (0,100) width 305: "PASS: event at (582, 87) hit box8 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 304x19 [color=#008000] + LayoutText {#text} at (0,100) size 304x19 + text run at (0,100) width 304: "PASS: event at (582, 87) hit box8 at offset (1, 1)" LayoutBR {BR} at (304,115) size 0x0 - LayoutInline {SPAN} at (0,0) size 329x19 [color=#008000] - LayoutText {#text} at (0,120) size 329x19 - text run at (0,120) width 329: "PASS: event at (658, 174) hit box8 at offset (85, 85)" + LayoutInline {SPAN} at (0,0) size 328x19 [color=#008000] + LayoutText {#text} at (0,120) size 328x19 + text run at (0,120) width 328: "PASS: event at (658, 174) hit box8 at offset (85, 85)" LayoutBR {BR} at (328,135) size 0x0 - LayoutInline {SPAN} at (0,0) size 313x19 [color=#008000] - LayoutText {#text} at (0,140) size 313x19 - text run at (0,140) width 313: "PASS: event at (74, 314) hit box10 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] + LayoutText {#text} at (0,140) size 312x19 + text run at (0,140) width 312: "PASS: event at (74, 314) hit box10 at offset (1, 1)" LayoutBR {BR} at (312,155) size 0x0 LayoutInline {SPAN} at (0,0) size 312x19 [color=#008000] LayoutText {#text} at (0,160) size 312x19 text run at (0,160) width 312: "PASS: event at (91, 351) hit box11 at offset (1, 1)" - LayoutBR {BR} at (311,175) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,180) size 321x19 - text run at (0,180) width 321: "PASS: event at (320, 314) hit box13 at offset (1, 1)" + LayoutBR {BR} at (312,175) size 0x0 + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,180) size 320x19 + text run at (0,180) width 320: "PASS: event at (320, 314) hit box13 at offset (1, 1)" LayoutBR {BR} at (320,195) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,200) size 321x19 - text run at (0,200) width 321: "PASS: event at (343, 351) hit box14 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,200) size 320x19 + text run at (0,200) width 320: "PASS: event at (343, 351) hit box14 at offset (1, 1)" LayoutBR {BR} at (320,215) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,220) size 321x19 - text run at (0,220) width 321: "PASS: event at (365, 375) hit box15 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,220) size 320x19 + text run at (0,220) width 320: "PASS: event at (365, 375) hit box15 at offset (1, 1)" LayoutBR {BR} at (320,235) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,240) size 321x19 - text run at (0,240) width 321: "PASS: event at (566, 314) hit box17 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,240) size 320x19 + text run at (0,240) width 320: "PASS: event at (566, 314) hit box17 at offset (1, 1)" LayoutBR {BR} at (320,255) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,260) size 321x19 - text run at (0,260) width 321: "PASS: event at (587, 352) hit box18 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,260) size 320x19 + text run at (0,260) width 320: "PASS: event at (587, 352) hit box18 at offset (1, 1)" LayoutBR {BR} at (320,275) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,280) size 321x19 - text run at (0,280) width 321: "PASS: event at (629, 401) hit box19 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,280) size 320x19 + text run at (0,280) width 320: "PASS: event at (629, 401) hit box19 at offset (1, 1)" LayoutBR {BR} at (320,295) size 0x0 - LayoutInline {SPAN} at (0,0) size 321x19 [color=#008000] - LayoutText {#text} at (0,300) size 321x19 - text run at (0,300) width 321: "PASS: event at (653, 422) hit box20 at offset (1, 1)" + LayoutInline {SPAN} at (0,0) size 320x19 [color=#008000] + LayoutText {#text} at (0,300) size 320x19 + text run at (0,300) width 320: "PASS: event at (653, 422) hit box20 at offset (1, 1)" LayoutBR {BR} at (320,315) size 0x0 - LayoutInline {SPAN} at (0,0) size 337x19 [color=#008000] - LayoutText {#text} at (0,320) size 337x19 - text run at (0,320) width 337: "PASS: event at (745, 505) hit box20 at offset (85, 86)" + LayoutInline {SPAN} at (0,0) size 336x19 [color=#008000] + LayoutText {#text} at (0,320) size 336x19 + text run at (0,320) width 336: "PASS: event at (745, 505) hit box20 at offset (85, 86)" LayoutBR {BR} at (336,335) size 0x0 layer at (21,21) size 202x202 LayoutNGBlockFlow (positioned) {DIV} at (21,21) size 202x202 [border: (1px solid #000000)]
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/bounding-rect-zoom-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/bounding-rect-zoom-expected.txt new file mode 100644 index 0000000..44fb0de --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/bounding-rect-zoom-expected.txt
@@ -0,0 +1,40 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x600 + LayoutNGBlockFlow {HTML} at (0,0) size 800x600 + LayoutNGBlockFlow {BODY} at (7.19,7.19) size 785.63x585.63 + LayoutNGBlockFlow {P} at (0,0) size 785.63x34 + LayoutText {#text} at (0,0) size 301x16 + text run at (0,0) width 301: "Tests that these functions account for full page zoom." + LayoutBR {BR} at (301,0) size 0x0 + LayoutText {#text} at (0,17) size 176x16 + text run at (0,17) width 176: "There should be no red visible." + LayoutTable {TABLE} at (0,48.39) size 785x21 + LayoutTableSection {TBODY} at (0,0) size 785x21 + LayoutTableRow {TR} at (0,1) size 785x19 + LayoutNGTableCell {TD} at (1,1) size 181x18.78 [r=0 c=0 rs=1 cs=1] + LayoutText {#text} at (0,0) size 146x17 + text run at (0,0) width 146: "getClientBoundingRect():" + LayoutNGTableCell {TD} at (183,1) size 601x18.78 [r=0 c=1 rs=1 cs=1] + LayoutText {#text} at (0,0) size 96x17 + text run at (0,0) width 96: "getClientRects():" +layer at (90,90) size 90x90 + LayoutNGBlockFlow (positioned) {DIV} at (90,90) size 90x90 [bgcolor=#FF0000] +layer at (90,90) size 90x90 + LayoutNGBlockFlow (positioned) {DIV} at (90,90) size 90x90 [bgcolor=#008000] +layer at (9,198) size 33x18 + LayoutNGBlockFlow (positioned) {DIV} at (9,198) size 33x18 + LayoutInline {SPAN} at (0,0) size 33x17 [color=#008000] + LayoutInline {B} at (0,0) size 33x17 + LayoutText {#text} at (0,0) size 33x17 + text run at (0,0) width 33: "PASS" +layer at (270,90) size 90x90 + LayoutNGBlockFlow (positioned) {DIV} at (270,90) size 90x90 [bgcolor=#FF0000] +layer at (270,90) size 90x90 + LayoutNGBlockFlow (positioned) {DIV} at (270,90) size 90x90 [bgcolor=#008000] +layer at (198,198) size 33x18 + LayoutNGBlockFlow (positioned) {DIV} at (198,198) size 33x18 + LayoutInline {SPAN} at (0,0) size 33x17 [color=#008000] + LayoutInline {B} at (0,0) size 33x17 + LayoutText {#text} at (0,0) size 33x17 + text run at (0,0) width 33: "PASS"
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/diamond-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/diamond-expected.txt index 9b1d65c..3349da5 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/diamond-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/diamond-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 749x19 - text run at (0,0) width 749: "You should see three blocks below. The middle one should look like a diamond because it has been rotated 45 degrees." + LayoutText {#text} at (0,0) size 747x19 + text run at (0,0) width 747: "You should see three blocks below. The middle one should look like a diamond because it has been rotated 45 degrees." LayoutNGBlockFlow (floating) {DIV} at (5,41) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)] LayoutNGBlockFlow (floating) {DIV} at (245,41) size 110x110 [bgcolor=#87CEEB] [border: (5px solid #000000)] layer at (133,49) size 110x110
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/transformed-caret-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/transformed-caret-expected.txt new file mode 100644 index 0000000..70badc1d --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/transforms/transformed-caret-expected.txt
@@ -0,0 +1,17 @@ +layer at (0,0) size 800x600 + LayoutView at (0,0) size 800x600 +layer at (0,0) size 800x418 + LayoutNGBlockFlow {HTML} at (0,0) size 800x418 + LayoutNGBlockFlow {BODY} at (8,16) size 784x322 + LayoutNGBlockFlow {P} at (0,0) size 784x40 + LayoutText {#text} at (0,0) size 362x19 + text run at (0,0) width 362: "The caret should render correctly in transformed elements" + LayoutBR {BR} at (362,0) size 0x0 + LayoutInline {A} at (0,0) size 305x19 [color=#0000EE] + LayoutText {#text} at (0,20) size 305x19 + text run at (0,20) width 305: "https://bugs.webkit.org/show_bug.cgi?id=15671" +layer at (88,136) size 302x202 + LayoutBlockFlow {DIV} at (80,120) size 302x202 [border: (1px solid #000000)] + LayoutText {#text} at (1,2) size 174x90 + text run at (1,2) width 174: "Caret" +caret: position 6 of child 0 {#text} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-css-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-css-expected.png index 03a81df..92c8782 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-css-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-css-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-expected.png index 460f498..5a3ef4ac 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-image-document-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-image-document-expected.png index 0d8af5ebb..da8d521f 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-image-document-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/exif-orientation-image-document-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-expected.txt index d4eb00d..deb1d8c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 724x39 text run at (0,0) width 724: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an" - text run at (0,20) width 623: "imagemap. This test PASSED if a focus ring is drawn around the <area> in the imagemap (below)." + text run at (0,20) width 622: "imagemap. This test PASSED if a focus ring is drawn around the <area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,56) size 784x133 LayoutInline {MAP} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.png index 7ffd87a5..fbfdc84 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.txt index 31c4984f..b5fcfcf 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 776x39 text run at (0,0) width 776: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area>." - text run at (0,20) width 641: "This test PASSED if a green-colored focus ring is drawn around the <area> in the imagemap (below)." + text run at (0,20) width 640: "This test PASSED if a green-colored focus ring is drawn around the <area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,56) size 784x133 LayoutInline {MAP} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt index cc52415..8fc1865 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-outline-color-explicitly-inherited-from-map-expected.txt
@@ -4,9 +4,9 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x584 LayoutNGBlockFlow {P} at (0,0) size 784x60 - LayoutText {#text} at (0,0) size 768x59 + LayoutText {#text} at (0,0) size 767x59 text run at (0,0) width 762: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that the focus ring color for an <area>" - text run at (0,20) width 768: "can be explicitly inherited from <map>. This test PASSED if a green-colored focus ring is drawn around the <area> in the" + text run at (0,20) width 767: "can be explicitly inherited from <map>. This test PASSED if a green-colored focus ring is drawn around the <area> in the" text run at (0,40) width 122: "imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,76) size 784x133 LayoutInline {MAP} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zero-outline-width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zero-outline-width-expected.txt index c2f98e33..9d21392c 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zero-outline-width-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zero-outline-width-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x60 LayoutText {#text} at (0,0) size 748x59 text run at (0,0) width 748: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is not drawn for an" - text run at (0,20) width 737: "<area> with a 0px outline-width. This test PASSED if no red focus ring is drawn around the <area> in the imagemap" + text run at (0,20) width 736: "<area> with a 0px outline-width. This test PASSED if no red focus ring is drawn around the <area> in the imagemap" text run at (0,40) width 53: "(below)." LayoutNGBlockFlow (anonymous) at (0,76) size 784x128 LayoutInline {MAP} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zoom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zoom-expected.png index d72b005..7061307 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zoom-expected.png +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-focus-ring-zoom-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt index 8c3ecb2..18cd54d 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-overflowing-circle-focus-ring-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x60 LayoutText {#text} at (0,0) size 763x59 text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" - text run at (0,20) width 743: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the" + text run at (0,20) width 742: "shape=\"circle\"> that overflows the img element. This test PASSED if a half-circule-shaped focus ring is drawn for the" text run at (0,40) width 209: "<area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,76) size 784x133 LayoutInline {MAP} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt index 9d16e0f9..8fe081bc 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/imagemap-polygon-focus-ring-expected.txt
@@ -6,7 +6,7 @@ LayoutNGBlockFlow {P} at (0,0) size 784x40 LayoutText {#text} at (0,0) size 763x39 text run at (0,0) width 763: "Assuming the port-specific theme draws focus rings, this test can be used to ensure that a focus ring is drawn for an <area" - text run at (0,20) width 763: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." + text run at (0,20) width 762: "shape=\"polygon\">. This test PASSED if a cross-shaped focus ring is drawn around the <area> in the imagemap (below)." LayoutNGBlockFlow (anonymous) at (0,56) size 784x133 LayoutInline {MAP} at (0,0) size 0x0 LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/pixel-crack-image-background-webkit-transform-scale-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/pixel-crack-image-background-webkit-transform-scale-expected.txt index 1254042..9661e68 100644 --- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/pixel-crack-image-background-webkit-transform-scale-expected.txt +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/gpu-rasterization/images/pixel-crack-image-background-webkit-transform-scale-expected.txt
@@ -4,8 +4,8 @@ LayoutNGBlockFlow {HTML} at (0,0) size 800x600 LayoutNGBlockFlow {BODY} at (8,8) size 784x576 LayoutNGBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 732x19 - text run at (0,0) width 732: "Test pixel cracks when background sprite is transformed with scale. Need to run pixel test to verify if it is successful." + LayoutText {#text} at (0,0) size 731x19 + text run at (0,0) width 731: "Test pixel cracks when background sprite is transformed with scale. Need to run pixel test to verify if it is successful." layer at (12,72) size 16x16 LayoutNGBlockFlow (positioned) {DIV} at (12,72) size 16x16 layer at (24,72) size 16x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt new file mode 100644 index 0000000..d043b2b --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt
@@ -0,0 +1,2 @@ +This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes. +PASS
diff --git a/third_party/WebKit/LayoutTests/flag-specific/js-flags=--harmony-bigint/http/tests/devtools/console/console-format-bigint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/js-flags=--harmony-bigint/http/tests/devtools/console/console-format-bigint-expected.txt new file mode 100644 index 0000000..5bf45fd --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/js-flags=--harmony-bigint/http/tests/devtools/console/console-format-bigint-expected.txt
@@ -0,0 +1,24 @@ +Tests that console properly displays BigInts. + +console-format-bigint.js:15 1n +console-format-bigint.js:16 BigInt {2n} +console-format-bigint.js:17 [1n] +console-format-bigint.js:18 [BigInt] +console-format-bigint.js:19 null 1n BigInt {2n} +Expanded all messages +console-format-bigint.js:15 1n +console-format-bigint.js:16 BigInt {2n} + __proto__: BigInt + [[PrimitiveValue]]: 2n +console-format-bigint.js:17 [1n] + 0: 1n + length: 1 + __proto__: Array(0) +console-format-bigint.js:18 [BigInt] + 0: BigInt {2n} + length: 1 + __proto__: Array(0) +console-format-bigint.js:19 null 1n BigInt {2n} + __proto__: BigInt + [[PrimitiveValue]]: 2n +
diff --git a/third_party/WebKit/LayoutTests/flag-specific/js-flags=--harmony-bigint/http/tests/devtools/startup/console/console-format-startup-bigint-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/js-flags=--harmony-bigint/http/tests/devtools/startup/console/console-format-startup-bigint-expected.txt new file mode 100644 index 0000000..25cc56f --- /dev/null +++ b/third_party/WebKit/LayoutTests/flag-specific/js-flags=--harmony-bigint/http/tests/devtools/startup/console/console-format-startup-bigint-expected.txt
@@ -0,0 +1,18 @@ +Tests console logging for messages with BigInts that happen before DevTools is open. + +console-format-startup-bigint.html:5 1n +console-format-startup-bigint.html:6 BigInt + __proto__: BigInt + [[PrimitiveValue]]: 2n +console-format-startup-bigint.html:7 Array(1) + 0: 1n + length: 1 + __proto__: Array(0) +console-format-startup-bigint.html:8 Array(1) + 0: BigInt {2n} + length: 1 + __proto__: Array(0) +console-format-startup-bigint.html:9 null 1n BigInt + __proto__: BigInt + [[PrimitiveValue]]: 2n +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-bigint-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-bigint-expected.txt new file mode 100644 index 0000000..5bf45fd --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-bigint-expected.txt
@@ -0,0 +1,24 @@ +Tests that console properly displays BigInts. + +console-format-bigint.js:15 1n +console-format-bigint.js:16 BigInt {2n} +console-format-bigint.js:17 [1n] +console-format-bigint.js:18 [BigInt] +console-format-bigint.js:19 null 1n BigInt {2n} +Expanded all messages +console-format-bigint.js:15 1n +console-format-bigint.js:16 BigInt {2n} + __proto__: BigInt + [[PrimitiveValue]]: 2n +console-format-bigint.js:17 [1n] + 0: 1n + length: 1 + __proto__: Array(0) +console-format-bigint.js:18 [BigInt] + 0: BigInt {2n} + length: 1 + __proto__: Array(0) +console-format-bigint.js:19 null 1n BigInt {2n} + __proto__: BigInt + [[PrimitiveValue]]: 2n +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-bigint.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-bigint.js new file mode 100644 index 0000000..5caf410 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-bigint.js
@@ -0,0 +1,30 @@ +// 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. +// TODO(luoe): once BigInts are on by default, merge this test into +// http/tests/devtools/console/console-format.js + +(async function() { + TestRunner.addResult('Tests that console properly displays BigInts.\n'); + + await TestRunner.loadModule('console_test_runner'); + await TestRunner.showPanel('console'); + + await TestRunner.evaluateInPagePromise(` + var wrappedBigInt = Object(BigInt(2)); + console.log(1n); + console.log(wrappedBigInt); + console.log([1n]); + console.log([wrappedBigInt]); + console.log(null, 1n, wrappedBigInt); + `); + + ConsoleTestRunner.dumpConsoleMessages(false, false, TestRunner.textContentWithLineBreaks); + TestRunner.addResult('Expanded all messages'); + ConsoleTestRunner.expandConsoleMessages(dumpConsoleMessages); + + function dumpConsoleMessages() { + ConsoleTestRunner.dumpConsoleMessages(false, false, TestRunner.textContentWithLineBreaks); + TestRunner.completeTest(); + } +})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await-expected.txt index c4d786a..ca767bc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await-expected.txt
@@ -82,4 +82,6 @@ undefined s 2 +await {...{foo: 42}} +{foo: 42}
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await.js index e331c46..272f08f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-top-level-await.js
@@ -59,6 +59,7 @@ await test('p'); await test('let q = 1, s = await 2'); await test('s'); + await test('await {...{foo: 42}}'); await new Promise(resolve => ConsoleTestRunner.waitForRemoteObjectsConsoleMessages(resolve)); ConsoleTestRunner.dumpConsoleMessages(); TestRunner.completeTest();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/profiler/heap-snapshot-statistics-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/profiler/heap-snapshot-statistics-expected.txt index 26da56f..2673e5d48 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/profiler/heap-snapshot-statistics-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/profiler/heap-snapshot-statistics-expected.txt
@@ -12,7 +12,8 @@ closure node size: 600000 regexp node size: 7000000 native node size: 80000000 -{"total":987654341,"v8heap":907654341,"native":80000000,"code":50000,"jsArrays":20,"strings":300,"system":900000000} +bigint node size: 900000000 +{"total":1887654341,"v8heap":1807654341,"native":80000000,"code":50000,"jsArrays":20,"strings":300,"system":900000000} Profiler was disabled.
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-infinite-loop-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-infinite-loop-expected.txt new file mode 100644 index 0000000..568b043 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-infinite-loop-expected.txt
@@ -0,0 +1,14 @@ +Tests that we can break infinite loop started from console. +Run infinite loop +Request pause +Script execution paused. +Change condition on pause to finish infinite loop +Message count: 3 +Script execution resumed. +Message count: 4 +while(a) {}; 42 +a = false +false +42 +Infinite loop finished +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-infinite-loop.js b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-infinite-loop.js new file mode 100644 index 0000000..c2b077a9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/sources/debugger-pause/debugger-pause-infinite-loop.js
@@ -0,0 +1,27 @@ +// 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. + +(async function() { + TestRunner.addResult( + `Tests that we can break infinite loop started from console.`); + await TestRunner.loadModule('console_test_runner'); + await TestRunner.loadModule('sources_test_runner'); + await TestRunner.showPanel('sources'); + await TestRunner.evaluateInPagePromise('a = true'); + + await SourcesTestRunner.startDebuggerTestPromise(); + TestRunner.addResult('Run infinite loop'); + ConsoleTestRunner.evaluateInConsole(`while(a) {}; 42`); + TestRunner.addResult('Request pause'); + SourcesTestRunner.togglePause(); + await SourcesTestRunner.waitUntilPausedPromise(); + TestRunner.addResult('Change condition on pause to finish infinite loop'); + ConsoleTestRunner.evaluateInConsole('a = false'); + await ConsoleTestRunner.waitForConsoleMessagesPromise(3); + await new Promise(resolve => SourcesTestRunner.resumeExecution(resolve)); + await ConsoleTestRunner.waitForConsoleMessagesPromise(4); + ConsoleTestRunner.dumpConsoleMessages(); + TestRunner.addResult('Infinite loop finished'); + SourcesTestRunner.completeDebuggerTest(); +})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/console-format-startup-bigint-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/console-format-startup-bigint-expected.txt new file mode 100644 index 0000000..25cc56f --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/console-format-startup-bigint-expected.txt
@@ -0,0 +1,18 @@ +Tests console logging for messages with BigInts that happen before DevTools is open. + +console-format-startup-bigint.html:5 1n +console-format-startup-bigint.html:6 BigInt + __proto__: BigInt + [[PrimitiveValue]]: 2n +console-format-startup-bigint.html:7 Array(1) + 0: 1n + length: 1 + __proto__: Array(0) +console-format-startup-bigint.html:8 Array(1) + 0: BigInt {2n} + length: 1 + __proto__: Array(0) +console-format-startup-bigint.html:9 null 1n BigInt + __proto__: BigInt + [[PrimitiveValue]]: 2n +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/console-format-startup-bigint.js b/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/console-format-startup-bigint.js new file mode 100644 index 0000000..32112cd --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/console-format-startup-bigint.js
@@ -0,0 +1,21 @@ +// 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. +// TODO(luoe): once BigInts are on by default, merge this test into +// http/tests/devtools/startup/console/console-format-startup.js + +(async function() { + await TestRunner.setupStartupTest('resources/console-format-startup-bigint.html'); + + TestRunner.addResult('Tests console logging for messages with BigInts that happen before DevTools is open.\n'); + + await TestRunner.loadModule('console_test_runner'); + await TestRunner.showPanel('console'); + + TestRunner.hideInspectorView(); + ConsoleTestRunner.expandConsoleMessages(finish); + function finish() { + ConsoleTestRunner.dumpConsoleMessagesIgnoreErrorStackFrames(); + TestRunner.completeTest(); + } +})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/resources/console-format-startup-bigint.html b/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/resources/console-format-startup-bigint.html new file mode 100644 index 0000000..31ffcee1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/startup/console/resources/console-format-startup-bigint.html
@@ -0,0 +1,15 @@ +<script type="text/javascript"> +function onload() +{ + var wrappedBigInt = Object(BigInt(2)); + console.log(1n); + console.log(wrappedBigInt); + console.log([1n]); + console.log([wrappedBigInt]); + console.log(null, 1n, wrappedBigInt); + testRunner.inspectSecondaryWindow(); +} + +</script> +<body onload="onload()"> +</body> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/paint/overflow/transformed-iframe-clipping-expected.html b/third_party/WebKit/LayoutTests/paint/overflow/transformed-iframe-clipping-expected.html new file mode 100644 index 0000000..7c36f67 --- /dev/null +++ b/third_party/WebKit/LayoutTests/paint/overflow/transformed-iframe-clipping-expected.html
@@ -0,0 +1,21 @@ +<!DOCTYPE html> +<style> +.fakeFrame { + transform-origin: left top; + transform: scale(2.0); + height: 150px; + width: 300px; + border: 2px solid red; +} +.outer { + overflow: hidden; + border: 1px solid black; + height: 150px; + width: 300px; + border-radius: 4px; +} +</style> +<div class="outer"> +<div class="fakeFrame"> +</div> +</div>
diff --git a/third_party/WebKit/LayoutTests/paint/overflow/transformed-iframe-clipping.html b/third_party/WebKit/LayoutTests/paint/overflow/transformed-iframe-clipping.html new file mode 100644 index 0000000..7940ce8d --- /dev/null +++ b/third_party/WebKit/LayoutTests/paint/overflow/transformed-iframe-clipping.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<style> +iframe { + transform-origin: left top; + transform: scale(2.0); + border: 2px solid red; +} +div { + overflow: hidden; + border: 1px solid black; + height: 150px; + width: 300px; + border-radius: 4px; +} +</style> +<div> +<iframe> +</iframe> +</div>
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index aeed334f..83fb371 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -5389,7 +5389,9 @@ getter dtmf getter track method constructor + method getParameters method replaceTrack + method setParameters interface RTCSessionDescription attribute @@toStringTag getter sdp
diff --git a/third_party/WebKit/Source/bindings/bindings.gni b/third_party/WebKit/Source/bindings/bindings.gni index b3cc6b8..d33e63c 100644 --- a/third_party/WebKit/Source/bindings/bindings.gni +++ b/third_party/WebKit/Source/bindings/bindings.gni
@@ -59,8 +59,6 @@ "core/v8/RejectedPromises.h", "core/v8/RemoteWindowProxy.cpp", "core/v8/RemoteWindowProxy.h", - "core/v8/RetainedDOMInfo.cpp", - "core/v8/RetainedDOMInfo.h", "core/v8/RetainedObjectInfo.h", "core/v8/ScheduledAction.cpp", "core/v8/ScheduledAction.h",
diff --git a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.cpp b/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.cpp deleted file mode 100644 index 45375ca..0000000 --- a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.cpp +++ /dev/null
@@ -1,130 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "bindings/core/v8/RetainedDOMInfo.h" - -#include "bindings/core/v8/V8Node.h" -#include "core/dom/ContainerNode.h" -#include "core/dom/NodeTraversal.h" -#include "platform/bindings/WrapperTypeInfo.h" - -namespace blink { - -v8::RetainedObjectInfo* RetainedDOMInfo::CreateRetainedDOMInfo( - uint16_t class_id, - v8::Local<v8::Value> wrapper) { - DCHECK_EQ(class_id, WrapperTypeInfo::kNodeClassId); - if (!wrapper->IsObject()) - return nullptr; - Node* node = V8Node::ToImpl(wrapper.As<v8::Object>()); - return node ? new RetainedDOMInfo(node) : nullptr; -} - -RetainedDOMInfo::RetainedDOMInfo(Node* root) : root_(root) { - DCHECK(root_); -} - -RetainedDOMInfo::~RetainedDOMInfo() = default; - -void RetainedDOMInfo::Dispose() { - delete this; -} - -bool RetainedDOMInfo::IsEquivalent(v8::RetainedObjectInfo* other) { - DCHECK(other); - if (other == this) - return true; - if (strcmp(GetLabel(), other->GetLabel())) - return false; - return static_cast<blink::RetainedObjectInfo*>(other) - ->GetEquivalenceClass() == this->GetEquivalenceClass(); -} - -intptr_t RetainedDOMInfo::GetHash() { - return PtrHash<void>::GetHash(root_); -} - -const char* RetainedDOMInfo::GetGroupLabel() { - return root_->isConnected() ? "(Document DOM trees)" : "(Detached DOM trees)"; -} - -const char* RetainedDOMInfo::GetLabel() { - return root_->isConnected() ? "Document DOM tree" : "Detached DOM tree"; -} - -intptr_t RetainedDOMInfo::GetElementCount() { - intptr_t count = 1; - for (Node& current : NodeTraversal::DescendantsOf(*root_)) { - ALLOW_UNUSED_LOCAL(current); - ++count; - } - return count; -} - -intptr_t RetainedDOMInfo::GetEquivalenceClass() { - return reinterpret_cast<intptr_t>(root_.Get()); -} - -PausableObjectsInfo::PausableObjectsInfo( - int number_of_objects_with_pending_activity) - : number_of_objects_with_pending_activity_( - number_of_objects_with_pending_activity) {} - -PausableObjectsInfo::~PausableObjectsInfo() = default; - -void PausableObjectsInfo::Dispose() { - delete this; -} - -bool PausableObjectsInfo::IsEquivalent(v8::RetainedObjectInfo* other) { - return this == other; -} - -intptr_t PausableObjectsInfo::GetHash() { - return PtrHash<void>::GetHash(this); -} - -const char* PausableObjectsInfo::GetGroupLabel() { - return "(Pending activities group)"; -} - -const char* PausableObjectsInfo::GetLabel() { - return "Pending activities"; -} - -intptr_t PausableObjectsInfo::GetElementCount() { - return number_of_objects_with_pending_activity_; -} - -intptr_t PausableObjectsInfo::GetEquivalenceClass() { - return reinterpret_cast<intptr_t>(this); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.h b/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.h deleted file mode 100644 index ecda5eb5..0000000 --- a/third_party/WebKit/Source/bindings/core/v8/RetainedDOMInfo.h +++ /dev/null
@@ -1,84 +0,0 @@ -/* - * Copyright (C) 2011 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef RetainedDOMInfo_h -#define RetainedDOMInfo_h - -#include "bindings/core/v8/RetainedObjectInfo.h" -#include "platform/heap/Handle.h" -#include "v8/include/v8-profiler.h" - -namespace blink { - -class Node; - -// Implements v8::RetainedObjectInfo. -class RetainedDOMInfo final : public RetainedObjectInfo { - public: - explicit RetainedDOMInfo(Node* root); - ~RetainedDOMInfo() override; - void Dispose() override; - bool IsEquivalent(v8::RetainedObjectInfo* other) override; - intptr_t GetHash() override; - const char* GetGroupLabel() override; - const char* GetLabel() override; - intptr_t GetElementCount() override; - intptr_t GetEquivalenceClass() override; - - static v8::RetainedObjectInfo* CreateRetainedDOMInfo( - uint16_t class_id, - v8::Local<v8::Value> wrapper); - - private: - // V8 guarantees to keep RetainedObjectInfos alive only during a GC or heap - // snapshotting round, when renderer doesn't get control. This allows us to - // use raw pointers. - UntracedMember<Node> root_; -}; - -class PausableObjectsInfo final : public RetainedObjectInfo { - public: - explicit PausableObjectsInfo(int number_of_objects_with_pending_activity); - ~PausableObjectsInfo() override; - void Dispose() override; - bool IsEquivalent(v8::RetainedObjectInfo* other) override; - intptr_t GetHash() override; - const char* GetGroupLabel() override; - const char* GetLabel() override; - intptr_t GetElementCount() override; - intptr_t GetEquivalenceClass() override; - - private: - int number_of_objects_with_pending_activity_; -}; - -} // namespace blink - -#endif // RetainedDOMInfo_h
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp index 5298acc..2dbc734 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -34,7 +34,6 @@ #include <unordered_map> #include <unordered_set> #include "bindings/core/v8/ActiveScriptWrappable.h" -#include "bindings/core/v8/RetainedDOMInfo.h" #include "bindings/core/v8/ScriptSourceCode.h" #include "bindings/core/v8/V8AbstractEventListener.h" #include "bindings/core/v8/V8BindingForCore.h" @@ -123,165 +122,6 @@ v8::Isolate* isolate_; }; -// TODO(ulan): Refactor this class to derive from ScriptWrappableVisitor -// and not rely on marking infrastructure. -class HeapSnaphotWrapperVisitor : public ScriptWrappableMarkingVisitor, - public v8::PersistentHandleVisitor { - public: - explicit HeapSnaphotWrapperVisitor(v8::Isolate* isolate) - : ScriptWrappableMarkingVisitor(isolate), - current_parent_(nullptr), - only_trace_single_level_(false), - first_script_wrappable_traced_(false) { - DCHECK(IsMainThread()); - } - - // Collect interesting V8 roots for the heap snapshot. Currently these are - // DOM nodes. - void CollectV8Roots() { isolate()->VisitHandlesWithClassIds(this); } - - void VisitPersistentHandle(v8::Persistent<v8::Value>* value, - uint16_t class_id) override { - if (class_id != WrapperTypeInfo::kNodeClassId) - return; - - v8::Local<v8::Object> wrapper = v8::Local<v8::Object>::New( - isolate(), v8::Persistent<v8::Object>::Cast(*value)); - DCHECK(V8Node::hasInstance(wrapper, isolate())); - Node* node = V8Node::ToImpl(wrapper); - Node* root = V8GCController::OpaqueRootForGC(isolate(), node); - nodes_requiring_tracing_[root].push_back(node); - } - - // Trace through the blink heap to find all V8 wrappers reachable from - // ActiveScriptWrappables. Also collect retainer edges on the way. - void TracePendingActivities() { - CHECK(found_v8_wrappers_.empty()); - current_parent_ = nullptr; - - TracePrologue(); - ActiveScriptWrappableBase::TraceActiveScriptWrappables(isolate(), this); - AdvanceTracing( - 0, - v8::EmbedderHeapTracer::AdvanceTracingActions( - v8::EmbedderHeapTracer::ForceCompletionAction::FORCE_COMPLETION)); - // Abort instead of Epilogue as we want to finish synchronously. - AbortTracing(); - - groups_.push_back( - std::make_pair(new PausableObjectsInfo(found_v8_wrappers_.size()), - std::move(found_v8_wrappers_))); - } - - // Trace through the blink heap to find all V8 wrappers reachable from any - // of the collected roots. Also collect retainer edges on the way. - void TraceV8Roots() { - for (auto& group_pair : nodes_requiring_tracing_) { - v8::HeapProfiler::RetainerChildren group_children; - for (auto& node : group_pair.second) { - // Ignore the actual wrappers reachable as we only want to create - // groups of DOM nodes. The method is still used to collect edges - // though. - FindV8WrappersDirectlyReachableFrom(node); - group_children.insert(PersistentForWrappable(node)); - } - groups_.push_back(std::make_pair(new RetainedDOMInfo(group_pair.first), - std::move(group_children))); - } - } - - v8::HeapProfiler::RetainerEdges Edges() { return std::move(edges_); } - v8::HeapProfiler::RetainerGroups Groups() { return std::move(groups_); } - - // ScriptWrappableVisitor overrides. - - void DispatchTraceWrappers(const TraceWrapperBase* traceable) const final { - if (!only_trace_single_level_ || !traceable->IsScriptWrappable() || - !reinterpret_cast<const ScriptWrappable*>(traceable) - ->ContainsWrapper() || - !first_script_wrappable_traced_) { - first_script_wrappable_traced_ = true; - traceable->TraceWrappers(this); - } - } - - protected: - // ScriptWrappableVisitor override. - void Visit( - const TraceWrapperV8Reference<v8::Value>& traced_wrapper) const final { - const v8::PersistentBase<v8::Value>* value = &traced_wrapper.Get(); - if (current_parent_ && current_parent_ != value) - edges_.push_back(std::make_pair(current_parent_, value)); - found_v8_wrappers_.insert(value); - } - - void Visit(DOMWrapperMap<ScriptWrappable>*, - const ScriptWrappable* key) const final { - // The found_v8_wrappers are PersistentBase pointers. We only mark the - // main world wrapper as we cannot properly record DOMWrapperMap values. - // This means that edges from the isolated worlds are missing in the - // snapshot. This will be fixed with crbug.com/749490. - } - - private: - inline v8::PersistentBase<v8::Value>* PersistentForWrappable( - ScriptWrappable* wrappable) { - return &v8::Persistent<v8::Value>::Cast(*wrappable->RawMainWorldWrapper()); - } - - v8::HeapProfiler::RetainerChildren FindV8WrappersDirectlyReachableFrom( - Node* traceable) { - CHECK(found_v8_wrappers_.empty()); - WTF::AutoReset<bool> scope(&only_trace_single_level_, true); - first_script_wrappable_traced_ = false; - current_parent_ = PersistentForWrappable(traceable); - - TracePrologue(); - traceable->TraceWrappers(this); - AdvanceTracing( - 0, - v8::EmbedderHeapTracer::AdvanceTracingActions( - v8::EmbedderHeapTracer::ForceCompletionAction::FORCE_COMPLETION)); - // Abort instead of Epilogue as we want to finish synchronously. - AbortTracing(); - - return std::move(found_v8_wrappers_); - } - - // Input obtained from |VisitPersistentHandle|. - std::unordered_map<Node*, std::vector<Node*>> nodes_requiring_tracing_; - - // Temporaries used for tracing a single Node. - const v8::PersistentBase<v8::Value>* current_parent_; - bool only_trace_single_level_; - mutable bool first_script_wrappable_traced_; - mutable v8::HeapProfiler::RetainerChildren found_v8_wrappers_; - - // Out variables - mutable v8::HeapProfiler::RetainerEdges edges_; - mutable v8::HeapProfiler::RetainerGroups groups_; -}; - -// The function |getRetainerInfos| processing all handles on the blink heap, -// logically grouping together DOM trees (attached and detached) and pending -// activities, while at the same time finding parent to child relationships -// for non-Node wrappers. Since we are processing *all* handles there is no -// way we miss out on a handle. V8 will figure out the liveness information -// for the provided information itself. -v8::HeapProfiler::RetainerInfos V8GCController::GetRetainerInfos( - v8::Isolate* isolate) { - V8PerIsolateData::TemporaryScriptWrappableVisitorScope scope( - isolate, std::unique_ptr<HeapSnaphotWrapperVisitor>( - new HeapSnaphotWrapperVisitor(isolate))); - - HeapSnaphotWrapperVisitor* tracer = - reinterpret_cast<HeapSnaphotWrapperVisitor*>(scope.CurrentVisitor()); - tracer->CollectV8Roots(); - tracer->TraceV8Roots(); - tracer->TracePendingActivities(); - return v8::HeapProfiler::RetainerInfos{tracer->Groups(), tracer->Edges()}; -} - static unsigned long long UsedHeapSize(v8::Isolate* isolate) { v8::HeapStatistics heap_statistics; isolate->GetHeapStatistics(&heap_statistics);
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.h b/third_party/WebKit/Source/bindings/core/v8/V8GCController.h index 55d4383d..b576647d 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.h
@@ -60,8 +60,6 @@ static void TraceDOMWrappers(v8::Isolate*, Visitor*); static bool HasPendingActivity(v8::Isolate*, ExecutionContext*); - - static v8::HeapProfiler::RetainerInfos GetRetainerInfos(v8::Isolate*); }; } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp index 9093d13..2e3cacb 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -31,7 +31,6 @@ #include "bindings/core/v8/BindingSecurity.h" #include "bindings/core/v8/ReferrerScriptInfo.h" #include "bindings/core/v8/RejectedPromises.h" -#include "bindings/core/v8/RetainedDOMInfo.h" #include "bindings/core/v8/ScriptController.h" #include "bindings/core/v8/ScriptPromiseResolver.h" #include "bindings/core/v8/ScriptValue.h" @@ -636,9 +635,6 @@ isolate->SetPromiseRejectCallback(PromiseRejectHandlerInMainThread); if (v8::HeapProfiler* profiler = isolate->GetHeapProfiler()) { - profiler->SetWrapperClassInfoProvider( - WrapperTypeInfo::kNodeClassId, &RetainedDOMInfo::CreateRetainedDOMInfo); - profiler->SetGetRetainerInfosCallback(&V8GCController::GetRetainerInfos); profiler->SetBuildEmbedderGraphCallback( &V8EmbedderGraphBuilder::BuildEmbedderGraphCallback); }
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ObjectParser.h b/third_party/WebKit/Source/bindings/core/v8/V8ObjectParser.h index 40b90d2..b4f00cca 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8ObjectParser.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8ObjectParser.h
@@ -5,8 +5,8 @@ #ifndef V8ObjectParser_h #define V8ObjectParser_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/text/AtomicString.h" #include "v8/include/v8.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp index 73b22e4..19e9770 100644 --- a/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8CSSStyleDeclarationCustom.cpp
@@ -34,13 +34,13 @@ #include "base/memory/scoped_refptr.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/V8BindingForCore.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSPropertyIDTemplates.h" #include "core/css/CSSStyleDeclaration.h" #include "core/css/CSSValue.h" #include "core/css/parser/CSSParser.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" #include "core/dom/events/EventTarget.h" #include "core/html/custom/CEReactionsScope.h" #include "platform/wtf/ASCIICType.h"
diff --git a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp index f610b83..3cba2935 100644 --- a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializerTest.cpp
@@ -43,7 +43,7 @@ #include "core/messaging/MessagePort.h" #include "core/offscreencanvas/OffscreenCanvas.h" #include "platform/graphics/StaticBitmapImage.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/DateMath.h" #include "platform/wtf/Time.h" #include "public/platform/WebBlobInfo.h"
diff --git a/third_party/WebKit/Source/build/scripts/core/css/parser/templates/AtRuleDescriptors.h.tmpl b/third_party/WebKit/Source/build/scripts/core/css/parser/templates/AtRuleDescriptors.h.tmpl index 7b149a0c..b187075 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/parser/templates/AtRuleDescriptors.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/parser/templates/AtRuleDescriptors.h.tmpl
@@ -5,7 +5,7 @@ #ifndef AtRuleDescriptors_h #define AtRuleDescriptors_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/text/StringView.h" #include <string.h>
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl index 6165b10..902fc03 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSProperty.h.tmpl
@@ -9,7 +9,7 @@ #ifndef CSSProperty_h #define CSSProperty_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/css/CSSValue.h" #include "core/css/properties/CSSUnresolvedProperty.h" #include "platform/heap/HeapAllocator.h"
diff --git a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSUnresolvedProperty.h.tmpl b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSUnresolvedProperty.h.tmpl index 1d46a42..ed1c16bb 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSUnresolvedProperty.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/properties/templates/CSSUnresolvedProperty.h.tmpl
@@ -9,7 +9,7 @@ #ifndef CSSUnresolvedProperty_h #define CSSUnresolvedProperty_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/text/WTFString.h" namespace blink {
diff --git a/third_party/WebKit/Source/build/scripts/core/css/templates/StylePropertyShorthand.h.tmpl b/third_party/WebKit/Source/build/scripts/core/css/templates/StylePropertyShorthand.h.tmpl index 036482a..a573a54 100644 --- a/third_party/WebKit/Source/build/scripts/core/css/templates/StylePropertyShorthand.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/core/css/templates/StylePropertyShorthand.h.tmpl
@@ -25,7 +25,7 @@ #ifndef StylePropertyShorthand_h #define StylePropertyShorthand_h -#include "CSSPropertyNames.h" +#include "css_property_names.h" #include "core/css/properties/CSSProperty.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_names.py b/third_party/WebKit/Source/build/scripts/make_css_property_names.py index 424f8f91..d6be31c2 100755 --- a/third_party/WebKit/Source/build/scripts/make_css_property_names.py +++ b/third_party/WebKit/Source/build/scripts/make_css_property_names.py
@@ -8,12 +8,13 @@ class CSSPropertyNamesWriter(json5_generator.Writer): class_name = "CSSPropertyNames" + file_basename = "css_property_names" def __init__(self, json5_file_path): super(CSSPropertyNamesWriter, self).__init__(json5_file_path) self._outputs = { - (self.class_name + ".h"): self.generate_header, - (self.class_name + ".cpp"): self.generate_implementation, + (self.file_basename + ".h"): self.generate_header, + (self.file_basename + ".cc"): self.generate_implementation, } self._css_properties = css_properties.CSSProperties(json5_file_path) @@ -24,7 +25,7 @@ return " static_cast<CSSPropertyID>(%(enum_value)s), " \ "// %(property_id)s" % property_ - @template_expander.use_jinja('templates/CSSPropertyNames.h.tmpl') + @template_expander.use_jinja('templates/css_property_names.h.tmpl') def generate_header(self): return { 'alias_offset': self._css_properties.alias_offset, @@ -44,7 +45,7 @@ max(map(len, self._css_properties.properties_by_id)), } - @gperf.use_jinja_gperf_template('templates/CSSPropertyNames.cpp.tmpl', + @gperf.use_jinja_gperf_template('templates/css_property_names.cc.tmpl', ['-Q', 'CSSPropStringPool']) def generate_implementation(self): enum_value_to_name = {} @@ -67,6 +68,7 @@ return { 'class_name': 'CSSPropertyNames', + 'file_basename': self.file_basename, 'property_names': property_names, 'property_offsets': property_offsets, 'property_to_enum_map':
diff --git a/third_party/WebKit/Source/build/scripts/make_runtime_features.py b/third_party/WebKit/Source/build/scripts/make_runtime_features.py index 582a1c66..c0742151 100755 --- a/third_party/WebKit/Source/build/scripts/make_runtime_features.py +++ b/third_party/WebKit/Source/build/scripts/make_runtime_features.py
@@ -88,7 +88,7 @@ class RuntimeFeatureTestHelpersWriter(json5_generator.Writer): class_name = 'ScopedRuntimeEnabledFeatureForTest' - file_basename = 'RuntimeEnabledFeaturesTestHelpers' + file_basename = 'runtime_enabled_features_test_helpers' def __init__(self, json5_file_path): super(RuntimeFeatureTestHelpersWriter, self).__init__(json5_file_path)
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyNames.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/css_property_names.cc.tmpl similarity index 96% rename from third_party/WebKit/Source/build/scripts/templates/CSSPropertyNames.cpp.tmpl rename to third_party/WebKit/Source/build/scripts/templates/css_property_names.cc.tmpl index ea54cc7..5751fd3 100644 --- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyNames.cpp.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/css_property_names.cc.tmpl
@@ -3,10 +3,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "{{class_name}}.h" -#include "core/css/HashTools.h" -#include <string.h> +#include "blink/core/{{file_basename}}.h" +#include <string.h> +#include "core/css/HashTools.h" #include "platform/wtf/ASCIICType.h" #include "platform/wtf/text/AtomicString.h" #include "platform/wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyNames.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/css_property_names.h.tmpl similarity index 92% rename from third_party/WebKit/Source/build/scripts/templates/CSSPropertyNames.h.tmpl rename to third_party/WebKit/Source/build/scripts/templates/css_property_names.h.tmpl index 1fe1ddc4..fd426f0 100644 --- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyNames.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/css_property_names.h.tmpl
@@ -1,12 +1,12 @@ {% from 'templates/macros.tmpl' import license %} {{license()}} -#ifndef CSSPropertyNames_h -#define CSSPropertyNames_h +#ifndef BLINK_CORE_CSS_PROPERTY_NAMES_H_ +#define BLINK_CORE_CSS_PROPERTY_NAMES_H_ +#include <stddef.h> #include "core/CoreExport.h" #include "platform/wtf/Assertions.h" -#include <stddef.h> namespace WTF { class AtomicString; @@ -62,4 +62,4 @@ } // namespace blink -#endif // CSSPropertyNames_h +#endif // BLINK_CORE_CSS_PROPERTY_NAMES_H_
diff --git a/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeaturesTestHelpers.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/runtime_enabled_features_test_helpers.h.tmpl similarity index 82% rename from third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeaturesTestHelpers.h.tmpl rename to third_party/WebKit/Source/build/scripts/templates/runtime_enabled_features_test_helpers.h.tmpl index 3b564661..acea4dea 100644 --- a/third_party/WebKit/Source/build/scripts/templates/RuntimeEnabledFeaturesTestHelpers.h.tmpl +++ b/third_party/WebKit/Source/build/scripts/templates/runtime_enabled_features_test_helpers.h.tmpl
@@ -3,8 +3,8 @@ {{source_files_for_generated_file(template_file, input_files)}} -#ifndef RuntimeEnabledFeaturesTestHelpers_h -#define RuntimeEnabledFeaturesTestHelpers_h +#ifndef BLINK_PLATFORM_TESTING_RUNTIME_ENABLED_FEATURES_TEST_HELPERS_H_ +#define BLINK_PLATFORM_TESTING_RUNTIME_ENABLED_FEATURES_TEST_HELPERS_H_ #include "platform/runtime_enabled_features.h" #include "platform/wtf/Assertions.h" @@ -41,4 +41,4 @@ {% endfor %} } // namespace blink -#endif // RuntimeEnabledFeaturesTestHelpers_h +#endif // BLINK_PLATFORM_TESTING_RUNTIME_ENABLED_FEATURES_TEST_HELPERS_H_
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index e92dfabd..cb98597c 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -1102,12 +1102,12 @@ script = "../build/scripts/make_css_property_names.py" other_inputs = [ "../build/scripts/gperf.py", - "../build/scripts/templates/CSSPropertyNames.cpp.tmpl", - "../build/scripts/templates/CSSPropertyNames.h.tmpl", + "../build/scripts/templates/css_property_names.cc.tmpl", + "../build/scripts/templates/css_property_names.h.tmpl", ] outputs = [ - "$blink_core_output_dir/CSSPropertyNames.cpp", - "$blink_core_output_dir/CSSPropertyNames.h", + "$blink_core_output_dir/css_property_names.cc", + "$blink_core_output_dir/css_property_names.h", ] }
diff --git a/third_party/WebKit/Source/core/animation/Animation.h b/third_party/WebKit/Source/core/animation/Animation.h index 02a8091..2613b37 100644 --- a/third_party/WebKit/Source/core/animation/Animation.h +++ b/third_party/WebKit/Source/core/animation/Animation.h
@@ -39,12 +39,12 @@ #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseProperty.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/animation/AnimationEffectOwner.h" #include "core/animation/AnimationEffectReadOnly.h" #include "core/animation/CompositorAnimations.h" #include "core/animation/DocumentTimeline.h" +#include "core/css_property_names.h" #include "core/dom/ContextLifecycleObserver.h" #include "core/dom/DOMException.h" #include "core/dom/events/EventTarget.h"
diff --git a/third_party/WebKit/Source/core/animation/AnimationInputHelpers.h b/third_party/WebKit/Source/core/animation/AnimationInputHelpers.h index c131539..81b69fb1 100644 --- a/third_party/WebKit/Source/core/animation/AnimationInputHelpers.h +++ b/third_party/WebKit/Source/core/animation/AnimationInputHelpers.h
@@ -5,8 +5,8 @@ #ifndef AnimationInputHelpers_h #define AnimationInputHelpers_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/Forward.h"
diff --git a/third_party/WebKit/Source/core/animation/AnimationSimTest.cpp b/third_party/WebKit/Source/core/animation/AnimationSimTest.cpp index 68555fee..cada24b7 100644 --- a/third_party/WebKit/Source/core/animation/AnimationSimTest.cpp +++ b/third_party/WebKit/Source/core/animation/AnimationSimTest.cpp
@@ -11,7 +11,7 @@ #include "core/testing/sim/SimCompositor.h" #include "core/testing/sim/SimRequest.h" #include "core/testing/sim/SimTest.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Time.h" #include "public/web/WebScriptSource.h"
diff --git a/third_party/WebKit/Source/core/animation/AnimationTest.cpp b/third_party/WebKit/Source/core/animation/AnimationTest.cpp index d2182ac3..a13c3a7 100644 --- a/third_party/WebKit/Source/core/animation/AnimationTest.cpp +++ b/third_party/WebKit/Source/core/animation/AnimationTest.cpp
@@ -43,7 +43,7 @@ #include "core/layout/LayoutTestHelper.h" #include "core/paint/PaintLayer.h" #include "core/testing/DummyPageHolder.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/KURL.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp index 52e1703d..1ce393a7 100644 --- a/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp
@@ -5,10 +5,10 @@ #include "core/animation/CSSBasicShapeInterpolationType.h" #include <memory> -#include "core/CSSPropertyNames.h" #include "core/animation/BasicShapeInterpolationFunctions.h" #include "core/css/CSSValueList.h" #include "core/css/resolver/StyleResolverState.h" +#include "core/css_property_names.h" #include "core/style/BasicShapes.h" #include "core/style/ComputedStyle.h" #include "core/style/DataEquivalency.h"
diff --git a/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp index 65123447..7e59961 100644 --- a/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp
@@ -5,12 +5,12 @@ #include "core/animation/CSSBorderImageLengthBoxInterpolationType.h" #include <memory> -#include "core/CSSPropertyNames.h" #include "core/animation/LengthInterpolationFunctions.h" #include "core/animation/SideIndex.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSQuadValue.h" #include "core/css/resolver/StyleResolverState.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" #include "platform/wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp index 2fc47bf..fee7b17 100644 --- a/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp
@@ -5,12 +5,12 @@ #include "core/animation/CSSFilterListInterpolationType.h" #include <memory> -#include "core/CSSPropertyNames.h" #include "core/animation/FilterInterpolationFunctions.h" #include "core/animation/ListInterpolationFunctions.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSValueList.h" #include "core/css/resolver/StyleResolverState.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" #include "platform/wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp index 3cfbbbd..8c7f4a1 100644 --- a/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp
@@ -5,10 +5,10 @@ #include "core/animation/CSSImageInterpolationType.h" #include <memory> -#include "core/CSSPropertyNames.h" #include "core/css/CSSCrossfadeValue.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/resolver/StyleResolverState.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" #include "core/style/StyleImage.h" #include "platform/wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp index afbaa540..b19972c8 100644 --- a/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp
@@ -5,10 +5,10 @@ #include "core/animation/CSSPaintInterpolationType.h" #include <memory> -#include "core/CSSPropertyNames.h" #include "core/animation/CSSColorInterpolationType.h" #include "core/css/StyleColor.h" #include "core/css/resolver/StyleResolverState.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" #include "platform/wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp index 9136c314..dca696a 100644 --- a/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp
@@ -5,13 +5,13 @@ #include "core/animation/CSSShadowListInterpolationType.h" #include <memory> -#include "core/CSSPropertyNames.h" #include "core/animation/ListInterpolationFunctions.h" #include "core/animation/ShadowInterpolationFunctions.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSValueList.h" #include "core/css/resolver/StyleBuilder.h" #include "core/css/resolver/StyleResolverState.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" #include "core/style/ShadowList.h" #include "platform/wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h index e5a4333..7e234c54 100644 --- a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h
@@ -5,8 +5,8 @@ #ifndef ColorPropertyFunctions_h #define ColorPropertyFunctions_h -#include "core/CSSPropertyNames.h" #include "core/css/StyleColor.h" +#include "core/css_property_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp b/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp index 067982a2..6109d341 100644 --- a/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp +++ b/third_party/WebKit/Source/core/animation/CompositorAnimationsTest.cpp
@@ -56,9 +56,9 @@ #include "platform/geometry/FloatBox.h" #include "platform/geometry/IntSize.h" #include "platform/testing/HistogramTester.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/transforms/TransformOperations.h" #include "platform/transforms/TranslateTransformOperation.h" #include "platform/wtf/HashFunctions.h"
diff --git a/third_party/WebKit/Source/core/animation/DocumentAnimations.h b/third_party/WebKit/Source/core/animation/DocumentAnimations.h index 7e09977..96ed8ac 100644 --- a/third_party/WebKit/Source/core/animation/DocumentAnimations.h +++ b/third_party/WebKit/Source/core/animation/DocumentAnimations.h
@@ -31,7 +31,7 @@ #ifndef DocumentAnimations_h #define DocumentAnimations_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/DocumentLifecycle.h" #include "platform/graphics/CompositorElementId.h" #include "platform/wtf/Optional.h"
diff --git a/third_party/WebKit/Source/core/animation/EffectModel.h b/third_party/WebKit/Source/core/animation/EffectModel.h index e808be9..15c4634 100644 --- a/third_party/WebKit/Source/core/animation/EffectModel.h +++ b/third_party/WebKit/Source/core/animation/EffectModel.h
@@ -31,9 +31,9 @@ #ifndef EffectModel_h #define EffectModel_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/animation/PropertyHandle.h" +#include "core/css_property_names.h" #include "platform/heap/Handle.h" #include "platform/wtf/HashMap.h"
diff --git a/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h b/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h index ae80c213..0ad7231f 100644 --- a/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h
@@ -5,7 +5,7 @@ #ifndef ImageListPropertyFunctions_h #define ImageListPropertyFunctions_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h b/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h index f3f273e..95f3fe5 100644 --- a/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h
@@ -5,7 +5,7 @@ #ifndef ImageSlicePropertyFunctions_h #define ImageSlicePropertyFunctions_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/animation/KeyframeEffectTest.cpp b/third_party/WebKit/Source/core/animation/KeyframeEffectTest.cpp index 83c36f3..3272f97 100644 --- a/third_party/WebKit/Source/core/animation/KeyframeEffectTest.cpp +++ b/third_party/WebKit/Source/core/animation/KeyframeEffectTest.cpp
@@ -19,7 +19,7 @@ #include "core/animation/Timing.h" #include "core/dom/Document.h" #include "core/testing/PageTestBase.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "v8/include/v8.h"
diff --git a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h index ea918241..683bdadd 100644 --- a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h
@@ -5,7 +5,7 @@ #ifndef LengthListPropertyFunctions_h #define LengthListPropertyFunctions_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/Length.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h b/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h index 77405df..1b6bb6e 100644 --- a/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h
@@ -5,8 +5,8 @@ #ifndef LengthPropertyFunctions_h #define LengthPropertyFunctions_h -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "platform/Length.h" #include "platform/wtf/Allocator.h"
diff --git a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h index 0ba9a8a9..b03ce17 100644 --- a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h
@@ -5,7 +5,7 @@ #ifndef NumberPropertyFunctions_h #define NumberPropertyFunctions_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/Optional.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/animation/PropertyHandle.h b/third_party/WebKit/Source/core/animation/PropertyHandle.h index 57c8122..cd5aafb 100644 --- a/third_party/WebKit/Source/core/animation/PropertyHandle.h +++ b/third_party/WebKit/Source/core/animation/PropertyHandle.h
@@ -5,9 +5,9 @@ #ifndef PropertyHandle_h #define PropertyHandle_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" #include "core/dom/QualifiedName.h" #include "platform/wtf/Allocator.h"
diff --git a/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h b/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h index 567a409..24592f5 100644 --- a/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h
@@ -5,7 +5,7 @@ #ifndef SizeListPropertyFunctions_h #define SizeListPropertyFunctions_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/style/FillLayer.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimatableValueFactory.h b/third_party/WebKit/Source/core/animation/css/CSSAnimatableValueFactory.h index 21cdd4e..9ce754e 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSAnimatableValueFactory.h +++ b/third_party/WebKit/Source/core/animation/css/CSSAnimatableValueFactory.h
@@ -32,9 +32,9 @@ #define CSSAnimatableValueFactory_h #include "base/memory/scoped_refptr.h" -#include "core/CSSPropertyNames.h" #include "core/animation/animatable/AnimatableValue.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/animation/css/CSSTransitionData.h b/third_party/WebKit/Source/core/animation/css/CSSTransitionData.h index b5cb7ec..9c2687b 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSTransitionData.h +++ b/third_party/WebKit/Source/core/animation/css/CSSTransitionData.h
@@ -6,8 +6,8 @@ #define CSSTransitionData_h #include <memory> -#include "core/CSSPropertyNames.h" #include "core/animation/css/CSSTimingData.h" +#include "core/css_property_names.h" #include "platform/wtf/PtrUtil.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp index fcb74921..f97d21d 100644 --- a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp +++ b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp
@@ -29,6 +29,7 @@ #include "build/build_config.h" #include "core/clipboard/DataObject.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/clipboard/DataTransferItem.h" #include "core/clipboard/DataTransferItemList.h" #include "core/editing/EphemeralRange.h" @@ -218,8 +219,8 @@ } DataTransfer* DataTransfer::Create() { - DataTransfer* data = - Create(kCopyAndPaste, kDataTransferWritable, DataObject::Create()); + DataTransfer* data = Create( + kCopyAndPaste, DataTransferAccessPolicy::kWritable, DataObject::Create()); data->drop_effect_ = "none"; data->effect_allowed_ = "none"; return data; @@ -533,27 +534,29 @@ void DataTransfer::SetAccessPolicy(DataTransferAccessPolicy policy) { // once you go numb, can never go back - DCHECK(policy_ != kDataTransferNumb || policy == kDataTransferNumb); + DCHECK(policy_ != DataTransferAccessPolicy::kNumb || + policy == DataTransferAccessPolicy::kNumb); policy_ = policy; } bool DataTransfer::CanReadTypes() const { - return policy_ == kDataTransferReadable || - policy_ == kDataTransferTypesReadable || - policy_ == kDataTransferWritable; + return policy_ == DataTransferAccessPolicy::kReadable || + policy_ == DataTransferAccessPolicy::kTypesReadable || + policy_ == DataTransferAccessPolicy::kWritable; } bool DataTransfer::CanReadData() const { - return policy_ == kDataTransferReadable || policy_ == kDataTransferWritable; + return policy_ == DataTransferAccessPolicy::kReadable || + policy_ == DataTransferAccessPolicy::kWritable; } bool DataTransfer::CanWriteData() const { - return policy_ == kDataTransferWritable; + return policy_ == DataTransferAccessPolicy::kWritable; } bool DataTransfer::CanSetDragImage() const { - return policy_ == kDataTransferImageWritable || - policy_ == kDataTransferWritable; + return policy_ == DataTransferAccessPolicy::kImageWritable || + policy_ == DataTransferAccessPolicy::kWritable; } DragOperation DataTransfer::SourceOperation() const {
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransfer.h b/third_party/WebKit/Source/core/clipboard/DataTransfer.h index e520d273..2ea7d34 100644 --- a/third_party/WebKit/Source/core/clipboard/DataTransfer.h +++ b/third_party/WebKit/Source/core/clipboard/DataTransfer.h
@@ -27,7 +27,6 @@ #include <memory> #include "core/CoreExport.h" #include "core/clipboard/DataObject.h" -#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/loader/resource/ImageResourceContent.h" #include "core/page/DragActions.h" #include "platform/bindings/ScriptWrappable.h" @@ -47,6 +46,8 @@ class PaintRecordBuilder; class PropertyTreeState; +enum class DataTransferAccessPolicy; + // Used for drag and drop and copy/paste. // Drag and Drop: // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransferAccessPolicy.h b/third_party/WebKit/Source/core/clipboard/DataTransferAccessPolicy.h index e91b06c..3fc27ec0 100644 --- a/third_party/WebKit/Source/core/clipboard/DataTransferAccessPolicy.h +++ b/third_party/WebKit/Source/core/clipboard/DataTransferAccessPolicy.h
@@ -28,12 +28,12 @@ namespace blink { -enum DataTransferAccessPolicy { - kDataTransferNumb, - kDataTransferImageWritable, - kDataTransferWritable, - kDataTransferTypesReadable, - kDataTransferReadable +enum class DataTransferAccessPolicy { + kNumb, + kImageWritable, + kWritable, + kTypesReadable, + kReadable }; } // namespace
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp b/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp index eb43df9..26c80902 100644 --- a/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp +++ b/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp
@@ -11,7 +11,7 @@ #include "core/layout/LayoutObject.h" #include "core/layout/LayoutTestHelper.h" #include "platform/DragImage.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp index 0f5c61e4..7ad3450 100644 --- a/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp +++ b/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -25,7 +25,6 @@ #include "core/css/CSSComputedStyleDeclaration.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSPrimitiveValueMappings.h" @@ -36,6 +35,7 @@ #include "core/css/StyleEngine.h" #include "core/css/ZoomAdjustedPixelValue.h" #include "core/css/parser/CSSParser.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/ExceptionCode.h" #include "core/dom/PseudoElement.h"
diff --git a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h index 82c2665..0466556 100644 --- a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h +++ b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h
@@ -5,8 +5,8 @@ #ifndef CSSCustomIdentValue_h #define CSSCustomIdentValue_h -#include "core/CSSPropertyNames.h" #include "core/css/CSSValue.h" +#include "core/css_property_names.h" #include "platform/wtf/text/AtomicString.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/CSSPaintImageGenerator.h b/third_party/WebKit/Source/core/css/CSSPaintImageGenerator.h index bd9a86a3..a7adfd9 100644 --- a/third_party/WebKit/Source/core/css/CSSPaintImageGenerator.h +++ b/third_party/WebKit/Source/core/css/CSSPaintImageGenerator.h
@@ -5,9 +5,9 @@ #ifndef CSSPaintImageGenerator_h #define CSSPaintImageGenerator_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/cssom/CSSStyleValue.h" +#include "core/css_property_names.h" #include "platform/geometry/IntSize.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/css/CSSPendingSubstitutionValue.h b/third_party/WebKit/Source/core/css/CSSPendingSubstitutionValue.h index 55684e5..3ec063a8 100644 --- a/third_party/WebKit/Source/core/css/CSSPendingSubstitutionValue.h +++ b/third_party/WebKit/Source/core/css/CSSPendingSubstitutionValue.h
@@ -5,9 +5,9 @@ #ifndef CSSPendingSubstitutionValue_h #define CSSPendingSubstitutionValue_h -#include "core/CSSPropertyNames.h" #include "core/css/CSSValue.h" #include "core/css/CSSVariableReferenceValue.h" +#include "core/css_property_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h index efb92e9..30b76f4 100644 --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.h
@@ -22,10 +22,10 @@ #ifndef CSSPrimitiveValue_h #define CSSPrimitiveValue_h -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/CoreExport.h" #include "core/css/CSSValue.h" +#include "core/css_property_names.h" #include "platform/wtf/BitVector.h" #include "platform/wtf/Forward.h" #include "platform/wtf/MathExtras.h"
diff --git a/third_party/WebKit/Source/core/css/CSSPropertyEquality.h b/third_party/WebKit/Source/core/css/CSSPropertyEquality.h index 6610625..806561d 100644 --- a/third_party/WebKit/Source/core/css/CSSPropertyEquality.h +++ b/third_party/WebKit/Source/core/css/CSSPropertyEquality.h
@@ -5,7 +5,7 @@ #ifndef CSSPropertyEquality_h #define CSSPropertyEquality_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/text/AtomicString.h"
diff --git a/third_party/WebKit/Source/core/css/CSSPropertyIDTemplates.h b/third_party/WebKit/Source/core/css/CSSPropertyIDTemplates.h index cfc341c5..0a307381 100644 --- a/third_party/WebKit/Source/core/css/CSSPropertyIDTemplates.h +++ b/third_party/WebKit/Source/core/css/CSSPropertyIDTemplates.h
@@ -5,7 +5,7 @@ #ifndef CSSPropertyIDTemplates_h #define CSSPropertyIDTemplates_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/HashFunctions.h" #include "platform/wtf/HashTraits.h"
diff --git a/third_party/WebKit/Source/core/css/CSSPropertyValue.h b/third_party/WebKit/Source/core/css/CSSPropertyValue.h index f46818e..4cc47cd 100644 --- a/third_party/WebKit/Source/core/css/CSSPropertyValue.h +++ b/third_party/WebKit/Source/core/css/CSSPropertyValue.h
@@ -21,9 +21,9 @@ #ifndef CSSPropertyValue_h #define CSSPropertyValue_h -#include "core/CSSPropertyNames.h" #include "core/css/CSSValue.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/CSSPropertyValueSet.h b/third_party/WebKit/Source/core/css/CSSPropertyValueSet.h index 3ab3d51..e716b10 100644 --- a/third_party/WebKit/Source/core/css/CSSPropertyValueSet.h +++ b/third_party/WebKit/Source/core/css/CSSPropertyValueSet.h
@@ -22,12 +22,12 @@ #define CSSPropertyValueSet_h #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSPropertyValue.h" #include "core/css/PropertySetCSSStyleDeclaration.h" #include "core/css/parser/CSSParserMode.h" +#include "core/css_property_names.h" #include "platform/wtf/Noncopyable.h" #include "platform/wtf/Vector.h" #include "platform/wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/css/CSSSelectorList.h b/third_party/WebKit/Source/core/css/CSSSelectorList.h index 350b279..04b81759 100644 --- a/third_party/WebKit/Source/core/css/CSSSelectorList.h +++ b/third_party/WebKit/Source/core/css/CSSSelectorList.h
@@ -27,7 +27,6 @@ #define CSSSelectorList_h #include <memory> -#include <vector> #include "core/CoreExport.h" #include "core/css/CSSSelector.h"
diff --git a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h index d0b61cc..3db71d5 100644 --- a/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h +++ b/third_party/WebKit/Source/core/css/CSSStyleDeclaration.h
@@ -22,8 +22,8 @@ #define CSSStyleDeclaration_h #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "core/dom/ExecutionContext.h" #include "platform/bindings/ScriptWrappable.h" #include "platform/wtf/Forward.h"
diff --git a/third_party/WebKit/Source/core/css/CSSValuePool.h b/third_party/WebKit/Source/core/css/CSSValuePool.h index bd4473e..ce9275f 100644 --- a/third_party/WebKit/Source/core/css/CSSValuePool.h +++ b/third_party/WebKit/Source/core/css/CSSValuePool.h
@@ -28,7 +28,6 @@ #include "base/macros.h" #include "base/memory/scoped_refptr.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/CoreExport.h" #include "core/css/CSSColorValue.h" @@ -40,6 +39,7 @@ #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSUnsetValue.h" #include "core/css/CSSValueList.h" +#include "core/css_property_names.h" #include "platform/wtf/HashMap.h" #include "platform/wtf/text/AtomicStringHash.h"
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5 b/third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5 index 857cfb0..29e4639 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5 +++ b/third_party/WebKit/Source/core/css/ComputedStyleExtraFields.json5
@@ -865,7 +865,7 @@ type_name: "Vector<CSSPropertyID>", field_group: "*->will-change", default_value: "Vector<CSSPropertyID>()", - include_paths: ["platform/wtf/Vector.h", "core/CSSPropertyNames.h"], + include_paths: ["platform/wtf/Vector.h", "core/css_property_names.h"], }, { name: "WillChangeContents",
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSOMKeywords.h b/third_party/WebKit/Source/core/css/cssom/CSSOMKeywords.h index 603f0f1f..8ed9e5a 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSOMKeywords.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSOMKeywords.h
@@ -5,7 +5,7 @@ #ifndef CSSOMKeywords_h #define CSSOMKeywords_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSOMTypes.h b/third_party/WebKit/Source/core/css/cssom/CSSOMTypes.h index fe01e6c2..0a636b11 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSOMTypes.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSOMTypes.h
@@ -5,8 +5,8 @@ #ifndef CSSOMTypes_h #define CSSOMTypes_h -#include "core/CSSPropertyNames.h" #include "core/css/cssom/CSSStyleValue.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h index 3e12178c..598bb5c 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h +++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h
@@ -6,9 +6,9 @@ #define CSSStyleValue_h #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/CSSValue.h" +#include "core/css_property_names.h" #include "platform/bindings/ScriptWrappable.h" #include "platform/wtf/Optional.h" #include "platform/wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSUnsupportedStyleValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSUnsupportedStyleValue.cpp index 606bb712..8eb4983 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSUnsupportedStyleValue.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSUnsupportedStyleValue.cpp
@@ -4,8 +4,8 @@ #include "core/css/cssom/CSSUnsupportedStyleValue.h" -#include "core/CSSPropertyNames.h" #include "core/css/parser/CSSParser.h" +#include "core/css_property_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.cpp b/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.cpp index 4ffb121..13ee0eea 100644 --- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.cpp +++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.cpp
@@ -5,7 +5,6 @@ #include "core/css/cssom/StylePropertyMapReadOnly.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/StylePropertyShorthand.h" #include "core/css/CSSCustomPropertyDeclaration.h" #include "core/css/CSSValueList.h" @@ -15,6 +14,7 @@ #include "core/css/cssom/CSSUnsupportedStyleValue.h" #include "core/css/cssom/StyleValueFactory.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.h b/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.h index 0d953c5..b83abbf 100644 --- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.h +++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMapReadOnly.h
@@ -7,9 +7,9 @@ #include "base/macros.h" #include "bindings/core/v8/Iterable.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/cssom/CSSStyleValue.h" +#include "core/css_property_names.h" #include "platform/bindings/ScriptWrappable.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.h b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.h index 9ec0395..8ef52811 100644 --- a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.h +++ b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.h
@@ -5,8 +5,8 @@ #ifndef StyleValueFactory_h #define StyleValueFactory_h -#include "core/CSSPropertyNames.h" #include "core/css/cssom/CSSStyleValue.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParser.h b/third_party/WebKit/Source/core/css/parser/CSSParser.h index 4b9945a6..e877775 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParser.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParser.h
@@ -6,10 +6,10 @@ #define CSSParser_h #include <memory> -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/parser/CSSParserContext.h" +#include "core/css_property_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h index ea2d8dac..bb2e6a9 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserContext.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserContext.h
@@ -5,9 +5,9 @@ #ifndef CSSParserContext_h #define CSSParserContext_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/parser/CSSParserMode.h" +#include "core/css_property_names.h" #include "core/dom/ExecutionContext.h" #include "core/frame/WebFeatureForward.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h index 0fee1dd4..4ca51f5f 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.h
@@ -5,8 +5,8 @@ #ifndef CSSParserFastPaths_h #define CSSParserFastPaths_h -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "platform/graphics/Color.h" #include "platform/heap/Handle.h" #include "platform/wtf/Allocator.h"
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h index 2dea9c7..7616f9b 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserImpl.h
@@ -8,11 +8,11 @@ #include <memory> #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSPropertySourceData.h" #include "core/css/CSSPropertyValue.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/parser/CSSParserTokenRange.h" +#include "core/css_property_names.h" #include "platform/heap/Handle.h" #include "platform/wtf/Vector.h" #include "platform/wtf/text/WTFString.h"
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserLocalContext.h b/third_party/WebKit/Source/core/css/parser/CSSParserLocalContext.h index 70c8fe3..c63debc 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSParserLocalContext.h +++ b/third_party/WebKit/Source/core/css/parser/CSSParserLocalContext.h
@@ -5,7 +5,7 @@ #ifndef CSSParserLocalContext_h #define CSSParserLocalContext_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp index bd2f28b..b943647 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp
@@ -11,7 +11,7 @@ #include "core/css/parser/CSSParser.h" #include "core/html/HTMLHtmlElement.h" #include "core/testing/DummyPageHolder.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/properties/CSSParsingUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSParsingUtils.cpp index 4297374f..2b8223b 100644 --- a/third_party/WebKit/Source/core/css/properties/CSSParsingUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/CSSParsingUtils.cpp
@@ -4,7 +4,6 @@ #include "core/css/properties/CSSParsingUtils.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/StylePropertyShorthand.h" #include "core/css/CSSBasicShapeValues.h" @@ -36,6 +35,7 @@ #include "core/css/parser/CSSParserTokenRange.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" #include "core/frame/UseCounter.h" #include "core/frame/WebFeature.h" #include "core/svg/SVGParsingError.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.h b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.h index 861be42..37d5865 100644 --- a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.h +++ b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.h
@@ -31,7 +31,7 @@ #ifndef AnimatedStyleBuilder_h #define AnimatedStyleBuilder_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h b/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h index b9cb2a1..1750373 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h +++ b/third_party/WebKit/Source/core/css/resolver/CSSPropertyPriority.h
@@ -5,7 +5,7 @@ #ifndef CSSPropertyPriority_h #define CSSPropertyPriority_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "platform/wtf/Allocator.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.h b/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.h index 5d86fbc0..44cb393 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.h +++ b/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.h
@@ -23,9 +23,9 @@ #ifndef CSSToStyleMap_h #define CSSToStyleMap_h -#include "core/CSSPropertyNames.h" #include "core/animation/Timing.h" #include "core/animation/css/CSSTransitionData.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyleConstants.h" #include "platform/animation/TimingFunction.h" #include "platform/wtf/Allocator.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp index c22cfb5d..c5a4850 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
@@ -4,7 +4,6 @@ #include "core/css/resolver/CSSVariableResolver.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/StyleBuilderFunctions.h" #include "core/StylePropertyShorthand.h" @@ -22,6 +21,7 @@ #include "core/css/resolver/StyleBuilderConverter.h" #include "core/css/resolver/StyleResolverState.h" #include "core/css/resolver/StyleResolverStats.h" +#include "core/css_property_names.h" #include "core/style/ComputedStyle.h" #include "core/style/StyleInheritedVariables.h" #include "core/style/StyleNonInheritedVariables.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h index 455d520..892f942 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h
@@ -5,8 +5,8 @@ #ifndef CSSVariableResolver_h #define CSSVariableResolver_h -#include "core/CSSPropertyNames.h" #include "core/css/parser/CSSParserToken.h" +#include "core/css_property_names.h" #include "platform/wtf/HashSet.h" #include "platform/wtf/text/AtomicString.h" #include "platform/wtf/text/AtomicStringHash.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp index f59290f..c0e5299 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp +++ b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.cpp
@@ -23,10 +23,10 @@ #include "core/css/resolver/ElementStyleResources.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSGradientValue.h" #include "core/css/CSSImageValue.h" #include "core/css/CSSURIValue.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/TreeScope.h" #include "core/style/ComputedStyle.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h index ef39372..46cc179 100644 --- a/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h +++ b/third_party/WebKit/Source/core/css/resolver/ElementStyleResources.h
@@ -25,8 +25,8 @@ #define ElementStyleResources_h #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSPropertyIDTemplates.h" +#include "core/css_property_names.h" #include "platform/CrossOriginAttributeValue.h" #include "platform/graphics/Color.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp index 81e15222..6a19bd9 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjusterTest.cpp
@@ -4,7 +4,7 @@ #include "core/dom/NodeComputedStyle.h" #include "core/layout/LayoutTestHelper.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilder.h b/third_party/WebKit/Source/core/css/resolver/StyleBuilder.h index 36ec0a2..f11a902 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilder.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilder.h
@@ -31,9 +31,9 @@ #ifndef StyleBuilder_h #define StyleBuilder_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" #include "platform/heap/Handle.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp index 4877a7b9..cddb6749 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -39,7 +39,6 @@ */ #include <memory> -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/StyleBuilderFunctions.h" #include "core/StylePropertyShorthand.h" @@ -66,6 +65,7 @@ #include "core/css/resolver/FilterOperationResolver.h" #include "core/css/resolver/FontBuilder.h" #include "core/css/resolver/StyleBuilder.h" +#include "core/css_property_names.h" #include "core/frame/LocalFrame.h" #include "core/frame/Settings.h" #include "core/style/ComputedStyle.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp index ef8fea3..e23329b 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -30,7 +30,6 @@ #include "core/css/resolver/StyleResolver.h" -#include "core/CSSPropertyNames.h" #include "core/StylePropertyShorthand.h" #include "core/animation/CSSInterpolationEnvironment.h" #include "core/animation/CSSInterpolationTypesMap.h" @@ -74,6 +73,7 @@ #include "core/css/resolver/StyleResolverState.h" #include "core/css/resolver/StyleResolverStats.h" #include "core/css/resolver/StyleRuleUsageTracker.h" +#include "core/css_property_names.h" #include "core/dom/ElementShadow.h" #include "core/dom/FirstLetterPseudoElement.h" #include "core/dom/NodeComputedStyle.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h index 4527047..af32fb9 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.h
@@ -25,7 +25,6 @@ #include <memory> #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/animation/css/CSSAnimationUpdate.h" #include "core/css/CSSPendingSubstitutionValue.h" @@ -34,6 +33,7 @@ #include "core/css/resolver/ElementResolveContext.h" #include "core/css/resolver/ElementStyleResources.h" #include "core/css/resolver/FontBuilder.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/style/CachedUAStyle.h"
diff --git a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h index 3535f53..90009bdc 100644 --- a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h +++ b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.h
@@ -30,9 +30,9 @@ #ifndef ViewportStyleResolver_h #define ViewportStyleResolver_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/RuleSet.h" +#include "core/css_property_names.h" #include "platform/Length.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/css/threaded/CSSParserThreadedTest.cpp b/third_party/WebKit/Source/core/css/threaded/CSSParserThreadedTest.cpp index 4f6133b..36052465 100644 --- a/third_party/WebKit/Source/core/css/threaded/CSSParserThreadedTest.cpp +++ b/third_party/WebKit/Source/core/css/threaded/CSSParserThreadedTest.cpp
@@ -5,9 +5,9 @@ #include "core/css/parser/CSSParser.h" #include "core/css/parser/CSSParserContext.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/threaded/MultiThreadedTestUtil.h" +#include "core/css_property_names.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/dom/DocumentTest.cpp b/third_party/WebKit/Source/core/dom/DocumentTest.cpp index c84f1f69..15d7ea9 100644 --- a/third_party/WebKit/Source/core/dom/DocumentTest.cpp +++ b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
@@ -49,7 +49,7 @@ #include "core/page/ValidationMessageClient.h" #include "core/testing/PageTestBase.h" #include "platform/heap/Handle.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/ReferrerPolicy.h" #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityOrigin.h"
diff --git a/third_party/WebKit/Source/core/dom/FlatTreeTraversalTest.cpp b/third_party/WebKit/Source/core/dom/FlatTreeTraversalTest.cpp index 1ea98a6f..e83df7c 100644 --- a/third_party/WebKit/Source/core/dom/FlatTreeTraversalTest.cpp +++ b/third_party/WebKit/Source/core/dom/FlatTreeTraversalTest.cpp
@@ -15,7 +15,7 @@ #include "core/html/HTMLElement.h" #include "core/testing/PageTestBase.h" #include "platform/geometry/IntSize.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Compiler.h" #include "platform/wtf/StdLibExtras.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/core/dom/ng/flat_tree_traversal_ng_test.cc b/third_party/WebKit/Source/core/dom/ng/flat_tree_traversal_ng_test.cc index 17be358..8ba536e 100644 --- a/third_party/WebKit/Source/core/dom/ng/flat_tree_traversal_ng_test.cc +++ b/third_party/WebKit/Source/core/dom/ng/flat_tree_traversal_ng_test.cc
@@ -16,7 +16,7 @@ #include "core/testing/PageTestBase.h" #include "platform/geometry/IntSize.h" #include "platform/runtime_enabled_features.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Compiler.h" #include "platform/wtf/StdLibExtras.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/core/dom/ng/slot_assignment_test.cpp b/third_party/WebKit/Source/core/dom/ng/slot_assignment_test.cpp index 09218fe..c28f28e 100644 --- a/third_party/WebKit/Source/core/dom/ng/slot_assignment_test.cpp +++ b/third_party/WebKit/Source/core/dom/ng/slot_assignment_test.cpp
@@ -13,7 +13,7 @@ #include "core/html/HTMLElement.h" #include "core/html/HTMLSlotElement.h" #include "core/testing/DummyPageHolder.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Vector.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/editing/BUILD.gn b/third_party/WebKit/Source/core/editing/BUILD.gn index cbe17d7..08d78dad 100644 --- a/third_party/WebKit/Source/core/editing/BUILD.gn +++ b/third_party/WebKit/Source/core/editing/BUILD.gn
@@ -101,6 +101,7 @@ "commands/ApplyStyleCommand.h", "commands/BreakBlockquoteCommand.cpp", "commands/BreakBlockquoteCommand.h", + "commands/ClipboardCommands.h", "commands/CompositeEditCommand.cpp", "commands/CompositeEditCommand.h", "commands/CreateLinkCommand.cpp",
diff --git a/third_party/WebKit/Source/core/editing/EditingStyle.h b/third_party/WebKit/Source/core/editing/EditingStyle.h index 288dd7bb..2a7c2c7 100644 --- a/third_party/WebKit/Source/core/editing/EditingStyle.h +++ b/third_party/WebKit/Source/core/editing/EditingStyle.h
@@ -32,9 +32,9 @@ #ifndef EditingStyle_h #define EditingStyle_h -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "core/editing/Forward.h" #include "core/editing/WritingDirection.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp index 92d6a2f..a478733 100644 --- a/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp +++ b/third_party/WebKit/Source/core/editing/EditingStyleUtilities.cpp
@@ -26,12 +26,12 @@ #include "core/editing/EditingStyleUtilities.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSColorValue.h" #include "core/css/CSSComputedStyleDeclaration.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/parser/CSSParser.h" +#include "core/css_property_names.h" #include "core/editing/EditingStyle.h" #include "core/editing/EditingUtilities.h" #include "core/editing/EphemeralRange.h"
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp index 7eb62e8..e11ae08d 100644 --- a/third_party/WebKit/Source/core/editing/Editor.cpp +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -27,12 +27,13 @@ #include "core/editing/Editor.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/clipboard/DataObject.h" #include "core/clipboard/DataTransfer.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/clipboard/Pasteboard.h" #include "core/css/CSSComputedStyleDeclaration.h" #include "core/css/CSSPropertyValueSet.h" +#include "core/css_property_names.h" #include "core/dom/AXObjectCache.h" #include "core/dom/DocumentFragment.h" #include "core/dom/ElementTraversal.h" @@ -380,9 +381,9 @@ return true; // Dispatch 'beforeinput'. - DataTransfer* data_transfer = - DataTransfer::Create(DataTransfer::kDragAndDrop, kDataTransferReadable, - drag_data->PlatformData()); + DataTransfer* data_transfer = DataTransfer::Create( + DataTransfer::kDragAndDrop, DataTransferAccessPolicy::kReadable, + drag_data->PlatformData()); data_transfer->SetSourceOperation(drag_data->DraggingSourceOperationMask()); const bool should_insert = DispatchBeforeInputDataTransfer(
diff --git a/third_party/WebKit/Source/core/editing/Editor.h b/third_party/WebKit/Source/core/editing/Editor.h index 6fd0c17c..cecc631 100644 --- a/third_party/WebKit/Source/core/editing/Editor.h +++ b/third_party/WebKit/Source/core/editing/Editor.h
@@ -30,7 +30,6 @@ #include "base/macros.h" #include "core/CoreExport.h" -#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/editing/EditingBehavior.h" #include "core/editing/EditingStyle.h" #include "core/editing/Forward.h"
diff --git a/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp b/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp index b142fb7..76003c6 100644 --- a/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp +++ b/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp
@@ -15,7 +15,7 @@ #include "core/layout/ng/inline/ng_physical_text_fragment.h" #include "core/layout/ng/layout_ng_block_flow.h" #include "core/paint/ng/ng_paint_fragment.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/Functional.h"
diff --git a/third_party/WebKit/Source/core/editing/LocalCaretRectTest.cpp b/third_party/WebKit/Source/core/editing/LocalCaretRectTest.cpp index fd5e8a1..9846836 100644 --- a/third_party/WebKit/Source/core/editing/LocalCaretRectTest.cpp +++ b/third_party/WebKit/Source/core/editing/LocalCaretRectTest.cpp
@@ -10,7 +10,7 @@ #include "core/html/forms/TextControlElement.h" #include "core/layout/LayoutObject.h" #include "core/layout/ng/ng_physical_box_fragment.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp index ca1023ae..d4302a74 100644 --- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -25,11 +25,11 @@ #include "core/editing/commands/ApplyStyleCommand.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/css/CSSComputedStyleDeclaration.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSPropertyValueSet.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/NodeList.h" #include "core/dom/NodeTraversal.h"
diff --git a/third_party/WebKit/Source/core/editing/commands/ClipboardCommands.h b/third_party/WebKit/Source/core/editing/commands/ClipboardCommands.h new file mode 100644 index 0000000..cfdb366 --- /dev/null +++ b/third_party/WebKit/Source/core/editing/commands/ClipboardCommands.h
@@ -0,0 +1,120 @@ +/* + * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) + * Copyright (C) 2009 Igalia S.L. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef ClipboardCommands_h +#define ClipboardCommands_h + +#include "core/clipboard/DataTransferAccessPolicy.h" +#include "core/editing/Forward.h" +#include "platform/wtf/Allocator.h" +#include "platform/wtf/text/WTFString.h" + +namespace blink { + +class DocumentFragment; +class Element; +class Event; +class LocalFrame; +class Pasteboard; + +enum class EditorCommandSource; +enum class PasteMode; + +// This class provides static functions about commands related to clipboard. +class ClipboardCommands { + STATIC_ONLY(ClipboardCommands); + + public: + static bool EnabledCopy(LocalFrame&, Event*, EditorCommandSource); + static bool EnabledCut(LocalFrame&, Event*, EditorCommandSource); + static bool EnabledPaste(LocalFrame&, Event*, EditorCommandSource); + + // Returns |bool| value for Document#execCommand(). + static bool ExecuteCopy(LocalFrame&, + Event*, + EditorCommandSource, + const String&); + static bool ExecuteCut(LocalFrame&, + Event*, + EditorCommandSource, + const String&); + static bool ExecutePaste(LocalFrame&, + Event*, + EditorCommandSource, + const String&); + static bool ExecutePasteGlobalSelection(LocalFrame&, + Event*, + EditorCommandSource, + const String&); + static bool ExecutePasteAndMatchStyle(LocalFrame&, + Event*, + EditorCommandSource, + const String&); + + static bool PasteSupported(LocalFrame*); + + private: + static bool CanReadClipboard(LocalFrame&, EditorCommandSource); + static bool CanWriteClipboard(LocalFrame&, EditorCommandSource); + static bool CanSmartReplaceWithPasteboard(LocalFrame&, Pasteboard*); + static bool CanDeleteRange(const EphemeralRange&); + static Element* FindEventTargetForClipboardEvent(LocalFrame&, + EditorCommandSource); + + // Returns true if Editor should continue with default processing. + static bool DispatchClipboardEvent(LocalFrame&, + const AtomicString&, + DataTransferAccessPolicy, + EditorCommandSource, + PasteMode); + static bool DispatchCopyOrCutEvent(LocalFrame&, + EditorCommandSource, + const AtomicString&); + static bool DispatchPasteEvent(LocalFrame&, PasteMode, EditorCommandSource); + + static void WriteSelectionToPasteboard(LocalFrame&); + static void Paste(LocalFrame&, EditorCommandSource); + static void PasteAsFragment(LocalFrame&, + DocumentFragment*, + bool smart_replace, + bool match_style, + EditorCommandSource); + static void PasteAsPlainTextWithPasteboard(LocalFrame&, + Pasteboard*, + EditorCommandSource); + static void PasteWithPasteboard(LocalFrame&, + Pasteboard*, + EditorCommandSource); +}; + +} // namespace blink + +#endif
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h index be7d242..32d2461 100644 --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
@@ -26,8 +26,8 @@ #ifndef CompositeEditCommand_h #define CompositeEditCommand_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "core/editing/Forward.h" #include "core/editing/commands/EditCommand.h" #include "core/editing/commands/EditingState.h"
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index 3988801..da43a47d 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -28,13 +28,14 @@ #include "core/editing/Editor.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/clipboard/Pasteboard.h" #include "core/css/CSSComputedStyleDeclaration.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/CSSValueList.h" +#include "core/css_property_names.h" #include "core/dom/DocumentFragment.h" #include "core/dom/TagCollection.h" #include "core/dom/events/Event.h" @@ -48,6 +49,7 @@ #include "core/editing/SetSelectionOptions.h" #include "core/editing/VisiblePosition.h" #include "core/editing/commands/ApplyStyleCommand.h" +#include "core/editing/commands/ClipboardCommands.h" #include "core/editing/commands/CreateLinkCommand.h" #include "core/editing/commands/EditingCommandsUtilities.h" #include "core/editing/commands/EditorCommandNames.h" @@ -258,9 +260,7 @@ EditingTriState (*state)(LocalFrame&, Event*); String (*value)(const EditorInternalCommand&, LocalFrame&, Event*); bool is_text_insertion; - // TODO(yosin) We should have |canExecute()|, which checks clipboard - // accessibility to simplify |Editor::Command::execute()|. - bool allow_execution_when_disabled; + bool (*canExecute)(LocalFrame&, EditorCommandSource); }; static const bool kNotTextInsertion = false; @@ -739,7 +739,8 @@ CSSPropertyBackgroundColor, value); } -static bool CanWriteClipboard(LocalFrame& frame, EditorCommandSource source) { +bool ClipboardCommands::CanWriteClipboard(LocalFrame& frame, + EditorCommandSource source) { if (source == EditorCommandSource::kMenuOrKeyBinding) return true; Settings* settings = frame.GetSettings(); @@ -751,8 +752,9 @@ return frame.GetContentSettingsClient()->AllowWriteToClipboard(default_value); } -static Element* FindEventTargetForClipboardEvent(LocalFrame& frame, - EditorCommandSource source) { +Element* ClipboardCommands::FindEventTargetForClipboardEvent( + LocalFrame& frame, + EditorCommandSource source) { // https://www.w3.org/TR/clipboard-apis/#fire-a-clipboard-event says: // "Set target to be the element that contains the start of the selection in // document order, or the body element if there is no selection or cursor." @@ -766,37 +768,37 @@ } // Returns true if Editor should continue with default processing. -static bool DispatchClipboardEvent(LocalFrame& frame, - const AtomicString& event_type, - DataTransferAccessPolicy policy, - EditorCommandSource source, - PasteMode paste_mode) { +bool ClipboardCommands::DispatchClipboardEvent(LocalFrame& frame, + const AtomicString& event_type, + DataTransferAccessPolicy policy, + EditorCommandSource source, + PasteMode paste_mode) { Element* const target = FindEventTargetForClipboardEvent(frame, source); if (!target) return true; DataTransfer* const data_transfer = DataTransfer::Create(DataTransfer::kCopyAndPaste, policy, - policy == kDataTransferWritable + policy == DataTransferAccessPolicy::kWritable ? DataObject::Create() : DataObject::CreateFromPasteboard(paste_mode)); Event* const evt = ClipboardEvent::Create(event_type, data_transfer); target->DispatchEvent(evt); const bool no_default_processing = evt->defaultPrevented(); - if (no_default_processing && policy == kDataTransferWritable) { + if (no_default_processing && policy == DataTransferAccessPolicy::kWritable) { Pasteboard::GeneralPasteboard()->WriteDataObject( data_transfer->GetDataObject()); } // Invalidate clipboard here for security. - data_transfer->SetAccessPolicy(kDataTransferNumb); + data_transfer->SetAccessPolicy(DataTransferAccessPolicy::kNumb); return !no_default_processing; } -static bool DispatchCopyOrCutEvent(LocalFrame& frame, - EditorCommandSource source, - const AtomicString& event_type) { +bool ClipboardCommands::DispatchCopyOrCutEvent(LocalFrame& frame, + EditorCommandSource source, + const AtomicString& event_type) { // TODO(editing-dev): The use of UpdateStyleAndLayoutIgnorePendingStylesheets // needs to be audited. See http://crbug.com/590369 for more details. frame.GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); @@ -804,8 +806,9 @@ frame.Selection().ComputeVisibleSelectionInDOMTree().Start())) return true; - return DispatchClipboardEvent(frame, event_type, kDataTransferWritable, - source, PasteMode::kAllMimeTypes); + return DispatchClipboardEvent(frame, event_type, + DataTransferAccessPolicy::kWritable, source, + PasteMode::kAllMimeTypes); } static bool CanSmartCopyOrDelete(LocalFrame& frame) { @@ -813,7 +816,7 @@ frame.Selection().Granularity() == TextGranularity::kWord; } -static void WriteSelectionToPasteboard(LocalFrame& frame) { +void ClipboardCommands::WriteSelectionToPasteboard(LocalFrame& frame) { const KURL& url = frame.GetDocument()->Url(); const String html = frame.Selection().SelectedHTMLForClipboard(); const String plain_text = frame.SelectedTextForClipboard(); @@ -821,10 +824,10 @@ CanSmartCopyOrDelete(frame)); } -static bool ExecuteCopy(LocalFrame& frame, - Event*, - EditorCommandSource source, - const String&) { +bool ClipboardCommands::ExecuteCopy(LocalFrame& frame, + Event*, + EditorCommandSource source, + const String&) { // To support |allowExecutionWhenDisabled|, we need to check clipboard // accessibility here rather than |Editor::Command::execute()|. // TODO(yosin) We should move checking |canWriteClipboard()| to @@ -879,7 +882,7 @@ return CreateLinkCommand::Create(*frame.GetDocument(), value)->Apply(); } -static bool CanDeleteRange(const EphemeralRange& range) { +bool ClipboardCommands::CanDeleteRange(const EphemeralRange& range) { if (range.IsCollapsed()) return false; @@ -892,10 +895,10 @@ return HasEditableStyle(*start_container) && HasEditableStyle(*end_container); } -static bool ExecuteCut(LocalFrame& frame, - Event*, - EditorCommandSource source, - const String&) { +bool ClipboardCommands::ExecuteCut(LocalFrame& frame, + Event*, + EditorCommandSource source, + const String&) { // To support |allowExecutionWhenDisabled|, we need to check clipboard // accessibility here rather than |Editor::Command::execute()|. // TODO(yosin) We should move checking |canWriteClipboard()| to @@ -2027,7 +2030,8 @@ return true; } -static bool CanReadClipboard(LocalFrame& frame, EditorCommandSource source) { +bool ClipboardCommands::CanReadClipboard(LocalFrame& frame, + EditorCommandSource source) { if (source == EditorCommandSource::kMenuOrKeyBinding) return true; Settings* settings = frame.GetSettings(); @@ -2040,15 +2044,16 @@ default_value); } -static bool CanSmartReplaceWithPasteboard(LocalFrame& frame, - Pasteboard* pasteboard) { +bool ClipboardCommands::CanSmartReplaceWithPasteboard(LocalFrame& frame, + Pasteboard* pasteboard) { return frame.GetEditor().SmartInsertDeleteEnabled() && pasteboard->CanSmartReplace(); } -static void PasteAsPlainTextWithPasteboard(LocalFrame& frame, - Pasteboard* pasteboard, - EditorCommandSource source) { +void ClipboardCommands::PasteAsPlainTextWithPasteboard( + LocalFrame& frame, + Pasteboard* pasteboard, + EditorCommandSource source) { Element* const target = FindEventTargetForClipboardEvent(frame, source); if (!target) return; @@ -2057,18 +2062,19 @@ CanSmartReplaceWithPasteboard(frame, pasteboard))); } -static bool DispatchPasteEvent(LocalFrame& frame, - PasteMode paste_mode, - EditorCommandSource source) { +bool ClipboardCommands::DispatchPasteEvent(LocalFrame& frame, + PasteMode paste_mode, + EditorCommandSource source) { return DispatchClipboardEvent(frame, EventTypeNames::paste, - kDataTransferReadable, source, paste_mode); + DataTransferAccessPolicy::kReadable, source, + paste_mode); } -static void PasteAsFragment(LocalFrame& frame, - DocumentFragment* pasting_fragment, - bool smart_replace, - bool match_style, - EditorCommandSource source) { +void ClipboardCommands::PasteAsFragment(LocalFrame& frame, + DocumentFragment* pasting_fragment, + bool smart_replace, + bool match_style, + EditorCommandSource source) { Element* const target = FindEventTargetForClipboardEvent(frame, source); if (!target) return; @@ -2076,9 +2082,9 @@ frame.DomWindow(), pasting_fragment, smart_replace, match_style)); } -static void PasteWithPasteboard(LocalFrame& frame, - Pasteboard* pasteboard, - EditorCommandSource source) { +void ClipboardCommands::PasteWithPasteboard(LocalFrame& frame, + Pasteboard* pasteboard, + EditorCommandSource source) { DocumentFragment* fragment = nullptr; bool chose_plain_text = false; @@ -2120,7 +2126,7 @@ chose_plain_text, source); } -static void Paste(LocalFrame& frame, EditorCommandSource source) { +void ClipboardCommands::Paste(LocalFrame& frame, EditorCommandSource source) { DCHECK(frame.GetDocument()); if (!DispatchPasteEvent(frame, PasteMode::kAllMimeTypes, source)) return; @@ -2145,9 +2151,9 @@ : PasteMode::kPlainTextOnly; if (source == EditorCommandSource::kMenuOrKeyBinding) { - DataTransfer* data_transfer = - DataTransfer::Create(DataTransfer::kCopyAndPaste, kDataTransferReadable, - DataObject::CreateFromPasteboard(paste_mode)); + DataTransfer* data_transfer = DataTransfer::Create( + DataTransfer::kCopyAndPaste, DataTransferAccessPolicy::kReadable, + DataObject::CreateFromPasteboard(paste_mode)); if (DispatchBeforeInputDataTransfer( FindEventTargetForClipboardEvent(frame, source), @@ -2167,10 +2173,10 @@ source); } -static bool ExecutePaste(LocalFrame& frame, - Event*, - EditorCommandSource source, - const String&) { +bool ClipboardCommands::ExecutePaste(LocalFrame& frame, + Event*, + EditorCommandSource source, + const String&) { // To support |allowExecutionWhenDisabled|, we need to check clipboard // accessibility here rather than |Editor::Command::execute()|. // TODO(yosin) We should move checking |canReadClipboard()| to @@ -2182,10 +2188,10 @@ return true; } -static bool ExecutePasteGlobalSelection(LocalFrame& frame, - Event*, - EditorCommandSource source, - const String&) { +bool ClipboardCommands::ExecutePasteGlobalSelection(LocalFrame& frame, + Event*, + EditorCommandSource source, + const String&) { // To support |allowExecutionWhenDisabled|, we need to check clipboard // accessibility here rather than |Editor::Command::execute()|. // TODO(yosin) We should move checking |canReadClipboard()| to @@ -2204,10 +2210,10 @@ return true; } -static bool ExecutePasteAndMatchStyle(LocalFrame& frame, - Event*, - EditorCommandSource source, - const String&) { +bool ClipboardCommands::ExecutePasteAndMatchStyle(LocalFrame& frame, + Event*, + EditorCommandSource source, + const String&) { if (!DispatchPasteEvent(frame, PasteMode::kPlainTextOnly, source)) return false; if (!frame.GetEditor().CanPaste()) @@ -2614,7 +2620,7 @@ return true; } -static bool PasteSupported(LocalFrame* frame) { +bool ClipboardCommands::PasteSupported(LocalFrame* frame) { const Settings* const settings = frame->GetSettings(); const bool default_value = settings && settings->GetJavaScriptCanAccessClipboard() && @@ -2687,14 +2693,18 @@ // because we allow elements that are not normally selectable to implement // copy/paste (like divs, or a document body). -static bool EnabledCopy(LocalFrame& frame, Event*, EditorCommandSource source) { +bool ClipboardCommands::EnabledCopy(LocalFrame& frame, + Event*, + EditorCommandSource source) { if (!CanWriteClipboard(frame, source)) return false; return !DispatchCopyOrCutEvent(frame, source, EventTypeNames::beforecopy) || frame.GetEditor().CanCopy(); } -static bool EnabledCut(LocalFrame& frame, Event*, EditorCommandSource source) { +bool ClipboardCommands::EnabledCut(LocalFrame& frame, + Event*, + EditorCommandSource source) { if (!CanWriteClipboard(frame, source)) return false; if (source == EditorCommandSource::kMenuOrKeyBinding && @@ -2746,9 +2756,9 @@ selection.RootEditableElement(); } -static bool EnabledPaste(LocalFrame& frame, - Event*, - EditorCommandSource source) { +bool ClipboardCommands::EnabledPaste(LocalFrame& frame, + Event*, + EditorCommandSource source) { if (!CanReadClipboard(frame, source)) return false; if (source == EditorCommandSource::kMenuOrKeyBinding && @@ -2984,6 +2994,16 @@ return format_block_element->localName(); } +// CanExectue functions + +static bool CanNotExecuteWhenDisabled(LocalFrame&, EditorCommandSource) { + return kDoNotAllowExecutionWhenDisabled; +} + +static bool CanExecuteWhenDisabled(LocalFrame&, EditorCommandSource) { + return kAllowExecutionWhenDisabled; +} + // Map of functions static const EditorInternalCommand* InternalCommand( @@ -2994,470 +3014,471 @@ // Covered by unit tests in EditingCommandTest.cpp {WebEditingCommandType::kAlignJustified, ExecuteJustifyFull, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kAlignLeft, ExecuteJustifyLeft, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kAlignRight, ExecuteJustifyRight, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kBackColor, ExecuteBackColor, Supported, EnabledInRichlyEditableText, StateNone, ValueBackColor, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, // FIXME: remove BackwardDelete when Safari for Windows stops using it. {WebEditingCommandType::kBackwardDelete, ExecuteDeleteBackward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kBold, ExecuteToggleBold, Supported, EnabledInRichlyEditableText, StateBold, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, - {WebEditingCommandType::kCopy, ExecuteCopy, Supported, EnabledCopy, - StateNone, ValueStateOrNull, kNotTextInsertion, - kAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, + {WebEditingCommandType::kCopy, ClipboardCommands::ExecuteCopy, Supported, + ClipboardCommands::EnabledCopy, StateNone, ValueStateOrNull, + kNotTextInsertion, CanExecuteWhenDisabled}, {WebEditingCommandType::kCreateLink, ExecuteCreateLink, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, - {WebEditingCommandType::kCut, ExecuteCut, Supported, EnabledCut, - StateNone, ValueStateOrNull, kNotTextInsertion, - kAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, + {WebEditingCommandType::kCut, ClipboardCommands::ExecuteCut, Supported, + ClipboardCommands::EnabledCut, StateNone, ValueStateOrNull, + kNotTextInsertion, CanExecuteWhenDisabled}, {WebEditingCommandType::kDefaultParagraphSeparator, ExecuteDefaultParagraphSeparator, Supported, Enabled, StateNone, ValueDefaultParagraphSeparator, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDelete, ExecuteDelete, Supported, EnabledDelete, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteBackward, ExecuteDeleteBackward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteBackwardByDecomposingPreviousCharacter, ExecuteDeleteBackwardByDecomposingPreviousCharacter, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteForward, ExecuteDeleteForward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteToBeginningOfLine, ExecuteDeleteToBeginningOfLine, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteToBeginningOfParagraph, ExecuteDeleteToBeginningOfParagraph, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteToEndOfLine, ExecuteDeleteToEndOfLine, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteToEndOfParagraph, ExecuteDeleteToEndOfParagraph, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteToMark, ExecuteDeleteToMark, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteWordBackward, ExecuteDeleteWordBackward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kDeleteWordForward, ExecuteDeleteWordForward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kFindString, ExecuteFindString, Supported, Enabled, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kFontName, ExecuteFontName, Supported, EnabledInRichlyEditableText, StateNone, ValueFontName, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kFontSize, ExecuteFontSize, Supported, EnabledInRichlyEditableText, StateNone, ValueFontSize, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kFontSizeDelta, ExecuteFontSizeDelta, Supported, EnabledInRichlyEditableText, StateNone, ValueFontSizeDelta, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kForeColor, ExecuteForeColor, Supported, EnabledInRichlyEditableText, StateNone, ValueForeColor, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kFormatBlock, ExecuteFormatBlock, Supported, EnabledInRichlyEditableText, StateNone, ValueFormatBlock, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kForwardDelete, ExecuteForwardDelete, Supported, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kHiliteColor, ExecuteBackColor, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kIgnoreSpelling, ExecuteIgnoreSpelling, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kIndent, ExecuteIndent, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertBacktab, ExecuteInsertBacktab, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kIsTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kIsTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertHTML, ExecuteInsertHTML, Supported, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertHorizontalRule, ExecuteInsertHorizontalRule, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertImage, ExecuteInsertImage, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertLineBreak, ExecuteInsertLineBreak, Supported, EnabledInEditableText, StateNone, ValueStateOrNull, - kIsTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kIsTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertNewline, ExecuteInsertNewline, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kIsTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kIsTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertNewlineInQuotedContent, ExecuteInsertNewlineInQuotedContent, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertOrderedList, ExecuteInsertOrderedList, Supported, EnabledInRichlyEditableText, StateOrderedList, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertParagraph, ExecuteInsertParagraph, Supported, EnabledInEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertTab, ExecuteInsertTab, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kIsTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kIsTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertText, ExecuteInsertText, Supported, EnabledInEditableText, StateNone, ValueStateOrNull, kIsTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kInsertUnorderedList, ExecuteInsertUnorderedList, Supported, EnabledInRichlyEditableText, StateUnorderedList, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kItalic, ExecuteToggleItalic, Supported, EnabledInRichlyEditableText, StateItalic, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kJustifyCenter, ExecuteJustifyCenter, Supported, EnabledInRichlyEditableText, StateJustifyCenter, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kJustifyFull, ExecuteJustifyFull, Supported, EnabledInRichlyEditableText, StateJustifyFull, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kJustifyLeft, ExecuteJustifyLeft, Supported, EnabledInRichlyEditableText, StateJustifyLeft, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kJustifyNone, ExecuteJustifyLeft, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kJustifyRight, ExecuteJustifyRight, Supported, EnabledInRichlyEditableText, StateJustifyRight, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMakeTextWritingDirectionLeftToRight, ExecuteMakeTextWritingDirectionLeftToRight, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateTextWritingDirectionLeftToRight, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMakeTextWritingDirectionNatural, ExecuteMakeTextWritingDirectionNatural, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateTextWritingDirectionNatural, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMakeTextWritingDirectionRightToLeft, ExecuteMakeTextWritingDirectionRightToLeft, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateTextWritingDirectionRightToLeft, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveBackward, ExecuteMoveBackward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveBackwardAndModifySelection, ExecuteMoveBackwardAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveDown, ExecuteMoveDown, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveDownAndModifySelection, ExecuteMoveDownAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveForward, ExecuteMoveForward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveForwardAndModifySelection, ExecuteMoveForwardAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveLeft, ExecuteMoveLeft, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveLeftAndModifySelection, ExecuteMoveLeftAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMovePageDown, ExecuteMovePageDown, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMovePageDownAndModifySelection, ExecuteMovePageDownAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMovePageUp, ExecuteMovePageUp, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMovePageUpAndModifySelection, ExecuteMovePageUpAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveParagraphBackward, ExecuteMoveParagraphBackward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveParagraphBackwardAndModifySelection, ExecuteMoveParagraphBackwardAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveParagraphForward, ExecuteMoveParagraphForward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveParagraphForwardAndModifySelection, ExecuteMoveParagraphForwardAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveRight, ExecuteMoveRight, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveRightAndModifySelection, ExecuteMoveRightAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfDocument, ExecuteMoveToBeginningOfDocument, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfDocumentAndModifySelection, ExecuteMoveToBeginningOfDocumentAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfLine, ExecuteMoveToBeginningOfLine, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfLineAndModifySelection, ExecuteMoveToBeginningOfLineAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfParagraph, ExecuteMoveToBeginningOfParagraph, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfParagraphAndModifySelection, ExecuteMoveToBeginningOfParagraphAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfSentence, ExecuteMoveToBeginningOfSentence, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToBeginningOfSentenceAndModifySelection, ExecuteMoveToBeginningOfSentenceAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfDocument, ExecuteMoveToEndOfDocument, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfDocumentAndModifySelection, ExecuteMoveToEndOfDocumentAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfLine, ExecuteMoveToEndOfLine, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfLineAndModifySelection, ExecuteMoveToEndOfLineAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfParagraph, ExecuteMoveToEndOfParagraph, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfParagraphAndModifySelection, ExecuteMoveToEndOfParagraphAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfSentence, ExecuteMoveToEndOfSentence, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToEndOfSentenceAndModifySelection, ExecuteMoveToEndOfSentenceAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToLeftEndOfLine, ExecuteMoveToLeftEndOfLine, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToLeftEndOfLineAndModifySelection, ExecuteMoveToLeftEndOfLineAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToRightEndOfLine, ExecuteMoveToRightEndOfLine, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveToRightEndOfLineAndModifySelection, ExecuteMoveToRightEndOfLineAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveUp, ExecuteMoveUp, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveUpAndModifySelection, ExecuteMoveUpAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordBackward, ExecuteMoveWordBackward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordBackwardAndModifySelection, ExecuteMoveWordBackwardAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordForward, ExecuteMoveWordForward, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordForwardAndModifySelection, ExecuteMoveWordForwardAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordLeft, ExecuteMoveWordLeft, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordLeftAndModifySelection, ExecuteMoveWordLeftAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordRight, ExecuteMoveWordRight, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kMoveWordRightAndModifySelection, ExecuteMoveWordRightAndModifySelection, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kOutdent, ExecuteOutdent, Supported, EnabledInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kOverWrite, ExecuteToggleOverwrite, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, - {WebEditingCommandType::kPaste, ExecutePaste, PasteSupported, - EnabledPaste, StateNone, ValueStateOrNull, kNotTextInsertion, - kAllowExecutionWhenDisabled}, - {WebEditingCommandType::kPasteAndMatchStyle, ExecutePasteAndMatchStyle, - Supported, EnabledPaste, StateNone, ValueStateOrNull, kNotTextInsertion, - kAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, + {WebEditingCommandType::kPaste, ClipboardCommands::ExecutePaste, + ClipboardCommands::PasteSupported, ClipboardCommands::EnabledPaste, + StateNone, ValueStateOrNull, kNotTextInsertion, CanExecuteWhenDisabled}, + {WebEditingCommandType::kPasteAndMatchStyle, + ClipboardCommands::ExecutePasteAndMatchStyle, Supported, + ClipboardCommands::EnabledPaste, StateNone, ValueStateOrNull, + kNotTextInsertion, CanExecuteWhenDisabled}, {WebEditingCommandType::kPasteGlobalSelection, - ExecutePasteGlobalSelection, SupportedFromMenuOrKeyBinding, EnabledPaste, - StateNone, ValueStateOrNull, kNotTextInsertion, - kAllowExecutionWhenDisabled}, + ClipboardCommands::ExecutePasteGlobalSelection, + SupportedFromMenuOrKeyBinding, ClipboardCommands::EnabledPaste, + StateNone, ValueStateOrNull, kNotTextInsertion, CanExecuteWhenDisabled}, {WebEditingCommandType::kPrint, ExecutePrint, Supported, Enabled, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kRedo, ExecuteRedo, Supported, EnabledRedo, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kRemoveFormat, ExecuteRemoveFormat, Supported, EnabledRangeInEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kScrollPageBackward, ExecuteScrollPageBackward, SupportedFromMenuOrKeyBinding, Enabled, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kScrollPageForward, ExecuteScrollPageForward, SupportedFromMenuOrKeyBinding, Enabled, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kScrollLineUp, ExecuteScrollLineUp, SupportedFromMenuOrKeyBinding, Enabled, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kScrollLineDown, ExecuteScrollLineDown, SupportedFromMenuOrKeyBinding, Enabled, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kScrollToBeginningOfDocument, ExecuteScrollToBeginningOfDocument, SupportedFromMenuOrKeyBinding, Enabled, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kScrollToEndOfDocument, ExecuteScrollToEndOfDocument, SupportedFromMenuOrKeyBinding, Enabled, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSelectAll, ExecuteSelectAll, Supported, EnabledSelectAll, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSelectLine, ExecuteSelectLine, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSelectParagraph, ExecuteSelectParagraph, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSelectSentence, ExecuteSelectSentence, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSelectToMark, ExecuteSelectToMark, SupportedFromMenuOrKeyBinding, EnabledVisibleSelectionAndMark, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSelectWord, ExecuteSelectWord, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSetMark, ExecuteSetMark, SupportedFromMenuOrKeyBinding, EnabledVisibleSelection, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kStrikethrough, ExecuteStrikethrough, Supported, EnabledInRichlyEditableText, StateStrikethrough, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kStyleWithCSS, ExecuteStyleWithCSS, Supported, Enabled, StateStyleWithCSS, ValueEmpty, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSubscript, ExecuteSubscript, Supported, EnabledInRichlyEditableText, StateSubscript, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSuperscript, ExecuteSuperscript, Supported, EnabledInRichlyEditableText, StateSuperscript, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kSwapWithMark, ExecuteSwapWithMark, SupportedFromMenuOrKeyBinding, EnabledVisibleSelectionAndMark, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kToggleBold, ExecuteToggleBold, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateBold, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kToggleItalic, ExecuteToggleItalic, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateItalic, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kToggleUnderline, ExecuteUnderline, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateUnderline, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kTranspose, ExecuteTranspose, Supported, EnableCaretInEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kUnderline, ExecuteUnderline, Supported, EnabledInRichlyEditableText, StateUnderline, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kUndo, ExecuteUndo, Supported, EnabledUndo, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kUnlink, ExecuteUnlink, Supported, EnabledRangeInRichlyEditableText, StateNone, ValueStateOrNull, - kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kUnscript, ExecuteUnscript, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kUnselect, ExecuteUnselect, Supported, EnabledUnselect, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kUseCSS, ExecuteUseCSS, Supported, Enabled, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kYank, ExecuteYank, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, ValueStateOrNull, kNotTextInsertion, - kDoNotAllowExecutionWhenDisabled}, + CanNotExecuteWhenDisabled}, {WebEditingCommandType::kYankAndSelect, ExecuteYankAndSelect, SupportedFromMenuOrKeyBinding, EnabledInEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, {WebEditingCommandType::kAlignCenter, ExecuteJustifyCenter, SupportedFromMenuOrKeyBinding, EnabledInRichlyEditableText, StateNone, - ValueStateOrNull, kNotTextInsertion, kDoNotAllowExecutionWhenDisabled}, + ValueStateOrNull, kNotTextInsertion, CanNotExecuteWhenDisabled}, }; // Handles all commands except WebEditingCommandType::Invalid. static_assert( @@ -3571,7 +3592,7 @@ if (!IsEnabled(triggering_event)) { // Let certain commands be executed when performed explicitly even if they // are disabled. - if (!IsSupported() || !frame_ || !command_->allow_execution_when_disabled) + if (!IsSupported() || !frame_ || !command_->canExecute(*frame_, source_)) return false; }
diff --git a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h index 9b0aff3..66e68572 100644 --- a/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h +++ b/third_party/WebKit/Source/core/editing/commands/RemoveCSSPropertyCommand.h
@@ -26,7 +26,7 @@ #ifndef RemoveCSSPropertyCommand_h #define RemoveCSSPropertyCommand_h -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/editing/commands/EditCommand.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp index 85770788..3d2bdbd 100644 --- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -28,9 +28,9 @@ #include "base/macros.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/CSSStyleDeclaration.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/DocumentFragment.h" #include "core/dom/Element.h"
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp index 9d9e31e3..89b1622 100644 --- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp +++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
@@ -36,7 +36,7 @@ #include "core/editing/testing/EditingTestBase.h" #include "core/frame/LocalFrameView.h" #include "core/html/forms/TextControlElement.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink { namespace text_iterator_test {
diff --git a/third_party/WebKit/Source/core/editing/serializers/Serialization.h b/third_party/WebKit/Source/core/editing/serializers/Serialization.h index 59be6e7..56f11c3 100644 --- a/third_party/WebKit/Source/core/editing/serializers/Serialization.h +++ b/third_party/WebKit/Source/core/editing/serializers/Serialization.h
@@ -26,8 +26,8 @@ #ifndef Serialization_h #define Serialization_h -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "core/dom/ParserContentPolicy.h" #include "core/editing/Forward.h" #include "core/editing/serializers/HTMLInterchange.h"
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp index 9632b55..0a03b5d 100644 --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -26,6 +26,7 @@ #include "core/editing/spellcheck/SpellChecker.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/dom/Document.h" #include "core/dom/Element.h" #include "core/dom/ElementTraversal.h" @@ -517,8 +518,7 @@ DataTransfer* const data_transfer = DataTransfer::Create( DataTransfer::DataTransferType::kInsertReplacementText, - DataTransferAccessPolicy::kDataTransferReadable, - DataObject::CreateFromString(text)); + DataTransferAccessPolicy::kReadable, DataObject::CreateFromString(text)); const bool cancel = DispatchBeforeInputDataTransfer( target, InputEvent::InputType::kInsertReplacementText,
diff --git a/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionController.cpp b/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionController.cpp index ea11a1a..6ea89fe7 100644 --- a/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionController.cpp +++ b/third_party/WebKit/Source/core/editing/suggestion/TextSuggestionController.cpp
@@ -4,6 +4,7 @@ #include "core/editing/suggestion/TextSuggestionController.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/editing/EditingUtilities.h" #include "core/editing/Editor.h" #include "core/editing/EphemeralRange.h" @@ -612,7 +613,7 @@ DataTransfer* const data_transfer = DataTransfer::Create( DataTransfer::DataTransferType::kInsertReplacementText, - DataTransferAccessPolicy::kDataTransferReadable, + DataTransferAccessPolicy::kReadable, DataObject::CreateFromString(replacement)); const bool is_canceled =
diff --git a/third_party/WebKit/Source/core/editing/testing/SelectionSample.cpp b/third_party/WebKit/Source/core/editing/testing/SelectionSample.cpp index a12389a..5be24996 100644 --- a/third_party/WebKit/Source/core/editing/testing/SelectionSample.cpp +++ b/third_party/WebKit/Source/core/editing/testing/SelectionSample.cpp
@@ -5,7 +5,6 @@ #include "core/editing/testing/SelectionSample.h" #include <algorithm> -#include <vector> #include "core/dom/Attribute.h" #include "core/dom/CharacterData.h"
diff --git a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp index 647da1f..887deaf 100644 --- a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
@@ -385,8 +385,6 @@ // detach, so we have to check a flag here. if (detached_) return; - InspectorTaskRunner::IgnoreInterruptsScope scope( - frame_->GetFrame()->GetInspectorTaskRunner()); inspector_session_->DispatchProtocolMessage(method, message); }
diff --git a/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp b/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp index 11b6b500..010144f 100644 --- a/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebDocumentTest.cpp
@@ -6,8 +6,8 @@ #include <string> -#include "core/CSSPropertyNames.h" #include "core/css/StyleEngine.h" +#include "core/css_property_names.h" #include "core/dom/NodeComputedStyle.h" #include "core/frame/FrameTestHelpers.h" #include "core/frame/LocalFrame.h"
diff --git a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp index 5e96bd4d..d392d3e 100644 --- a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
@@ -113,9 +113,9 @@ #include "platform/scroll/ScrollbarTestSuite.h" #include "platform/testing/HistogramTester.h" #include "platform/testing/PaintTestConfigurations.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/KURLHash.h" #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityOrigin.h" @@ -11974,6 +11974,39 @@ ASSERT_EQ(ScrollOffset(0, 0), area->GetScrollOffset()); } +TEST_P(WebFrameSimTest, LayoutViewportExceedsLayoutOverflow) { + // This test fails without RLS (but doesn't cause visible paint clipping due + // to differences in composited layer geometry logic). + if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) + return; + + WebView().GetSettings()->SetViewportEnabled(true); + WebView().GetSettings()->SetViewportMetaEnabled(true); + + WebView().ResizeWithBrowserControls(WebSize(400, 540), 60, 0, true); + WebView().SetDefaultPageScaleLimits(0.25f, 2); + + SimRequest main_resource("https://example.com/test.html", "text/html"); + LoadURL("https://example.com/test.html"); + main_resource.Complete(R"HTML( + <meta name='viewport' content='width=device-width, minimum-scale=1'> + <body style='margin: 0; height: 95vh'> + )HTML"); + + Compositor().BeginFrame(); + ScrollableArea* area = GetDocument().View()->LayoutViewportScrollableArea(); + ASSERT_EQ(540, area->VisibleHeight()); + ASSERT_EQ(IntSize(400, 570), area->ContentsSize()); + + // Hide browser controls, growing layout viewport without affecting ICB. + WebView().ResizeWithBrowserControls(WebSize(400, 600), 60, 0, false); + Compositor().BeginFrame(); + + // ContentsSize() should grow to accomodate new visible size. + ASSERT_EQ(600, area->VisibleHeight()); + ASSERT_EQ(IntSize(400, 600), area->ContentsSize()); +} + TEST_P(WebFrameSimTest, NamedLookupIgnoresEmptyNames) { SimRequest main_resource("https://example.com/main.html", "text/html"); LoadURL("https://example.com/main.html");
diff --git a/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp b/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp index 6143fa46..9ddbbea 100644 --- a/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebPluginContainerTest.cpp
@@ -51,9 +51,9 @@ #include "platform/graphics/paint/ForeignLayerDisplayItem.h" #include "platform/graphics/paint/PaintController.h" #include "platform/graphics/paint/PaintRecorder.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/Platform.h" #include "public/platform/WebClipboard.h" #include "public/platform/WebCoalescedInputEvent.h"
diff --git a/third_party/WebKit/Source/core/exported/WebViewTest.cpp b/third_party/WebKit/Source/core/exported/WebViewTest.cpp index 6db75d2..a7f62a20 100644 --- a/third_party/WebKit/Source/core/exported/WebViewTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebViewTest.cpp
@@ -83,9 +83,9 @@ #include "platform/graphics/GraphicsLayer.h" #include "platform/graphics/paint/PaintRecordBuilder.h" #include "platform/scroll/ScrollTypes.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/testing/wtf/ScopedMockClock.h" #include "platform/wtf/PtrUtil.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/core/fetch/BytesConsumerForDataConsumerHandle.cpp b/third_party/WebKit/Source/core/fetch/BytesConsumerForDataConsumerHandle.cpp index 9cf1af5..279ef79d 100644 --- a/third_party/WebKit/Source/core/fetch/BytesConsumerForDataConsumerHandle.cpp +++ b/third_party/WebKit/Source/core/fetch/BytesConsumerForDataConsumerHandle.cpp
@@ -5,7 +5,6 @@ #include "core/fetch/BytesConsumerForDataConsumerHandle.h" #include <algorithm> -#include <string> #include "base/location.h" #include "core/dom/ExecutionContext.h"
diff --git a/third_party/WebKit/Source/core/fileapi/PublicURLManagerTest.cpp b/third_party/WebKit/Source/core/fileapi/PublicURLManagerTest.cpp index ef0b1e4..4658227 100644 --- a/third_party/WebKit/Source/core/fileapi/PublicURLManagerTest.cpp +++ b/third_party/WebKit/Source/core/fileapi/PublicURLManagerTest.cpp
@@ -10,7 +10,7 @@ #include "mojo/public/cpp/bindings/strong_binding.h" #include "platform/blob/testing/FakeBlob.h" #include "platform/blob/testing/FakeBlobURLStore.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/SecurityOrigin.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/frame/Deprecation.h b/third_party/WebKit/Source/core/frame/Deprecation.h index 212cd8c..6faee46 100644 --- a/third_party/WebKit/Source/core/frame/Deprecation.h +++ b/third_party/WebKit/Source/core/frame/Deprecation.h
@@ -6,8 +6,8 @@ #define Deprecation_h #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "core/frame/UseCounter.h" #include "platform/wtf/BitVector.h"
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index 97056fee..da1863c 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -27,7 +27,6 @@ #include "core/frame/LocalDOMWindow.h" #include <memory> -#include <string> #include <utility> #include "bindings/core/v8/BindingSecurity.h"
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp b/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp index a36429d..06ef860 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrameViewTest.cpp
@@ -13,7 +13,7 @@ #include "platform/geometry/IntSize.h" #include "platform/graphics/paint/PaintArtifact.h" #include "platform/runtime_enabled_features.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "core/paint/PaintPropertyTreePrinter.h"
diff --git a/third_party/WebKit/Source/core/frame/RotationViewportAnchorTest.cpp b/third_party/WebKit/Source/core/frame/RotationViewportAnchorTest.cpp index d50e5dbf..51779f1 100644 --- a/third_party/WebKit/Source/core/frame/RotationViewportAnchorTest.cpp +++ b/third_party/WebKit/Source/core/frame/RotationViewportAnchorTest.cpp
@@ -5,10 +5,10 @@ #include "build/build_config.h" #include "core/testing/sim/SimRequest.h" #include "core/testing/sim/SimTest.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupport.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h index ec3b0da..a21973e 100644 --- a/third_party/WebKit/Source/core/frame/UseCounter.h +++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -27,9 +27,9 @@ #define UseCounter_h #include "base/macros.h" -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" #include "core/css/parser/CSSParserMode.h" +#include "core/css_property_names.h" #include "core/frame/WebFeature.h" #include "platform/heap/GarbageCollected.h" #include "platform/heap/HeapAllocator.h"
diff --git a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp index aaf4b83..22029bd 100644 --- a/third_party/WebKit/Source/core/frame/UseCounterTest.cpp +++ b/third_party/WebKit/Source/core/frame/UseCounterTest.cpp
@@ -9,8 +9,8 @@ #include "core/page/Page.h" #include "core/testing/DummyPageHolder.h" #include "platform/testing/HistogramTester.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/KURL.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp index ffb799ee..1f66af92 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
@@ -12,7 +12,7 @@ #include "platform/loader/fetch/IntegrityMetadata.h" #include "platform/loader/fetch/ResourceRequest.h" #include "platform/network/ContentSecurityPolicyParsers.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityOrigin.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLBRElement.cpp b/third_party/WebKit/Source/core/html/HTMLBRElement.cpp index 3144342..5ca20e2 100644 --- a/third_party/WebKit/Source/core/html/HTMLBRElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLBRElement.cpp
@@ -22,8 +22,8 @@ #include "core/html/HTMLBRElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/html_names.h" #include "core/layout/LayoutBR.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp b/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp index 6ab4d7c..8502623a 100644 --- a/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp
@@ -21,8 +21,8 @@ #include "core/html/HTMLDetailsElement.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/dom/ElementTraversal.h" #include "core/dom/ShadowRoot.h" #include "core/dom/Text.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLDivElement.cpp b/third_party/WebKit/Source/core/html/HTMLDivElement.cpp index 7fc8234..6e9c41c 100644 --- a/third_party/WebKit/Source/core/html/HTMLDivElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLDivElement.cpp
@@ -22,8 +22,8 @@ #include "core/html/HTMLDivElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/html_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp index 400d393d..d8ab57bd 100644 --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
@@ -27,12 +27,12 @@ #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ScriptEventListener.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/css/CSSColorValue.h" #include "core/css/CSSMarkup.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/StyleChangeReason.h" +#include "core/css_property_names.h" #include "core/dom/DocumentFragment.h" #include "core/dom/ElementShadow.h" #include "core/dom/ElementTraversal.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp b/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp index c73bb582..49a6a65 100644 --- a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
@@ -24,7 +24,7 @@ #include "core/html/HTMLEmbedElement.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/Attribute.h" #include "core/dom/ElementTraversal.h" #include "core/dom/ShadowRoot.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLFontElement.cpp b/third_party/WebKit/Source/core/html/HTMLFontElement.cpp index b21c7b6..be3d5d78 100644 --- a/third_party/WebKit/Source/core/html/HTMLFontElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFontElement.cpp
@@ -22,12 +22,12 @@ #include "core/html/HTMLFontElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/CSSValueList.h" #include "core/css/CSSValuePool.h" #include "core/css/parser/CSSParser.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/html_names.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp index da5eca7..75a6f45 100644 --- a/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp
@@ -24,8 +24,8 @@ #include "core/html/HTMLFrameSetElement.h" #include "bindings/core/v8/ScriptEventListener.h" -#include "core/CSSPropertyNames.h" #include "core/css/StyleChangeReason.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/events/Event.h" #include "core/events/MouseEvent.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLHRElement.cpp b/third_party/WebKit/Source/core/html/HTMLHRElement.cpp index 0a2bdc508..76446ae 100644 --- a/third_party/WebKit/Source/core/html/HTMLHRElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLHRElement.cpp
@@ -22,10 +22,10 @@ #include "core/html/HTMLHRElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/css/CSSColorValue.h" #include "core/css/CSSPropertyValueSet.h" +#include "core/css_property_names.h" #include "core/html/forms/HTMLOptGroupElement.h" #include "core/html/forms/HTMLSelectElement.h" #include "core/html_names.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp index b16a4c6..e2e9b9cb 100644 --- a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
@@ -24,7 +24,7 @@ #include "core/html/HTMLIFrameElement.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/frame/UseCounter.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/html/HTMLDocument.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp index dc34c99..bd177908 100644 --- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -24,10 +24,10 @@ #include "core/html/HTMLImageElement.h" #include "bindings/core/v8/ScriptEventListener.h" -#include "core/CSSPropertyNames.h" #include "core/css/MediaQueryMatcher.h" #include "core/css/MediaValuesDynamic.h" #include "core/css/parser/SizesAttributeParser.h" +#include "core/css_property_names.h" #include "core/dom/Attribute.h" #include "core/dom/DOMException.h" #include "core/dom/NodeTraversal.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLLIElement.cpp b/third_party/WebKit/Source/core/html/HTMLLIElement.cpp index d2effe4..0e61bef 100644 --- a/third_party/WebKit/Source/core/html/HTMLLIElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLLIElement.cpp
@@ -22,8 +22,8 @@ #include "core/html/HTMLLIElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/LayoutTreeBuilderTraversal.h" #include "core/html/ListItemOrdinal.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp index 384d53a..4af2559 100644 --- a/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLMarqueeElement.cpp
@@ -27,7 +27,6 @@ #include "base/macros.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/V8HTMLMarqueeElement.h" -#include "core/CSSPropertyNames.h" #include "core/animation/DocumentTimeline.h" #include "core/animation/KeyframeEffect.h" #include "core/animation/KeyframeEffectModel.h" @@ -36,6 +35,7 @@ #include "core/animation/TimingInput.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/CSSStyleDeclaration.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/FrameRequestCallbackCollection.h" #include "core/dom/ShadowRoot.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLOListElement.cpp b/third_party/WebKit/Source/core/html/HTMLOListElement.cpp index 035d6d825..07e3cd3 100644 --- a/third_party/WebKit/Source/core/html/HTMLOListElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLOListElement.cpp
@@ -22,8 +22,8 @@ #include "core/html/HTMLOListElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/frame/UseCounter.h" #include "core/html/ListItemOrdinal.h" #include "core/html/parser/HTMLParserIdioms.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp b/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp index 368c9a14..9fbaeae5 100644 --- a/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLParagraphElement.cpp
@@ -22,8 +22,8 @@ #include "core/html/HTMLParagraphElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/html_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp index bb537f1a..f21cc414 100644 --- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -23,7 +23,7 @@ #include "core/html/HTMLPlugInElement.h" #include "bindings/core/v8/ScriptController.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/Node.h" #include "core/dom/ShadowRoot.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLPreElement.cpp b/third_party/WebKit/Source/core/html/HTMLPreElement.cpp index a144c7f7..b3a874b 100644 --- a/third_party/WebKit/Source/core/html/HTMLPreElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLPreElement.cpp
@@ -22,9 +22,9 @@ #include "core/html/HTMLPreElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/css/CSSPropertyValueSet.h" +#include "core/css_property_names.h" #include "core/html_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.cpp index 8200ac0..496e628 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableCaptionElement.cpp
@@ -24,7 +24,7 @@ #include "core/html/HTMLTableCaptionElement.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/html_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp index 1f0b2969..04939f8f 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableCellElement.cpp
@@ -24,8 +24,8 @@ #include "core/html/HTMLTableCellElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/dom/Attribute.h" #include "core/dom/ElementTraversal.h" #include "core/frame/UseCounter.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp index 2682187..416f82701 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableColElement.cpp
@@ -25,7 +25,7 @@ #include "core/html/HTMLTableColElement.h" #include <algorithm> -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/html/HTMLTableCellElement.h" #include "core/html/HTMLTableElement.h" #include "core/html/TableConstants.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp index 43636f6..e9c456c 100644 --- a/third_party/WebKit/Source/core/html/HTMLTableElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTableElement.cpp
@@ -26,13 +26,13 @@ #include "core/html/HTMLTableElement.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/css/CSSIdentifierValue.h" #include "core/css/CSSImageValue.h" #include "core/css/CSSInheritedValue.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/StyleChangeReason.h" +#include "core/css_property_names.h" #include "core/dom/Attribute.h" #include "core/dom/ElementTraversal.h" #include "core/dom/ExceptionCode.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp b/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp index 42fc088..5fa139c 100644 --- a/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLTablePartElement.cpp
@@ -24,10 +24,10 @@ #include "core/html/HTMLTablePartElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" #include "core/css/CSSImageValue.h" #include "core/css/CSSPropertyValueSet.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/FlatTreeTraversal.h" #include "core/frame/UseCounter.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLUListElement.cpp b/third_party/WebKit/Source/core/html/HTMLUListElement.cpp index d7cbbf0f..aaa6dda0 100644 --- a/third_party/WebKit/Source/core/html/HTMLUListElement.cpp +++ b/third_party/WebKit/Source/core/html/HTMLUListElement.cpp
@@ -22,7 +22,7 @@ #include "core/html/HTMLUListElement.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/html_names.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/canvas/ImageDataTest.cpp b/third_party/WebKit/Source/core/html/canvas/ImageDataTest.cpp index 38f60c2..00759f70 100644 --- a/third_party/WebKit/Source/core/html/canvas/ImageDataTest.cpp +++ b/third_party/WebKit/Source/core/html/canvas/ImageDataTest.cpp
@@ -7,7 +7,7 @@ #include "core/dom/ExceptionCode.h" #include "platform/geometry/IntSize.h" #include "platform/graphics/ColorCorrectionTestUtils.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/ByteSwap.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkColorSpaceXform.h"
diff --git a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp index d16a9d91..30d5e7a 100644 --- a/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp +++ b/third_party/WebKit/Source/core/html/forms/ColorInputType.cpp
@@ -32,7 +32,7 @@ #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ScriptController.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/ShadowRoot.h" #include "core/dom/events/ScopedEventQueue.h" #include "core/events/MouseEvent.h"
diff --git a/third_party/WebKit/Source/core/html/forms/DateTimeNumericFieldElement.cpp b/third_party/WebKit/Source/core/html/forms/DateTimeNumericFieldElement.cpp index 3f48539f..bb9b0b0 100644 --- a/third_party/WebKit/Source/core/html/forms/DateTimeNumericFieldElement.cpp +++ b/third_party/WebKit/Source/core/html/forms/DateTimeNumericFieldElement.cpp
@@ -25,8 +25,8 @@ #include "core/html/forms/DateTimeNumericFieldElement.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/events/KeyboardEvent.h" #include "platform/fonts/Font.h" #include "platform/text/PlatformLocale.h"
diff --git a/third_party/WebKit/Source/core/html/forms/HTMLInputElement.cpp b/third_party/WebKit/Source/core/html/forms/HTMLInputElement.cpp index 7395887b..72ae1d68 100644 --- a/third_party/WebKit/Source/core/html/forms/HTMLInputElement.cpp +++ b/third_party/WebKit/Source/core/html/forms/HTMLInputElement.cpp
@@ -33,8 +33,8 @@ #include "bindings/core/v8/ExceptionMessages.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ScriptEventListener.h" -#include "core/CSSPropertyNames.h" #include "core/css/StyleChangeReason.h" +#include "core/css_property_names.h" #include "core/dom/AXObjectCache.h" #include "core/dom/Document.h" #include "core/dom/IdTargetObserver.h"
diff --git a/third_party/WebKit/Source/core/html/media/HTMLMediaElementEventListenersTest.cpp b/third_party/WebKit/Source/core/html/media/HTMLMediaElementEventListenersTest.cpp index a1e048b6..819b190 100644 --- a/third_party/WebKit/Source/core/html/media/HTMLMediaElementEventListenersTest.cpp +++ b/third_party/WebKit/Source/core/html/media/HTMLMediaElementEventListenersTest.cpp
@@ -13,10 +13,10 @@ #include "core/loader/EmptyClients.h" #include "core/testing/PageTestBase.h" #include "platform/testing/EmptyWebMediaPlayer.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupport.h" #include "platform/testing/TestingPlatformSupportWithMockScheduler.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/Source/platform/wtf/Time.h"
diff --git a/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp b/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp index 9a26716..f2f9cfda 100644 --- a/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp +++ b/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp
@@ -26,7 +26,7 @@ #include "core/html/media/HTMLVideoElement.h" #include <memory> -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/Attribute.h" #include "core/dom/DOMException.h" #include "core/dom/Document.h"
diff --git a/third_party/WebKit/Source/core/html/media/MediaCustomControlsFullscreenDetectorTest.cpp b/third_party/WebKit/Source/core/html/media/MediaCustomControlsFullscreenDetectorTest.cpp index 2a6d01a..c088c1a2 100644 --- a/third_party/WebKit/Source/core/html/media/MediaCustomControlsFullscreenDetectorTest.cpp +++ b/third_party/WebKit/Source/core/html/media/MediaCustomControlsFullscreenDetectorTest.cpp
@@ -8,7 +8,7 @@ #include "core/html/media/HTMLVideoElement.h" #include "core/testing/DummyPageHolder.h" #include "platform/geometry/IntRect.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp index aa6fab46..c1a912c 100644 --- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp +++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
@@ -32,8 +32,8 @@ #include "bindings/core/v8/ExceptionMessages.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/double_or_auto_keyword.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/dom/DocumentFragment.h" #include "core/dom/NodeTraversal.h" #include "core/dom/events/Event.h"
diff --git a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapTest.cpp b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapTest.cpp index 6b7af7f2..48a2fe1 100644 --- a/third_party/WebKit/Source/core/imagebitmap/ImageBitmapTest.cpp +++ b/third_party/WebKit/Source/core/imagebitmap/ImageBitmapTest.cpp
@@ -47,7 +47,7 @@ #include "platform/image-decoders/ImageDecoder.h" #include "platform/loader/fetch/MemoryCache.h" #include "platform/loader/fetch/ResourceRequest.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColorSpaceXform.h" @@ -250,17 +250,7 @@ return options; } -// This test is failing on Android Arm 64 Official Test Bot. -// See <http://crbug.com/721819>. -#if defined(OS_ANDROID) -#define MAYBE_ImageBitmapColorSpaceConversionHTMLImageElement \ - DISABLED_ImageBitmapColorSpaceConversionHTMLImageElement -#else -#define MAYBE_ImageBitmapColorSpaceConversionHTMLImageElement \ - ImageBitmapColorSpaceConversionHTMLImageElement -#endif - -TEST_F(ImageBitmapTest, MAYBE_ImageBitmapColorSpaceConversionHTMLImageElement) { +TEST_F(ImageBitmapTest, ImageBitmapColorSpaceConversionHTMLImageElement) { // Enable experimental canvas features for this test. ScopedExperimentalCanvasFeaturesForTest experimental_canvas_features(true); @@ -375,17 +365,7 @@ } } -// This test is failing on Android Arm 64 Official Test Bot. -// See <http://crbug.com/721819>. -#if defined(OS_ANDROID) -#define MAYBE_ImageBitmapColorSpaceConversionImageBitmap \ - DISABLED_ImageBitmapColorSpaceConversionImageBitmap -#else -#define MAYBE_ImageBitmapColorSpaceConversionImageBitmap \ - ImageBitmapColorSpaceConversionImageBitmap -#endif - -TEST_F(ImageBitmapTest, MAYBE_ImageBitmapColorSpaceConversionImageBitmap) { +TEST_F(ImageBitmapTest, ImageBitmapColorSpaceConversionImageBitmap) { // Enable experimental canvas features for this test. ScopedExperimentalCanvasFeaturesForTest experimental_canvas_features(true); @@ -499,18 +479,7 @@ } } -// This test is failing on Android Arm 64 Official Test Bot. -// See <http://crbug.com/721819>. -#if defined(OS_ANDROID) -#define MAYBE_ImageBitmapColorSpaceConversionStaticBitmapImage \ - DISABLED_ImageBitmapColorSpaceConversionStaticBitmapImage -#else -#define MAYBE_ImageBitmapColorSpaceConversionStaticBitmapImage \ - ImageBitmapColorSpaceConversionStaticBitmapImage -#endif - -TEST_F(ImageBitmapTest, - MAYBE_ImageBitmapColorSpaceConversionStaticBitmapImage) { +TEST_F(ImageBitmapTest, ImageBitmapColorSpaceConversionStaticBitmapImage) { // Enable experimental canvas features for this test. ScopedExperimentalCanvasFeaturesForTest experimental_canvas_features(true);
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp index 5dc2a4d..a002eac 100644 --- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp +++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -7,6 +7,7 @@ #include "build/build_config.h" #include "core/clipboard/DataObject.h" #include "core/clipboard/DataTransfer.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/dom/Element.h" #include "core/dom/ElementTraversal.h" #include "core/editing/EditingUtilities.h" @@ -925,7 +926,8 @@ } DataTransfer* MouseEventManager::CreateDraggingDataTransfer() const { - return DataTransfer::Create(DataTransfer::kDragAndDrop, kDataTransferWritable, + return DataTransfer::Create(DataTransfer::kDragAndDrop, + DataTransferAccessPolicy::kWritable, DataObject::Create()); } @@ -964,7 +966,7 @@ // The drag image can still be changed as we drag, but not the pasteboard // data. GetDragState().drag_data_transfer_->SetAccessPolicy( - kDataTransferImageWritable); + DataTransferAccessPolicy::kImageWritable); if (mouse_down_may_start_drag_) { // Dispatching the event could cause Page to go away. Make sure it's still @@ -1035,7 +1037,8 @@ return; if (GetDragState().drag_data_transfer_) { GetDragState().drag_data_transfer_->ClearDragImage(); - GetDragState().drag_data_transfer_->SetAccessPolicy(kDataTransferNumb); + GetDragState().drag_data_transfer_->SetAccessPolicy( + DataTransferAccessPolicy::kNumb); } }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp index d330865..00d27a7 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -27,7 +27,6 @@ #include "base/macros.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/StylePropertyShorthand.h" #include "core/animation/css/CSSAnimationData.h" #include "core/css/CSSColorValue.h" @@ -59,6 +58,7 @@ #include "core/css/properties/CSSProperty.h" #include "core/css/resolver/StyleResolver.h" #include "core/css/resolver/StyleRuleUsageTracker.h" +#include "core/css_property_names.h" #include "core/dom/DOMException.h" #include "core/dom/DOMNodeIds.h" #include "core/dom/Node.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h index 9a4ec60..102f100 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h
@@ -6,7 +6,7 @@ #define InspectorDOMSnapshotAgent_h #include "base/macros.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/inspector/InspectorBaseAgent.h" #include "core/inspector/protocol/DOMSnapshot.h" #include "platform/wtf/HashMap.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp index b42fad4..2d68d006 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorStyleSheet.cpp
@@ -28,7 +28,6 @@ #include <algorithm> #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ScriptRegexp.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSImportRule.h" #include "core/css/CSSKeyframeRule.h" #include "core/css/CSSKeyframesRule.h" @@ -43,6 +42,7 @@ #include "core/css/StyleSheetContents.h" #include "core/css/parser/CSSParser.h" #include "core/css/parser/CSSParserObserver.h" +#include "core/css_property_names.h" #include "core/dom/DOMNodeIds.h" #include "core/dom/Document.h" #include "core/dom/Element.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp index 451d1425..4cda2b9b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBlockTest.cpp
@@ -7,7 +7,7 @@ #include "core/layout/LayoutBlockFlow.h" #include "core/layout/LayoutTestHelper.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp index 21bcc09..6d24707 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
@@ -11,7 +11,7 @@ #include "core/page/scrolling/StickyPositionScrollingConstraints.h" #include "core/paint/PaintLayer.h" #include "core/paint/PaintLayerScrollableArea.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutCountTest.cpp b/third_party/WebKit/Source/core/layout/LayoutCountTest.cpp index 7fb967f..6214622 100644 --- a/third_party/WebKit/Source/core/layout/LayoutCountTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutCountTest.cpp
@@ -4,7 +4,7 @@ #include "core/layout/LayoutBlockFlow.h" #include "core/layout/LayoutTestHelper.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp b/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp index 8ed405f4..c1abb5f 100644 --- a/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutFieldset.cpp
@@ -23,7 +23,7 @@ #include "core/layout/LayoutFieldset.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/html/forms/HTMLLegendElement.h" #include "core/html_names.h" #include "core/paint/FieldsetPainter.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutGeometryMapTest.cpp b/third_party/WebKit/Source/core/layout/LayoutGeometryMapTest.cpp index 509a4d73..d7d07fb 100644 --- a/third_party/WebKit/Source/core/layout/LayoutGeometryMapTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutGeometryMapTest.cpp
@@ -38,9 +38,9 @@ #include "core/layout/LayoutBox.h" #include "core/layout/LayoutView.h" #include "core/paint/PaintLayer.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/Platform.h" #include "public/platform/WebURLLoaderMockFactory.h" #include "public/web/WebFrameClient.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp b/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp index 27f71a9..6c03b2c6 100644 --- a/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutInlineTest.cpp
@@ -7,7 +7,7 @@ #include "core/layout/LayoutBlockFlow.h" #include "core/layout/LayoutTestHelper.h" #include "platform/runtime_enabled_features.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp index b1c8943..59e9e4b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -2006,19 +2006,13 @@ // Text nodes share style with their parents but the paint properties don't // apply to them, hence the !isText() check. + // In SPv175 mode, if property nodes are added or removed as a result of these + // style changes, PaintPropertyTreeBuilder will call SetNeedsRepaint + // to cause re-generation of PaintChunks. if (!IsText() && (diff.TransformChanged() || diff.OpacityChanged() || diff.ZIndexChanged() || diff.FilterChanged() || - diff.BackdropFilterChanged() || diff.CssClipChanged())) { + diff.BackdropFilterChanged() || diff.CssClipChanged())) SetNeedsPaintPropertyUpdate(); - - // We don't need to invalidate paint of objects on SPv175 when only paint - // property or paint order change. Mark the painting layer needing repaint - // for changed paint property or paint order. Raster invalidation will be - // issued if needed during paint. - if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled() && - !ShouldDoFullPaintInvalidation()) - ObjectPaintInvalidator(*this).SlowSetPaintingLayerNeedsRepaint(); - } } void LayoutObject::StyleWillChange(StyleDifference diff,
diff --git a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp index 41e9e9b4..6622188 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutObjectTest.cpp
@@ -10,7 +10,7 @@ #include "core/layout/LayoutTextFragment.h" #include "core/layout/LayoutView.h" #include "platform/json/JSONValues.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp index ac4a4b7..e0eb47a 100644 --- a/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
@@ -30,9 +30,13 @@ #include "core/layout/LayoutInline.h" #include "core/layout/LayoutVideo.h" #include "core/layout/api/LineLayoutBlockFlow.h" +#include "core/layout/ng/geometry/ng_logical_offset.h" +#include "core/layout/ng/geometry/ng_logical_size.h" +#include "core/layout/ng/ng_physical_box_fragment.h" #include "core/paint/PaintInfo.h" #include "core/paint/PaintLayer.h" #include "core/paint/ReplacedPainter.h" +#include "core/paint/ng/ng_paint_fragment.h" #include "platform/LengthFunctions.h" namespace blink { @@ -875,14 +879,62 @@ ClearPreferredLogicalWidthsDirty(); } +static std::pair<LayoutUnit, LayoutUnit> SelectionTopAndBottom( + const LayoutReplaced& layout_replaced) { + // TODO(layout-dev): This code is buggy if the replaced element is relative + // positioned. + + // The fallback answer when we can't find the containing line box of + // |layout_replaced|. + const std::pair<LayoutUnit, LayoutUnit> fallback( + layout_replaced.LogicalTop(), layout_replaced.LogicalBottom()); + + const NGPaintFragment* inline_container = + layout_replaced.IsInline() + ? NGPaintFragment::GetForInlineContainer(&layout_replaced) + : nullptr; + if (inline_container) { + // Step 1: Find the line box containing |layout_replaced|. + const NGPaintFragment* inline_fragment = + *NGPaintFragment::InlineFragmentsFor(&layout_replaced).begin(); + if (!inline_fragment) + return fallback; + const NGPaintFragment* line_box_container = + inline_fragment->ContainerLineBox(); + if (!line_box_container) + return fallback; + + // Step 2: Return the logical top and bottom of the line box. + // TODO(layout-dev): Use selection top & bottom instead of line's, or decide + // if we still want to distinguish line and selection heights in NG. + const ComputedStyle& line_style = line_box_container->Style(); + const WritingMode writing_mode = line_style.GetWritingMode(); + const TextDirection text_direction = line_style.Direction(); + const NGPhysicalOffset line_box_offset = + line_box_container->InlineOffsetToContainerBox(); + const NGPhysicalSize line_box_size = line_box_container->Size(); + const NGLogicalOffset logical_offset = line_box_offset.ConvertToLogical( + writing_mode, text_direction, inline_container->Size(), + line_box_container->Size()); + const NGLogicalSize logical_size = + line_box_size.ConvertToLogical(writing_mode); + return {logical_offset.block_offset, + logical_offset.block_offset + logical_size.block_size}; + } + + InlineBox* box = layout_replaced.InlineBoxWrapper(); + RootInlineBox* root_box = box ? &box->Root() : nullptr; + if (!root_box) + return fallback; + + return {root_box->SelectionTop(), root_box->SelectionBottom()}; +} + PositionWithAffinity LayoutReplaced::PositionForPoint( const LayoutPoint& point) const { - // FIXME: This code is buggy if the replaced element is relative positioned. - InlineBox* box = InlineBoxWrapper(); - RootInlineBox* root_box = box ? &box->Root() : nullptr; - - LayoutUnit top = root_box ? root_box->SelectionTop() : LogicalTop(); - LayoutUnit bottom = root_box ? root_box->SelectionBottom() : LogicalBottom(); + LayoutUnit top; + LayoutUnit bottom; + std::tie(top, bottom) = SelectionTopAndBottom(*this); LayoutUnit block_direction_position = IsHorizontalWritingMode() ? point.Y() + Location().Y()
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.h b/third_party/WebKit/Source/core/layout/LayoutTable.h index e58b798..3668f4e 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.h +++ b/third_party/WebKit/Source/core/layout/LayoutTable.h
@@ -27,8 +27,8 @@ #define LayoutTable_h #include <memory> -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "core/layout/LayoutBlock.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableColTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTableColTest.cpp index 54dd7a25..a8c08f7 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableColTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableColTest.cpp
@@ -5,7 +5,7 @@ #include "core/layout/LayoutTableCol.h" #include "core/layout/LayoutTestHelper.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTextFragmentTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTextFragmentTest.cpp index 3f6483ee..92e604b 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTextFragmentTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTextFragmentTest.cpp
@@ -7,7 +7,7 @@ #include "core/html/HTMLHeadElement.h" #include "core/layout/LayoutTestHelper.h" #include "platform/runtime_enabled_features.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTextTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTextTest.cpp index 2cf44d9..8b5f742 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTextTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTextTest.cpp
@@ -7,7 +7,7 @@ #include "core/layout/LayoutTestHelper.h" #include "core/layout/line/InlineTextBox.h" #include "platform/runtime_enabled_features.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp index 66caba8..8fe790d 100644 --- a/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp +++ b/third_party/WebKit/Source/core/layout/MapCoordinatesTest.cpp
@@ -6,7 +6,7 @@ #include "core/layout/LayoutTestHelper.h" #include "core/layout/LayoutView.h" #include "platform/geometry/TransformState.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp index 2bf9319..3d54180 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -12,7 +12,7 @@ #include "core/page/PrintContext.h" #include "core/paint/PaintLayerScrollableArea.h" #include "platform/testing/HistogramTester.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp b/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp index 5e13274..53839c52 100644 --- a/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollbarsTest.cpp
@@ -16,10 +16,10 @@ #include "core/testing/sim/SimRequest.h" #include "core/testing/sim/SimTest.h" #include "platform/scroll/ScrollbarThemeOverlayMock.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupport.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/WebFloatRect.h" #include "public/platform/WebThemeEngine.h" #include "public/platform/scheduler/test/renderer_scheduler_test_support.h"
diff --git a/third_party/WebKit/Source/core/layout/custom/CSSLayoutDefinition.h b/third_party/WebKit/Source/core/layout/custom/CSSLayoutDefinition.h index 946a171..a089fb9 100644 --- a/third_party/WebKit/Source/core/layout/custom/CSSLayoutDefinition.h +++ b/third_party/WebKit/Source/core/layout/custom/CSSLayoutDefinition.h
@@ -5,8 +5,8 @@ #ifndef CSSLayoutDefinition_h #define CSSLayoutDefinition_h -#include "core/CSSPropertyNames.h" #include "core/css/cssom/CSSStyleValue.h" +#include "core/css_property_names.h" #include "platform/bindings/ScriptWrappable.h" #include "platform/bindings/TraceWrapperMember.h" #include "platform/bindings/TraceWrapperV8Reference.h"
diff --git a/third_party/WebKit/Source/core/layout/custom/LayoutWorkletGlobalScope.cpp b/third_party/WebKit/Source/core/layout/custom/LayoutWorkletGlobalScope.cpp index bc6aecf1..d7e0c209 100644 --- a/third_party/WebKit/Source/core/layout/custom/LayoutWorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/core/layout/custom/LayoutWorkletGlobalScope.cpp
@@ -6,7 +6,7 @@ #include "bindings/core/v8/V8ObjectParser.h" #include "bindings/core/v8/WorkerOrWorkletScriptController.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h" #include "core/inspector/MainThreadDebugger.h"
diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.h b/third_party/WebKit/Source/core/layout/line/InlineBox.h index e8aa206..4fe8862 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineBox.h +++ b/third_party/WebKit/Source/core/layout/line/InlineBox.h
@@ -259,10 +259,6 @@ else SetY(left); } - int PixelSnappedLogicalLeft() const { return LogicalLeft().ToInt(); } - int PixelSnappedLogicalRight() const { return LogicalRight().Ceil(); } - int PixelSnappedLogicalTop() const { return LogicalTop().ToInt(); } - int PixelSnappedLogicalBottom() const { return LogicalBottom().Ceil(); } // The logicalTop[ position is the top edge of the line box in a horizontal // line and the left edge in a vertical line.
diff --git a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp index fa3646f..aa0afe5 100644 --- a/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp +++ b/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
@@ -22,7 +22,7 @@ #include <math.h> #include <algorithm> -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/layout/HitTestResult.h" #include "core/layout/api/LineLayoutAPIShim.h" @@ -897,17 +897,15 @@ (DescendantsHaveSameLineHeightAndBaseline() && HasTextDescendants())) { if (!set_line_top) { set_line_top = true; - line_top = LayoutUnit(PixelSnappedLogicalTop()); + line_top = LogicalTop(); line_top_including_margins = line_top; } else { - line_top = std::min(line_top, LayoutUnit(PixelSnappedLogicalTop())); + line_top = std::min(line_top, LogicalTop()); line_top_including_margins = std::min(line_top, line_top_including_margins); } - selection_bottom = - std::max(selection_bottom, LayoutUnit(PixelSnappedLogicalBottom())); - line_bottom = - std::max(line_bottom, LayoutUnit(PixelSnappedLogicalBottom())); + selection_bottom = std::max(selection_bottom, LogicalBottom()); + line_bottom = std::max(line_bottom, LogicalBottom()); line_bottom_including_margins = std::max(line_bottom, line_bottom_including_margins); }
diff --git a/third_party/WebKit/Source/core/layout/ng/NGInlineLayoutTest.cpp b/third_party/WebKit/Source/core/layout/ng/NGInlineLayoutTest.cpp index 56c5b9a..1e04687f 100644 --- a/third_party/WebKit/Source/core/layout/ng/NGInlineLayoutTest.cpp +++ b/third_party/WebKit/Source/core/layout/ng/NGInlineLayoutTest.cpp
@@ -11,8 +11,8 @@ #include "core/testing/sim/SimCompositor.h" #include "core/testing/sim/SimRequest.h" #include "core/testing/sim/SimTest.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Time.h" #include "platform/wtf/text/CharacterNames.h"
diff --git a/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.cc index d233b90..bb6e67ae 100644 --- a/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.cc
@@ -18,38 +18,42 @@ namespace { std::pair<LayoutUnit, LayoutUnit> InlineMarginsForOutside( - const NGFragment& list_marker, - const NGConstraintSpace& constraint_space) { - DCHECK(&list_marker); + const ComputedStyle& style, + LayoutUnit list_marker_inline_size) { bool is_image = false; // TODO(kojii): implement - return LayoutListMarker::InlineMarginsForOutside( - list_marker.Style(), is_image, list_marker.InlineSize()); + return LayoutListMarker::InlineMarginsForOutside(style, is_image, + list_marker_inline_size); } } // namespace -void NGListLayoutAlgorithm::SetListMarkerPosition( - const NGConstraintSpace& constraint_space, - const NGLineInfo& line_info, - LayoutUnit line_width, - NGLineBoxFragmentBuilder::Child* list_marker_child) { - DCHECK(list_marker_child->PhysicalFragment()); - NGFragment list_marker_fragment(constraint_space.GetWritingMode(), - *list_marker_child->PhysicalFragment()); - auto margins = - InlineMarginsForOutside(list_marker_fragment, constraint_space); - LayoutUnit line_offset = IsLtr(line_info.BaseDirection()) - ? margins.first - : line_width + margins.second; - list_marker_child->offset.inline_offset = line_offset; -} - -void NGListLayoutAlgorithm::AddListMarkerForBlockContent( +bool NGListLayoutAlgorithm::AddListMarkerForBlockContent( NGBlockNode list_marker_node, const NGConstraintSpace& constraint_space, const NGPhysicalFragment& content, NGLogicalOffset offset, NGFragmentBuilder* container_builder) { + // Compute the baseline of the child content. + FontBaseline baseline_type = + IsHorizontalWritingMode(constraint_space.GetWritingMode()) + ? kAlphabeticBaseline + : kIdeographicBaseline; + NGLineHeightMetrics content_metrics; + if (content.IsLineBox()) { + content_metrics = ToNGPhysicalLineBoxFragment(content).Metrics(); + } else { + NGBoxFragment content_fragment(constraint_space.GetWritingMode(), + ToNGPhysicalBoxFragment(content)); + content_metrics = content_fragment.BaselineMetricsWithoutSynthesize( + {NGBaselineAlgorithmType::kFirstLine, baseline_type}, constraint_space); + + // 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 + if (content_metrics.IsEmpty()) + return false; + } + // Layout the list marker. scoped_refptr<NGLayoutResult> list_marker_layout_result = list_marker_node.LayoutAtomicInline(constraint_space, @@ -62,29 +66,16 @@ // Compute the inline offset of the marker from its margins. // The marker is relative to the border box of the list item and has nothing // to do with the content offset. - auto margins = - InlineMarginsForOutside(list_marker_fragment, constraint_space); + auto margins = InlineMarginsForOutside(list_marker_fragment.Style(), + list_marker_fragment.InlineSize()); offset.inline_offset = margins.first; // Compute the block offset of the marker by aligning the baseline of the // marker to the first baseline of the content. - FontBaseline baseline_type = - IsHorizontalWritingMode(constraint_space.GetWritingMode()) - ? kAlphabeticBaseline - : kIdeographicBaseline; NGLineHeightMetrics list_marker_metrics = list_marker_fragment.BaselineMetrics( {NGBaselineAlgorithmType::kAtomicInline, baseline_type}, constraint_space); - NGLineHeightMetrics content_metrics; - if (content.IsLineBox()) { - content_metrics = ToNGPhysicalLineBoxFragment(content).Metrics(); - } else { - NGBoxFragment content_fragment(constraint_space.GetWritingMode(), - ToNGPhysicalBoxFragment(content)); - content_metrics = content_fragment.BaselineMetrics( - {NGBaselineAlgorithmType::kFirstLine, baseline_type}, constraint_space); - } // |offset.block_offset| is at the top of the content. Adjust it to the top of // the list marker by adding the differences of the ascent between content's @@ -93,6 +84,35 @@ DCHECK(container_builder); container_builder->AddChild(std::move(list_marker_layout_result), offset); + return true; +} + +LayoutUnit NGListLayoutAlgorithm::AddListMarkerWithoutLineBoxes( + NGBlockNode list_marker_node, + const NGConstraintSpace& constraint_space, + NGFragmentBuilder* container_builder) { + // Layout the list marker. + scoped_refptr<NGLayoutResult> list_marker_layout_result = + list_marker_node.LayoutAtomicInline(constraint_space, + constraint_space.UseFirstLineStyle()); + DCHECK(list_marker_layout_result->PhysicalFragment()); + const NGPhysicalBoxFragment& list_marker_physical_fragment = + ToNGPhysicalBoxFragment(*list_marker_layout_result->PhysicalFragment()); + NGLogicalSize size = list_marker_physical_fragment.Size().ConvertToLogical( + constraint_space.GetWritingMode()); + + // Compute the inline offset of the marker from its margins. + auto margins = InlineMarginsForOutside(list_marker_physical_fragment.Style(), + size.inline_size); + + // When there are no line boxes, marker is top-aligned to the list item. + // https://github.com/w3c/csswg-drafts/issues/2417 + NGLogicalOffset offset(margins.first, LayoutUnit()); + + DCHECK(container_builder); + container_builder->AddChild(std::move(list_marker_layout_result), offset); + + return size.block_size; } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.h index 61e1180..3422897 100644 --- a/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/list/ng_list_layout_algorithm.h
@@ -11,29 +11,29 @@ namespace blink { -class LayoutUnit; class NGConstraintSpace; -class NGLineBoxFragmentBuilder; -class NGLineInfo; // Algorithm to layout lists and list-items. // TODO(kojii): This isn't a real NGLayoutAlgorithm yet. Consider restructuring // or renaming. class CORE_EXPORT NGListLayoutAlgorithm final { public: - // Compute and set the inline position to an outside list marker for a line - // box. - static void SetListMarkerPosition(const NGConstraintSpace&, - const NGLineInfo&, - LayoutUnit line_width, - NGLineBoxFragmentBuilder::Child*); - // Add a fragment for an outside list marker for a block content. - static void AddListMarkerForBlockContent(NGBlockNode, + // Returns true if the list marker was successfully added. False indicates + // that the child content does not have a baseline to align to, and that + // caller should try next child, or "WithoutLineBoxes" version. + static bool AddListMarkerForBlockContent(NGBlockNode, const NGConstraintSpace&, const NGPhysicalFragment&, NGLogicalOffset, NGFragmentBuilder*); + + // Add a fragment for an outside list marker when the list item has no line + // boxes. + // Returns the block size of the list marker. + static LayoutUnit AddListMarkerWithoutLineBoxes(NGBlockNode, + const NGConstraintSpace&, + NGFragmentBuilder*); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc index 663d5be5..23bea1e 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -529,6 +529,12 @@ } } + // List markers should have been positioned if we had line boxes, or boxes + // that have line boxes. If there were no line boxes, position without line + // boxes. + if (container_builder_.UnpositionedListMarker() && node_.IsListItem()) + PositionListMarkerWithoutLineBoxes(); + container_builder_.SetEndMarginStrut(end_margin_strut); container_builder_.SetIntrinsicBlockSize(intrinsic_block_size_); container_builder_.SetPadding(ComputePadding(ConstraintSpace(), Style())); @@ -1830,9 +1836,43 @@ return; container_builder_.SetUnpositionedListMarker(NGBlockNode(nullptr)); } - NGListLayoutAlgorithm::AddListMarkerForBlockContent( - list_marker_node, constraint_space_, *layout_result.PhysicalFragment(), - content_offset, &container_builder_); + if (NGListLayoutAlgorithm::AddListMarkerForBlockContent( + list_marker_node, constraint_space_, + *layout_result.PhysicalFragment(), content_offset, + &container_builder_)) + return; + + // If the list marker could not be positioned against this child because it + // does not have the baseline to align to, keep it as unpositioned and try + // the next child. + container_builder_.SetUnpositionedListMarker(list_marker_node); +} + +void NGBlockLayoutAlgorithm::PositionListMarkerWithoutLineBoxes() { + DCHECK(node_.IsListItem()); + DCHECK(container_builder_.UnpositionedListMarker()); + + // Position the list marker without aligning to line boxes. + LayoutUnit marker_block_size = + NGListLayoutAlgorithm::AddListMarkerWithoutLineBoxes( + container_builder_.UnpositionedListMarker(), constraint_space_, + &container_builder_); + container_builder_.SetUnpositionedListMarker(NGBlockNode(nullptr)); + + // Whether the list marker should affect the block size or not is not + // well-defined, but 3 out of 4 impls do. + // https://github.com/w3c/csswg-drafts/issues/2418 + // + // TODO(kojii): Since this makes this block non-empty, it's probably better to + // resolve BFC offset if not done yet, but that involves additional complexity + // without knowing how much this is needed. For now, include the marker into + // the block size only if BFC was resolved. + if (container_builder_.BfcOffset()) { + intrinsic_block_size_ = std::max(marker_block_size, intrinsic_block_size_); + container_builder_.SetIntrinsicBlockSize(intrinsic_block_size_); + container_builder_.SetBlockSize( + std::max(marker_block_size, container_builder_.Size().block_size)); + } } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h index 3764717..c11c86438 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
@@ -191,6 +191,9 @@ // Positions a list marker for the specified block content. void PositionListMarker(const NGLayoutResult&, const NGLogicalOffset&); + // Positions a list marker when the block does not have any line boxes. + void PositionListMarkerWithoutLineBoxes(); + // Calculates logical offset for the current fragment using either {@code // intrinsic_block_size_} when the fragment doesn't know it's offset or // {@code known_fragment_offset} if the fragment knows it's offset
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc index 41d0baa..1840fa6 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -18,7 +18,7 @@ #include "core/layout/ng/ng_physical_box_fragment.h" #include "core/layout/ng/ng_physical_fragment.h" #include "core/style/ComputedStyle.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc index a7a954d..fb5ffd4 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.cc
@@ -13,16 +13,13 @@ namespace blink { -NGLineHeightMetrics NGBoxFragment::BaselineMetrics( +NGLineHeightMetrics NGBoxFragment::BaselineMetricsWithoutSynthesize( const NGBaselineRequest& request, const NGConstraintSpace& constraint_space) const { const auto& physical_fragment = ToNGPhysicalBoxFragment(physical_fragment_); - - LayoutBox* layout_box = ToLayoutBox(physical_fragment_.GetLayoutObject()); bool is_parallel_writing_mode = - IsHorizontalWritingMode(constraint_space.GetWritingMode()) == - layout_box->IsHorizontalWritingMode(); - + IsParallelWritingMode(constraint_space.GetWritingMode(), + physical_fragment.Style().GetWritingMode()); if (is_parallel_writing_mode) { // Find the baseline from the computed results. if (const NGBaseline* baseline = physical_fragment.Baseline(request)) { @@ -32,6 +29,7 @@ // For replaced elements, inline-block elements, and inline-table // elements, the height is the height of their margin box. // https://drafts.csswg.org/css2/visudet.html#line-height + LayoutBox* layout_box = ToLayoutBox(physical_fragment_.GetLayoutObject()); if (layout_box->IsAtomicInlineLevel()) { ascent += layout_box->MarginOver(); descent += layout_box->MarginUnder(); @@ -41,12 +39,25 @@ } } + return NGLineHeightMetrics(); +} + +NGLineHeightMetrics NGBoxFragment::BaselineMetrics( + const NGBaselineRequest& request, + const NGConstraintSpace& constraint_space) const { + NGLineHeightMetrics metrics = + BaselineMetricsWithoutSynthesize(request, constraint_space); + if (!metrics.IsEmpty()) + return metrics; + // The baseline type was not found. This is either this box should synthesize // box-baseline without propagating from children, or caller forgot to add // baseline requests to constraint space when it called Layout(). LayoutUnit block_size = BlockSize(); + const auto& physical_fragment = ToNGPhysicalBoxFragment(physical_fragment_); const ComputedStyle& style = physical_fragment.Style(); + LayoutBox* layout_box = ToLayoutBox(physical_fragment_.GetLayoutObject()); if (style.HasAppearance() && !LayoutTheme::GetTheme().IsControlContainer(style.Appearance())) { return NGLineHeightMetrics( @@ -57,6 +68,9 @@ // If atomic inline, use the margin box. See above. if (layout_box->IsAtomicInlineLevel()) { + bool is_parallel_writing_mode = + IsParallelWritingMode(constraint_space.GetWritingMode(), + physical_fragment.Style().GetWritingMode()); if (is_parallel_writing_mode) block_size += layout_box->MarginLogicalHeight(); else
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h index 50f082d..62859af 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_box_fragment.h
@@ -26,6 +26,13 @@ // // Baseline requests must be added to constraint space when this fragment was // laid out. + // + // The "WithoutSynthesize" version returns an empty metrics if this box does + // not have any baselines, while the other version synthesize the baseline + // from the box. + NGLineHeightMetrics BaselineMetricsWithoutSynthesize( + const NGBaselineRequest&, + const NGConstraintSpace&) const; NGLineHeightMetrics BaselineMetrics(const NGBaselineRequest&, const NGConstraintSpace&) const; };
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc index e907029b..c3f1506 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc
@@ -54,8 +54,12 @@ Vector<NGPositionedFloat> positioned_floats(positioned_floats_); Vector<scoped_refptr<NGUnpositionedFloat>> unpositioned_floats( unpositioned_floats_); - std::unique_ptr<const NGExclusionSpace> exclusion_space( - WTF::WrapUnique(new NGExclusionSpace(*exclusion_space_))); + std::unique_ptr<const NGExclusionSpace> exclusion_space; + // TODO(layoutng) Replace this with DCHECK(exclusion_space_) when + // callers guarantee exclusion_space_ != null. + if (exclusion_space_) + exclusion_space = WTF::WrapUnique(new NGExclusionSpace(*exclusion_space_)); + return base::AdoptRef(new NGLayoutResult( physical_fragment_->CloneWithoutOffset(), oof_positioned_descendants, positioned_floats, unpositioned_floats, unpositioned_list_marker_,
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_test.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_test.h index ecd6433..65dd674 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_test.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_test.h
@@ -7,7 +7,7 @@ #include "core/frame/LocalFrameClient.h" #include "core/layout/LayoutTestHelper.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp index 4ec4dd6..0f6fbcf 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp
@@ -30,7 +30,7 @@ namespace { -SVGResource* ResourceForContainer( +LocalSVGResource* ResourceForContainer( const LayoutSVGResourceContainer& resource_container) { const SVGElement& element = *resource_container.GetElement(); return element.GetTreeScope() @@ -68,7 +68,7 @@ } void LayoutSVGResourceContainer::NotifyContentChanged() { - if (SVGResource* resource = ResourceForContainer(*this)) + if (LocalSVGResource* resource = ResourceForContainer(*this)) resource->NotifyContentChanged(); if (SVGElementProxySet* proxy_set = ElementProxySet()) proxy_set->NotifyContentChanged(GetElement()->GetTreeScope()); @@ -78,7 +78,7 @@ LayoutSVGHiddenContainer::WillBeDestroyed(); // The resource is being torn down. If we have any clients, move those to be // pending on the resource (if one exists.) - if (SVGResource* resource = ResourceForContainer(*this)) + if (LocalSVGResource* resource = ResourceForContainer(*this)) MakeClientsPending(*resource); } @@ -89,13 +89,14 @@ // The resource has (read: may have) been attached. Notify any pending // clients that they can now try to add themselves as clients to the // resource. - if (SVGResource* resource = ResourceForContainer(*this)) { + if (LocalSVGResource* resource = ResourceForContainer(*this)) { if (resource->Target() == GetElement()) resource->NotifyPendingClients(); } } -void LayoutSVGResourceContainer::MakeClientsPending(SVGResource& resource) { +void LayoutSVGResourceContainer::MakeClientsPending( + LocalSVGResource& resource) { RemoveAllClientsFromCache(); for (auto* client : clients_) { @@ -115,7 +116,7 @@ InvalidationModeMask invalidation_mask) { if (is_invalidating_) return; - SVGResource* resource = ResourceForContainer(*this); + LocalSVGResource* resource = ResourceForContainer(*this); SVGElementProxySet* proxy_set = ElementProxySet(); if (clients_.IsEmpty() && (!proxy_set || proxy_set->IsEmpty()) && (!resource || !resource->HasClients()))
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h index 9354e81..ed3170a 100644 --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.h
@@ -24,8 +24,8 @@ namespace blink { +class LocalSVGResource; class SVGElementProxySet; -class SVGResource; enum LayoutSVGResourceType { kMaskerResourceType, @@ -67,7 +67,7 @@ // Detach all clients from this resource, and add them as watches to the tree // scope's resource entry (the argument.) - void MakeClientsPending(SVGResource&); + void MakeClientsPending(LocalSVGResource&); bool HasClients() const { return !clients_.IsEmpty(); } void InvalidateCacheAndMarkForLayout(LayoutInvalidationReasonForTracing,
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp index ec7ca7d..747df45 100644 --- a/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp +++ b/third_party/WebKit/Source/core/layout/svg/SVGResources.cpp
@@ -158,7 +158,7 @@ ContainerType* AttachToResource(SVGTreeScopeResources& tree_scope_resources, const AtomicString& id, SVGElement& element) { - SVGResource* resource = tree_scope_resources.ResourceForId(id); + LocalSVGResource* resource = tree_scope_resources.ResourceForId(id); if (!resource) return nullptr; if (LayoutSVGResourceContainer* container = resource->ResourceContainer()) {
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp index b17d441..daf66cf 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
@@ -32,7 +32,7 @@ #include "core/testing/NullExecutionContext.h" #include "platform/loader/fetch/fetch_initiator_type_names.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp index e74ce98..8d95490 100644 --- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp +++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -51,10 +51,10 @@ #include "platform/loader/testing/MockResourceClient.h" #include "platform/network/http_names.h" #include "platform/scheduler/test/fake_task_runner.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/ScopedMockedURL.h" #include "platform/testing/TestingPlatformSupportWithMockScheduler.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/PtrUtil.h" #include "platform/wtf/text/Base64.h" #include "public/platform/Platform.h"
diff --git a/third_party/WebKit/Source/core/mojo/MojoWatcher.cpp b/third_party/WebKit/Source/core/mojo/MojoWatcher.cpp index 571120d0..20edc74 100644 --- a/third_party/WebKit/Source/core/mojo/MojoWatcher.cpp +++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.cpp
@@ -43,10 +43,10 @@ MojoWatcher::~MojoWatcher() = default; MojoResult MojoWatcher::cancel() { - if (!watcher_handle_.is_valid()) + if (!trap_handle_.is_valid()) return MOJO_RESULT_INVALID_ARGUMENT; - watcher_handle_.reset(); + trap_handle_.reset(); return MOJO_RESULT_OK; } @@ -86,12 +86,12 @@ signals |= MOJO_HANDLE_SIGNAL_PEER_CLOSED; MojoResult result = - mojo::CreateWatcher(&MojoWatcher::OnHandleReady, &watcher_handle_); + mojo::CreateTrap(&MojoWatcher::OnHandleReady, &trap_handle_); DCHECK_EQ(MOJO_RESULT_OK, result); - result = MojoWatch(watcher_handle_.get().value(), handle.value(), signals, - MOJO_WATCH_CONDITION_SATISFIED, - reinterpret_cast<uintptr_t>(this)); + result = MojoAddTrigger(trap_handle_.get().value(), handle.value(), signals, + MOJO_TRIGGER_CONDITION_SIGNALS_SATISFIED, + reinterpret_cast<uintptr_t>(this), nullptr); if (result != MOJO_RESULT_OK) return result; @@ -111,10 +111,10 @@ return MOJO_RESULT_OK; } - // If MojoWatch succeeds but Arm does not, that means another thread closed - // the watched handle in between. Treat it like we'd treat a MojoWatch trying - // to watch an invalid handle. - watcher_handle_.reset(); + // If MojoAddTrigger succeeds but Arm does not, that means another thread + // closed the watched handle in between. Treat it like we'd treat + // MojoAddTrigger trying to watch an invalid handle. + trap_handle_.reset(); return MOJO_RESULT_INVALID_ARGUMENT; } @@ -128,8 +128,8 @@ MojoResult local_ready_result; MojoHandleSignalsState ready_signals; MojoResult result = - MojoArmWatcher(watcher_handle_.get().value(), &num_ready_contexts, - &ready_context, &local_ready_result, &ready_signals); + MojoArmTrap(trap_handle_.get().value(), nullptr, &num_ready_contexts, + &ready_context, &local_ready_result, &ready_signals); if (result == MOJO_RESULT_OK) return MOJO_RESULT_OK; @@ -143,19 +143,17 @@ return result; } -void MojoWatcher::OnHandleReady(uintptr_t context, - MojoResult result, - MojoHandleSignalsState, - MojoWatcherNotificationFlags) { - // It is safe to assume the MojoWatcher still exists. It stays alive at least - // as long as |m_handle| is valid, and |m_handle| is only reset after we +// static +void MojoWatcher::OnHandleReady(const MojoTrapEvent* event) { + // It is safe to assume the MojoWathcer still exists. It stays alive at least + // as long as |handle_| is valid, and |handle_| is only reset after we // dispatch a |MOJO_RESULT_CANCELLED| notification. That is always the last // notification received by this callback. - MojoWatcher* watcher = reinterpret_cast<MojoWatcher*>(context); + MojoWatcher* watcher = reinterpret_cast<MojoWatcher*>(event->trigger_context); PostCrossThreadTask( *watcher->task_runner_, FROM_HERE, CrossThreadBind(&MojoWatcher::RunReadyCallback, - WrapCrossThreadWeakPersistent(watcher), result)); + WrapCrossThreadWeakPersistent(watcher), event->result)); } void MojoWatcher::RunReadyCallback(MojoResult result) { @@ -164,23 +162,23 @@ handle_ = mojo::Handle(); // Only dispatch to the callback if this cancellation was implicit due to - // |m_handle| closure. If it was explicit, |m_watcherHandle| has already - // been reset. - if (watcher_handle_.is_valid()) { - watcher_handle_.reset(); + // |handle_| closure. If it was explicit, |trap_handlde_| has already been + // reset. + if (trap_handle_.is_valid()) { + trap_handle_.reset(); callback_->InvokeAndReportException(this, result); } return; } // Ignore callbacks if not watching. - if (!watcher_handle_.is_valid()) + if (!trap_handle_.is_valid()) return; callback_->InvokeAndReportException(this, result); // The user callback may have canceled watching. - if (!watcher_handle_.is_valid()) + if (!trap_handle_.is_valid()) return; // Rearm the watcher so another notification can fire.
diff --git a/third_party/WebKit/Source/core/mojo/MojoWatcher.h b/third_party/WebKit/Source/core/mojo/MojoWatcher.h index dbbbab7..98c014b 100644 --- a/third_party/WebKit/Source/core/mojo/MojoWatcher.h +++ b/third_party/WebKit/Source/core/mojo/MojoWatcher.h
@@ -8,7 +8,7 @@ #include "bindings/core/v8/ActiveScriptWrappable.h" #include "core/dom/ContextLifecycleObserver.h" #include "mojo/public/cpp/system/handle.h" -#include "mojo/public/cpp/system/watcher.h" +#include "mojo/public/cpp/system/trap.h" #include "platform/bindings/ScriptWrappable.h" #include "platform/bindings/TraceWrapperMember.h" @@ -49,15 +49,12 @@ MojoResult Watch(mojo::Handle, const MojoHandleSignals&); MojoResult Arm(MojoResult* ready_result); - static void OnHandleReady(uintptr_t context, - MojoResult, - MojoHandleSignalsState, - MojoWatcherNotificationFlags); + static void OnHandleReady(const MojoTrapEvent*); void RunReadyCallback(MojoResult); scoped_refptr<base::SingleThreadTaskRunner> task_runner_; TraceWrapperMember<V8MojoWatchCallback> callback_; - mojo::ScopedWatcherHandle watcher_handle_; + mojo::ScopedTrapHandle trap_handle_; mojo::Handle handle_; };
diff --git a/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp b/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp index 41ba18fe..08e378e 100644 --- a/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp +++ b/third_party/WebKit/Source/core/origin_trials/OriginTrialContextTest.cpp
@@ -13,7 +13,7 @@ #include "core/testing/DummyPageHolder.h" #include "core/testing/NullExecutionContext.h" #include "platform/testing/HistogramTester.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/PtrUtil.h"
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp index 42108c7..92b1bfa 100644 --- a/third_party/WebKit/Source/core/page/DragController.cpp +++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -224,13 +224,14 @@ LocalFrameView* frame_view(local_root.View()); if (frame_view) { - DataTransferAccessPolicy policy = kDataTransferTypesReadable; + DataTransferAccessPolicy policy = DataTransferAccessPolicy::kTypesReadable; DataTransfer* data_transfer = CreateDraggingDataTransfer(policy, drag_data); data_transfer->SetSourceOperation(drag_data->DraggingSourceOperationMask()); local_root.GetEventHandler().CancelDragAndDrop(CreateMouseEvent(drag_data), data_transfer); data_transfer->SetAccessPolicy( - kDataTransferNumb); // invalidate clipboard here for security + DataTransferAccessPolicy::kNumb); // invalidate clipboard here for + // security } MouseMovedIntoDocument(nullptr); if (file_input_element_under_mouse_) @@ -250,8 +251,8 @@ bool prevented_default = false; if (local_root.View()) { // Sending an event can result in the destruction of the view and part. - DataTransfer* data_transfer = - CreateDraggingDataTransfer(kDataTransferReadable, drag_data); + DataTransfer* data_transfer = CreateDraggingDataTransfer( + DataTransferAccessPolicy::kReadable, drag_data); data_transfer->SetSourceOperation( drag_data->DraggingSourceOperationMask()); EventHandler& event_handler = local_root.GetEventHandler(); @@ -270,7 +271,7 @@ } // Invalidate clipboard here for security. - data_transfer->SetAccessPolicy(kDataTransferNumb); + data_transfer->SetAccessPolicy(DataTransferAccessPolicy::kNumb); } if (prevented_default) { document_under_mouse_ = nullptr; @@ -762,7 +763,7 @@ if (!local_root.View()) return false; - DataTransferAccessPolicy policy = kDataTransferTypesReadable; + DataTransferAccessPolicy policy = DataTransferAccessPolicy::kTypesReadable; DataTransfer* data_transfer = CreateDraggingDataTransfer(policy, drag_data); DragOperation src_op_mask = drag_data->DraggingSourceOperationMask(); data_transfer->SetSourceOperation(src_op_mask); @@ -771,7 +772,8 @@ if (local_root.GetEventHandler().UpdateDragAndDrop(event, data_transfer) == WebInputEventResult::kNotHandled) { data_transfer->SetAccessPolicy( - kDataTransferNumb); // invalidate clipboard here for security + DataTransferAccessPolicy::kNumb); // invalidate clipboard here for + // security return false; } @@ -784,7 +786,8 @@ } data_transfer->SetAccessPolicy( - kDataTransferNumb); // invalidate clipboard here for security + DataTransferAccessPolicy::kNumb); // invalidate clipboard here for + // security return true; }
diff --git a/third_party/WebKit/Source/core/page/DragControllerTest.cpp b/third_party/WebKit/Source/core/page/DragControllerTest.cpp index 052097f..8206703ad 100644 --- a/third_party/WebKit/Source/core/page/DragControllerTest.cpp +++ b/third_party/WebKit/Source/core/page/DragControllerTest.cpp
@@ -6,6 +6,7 @@ #include "core/clipboard/DataObject.h" #include "core/clipboard/DataTransfer.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/editing/FrameSelection.h" #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameView.h" @@ -18,7 +19,7 @@ #include "core/testing/sim/SimRequest.h" #include "core/testing/sim/SimTest.h" #include "platform/DragImage.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink { @@ -396,7 +397,8 @@ drag_state.drag_type_ = kDragSourceActionSelection; drag_state.drag_src_ = GetDocument().getElementById("drag"); drag_state.drag_data_transfer_ = DataTransfer::Create( - DataTransfer::kDragAndDrop, kDataTransferWritable, DataObject::Create()); + DataTransfer::kDragAndDrop, DataTransferAccessPolicy::kWritable, + DataObject::Create()); GetFrame().GetPage()->GetDragController().StartDrag( &GetFrame(), drag_state, mouse_event, IntPoint(5, 10)); @@ -439,7 +441,8 @@ drag_state.drag_type_ = kDragSourceActionLink; drag_state.drag_src_ = GetDocument().getElementById("drag"); drag_state.drag_data_transfer_ = DataTransfer::Create( - DataTransfer::kDragAndDrop, kDataTransferWritable, DataObject::Create()); + DataTransfer::kDragAndDrop, DataTransferAccessPolicy::kWritable, + DataObject::Create()); GetFrame().GetPage()->GetDragController().StartDrag( &GetFrame(), drag_state, mouse_event, IntPoint(5, 10));
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp index 83308105..67a1917 100644 --- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
@@ -24,9 +24,9 @@ #include "core/paint/compositing/PaintLayerCompositor.h" #include "core/testing/sim/SimRequest.h" #include "core/testing/sim/SimTest.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Vector.h" #include "public/platform/Platform.h" #include "public/platform/WebCoalescedInputEvent.h"
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp index 708848ee..6525c22 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -484,6 +484,9 @@ PixelSnappedIntRect( LayoutRect(LayoutPoint(subpixel_accumulation), contents_size)) .Size(); + // The scrolling contents layer must be at least as large as the clip. + scroll_contents_size = + scroll_contents_size.ExpandedTo(container_layer->Bounds()); web_layer->SetBounds(scroll_contents_size); // VisualViewport scrolling may involve pinch zoom and gets routed through // WebViewImpl explicitly rather than via ScrollingCoordinator::DidScroll
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp index 4e0d4cc..aa8d5b8 100644 --- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp
@@ -42,9 +42,9 @@ #include "platform/geometry/IntRect.h" #include "platform/graphics/GraphicsLayer.h" #include "platform/graphics/TouchAction.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/URLTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/Platform.h" #include "public/platform/WebCache.h" #include "public/platform/WebLayer.h"
diff --git a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp index 24025950..baa5bef3 100644 --- a/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp +++ b/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp
@@ -16,7 +16,7 @@ #include "core/style/ComputedStyle.h" #include "core/testing/DummyPageHolder.h" #include "platform/scroll/ScrollTypes.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp b/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp index e61d988..a263961 100644 --- a/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp +++ b/third_party/WebKit/Source/core/paint/BoxPaintInvalidatorTest.cpp
@@ -14,7 +14,7 @@ #include "core/paint/PaintLayer.h" #include "platform/graphics/GraphicsLayer.h" #include "platform/graphics/paint/RasterInvalidationTracking.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp b/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp index 86d3780..f33a8504 100644 --- a/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/HTMLCanvasPainterTest.cpp
@@ -15,7 +15,7 @@ #include "platform/graphics/gpu/SharedGpuContext.h" #include "platform/graphics/test/FakeGLES2Interface.h" #include "platform/graphics/test/FakeWebGraphicsContext3DProvider.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/WebLayer.h" #include "public/platform/WebSize.h"
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp index c51db0b..d1298f1d 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -44,8 +44,8 @@ #include "core/paint/PaintLayer.h" -#include "core/CSSPropertyNames.h" #include "core/css/PseudoStyleRequest.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/dom/ShadowRoot.h" #include "core/frame/LocalFrame.h" @@ -3027,6 +3027,14 @@ SetNeedsCompositingInputsUpdate(); GetLayoutObject().SetNeedsPaintPropertyUpdate(); + + // We don't need to invalidate paint of objects on SPv175 when paint order + // changes. However, we do need to repaint the containing stacking context, + // in order to generate new paint chunks in the correct order. Raster + // invalidation will be issued if needed during paint. + if (RuntimeEnabledFeatures::SlimmingPaintV175Enabled() && + diff.ZIndexChanged()) + SetNeedsRepaint(); } LayoutPoint PaintLayer::LocationInternal() const {
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp index 709e37b..cd0ee10b 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
@@ -10,8 +10,8 @@ #include "core/layout/LayoutView.h" #include "core/paint/PaintLayer.h" #include "platform/LayoutTestSupport.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp index e1da79e..bf31d5f 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -729,7 +729,8 @@ // the embedded content itself. Doing so would clip out the // border because LayoutEmbeddedObject does not obey the painting phases // of a normal box object. - if (layout_object.IsLayoutEmbeddedContent()) + if (layout_object.IsLayoutEmbeddedContent() && + layout_object.GetCompositingState() == kPaintsIntoOwnBacking) return paint_flags & kPaintLayerPaintingChildClippingMaskPhase; return clip_rect.Rect() != local_painting_info.paint_dirty_rect ||
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp index 6d4afa4..6c43be31 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -8,7 +8,7 @@ #include "core/paint/PaintControllerPaintTest.h" #include "core/paint/compositing/CompositedLayerMapping.h" #include "platform/graphics/GraphicsContext.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index aaff1ed..5f179d6 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -874,10 +874,19 @@ } void PaintLayerScrollableArea::UpdateScrollDimensions() { - if (overflow_rect_.Size() != GetLayoutBox()->LayoutOverflowRect().Size()) + LayoutRect new_overflow_rect = GetLayoutBox()->LayoutOverflowRect(); + GetLayoutBox()->FlipForWritingMode(new_overflow_rect); + + // The layout viewport can be larger than the document's layout overflow when + // top controls are hidden. Expand the overflow here to ensure that our + // contents size >= visible size. + new_overflow_rect.Unite( + LayoutRect(new_overflow_rect.Location(), + LayoutContentRect(kExcludeScrollbars).Size())); + + if (overflow_rect_.Size() != new_overflow_rect.Size()) ContentsResized(); - overflow_rect_ = GetLayoutBox()->LayoutOverflowRect(); - GetLayoutBox()->FlipForWritingMode(overflow_rect_); + overflow_rect_ = new_overflow_rect; UpdateScrollOrigin(); }
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp index ec34178..bcd4e63 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -11,7 +11,7 @@ #include "platform/graphics/GraphicsLayer.h" #include "platform/scroll/ScrollTypes.h" #include "platform/scroll/ScrollbarTheme.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" using ::testing::_;
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp index 23092112..32fba52 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -2264,7 +2264,8 @@ } } -void ObjectPaintPropertyTreeBuilder::UpdateFragments() { +bool ObjectPaintPropertyTreeBuilder::UpdateFragments() { + bool had_paint_properties = object_.FirstFragment().PaintProperties(); // Note: It is important to short-circuit on object_.StyleRef().ClipPath() // because NeedsClipPathClip() and NeedsEffect() requires the clip path // cache to be resolved, but the clip path cache invalidation must delayed @@ -2305,6 +2306,8 @@ } UpdateRepeatingPaintOffsetAdjustment(); + + return needs_paint_properties != had_paint_properties; } bool ObjectPaintPropertyTreeBuilder::ObjectTypeMightNeedPaintProperties() @@ -2332,13 +2335,13 @@ bool ObjectPaintPropertyTreeBuilder::UpdateForSelf() { UpdatePaintingLayer(); + bool property_added_or_removed = false; if (ObjectTypeMightNeedPaintProperties()) - UpdateFragments(); + property_added_or_removed = UpdateFragments(); else object_.GetMutableForPainting().FirstFragment().ClearNextFragment(); bool property_changed = false; - bool property_added_or_removed = false; auto* fragment_data = &object_.GetMutableForPainting().FirstFragment(); for (auto& fragment_context : context_.fragments) { FragmentPaintPropertyTreeBuilder builder(object_, context_,
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h index d92a9c8f..5fd944f 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h
@@ -198,7 +198,8 @@ ContextForFragment(const Optional<LayoutRect>& fragment_clip, LayoutUnit logical_top_in_flow_thread) const; ALWAYS_INLINE void CreateFragmentContexts(bool needs_paint_properties); - ALWAYS_INLINE void UpdateFragments(); + // Returns whether ObjectPaintProperties were allocated or deleted. + ALWAYS_INLINE bool UpdateFragments(); ALWAYS_INLINE void UpdatePaintingLayer(); ALWAYS_INLINE void UpdateRepeatingPaintOffsetAdjustment(); ALWAYS_INLINE void UpdateRepeatingTableHeaderPaintOffsetAdjustment();
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h index 33f9fc1..2d05e81 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilderTest.h
@@ -6,8 +6,8 @@ #define PaintPropertyTreeBuilderTest_h #include "core/paint/PaintControllerPaintTest.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp index 2d0c316..902ba3f 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreePrinterTest.cpp
@@ -6,7 +6,7 @@ #include "core/layout/LayoutObject.h" #include "core/paint/PaintControllerPaintTest.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock-matchers.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp index e2b387b..632b2db6 100644 --- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp +++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalk.cpp
@@ -100,11 +100,9 @@ FrameViewPaintPropertyTreeBuilder::Update(frame_view, *context().tree_builder_context); } - paint_invalidator_.InvalidatePaint(frame_view, - context().tree_builder_context - ? &*context().tree_builder_context - : nullptr, - context().paint_invalidator_context); + paint_invalidator_.InvalidatePaint( + frame_view, WTF::OptionalOrNullptr(context().tree_builder_context), + context().paint_invalidator_context); if (LayoutView* view = frame_view.GetLayoutView()) { #ifndef NDEBUG @@ -210,8 +208,7 @@ } paint_invalidator_.InvalidatePaint( - object, - context.tree_builder_context ? &*context.tree_builder_context : nullptr, + object, WTF::OptionalOrNullptr(context.tree_builder_context), context.paint_invalidator_context); if (context.tree_builder_context) {
diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp index 9aad59c8..5d90695 100644 --- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp +++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp
@@ -13,8 +13,8 @@ #include "platform/graphics/paint/GeometryMapper.h" #include "platform/graphics/paint/ScrollPaintPropertyNode.h" #include "platform/graphics/paint/TransformPaintPropertyNode.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/text/TextStream.h" #include "platform/wtf/HashMap.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/paint/TextPainter.cpp b/third_party/WebKit/Source/core/paint/TextPainter.cpp index 27c75cd..966d476 100644 --- a/third_party/WebKit/Source/core/paint/TextPainter.cpp +++ b/third_party/WebKit/Source/core/paint/TextPainter.cpp
@@ -4,7 +4,7 @@ #include "core/paint/TextPainter.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/frame/Settings.h" #include "core/layout/LayoutObject.h" #include "core/layout/LayoutTextCombine.h"
diff --git a/third_party/WebKit/Source/core/paint/TextPainterTest.cpp b/third_party/WebKit/Source/core/paint/TextPainterTest.cpp index 60e6c71..7927179 100644 --- a/third_party/WebKit/Source/core/paint/TextPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/TextPainterTest.cpp
@@ -4,9 +4,10 @@ #include "core/paint/TextPainter.h" -#include "core/CSSPropertyNames.h" +#include <memory> #include "core/CSSValueKeywords.h" #include "core/css/CSSPrimitiveValue.h" +#include "core/css_property_names.h" #include "core/frame/Settings.h" #include "core/layout/LayoutTestHelper.h" #include "core/layout/api/LineLayoutText.h" @@ -15,7 +16,6 @@ #include "core/style/ShadowList.h" #include "platform/graphics/paint/PaintController.h" #include "testing/gtest/include/gtest/gtest.h" -#include <memory> namespace blink { namespace {
diff --git a/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp b/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp index 1efa342..a2e7ba0 100644 --- a/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp +++ b/third_party/WebKit/Source/core/paint/VideoPainterTest.cpp
@@ -8,8 +8,8 @@ #include "core/paint/PaintControllerPaintTest.h" #include "core/paint/StubChromeClientForSPv2.h" #include "platform/testing/EmptyWebMediaPlayer.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/Platform.h" #include "public/platform/WebCompositorSupport.h" #include "public/platform/WebLayer.h"
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp index 1f24cbbf..cf4b24ec8 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
@@ -1689,6 +1689,8 @@ LayoutPoint(owning_layer_.SubpixelAccumulation()), LayoutSize(layout_box.ScrollWidth(), layout_box.ScrollHeight()))) .Size(); + // Ensure scrolling contents are at least as large as the scroll clip + scroll_size = scroll_size.ExpandedTo(overflow_clip_rect.Size()); if (overflow_clip_rect_offset_changed) scrolling_contents_layer_->SetNeedsDisplay();
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp index 73543a2a..38a3b41 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp
@@ -9,7 +9,7 @@ #include "core/layout/LayoutTestHelper.h" #include "core/layout/LayoutView.h" #include "core/paint/PaintLayer.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/WebContentLayer.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.cpp index bce1cac..7cd94fc 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.cpp
@@ -60,17 +60,6 @@ return nullptr; } -static const PaintLayer* FindParentLayerOnContainingBlockChain( - const LayoutObject* object) { - for (const LayoutObject* current = object; current; - current = current->ContainingBlock()) { - if (current->HasLayer()) - return static_cast<const LayoutBoxModelObject*>(current)->Layer(); - } - NOTREACHED(); - return nullptr; -} - static bool NeedsToEscapeClipInheritedFromCompositingContainer( const PaintLayer* layer, const LayoutObject& desired_clip) { @@ -92,11 +81,12 @@ return; LayoutBoxModelObject& layout_object = layer->GetLayoutObject(); + const ComputedStyle& style = layout_object.StyleRef(); const PaintLayer* previous_overflow_layer = layer->AncestorOverflowLayer(); layer->UpdateAncestorOverflowLayer(info.last_overflow_clip_layer); if (info.last_overflow_clip_layer && layer->NeedsCompositingInputsUpdate() && - layout_object.Style()->HasStickyConstrainedPosition()) { + style.HasStickyConstrainedPosition()) { if (!RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { if (info.last_overflow_clip_layer != previous_overflow_layer) { // Old ancestor scroller should no longer have these constraints. @@ -142,23 +132,49 @@ update_type = kForceUpdate; } + if (style.GetPosition() == EPosition::kAbsolute) { + info.scrolling_ancestor = info.scrolling_ancestor_for_absolute; + info.needs_reparent_scroll = info.needs_reparent_scroll_for_absolute; + } else if (style.GetPosition() == EPosition::kFixed) { + info.scrolling_ancestor = info.scrolling_ancestor_for_fixed; + info.needs_reparent_scroll = info.needs_reparent_scroll_for_fixed; + } + if (update_type == kForceUpdate) UpdateAncestorDependentCompositingInputs(layer, info); info.enclosing_composited_layer = enclosing_composited_layer; - if (layer->StackingNode()->IsStackingContext()) - info.ancestor_stacking_context = layer; - if (layer->IsRootLayer() || layout_object.HasOverflowClip()) info.last_overflow_clip_layer = layer; - if (layer->ScrollsOverflow()) - info.last_scrolling_ancestor = layer; - if (layout_object.HasClipRelatedProperty()) info.has_ancestor_with_clip_related_property = true; + // Handles sibling scroll problem, i.e. a non-stacking context scroller + // needs to propagate scroll to its descendants that are siblings in + // paint order. For example: + // <div style="overflow:scroll;"> + // <div style="position:relative;">Paint sibling.</div> + // </div> + if (layer->ScrollsOverflow()) { + info.scrolling_ancestor = layer; + info.needs_reparent_scroll = true; + } + if (layout_object.CanContainAbsolutePositionObjects()) { + info.scrolling_ancestor_for_absolute = info.scrolling_ancestor; + info.needs_reparent_scroll_for_absolute = info.needs_reparent_scroll; + } + if (layout_object.CanContainFixedPositionObjects() && + !layout_object.IsLayoutView()) { + info.scrolling_ancestor_for_fixed = info.scrolling_ancestor; + info.needs_reparent_scroll_for_fixed = info.needs_reparent_scroll; + } + if (style.IsStackingContext()) { + info.needs_reparent_scroll = info.needs_reparent_scroll_for_absolute = + info.needs_reparent_scroll_for_fixed = false; + } + for (PaintLayer* child = layer->FirstChild(); child; child = child->NextSibling()) UpdateRecursive(child, update_type, info); @@ -275,24 +291,9 @@ } } - if (info.last_scrolling_ancestor) { - const LayoutObject* containing_block = layout_object.ContainingBlock(); - const PaintLayer* parent_layer_on_containing_block_chain = - FindParentLayerOnContainingBlockChain(containing_block); - - properties.ancestor_scrolling_layer = - parent_layer_on_containing_block_chain->AncestorScrollingLayer(); - if (parent_layer_on_containing_block_chain->ScrollsOverflow()) { - properties.ancestor_scrolling_layer = - parent_layer_on_containing_block_chain; - } - - if (layer->StackingNode()->IsStacked() && - properties.ancestor_scrolling_layer && - !info.ancestor_stacking_context->GetLayoutObject().IsDescendantOf( - &properties.ancestor_scrolling_layer->GetLayoutObject())) - properties.scroll_parent = properties.ancestor_scrolling_layer; - } + properties.ancestor_scrolling_layer = info.scrolling_ancestor; + if (info.needs_reparent_scroll && layer->StackingNode()->IsStacked()) + properties.scroll_parent = info.scrolling_ancestor; layer->UpdateAncestorDependentCompositingInputs(properties); }
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.h b/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.h index 982c6a4..199663b 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.h +++ b/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdater.h
@@ -32,23 +32,20 @@ }; struct AncestorInfo { - AncestorInfo() - : ancestor_stacking_context(nullptr), - enclosing_composited_layer(nullptr), - last_overflow_clip_layer(nullptr), - last_scrolling_ancestor(nullptr), - has_ancestor_with_clip_related_property(false) {} + PaintLayer* enclosing_composited_layer = nullptr; + PaintLayer* last_overflow_clip_layer = nullptr; + bool has_ancestor_with_clip_related_property = false; - PaintLayer* ancestor_stacking_context; - PaintLayer* enclosing_composited_layer; - PaintLayer* last_overflow_clip_layer; - // Notice that lastScrollingAncestor isn't the same thing as - // ancestorScrollingLayer. The former is just the nearest scrolling - // along the PaintLayer::parent() chain. The latter is the layer that - // actually controls the scrolling of this layer, which we find on the - // containing block chain. - PaintLayer* last_scrolling_ancestor; - bool has_ancestor_with_clip_related_property; + PaintLayer* scrolling_ancestor = nullptr; + PaintLayer* scrolling_ancestor_for_absolute = nullptr; + PaintLayer* scrolling_ancestor_for_fixed = nullptr; + // These flags are set to true if a non-stacking context scroller + // is encountered, so that a descendant element won't inherit scroll + // translation from its compositing ancestor directly thus having to + // setup an alternative scroll parent instead. + bool needs_reparent_scroll = false; + bool needs_reparent_scroll_for_absolute = false; + bool needs_reparent_scroll_for_fixed = false; }; void UpdateRecursive(PaintLayer*, UpdateType, AncestorInfo);
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdaterTest.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdaterTest.cpp index 88783e1b..f368c306 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdaterTest.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositingInputsUpdaterTest.cpp
@@ -5,7 +5,7 @@ #include "core/layout/LayoutTestHelper.h" #include "core/paint/PaintLayer.h" #include "core/paint/compositing/CompositingInputsUpdater.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinder.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinder.cpp index d0a1066..6162357 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinder.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinder.cpp
@@ -4,7 +4,7 @@ #include "core/paint/compositing/CompositingReasonFinder.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/Document.h" #include "core/frame/LocalFrameView.h" #include "core/frame/Settings.h"
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinderTest.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinderTest.cpp index d08b4e4..0054aaa 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinderTest.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositingReasonFinderTest.cpp
@@ -10,8 +10,8 @@ #include "core/paint/PaintLayer.h" #include "platform/graphics/GraphicsLayer.h" #include "platform/scroll/ScrollTypes.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupport.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.cc b/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.cc index 1012701..899033d 100644 --- a/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.cc +++ b/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.cc
@@ -193,4 +193,15 @@ return block_fragment->VisualRect(); } +const NGPaintFragment* NGPaintFragment::ContainerLineBox() const { + DCHECK(PhysicalFragment().IsInline()); + for (const NGPaintFragment* runner = this; runner; + runner = runner->Parent()) { + if (runner->PhysicalFragment().IsLineBox()) + return runner; + } + NOTREACHED(); + return nullptr; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.h b/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.h index d9960ae4..88c9f80a 100644 --- a/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.h +++ b/third_party/WebKit/Source/core/paint/ng/ng_paint_fragment.h
@@ -50,9 +50,12 @@ return children_; } - // Returns offset to its container box for inline fragments. + // Returns the container line box for inline fragments. + const NGPaintFragment* ContainerLineBox() const; + + // Returns offset to its container box for inline and line box fragments. const NGPhysicalOffset& InlineOffsetToContainerBox() const { - DCHECK(PhysicalFragment().IsInline()); + DCHECK(PhysicalFragment().IsInline() || PhysicalFragment().IsLineBox()); return inline_offset_to_container_box_; }
diff --git a/third_party/WebKit/Source/core/paint/ng/ng_text_painter.cc b/third_party/WebKit/Source/core/paint/ng/ng_text_painter.cc index d448103..e7224f0 100644 --- a/third_party/WebKit/Source/core/paint/ng/ng_text_painter.cc +++ b/third_party/WebKit/Source/core/paint/ng/ng_text_painter.cc
@@ -4,7 +4,7 @@ #include "core/paint/ng/ng_text_painter.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/frame/Settings.h" #include "core/layout/ng/inline/ng_physical_text_fragment.h" #include "core/layout/ng/ng_unpositioned_float.h"
diff --git a/third_party/WebKit/Source/core/scheduler/ThrottlingTest.cpp b/third_party/WebKit/Source/core/scheduler/ThrottlingTest.cpp index 8004271..7f3188a 100644 --- a/third_party/WebKit/Source/core/scheduler/ThrottlingTest.cpp +++ b/third_party/WebKit/Source/core/scheduler/ThrottlingTest.cpp
@@ -5,8 +5,8 @@ #include "core/testing/sim/SimRequest.h" #include "core/testing/sim/SimTest.h" #include "platform/scheduler/child/web_scheduler.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/Platform.h" #include "public/platform/WebThread.h" #include "public/platform/scheduler/renderer/renderer_scheduler.h"
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h index c8473f6..c9f936768 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyle.h +++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -27,12 +27,12 @@ #define ComputedStyle_h #include <memory> -#include "core/CSSPropertyNames.h" #include "core/ComputedStyleBase.h" #include "core/CoreExport.h" #include "core/css/StyleAutoColor.h" #include "core/css/StyleColor.h" #include "core/css/properties/CSSProperty.h" +#include "core/css_property_names.h" #include "core/style/BorderValue.h" #include "core/style/ComputedStyleConstants.h" #include "core/style/ComputedStyleInitialValues.h"
diff --git a/third_party/WebKit/Source/core/svg/SVGAnimateElement.h b/third_party/WebKit/Source/core/svg/SVGAnimateElement.h index 7a2dbcb..9f96417 100644 --- a/third_party/WebKit/Source/core/svg/SVGAnimateElement.h +++ b/third_party/WebKit/Source/core/svg/SVGAnimateElement.h
@@ -24,8 +24,8 @@ #define SVGAnimateElement_h #include <base/gtest_prod_util.h> -#include "core/CSSPropertyNames.h" #include "core/CoreExport.h" +#include "core/css_property_names.h" #include "core/svg/SVGAnimationElement.h" #include "core/svg_names.h" #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp index 4bc311f..6d1fa764 100644 --- a/third_party/WebKit/Source/core/svg/SVGImageElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGImageElement.cpp
@@ -21,8 +21,8 @@ #include "core/svg/SVGImageElement.h" -#include "core/CSSPropertyNames.h" #include "core/css/StyleChangeReason.h" +#include "core/css_property_names.h" #include "core/frame/UseCounter.h" #include "core/layout/LayoutImageResource.h" #include "core/layout/svg/LayoutSVGImage.h"
diff --git a/third_party/WebKit/Source/core/svg/SVGResource.cpp b/third_party/WebKit/Source/core/svg/SVGResource.cpp index 897ae7b2..966036b 100644 --- a/third_party/WebKit/Source/core/svg/SVGResource.cpp +++ b/third_party/WebKit/Source/core/svg/SVGResource.cpp
@@ -16,20 +16,13 @@ namespace blink { -SVGResource::SVGResource(TreeScope& tree_scope, const AtomicString& id) - : tree_scope_(tree_scope) { - target_ = SVGURIReference::ObserveTarget( - id_observer_, tree_scope, id, - WTF::BindRepeating(&SVGResource::TargetChanged, WrapWeakPersistent(this), - id)); -} +SVGResource::SVGResource() = default; + +SVGResource::~SVGResource() = default; void SVGResource::Trace(Visitor* visitor) { - visitor->Trace(tree_scope_); visitor->Trace(target_); - visitor->Trace(id_observer_); visitor->Trace(clients_); - visitor->Trace(pending_clients_); } void SVGResource::AddClient(SVGResourceClient& client) { @@ -40,51 +33,6 @@ clients_.erase(&client); } -void SVGResource::AddWatch(SVGElement& element) { - pending_clients_.insert(&element); - element.SetHasPendingResources(); -} - -void SVGResource::RemoveWatch(SVGElement& element) { - pending_clients_.erase(&element); -} - -bool SVGResource::IsEmpty() const { - LayoutSVGResourceContainer* container = ResourceContainer(); - return !HasClients() && (!container || !container->HasClients()) && - pending_clients_.IsEmpty(); -} - -void SVGResource::Unregister() { - SVGURIReference::UnobserveTarget(id_observer_); -} - -void SVGResource::NotifyPendingClients() { - HeapHashSet<Member<SVGElement>> pending_clients; - pending_clients.swap(pending_clients_); - - for (SVGElement* client_element : pending_clients) { - if (LayoutObject* layout_object = client_element->GetLayoutObject()) - SVGResourcesCache::ResourceReferenceChanged(*layout_object); - } -} - -void SVGResource::NotifyContentChanged() { - HeapVector<Member<SVGResourceClient>> clients; - CopyToVector(clients_, clients); - - for (SVGResourceClient* client : clients) - client->ResourceContentChanged(); -} - -void SVGResource::NotifyElementChanged() { - HeapVector<Member<SVGResourceClient>> clients; - CopyToVector(clients_, clients); - - for (SVGResourceClient* client : clients) - client->ResourceElementChanged(); -} - LayoutSVGResourceContainer* SVGResource::ResourceContainer() const { if (!target_) return nullptr; @@ -94,7 +42,61 @@ return ToLayoutSVGResourceContainer(layout_object); } -void SVGResource::TargetChanged(const AtomicString& id) { +LocalSVGResource::LocalSVGResource(TreeScope& tree_scope, + const AtomicString& id) + : tree_scope_(tree_scope) { + target_ = SVGURIReference::ObserveTarget( + id_observer_, tree_scope, id, + WTF::BindRepeating(&LocalSVGResource::TargetChanged, + WrapWeakPersistent(this), id)); +} + +void LocalSVGResource::AddWatch(SVGElement& element) { + pending_clients_.insert(&element); + element.SetHasPendingResources(); +} + +void LocalSVGResource::RemoveWatch(SVGElement& element) { + pending_clients_.erase(&element); +} + +bool LocalSVGResource::IsEmpty() const { + LayoutSVGResourceContainer* container = ResourceContainer(); + return !HasClients() && (!container || !container->HasClients()) && + pending_clients_.IsEmpty(); +} + +void LocalSVGResource::Unregister() { + SVGURIReference::UnobserveTarget(id_observer_); +} + +void LocalSVGResource::NotifyPendingClients() { + HeapHashSet<Member<SVGElement>> pending_clients; + pending_clients.swap(pending_clients_); + + for (SVGElement* client_element : pending_clients) { + if (LayoutObject* layout_object = client_element->GetLayoutObject()) + SVGResourcesCache::ResourceReferenceChanged(*layout_object); + } +} + +void LocalSVGResource::NotifyContentChanged() { + HeapVector<Member<SVGResourceClient>> clients; + CopyToVector(clients_, clients); + + for (SVGResourceClient* client : clients) + client->ResourceContentChanged(); +} + +void LocalSVGResource::NotifyElementChanged() { + HeapVector<Member<SVGResourceClient>> clients; + CopyToVector(clients_, clients); + + for (SVGResourceClient* client : clients) + client->ResourceElementChanged(); +} + +void LocalSVGResource::TargetChanged(const AtomicString& id) { Element* new_target = tree_scope_->getElementById(id); if (new_target == target_) return; @@ -107,4 +109,11 @@ NotifyPendingClients(); } +void LocalSVGResource::Trace(Visitor* visitor) { + visitor->Trace(tree_scope_); + visitor->Trace(id_observer_); + visitor->Trace(pending_clients_); + SVGResource::Trace(visitor); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/svg/SVGResource.h b/third_party/WebKit/Source/core/svg/SVGResource.h index d16d5bb8..95fbcdd 100644 --- a/third_party/WebKit/Source/core/svg/SVGResource.h +++ b/third_party/WebKit/Source/core/svg/SVGResource.h
@@ -21,9 +21,9 @@ // A class tracking a reference to an SVG resource (an element that constitutes // a paint server, mask, clip-path, filter et.c.) -class SVGResource : public GarbageCollected<SVGResource> { +class SVGResource : public GarbageCollectedFinalized<SVGResource> { public: - SVGResource(TreeScope&, const AtomicString& id); + virtual ~SVGResource(); Element* Target() const { return target_; } LayoutSVGResourceContainer* ResourceContainer() const; @@ -33,6 +33,23 @@ bool HasClients() const { return !clients_.IsEmpty(); } + virtual void Trace(Visitor*); + + protected: + SVGResource(); + + Member<Element> target_; + HeapHashCountedSet<Member<SVGResourceClient>> clients_; + + private: + DISALLOW_COPY_AND_ASSIGN(SVGResource); +}; + +// Local resource reference (see SVGResource.) +class LocalSVGResource final : public SVGResource { + public: + LocalSVGResource(TreeScope&, const AtomicString& id); + void AddWatch(SVGElement&); void RemoveWatch(SVGElement&); @@ -40,22 +57,18 @@ bool IsEmpty() const; - void Trace(Visitor*); - void NotifyPendingClients(); void NotifyContentChanged(); + void Trace(Visitor*) override; + private: void TargetChanged(const AtomicString& id); void NotifyElementChanged(); Member<TreeScope> tree_scope_; - Member<Element> target_; Member<IdTargetObserver> id_observer_; - HeapHashCountedSet<Member<SVGResourceClient>> clients_; HeapHashSet<Member<SVGElement>> pending_clients_; - - DISALLOW_COPY_AND_ASSIGN(SVGResource); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp index 8b2ab50..c134d30 100644 --- a/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp +++ b/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
@@ -22,8 +22,8 @@ #include "bindings/core/v8/ExceptionMessages.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" #include "core/CSSValueKeywords.h" +#include "core/css_property_names.h" #include "core/editing/FrameSelection.h" #include "core/frame/LocalFrame.h" #include "core/frame/UseCounter.h"
diff --git a/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.cpp b/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.cpp index 6a7b686..d7395c8c 100644 --- a/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.cpp +++ b/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.cpp
@@ -17,16 +17,16 @@ SVGTreeScopeResources::~SVGTreeScopeResources() = default; -SVGResource* SVGTreeScopeResources::ResourceForId(const AtomicString& id) { +LocalSVGResource* SVGTreeScopeResources::ResourceForId(const AtomicString& id) { if (id.IsEmpty()) return nullptr; auto& entry = resources_.insert(id, nullptr).stored_value->value; if (!entry) - entry = new SVGResource(*tree_scope_, id); + entry = new LocalSVGResource(*tree_scope_, id); return entry; } -SVGResource* SVGTreeScopeResources::ExistingResourceForId( +LocalSVGResource* SVGTreeScopeResources::ExistingResourceForId( const AtomicString& id) const { if (id.IsEmpty()) return nullptr; @@ -39,7 +39,7 @@ // Remove resources that are no longer referenced. Vector<AtomicString> to_be_removed; for (const auto& entry : resources_) { - SVGResource* resource = entry.value.Get(); + LocalSVGResource* resource = entry.value.Get(); DCHECK(resource); if (resource->IsEmpty()) { resource->Unregister(); @@ -55,7 +55,7 @@ // Remove the element from pending resources. Vector<AtomicString> to_be_removed; for (const auto& entry : resources_) { - SVGResource* resource = entry.value.Get(); + LocalSVGResource* resource = entry.value.Get(); DCHECK(resource); resource->RemoveWatch(element); if (resource->IsEmpty()) {
diff --git a/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h b/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h index e6e8703a..117119f 100644 --- a/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h +++ b/third_party/WebKit/Source/core/svg/SVGTreeScopeResources.h
@@ -12,8 +12,8 @@ namespace blink { +class LocalSVGResource; class SVGElement; -class SVGResource; class TreeScope; // This class keeps track of SVG resources and pending references to such for a @@ -25,8 +25,8 @@ explicit SVGTreeScopeResources(TreeScope*); ~SVGTreeScopeResources(); - SVGResource* ResourceForId(const AtomicString& id); - SVGResource* ExistingResourceForId(const AtomicString& id) const; + LocalSVGResource* ResourceForId(const AtomicString& id); + LocalSVGResource* ExistingResourceForId(const AtomicString& id) const; void RemoveUnreferencedResources(); void RemoveWatchesForElement(SVGElement&); @@ -34,7 +34,7 @@ void Trace(blink::Visitor*); private: - HeapHashMap<AtomicString, Member<SVGResource>> resources_; + HeapHashMap<AtomicString, Member<LocalSVGResource>> resources_; Member<TreeScope> tree_scope_; DISALLOW_COPY_AND_ASSIGN(SVGTreeScopeResources);
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp index 365c9b6..e6ecdb9 100644 --- a/third_party/WebKit/Source/core/testing/Internals.cpp +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -36,12 +36,12 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseResolver.h" #include "bindings/core/v8/V8IteratorResultValue.h" -#include "core/CSSPropertyNames.h" #include "core/StylePropertyShorthand.h" #include "core/animation/DocumentTimeline.h" #include "core/css/SelectRuleFeatureSet.h" #include "core/css/StyleEngine.h" #include "core/css/properties/CSSUnresolvedProperty.h" +#include "core/css_property_names.h" #include "core/dom/DOMNodeIds.h" #include "core/dom/DOMStringList.h" #include "core/dom/Document.h"
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js index 9412ea1b..19452451 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -547,6 +547,7 @@ case 'regexp': case 'symbol': case 'undefined': + case 'bigint': element = this._formatParameterAsValue(output); break; default:
diff --git a/third_party/WebKit/Source/devtools/front_end/externs.js b/third_party/WebKit/Source/devtools/front_end/externs.js index 4aa1541..db622bb 100644 --- a/third_party/WebKit/Source/devtools/front_end/externs.js +++ b/third_party/WebKit/Source/devtools/front_end/externs.js
@@ -195,6 +195,15 @@ */ Int32Array.prototype.lowerBound = function(object, comparator, left, right) {}; +// TODO(luoe): remove these BigInt types once closure supports them. +/** + * @param {number|string} value + */ +const BigInt = function(value) {}; + +/** @typedef {*} */ +const bigint = null; + // File System API /** * @constructor
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js index 905bd26..8463752 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/FormatterWorker.js
@@ -100,7 +100,7 @@ * @param {string} content */ FormatterWorker.evaluatableJavaScriptSubstring = function(content) { - const tokenizer = acorn.tokenizer(content, {ecmaVersion: 8}); + const tokenizer = acorn.tokenizer(content, {ecmaVersion: 9}); let result = ''; try { let token = tokenizer.getToken(); @@ -143,7 +143,7 @@ */ FormatterWorker.preprocessTopLevelAwaitExpressions = function(content) { let wrapped = '(async () => {' + content + '})()'; - const root = acorn.parse(wrapped, {ecmaVersion: 8}); + const root = acorn.parse(wrapped, {ecmaVersion: 9}); const body = root.body[0].expression.callee.body; const changes = []; let containsAwait = false; @@ -227,7 +227,7 @@ * @param {string} content */ FormatterWorker.javaScriptIdentifiers = function(content) { - const root = acorn.parse(content, {ranges: false, ecmaVersion: 8}); + const root = acorn.parse(content, {ranges: false, ecmaVersion: 9}); /** @type {!Array<!ESTree.Node>} */ const identifiers = [];
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/AUTHORS b/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/AUTHORS new file mode 100644 index 0000000..86c8d9b --- /dev/null +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/AUTHORS
@@ -0,0 +1,75 @@ +List of Acorn contributors. Updated before every release. + +Adrian Heine +Adrian Rakovsky +Alistair Braidwood +Amila Welihinda +Andres Suarez +Angelo +Aparajita Fishman +Arian Stolwijk +Artem Govorov +Boopesh Mahendran +Bradley Heinz +Brandon Mills +Charles Hughes +Charmander +Conrad Irwin +Daniel Tschinder +David Bonnet +Domenico Matteo +ehmicky +Felix Maier +Forbes Lindesay +Gilad Peleg +impinball +Ingvar Stepanyan +Jackson Ray Hamilton +Jesse McCarthy +Jiaxing Wang +Joel Kemp +Johannes Herr +John-David Dalton +Jordan Klassen +Jürg Lehni +Kai Cataldo +keeyipchan +Keheliya Gallaba +Kevin Irish +Kevin Kwok +krator +laosb +Marek +Marijn Haverbeke +Martin Carlberg +Mat Garcia +Mathias Bynens +Mathieu 'p01' Henri +Matthew Bastien +Max Schaefer +Max Zerzouri +Mihai Bazon +Mike Rennie +naoh +Nicholas C. Zakas +Nick Fitzgerald +Olivier Thomann +Oskar Schöldström +Paul Harper +Peter Rust +PlNG +Prayag Verma +ReadmeCritic +r-e-d +Richard Gibson +Rich Harris +Sebastian McKenzie +Shahar Soel +Sheel Bedi +Simen Bekkhus +Teddy Katz +Timothy Gu +Toru Nagashima +Victor Homyakov +Wexpo Lyu +zsjforcn
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/LICENSE b/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/LICENSE index d4c7fc58..2c0632b 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/LICENSE +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/LICENSE
@@ -1,4 +1,4 @@ -Copyright (C) 2012-2014 by various contributors (see AUTHORS) +Copyright (C) 2012-2018 by various contributors (see AUTHORS) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
diff --git a/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/acorn.js b/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/acorn.js index 5d10b53..b8e0efe 100644 --- a/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/acorn.js +++ b/third_party/WebKit/Source/devtools/front_end/formatter_worker/acorn/acorn.js
@@ -2,7 +2,7 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : - (factory((global.acorn = global.acorn || {}))); + (factory((global.acorn = {}))); }(this, (function (exports) { 'use strict'; // Reserved word lists for various dialects of the language @@ -13,16 +13,18 @@ 6: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" -} +}; // And the keywords -var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this" +var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; var keywords = { 5: ecma5AndLessKeywords, 6: ecma5AndLessKeywords + " const class extends export import super" -} +}; + +var keywordRelationalOperator = /^in(stanceof)?$/; // ## Character categories @@ -32,58 +34,62 @@ // code point above 128. // Generated by `bin/generate-identifier-regex.js`. -var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fd5\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ae\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc" -var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d4-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d01-\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf8\u1cf9\u1dc0-\u1df5\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f" +var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312e\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fea\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ae\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab65\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc"; +var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d4-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f"; -var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]") -var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]") +var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); +var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null +nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; // These are a run-length and offset encoded representation of the // >0xffff code points that are a valid part of identifiers. The // offset starts at 0x10000, and each pair of numbers represents an // offset to the next range, and then a size of the range. They were // generated by bin/generate-identifier-regex.js -var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,17,26,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,449,56,264,8,2,36,18,0,50,29,881,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,0,32,6124,20,754,9486,1,3071,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,10591,541] -var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,838,7,2,7,17,9,57,21,2,13,19882,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239] + +// eslint-disable-next-line comma-spacing +var astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,26,45,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,785,52,76,44,33,24,27,35,42,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,54,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,86,25,391,63,32,0,257,0,11,39,8,0,22,0,12,39,3,3,55,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,698,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,881,68,12,0,67,12,65,1,31,6124,20,754,9486,286,82,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,4149,196,60,67,1213,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541]; + +// eslint-disable-next-line comma-spacing +var astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,1306,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,52,0,13,2,49,13,10,2,4,9,83,11,7,0,161,11,6,9,7,3,57,0,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,87,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,423,9,280,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,19719,9,135,4,60,6,26,9,1016,45,17,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,2214,6,110,6,6,9,792487,239]; // This has a complexity linear to the value of the code. The // assumption is that looking up astral identifier characters is // rare. function isInAstralSet(code, set) { - var pos = 0x10000 + var pos = 0x10000; for (var i = 0; i < set.length; i += 2) { - pos += set[i] - if (pos > code) return false - pos += set[i + 1] - if (pos >= code) return true + pos += set[i]; + if (pos > code) { return false } + pos += set[i + 1]; + if (pos >= code) { return true } } } // Test whether a given character code starts an identifier. function isIdentifierStart(code, astral) { - if (code < 65) return code === 36 - if (code < 91) return true - if (code < 97) return code === 95 - if (code < 123) return true - if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) - if (astral === false) return false + if (code < 65) { return code === 36 } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) } + if (astral === false) { return false } return isInAstralSet(code, astralIdentifierStartCodes) } // Test whether a given character is part of an identifier. function isIdentifierChar(code, astral) { - if (code < 48) return code === 36 - if (code < 58) return true - if (code < 65) return false - if (code < 91) return true - if (code < 97) return code === 95 - if (code < 123) return true - if (code <= 0xffff) return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) - if (astral === false) return false + if (code < 48) { return code === 36 } + if (code < 58) { return true } + if (code < 65) { return false } + if (code < 91) { return true } + if (code < 97) { return code === 95 } + if (code < 123) { return true } + if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) } + if (astral === false) { return false } return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes) } @@ -113,16 +119,16 @@ var TokenType = function TokenType(label, conf) { if ( conf === void 0 ) conf = {}; - this.label = label - this.keyword = conf.keyword - this.beforeExpr = !!conf.beforeExpr - this.startsExpr = !!conf.startsExpr - this.isLoop = !!conf.isLoop - this.isAssign = !!conf.isAssign - this.prefix = !!conf.prefix - this.postfix = !!conf.postfix - this.binop = conf.binop || null - this.updateContext = null + this.label = label; + this.keyword = conf.keyword; + this.beforeExpr = !!conf.beforeExpr; + this.startsExpr = !!conf.startsExpr; + this.isLoop = !!conf.isLoop; + this.isAssign = !!conf.isAssign; + this.prefix = !!conf.prefix; + this.postfix = !!conf.postfix; + this.binop = conf.binop || null; + this.updateContext = null; }; function binop(name, prec) { @@ -130,19 +136,20 @@ } var beforeExpr = {beforeExpr: true}; var startsExpr = {startsExpr: true}; + // Map keyword names to token types. -var keywordTypes = {} +var keywords$1 = {}; // Succinct definitions of keyword token types function kw(name, options) { if ( options === void 0 ) options = {}; - options.keyword = name - return keywordTypes[name] = new TokenType(name, options) + options.keyword = name; + return keywords$1[name] = new TokenType(name, options) } -var tt = { +var types = { num: new TokenType("num", startsExpr), regexp: new TokenType("regexp", startsExpr), string: new TokenType("string", startsExpr), @@ -163,6 +170,7 @@ question: new TokenType("?", beforeExpr), arrow: new TokenType("=>", beforeExpr), template: new TokenType("template"), + invalidTemplate: new TokenType("invalidTemplate"), ellipsis: new TokenType("...", beforeExpr), backQuote: new TokenType("`", startsExpr), dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}), @@ -184,15 +192,15 @@ eq: new TokenType("=", {beforeExpr: true, isAssign: true}), assign: new TokenType("_=", {beforeExpr: true, isAssign: true}), incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}), - prefix: new TokenType("prefix", {beforeExpr: true, prefix: true, startsExpr: true}), + prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}), logicalOR: binop("||", 1), logicalAND: binop("&&", 2), bitwiseOR: binop("|", 3), bitwiseXOR: binop("^", 4), bitwiseAND: binop("&", 5), - equality: binop("==/!=", 6), - relational: binop("</>", 7), - bitShift: binop("<</>>", 8), + equality: binop("==/!=/===/!==", 6), + relational: binop("</>/<=/>=", 7), + bitShift: binop("<</>>/>>>", 8), plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}), modulo: binop("%", 10), star: binop("*", 10), @@ -223,7 +231,7 @@ _new: kw("new", {beforeExpr: true, startsExpr: true}), _this: kw("this", startsExpr), _super: kw("super", startsExpr), - _class: kw("class"), + _class: kw("class", startsExpr), _extends: kw("extends", beforeExpr), _export: kw("export"), _import: kw("import"), @@ -235,38 +243,42 @@ _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}), _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}), _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true}) -} +}; // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. -var lineBreak = /\r\n?|\n|\u2028|\u2029/ -var lineBreakG = new RegExp(lineBreak.source, "g") +var lineBreak = /\r\n?|\n|\u2028|\u2029/; +var lineBreakG = new RegExp(lineBreak.source, "g"); function isNewLine(code) { return code === 10 || code === 13 || code === 0x2028 || code === 0x2029 } -var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/ +var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; -var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g +var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; -function isArray(obj) { - return Object.prototype.toString.call(obj) === "[object Array]" -} +var ref = Object.prototype; +var hasOwnProperty = ref.hasOwnProperty; +var toString = ref.toString; // Checks if an object has a property. function has(obj, propName) { - return Object.prototype.hasOwnProperty.call(obj, propName) + return hasOwnProperty.call(obj, propName) } +var isArray = Array.isArray || (function (obj) { return ( + toString.call(obj) === "[object Array]" +); }); + // These are used when `options.locations` is on, for the // `startLoc` and `endLoc` properties. var Position = function Position(line, col) { - this.line = line - this.column = col + this.line = line; + this.column = col; }; Position.prototype.offset = function offset (n) { @@ -274,9 +286,9 @@ }; var SourceLocation = function SourceLocation(p, start, end) { - this.start = start - this.end = end - if (p.sourceFile !== null) this.source = p.sourceFile + this.start = start; + this.end = end; + if (p.sourceFile !== null) { this.source = p.sourceFile; } }; // The `getLineInfo` function is mostly useful when the @@ -287,11 +299,11 @@ function getLineInfo(input, offset) { for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur - var match = lineBreakG.exec(input) + lineBreakG.lastIndex = cur; + var match = lineBreakG.exec(input); if (match && match.index < offset) { - ++line - cur = match.index + match[0].length + ++line; + cur = match.index + match[0].length; } else { return new Position(line, offset - cur) } @@ -381,128 +393,136 @@ // (non-standard) ParenthesizedExpression nodes preserveParens: false, plugins: {} -} +}; // Interpret and default an options object function getOptions(opts) { - var options = {} + var options = {}; for (var opt in defaultOptions) - options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt] + { options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; } if (options.ecmaVersion >= 2015) - options.ecmaVersion -= 2009 + { options.ecmaVersion -= 2009; } if (options.allowReserved == null) - options.allowReserved = options.ecmaVersion < 5 + { options.allowReserved = options.ecmaVersion < 5; } if (isArray(options.onToken)) { - var tokens = options.onToken - options.onToken = function (token) { return tokens.push(token); } + var tokens = options.onToken; + options.onToken = function (token) { return tokens.push(token); }; } if (isArray(options.onComment)) - options.onComment = pushComment(options, options.onComment) + { options.onComment = pushComment(options, options.onComment); } return options } function pushComment(options, array) { - return function (block, text, start, end, startLoc, endLoc) { + return function(block, text, start, end, startLoc, endLoc) { var comment = { - type: block ? 'Block' : 'Line', + type: block ? "Block" : "Line", value: text, start: start, end: end - } + }; if (options.locations) - comment.loc = new SourceLocation(this, startLoc, endLoc) + { comment.loc = new SourceLocation(this, startLoc, endLoc); } if (options.ranges) - comment.range = [start, end] - array.push(comment) + { comment.range = [start, end]; } + array.push(comment); } } // Registered plugins -var plugins = {} +var plugins = {}; function keywordRegexp(words) { - return new RegExp("^(" + words.replace(/ /g, "|") + ")$") + return new RegExp("^(?:" + words.replace(/ /g, "|") + ")$") } var Parser = function Parser(options, input, startPos) { - this.options = options = getOptions(options) - this.sourceFile = options.sourceFile - this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]) - var reserved = "" + this.options = options = getOptions(options); + this.sourceFile = options.sourceFile; + this.keywords = keywordRegexp(keywords[options.ecmaVersion >= 6 ? 6 : 5]); + var reserved = ""; if (!options.allowReserved) { for (var v = options.ecmaVersion;; v--) - if (reserved = reservedWords[v]) break - if (options.sourceType == "module") reserved += " await" + { if (reserved = reservedWords[v]) { break } } + if (options.sourceType == "module") { reserved += " await"; } } - this.reservedWords = keywordRegexp(reserved) - var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict - this.reservedWordsStrict = keywordRegexp(reservedStrict) - this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + reservedWords.strictBind) - this.input = String(input) + this.reservedWords = keywordRegexp(reserved); + var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict; + this.reservedWordsStrict = keywordRegexp(reservedStrict); + this.reservedWordsStrictBind = keywordRegexp(reservedStrict + " " + reservedWords.strictBind); + this.input = String(input); // Used to signal to callers of `readWord1` whether the word // contained any escape sequences. This is needed because words with // escape sequences must not be interpreted as keywords. - this.containsEsc = false + this.containsEsc = false; // Load plugins - this.loadPlugins(options.plugins) + this.loadPlugins(options.plugins); // Set up token state // The current position of the tokenizer in the input. if (startPos) { - this.pos = startPos - this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1 - this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length + this.pos = startPos; + this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1; + this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; } else { - this.pos = this.lineStart = 0 - this.curLine = 1 + this.pos = this.lineStart = 0; + this.curLine = 1; } // Properties of the current token: // Its type - this.type = tt.eof + this.type = types.eof; // For tokens that include more information than their type, the value - this.value = null + this.value = null; // Its start and end offset - this.start = this.end = this.pos + this.start = this.end = this.pos; // And, if locations are used, the {line, column} object // corresponding to those offsets - this.startLoc = this.endLoc = this.curPosition() + this.startLoc = this.endLoc = this.curPosition(); // Position information for the previous token - this.lastTokEndLoc = this.lastTokStartLoc = null - this.lastTokStart = this.lastTokEnd = this.pos + this.lastTokEndLoc = this.lastTokStartLoc = null; + this.lastTokStart = this.lastTokEnd = this.pos; // The context stack is used to superficially track syntactic // context to predict whether a regular expression is allowed in a // given position. - this.context = this.initialContext() - this.exprAllowed = true + this.context = this.initialContext(); + this.exprAllowed = true; // Figure out if it's a module code. - this.strict = this.inModule = options.sourceType === "module" + this.inModule = options.sourceType === "module"; + this.strict = this.inModule || this.strictDirective(this.pos); // Used to signify the start of a potential arrow function - this.potentialArrowAt = -1 + this.potentialArrowAt = -1; // Flags to track whether we are in a function, a generator, an async function. - this.inFunction = this.inGenerator = this.inAsync = false + this.inFunction = this.inGenerator = this.inAsync = false; // Positions to delayed-check that yield/await does not exist in default parameters. - this.yieldPos = this.awaitPos = 0 + this.yieldPos = this.awaitPos = 0; // Labels in scope. - this.labels = [] + this.labels = []; // If enabled, skip leading hashbang line. - if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === '#!') - this.skipLineComment(2) + if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!") + { this.skipLineComment(2); } + + // Scope tracking for duplicate variable names (see scope.js) + this.scopeStack = []; + this.enterFunctionScope(); + + // For RegExp validation + this.regexpState = null; }; // DEPRECATED Kept for backwards compatibility until 3.0 in case a plugin uses them @@ -510,138 +530,163 @@ Parser.prototype.isReservedWord = function isReservedWord (word) { return this.reservedWords.test(word) }; Parser.prototype.extend = function extend (name, f) { - this[name] = f(this[name]) + this[name] = f(this[name]); }; Parser.prototype.loadPlugins = function loadPlugins (pluginConfigs) { var this$1 = this; for (var name in pluginConfigs) { - var plugin = plugins[name] - if (!plugin) throw new Error("Plugin '" + name + "' not found") - plugin(this$1, pluginConfigs[name]) + var plugin = plugins[name]; + if (!plugin) { throw new Error("Plugin '" + name + "' not found") } + plugin(this$1, pluginConfigs[name]); } }; Parser.prototype.parse = function parse () { - var node = this.options.program || this.startNode() - this.nextToken() + var node = this.options.program || this.startNode(); + this.nextToken(); return this.parseTopLevel(node) }; -var pp = Parser.prototype +var pp = Parser.prototype; // ## Parser utilities -// Test whether a statement node is the string literal `"use strict"`. +var literal = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/; +pp.strictDirective = function(start) { + var this$1 = this; -pp.isUseStrict = function(stmt) { - return this.options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && - stmt.expression.type === "Literal" && - stmt.expression.raw.slice(1, -1) === "use strict" -} + for (;;) { + skipWhiteSpace.lastIndex = start; + start += skipWhiteSpace.exec(this$1.input)[0].length; + var match = literal.exec(this$1.input.slice(start)); + if (!match) { return false } + if ((match[1] || match[2]) == "use strict") { return true } + start += match[0].length; + } +}; // Predicate that tests whether the next token is of the given // type, and if yes, consumes it as a side effect. pp.eat = function(type) { if (this.type === type) { - this.next() + this.next(); return true } else { return false } -} +}; // Tests whether parsed token is a contextual keyword. pp.isContextual = function(name) { - return this.type === tt.name && this.value === name -} + return this.type === types.name && this.value === name && !this.containsEsc +}; // Consumes contextual keyword if possible. pp.eatContextual = function(name) { - return this.value === name && this.eat(tt.name) -} + if (!this.isContextual(name)) { return false } + this.next(); + return true +}; // Asserts that following token is given contextual keyword. pp.expectContextual = function(name) { - if (!this.eatContextual(name)) this.unexpected() -} + if (!this.eatContextual(name)) { this.unexpected(); } +}; // Test whether a semicolon can be inserted at the current position. pp.canInsertSemicolon = function() { - return this.type === tt.eof || - this.type === tt.braceR || + return this.type === types.eof || + this.type === types.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) -} +}; pp.insertSemicolon = function() { if (this.canInsertSemicolon()) { if (this.options.onInsertedSemicolon) - this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc) + { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); } return true } -} +}; // Consume a semicolon, or, failing that, see if we are allowed to // pretend that there is a semicolon at this position. pp.semicolon = function() { - if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected() -} + if (!this.eat(types.semi) && !this.insertSemicolon()) { this.unexpected(); } +}; pp.afterTrailingComma = function(tokType, notNext) { if (this.type == tokType) { if (this.options.onTrailingComma) - this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc) + { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); } if (!notNext) - this.next() + { this.next(); } return true } -} +}; // Expect a token of a given type. If found, consume it, otherwise, // raise an unexpected token error. pp.expect = function(type) { - this.eat(type) || this.unexpected() -} + this.eat(type) || this.unexpected(); +}; // Raise an unexpected token error. pp.unexpected = function(pos) { - this.raise(pos != null ? pos : this.start, "Unexpected token") -} - -var DestructuringErrors = function DestructuringErrors() { - this.shorthandAssign = 0 - this.trailingComma = 0 + this.raise(pos != null ? pos : this.start, "Unexpected token"); }; -pp.checkPatternErrors = function(refDestructuringErrors, andThrow) { - var trailing = refDestructuringErrors && refDestructuringErrors.trailingComma - if (!andThrow) return !!trailing - if (trailing) this.raise(trailing, "Comma is not permitted after the rest element") +function DestructuringErrors() { + this.shorthandAssign = + this.trailingComma = + this.parenthesizedAssign = + this.parenthesizedBind = + this.doubleProto = + -1; } +pp.checkPatternErrors = function(refDestructuringErrors, isAssign) { + if (!refDestructuringErrors) { return } + if (refDestructuringErrors.trailingComma > -1) + { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); } + var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind; + if (parens > -1) { this.raiseRecoverable(parens, "Parenthesized pattern"); } +}; + pp.checkExpressionErrors = function(refDestructuringErrors, andThrow) { - var pos = refDestructuringErrors && refDestructuringErrors.shorthandAssign - if (!andThrow) return !!pos - if (pos) this.raise(pos, "Shorthand property assignments are valid only in destructuring patterns") -} + if (!refDestructuringErrors) { return false } + var shorthandAssign = refDestructuringErrors.shorthandAssign; + var doubleProto = refDestructuringErrors.doubleProto; + if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 } + if (shorthandAssign >= 0) + { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); } + if (doubleProto >= 0) + { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); } +}; pp.checkYieldAwaitInDefaultParams = function() { if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos)) - this.raise(this.yieldPos, "Yield expression cannot be a default value") + { this.raise(this.yieldPos, "Yield expression cannot be a default value"); } if (this.awaitPos) - this.raise(this.awaitPos, "Await expression cannot be a default value") -} + { this.raise(this.awaitPos, "Await expression cannot be a default value"); } +}; -var pp$1 = Parser.prototype +pp.isSimpleAssignTarget = function(expr) { + if (expr.type === "ParenthesizedExpression") + { return this.isSimpleAssignTarget(expr.expression) } + return expr.type === "Identifier" || expr.type === "MemberExpression" +}; + +var pp$1 = Parser.prototype; // ### Statement parsing @@ -653,53 +698,52 @@ pp$1.parseTopLevel = function(node) { var this$1 = this; - var first = true, exports = {} - if (!node.body) node.body = [] - while (this.type !== tt.eof) { - var stmt = this$1.parseStatement(true, true, exports) - node.body.push(stmt) - if (first) { - if (this$1.isUseStrict(stmt)) this$1.setStrict(true) - first = false - } + var exports = {}; + if (!node.body) { node.body = []; } + while (this.type !== types.eof) { + var stmt = this$1.parseStatement(true, true, exports); + node.body.push(stmt); } - this.next() + this.adaptDirectivePrologue(node.body); + this.next(); if (this.options.ecmaVersion >= 6) { - node.sourceType = this.options.sourceType + node.sourceType = this.options.sourceType; } return this.finishNode(node, "Program") -} +}; var loopLabel = {kind: "loop"}; var switchLabel = {kind: "switch"}; + pp$1.isLet = function() { - if (this.type !== tt.name || this.options.ecmaVersion < 6 || this.value != "let") return false - skipWhiteSpace.lastIndex = this.pos - var skip = skipWhiteSpace.exec(this.input) - var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next) - if (nextCh === 91 || nextCh == 123) return true // '{' and '[' + if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false } + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next); + if (nextCh === 91 || nextCh == 123) { return true } // '{' and '[' if (isIdentifierStart(nextCh, true)) { - for (var pos = next + 1; isIdentifierChar(this.input.charCodeAt(pos), true); ++pos) {} - var ident = this.input.slice(next, pos) - if (!this.isKeyword(ident)) return true + var pos = next + 1; + while (isIdentifierChar(this.input.charCodeAt(pos), true)) { ++pos; } + var ident = this.input.slice(next, pos); + if (!keywordRelationalOperator.test(ident)) { return true } } return false -} +}; // check 'async [no LineTerminator here] function' // - 'async /*foo*/ function' is OK. // - 'async /*\n*/ function' is invalid. pp$1.isAsyncFunction = function() { - if (this.type !== tt.name || this.options.ecmaVersion < 8 || this.value != "async") - return false + if (this.options.ecmaVersion < 8 || !this.isContextual("async")) + { return false } - skipWhiteSpace.lastIndex = this.pos - var skip = skipWhiteSpace.exec(this.input) - var next = this.pos + skip[0].length + skipWhiteSpace.lastIndex = this.pos; + var skip = skipWhiteSpace.exec(this.input); + var next = this.pos + skip[0].length; return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 == this.input.length || !isIdentifierChar(this.input.charAt(next + 8))) -} +}; // Parse a single statement. // @@ -709,11 +753,11 @@ // does not help. pp$1.parseStatement = function(declaration, topLevel, exports) { - var starttype = this.type, node = this.startNode(), kind + var starttype = this.type, node = this.startNode(), kind; if (this.isLet()) { - starttype = tt._var - kind = "let" + starttype = types._var; + kind = "let"; } // Most types of statements are recognized by the keyword they @@ -721,38 +765,38 @@ // complexity. switch (starttype) { - case tt._break: case tt._continue: return this.parseBreakContinueStatement(node, starttype.keyword) - case tt._debugger: return this.parseDebuggerStatement(node) - case tt._do: return this.parseDoStatement(node) - case tt._for: return this.parseForStatement(node) - case tt._function: - if (!declaration && this.options.ecmaVersion >= 6) this.unexpected() + case types._break: case types._continue: return this.parseBreakContinueStatement(node, starttype.keyword) + case types._debugger: return this.parseDebuggerStatement(node) + case types._do: return this.parseDoStatement(node) + case types._for: return this.parseForStatement(node) + case types._function: + if (!declaration && this.options.ecmaVersion >= 6) { this.unexpected(); } return this.parseFunctionStatement(node, false) - case tt._class: - if (!declaration) this.unexpected() + case types._class: + if (!declaration) { this.unexpected(); } return this.parseClass(node, true) - case tt._if: return this.parseIfStatement(node) - case tt._return: return this.parseReturnStatement(node) - case tt._switch: return this.parseSwitchStatement(node) - case tt._throw: return this.parseThrowStatement(node) - case tt._try: return this.parseTryStatement(node) - case tt._const: case tt._var: - kind = kind || this.value - if (!declaration && kind != "var") this.unexpected() + case types._if: return this.parseIfStatement(node) + case types._return: return this.parseReturnStatement(node) + case types._switch: return this.parseSwitchStatement(node) + case types._throw: return this.parseThrowStatement(node) + case types._try: return this.parseTryStatement(node) + case types._const: case types._var: + kind = kind || this.value; + if (!declaration && kind != "var") { this.unexpected(); } return this.parseVarStatement(node, kind) - case tt._while: return this.parseWhileStatement(node) - case tt._with: return this.parseWithStatement(node) - case tt.braceL: return this.parseBlock() - case tt.semi: return this.parseEmptyStatement(node) - case tt._export: - case tt._import: + case types._while: return this.parseWhileStatement(node) + case types._with: return this.parseWithStatement(node) + case types.braceL: return this.parseBlock() + case types.semi: return this.parseEmptyStatement(node) + case types._export: + case types._import: if (!this.options.allowImportExportEverywhere) { if (!topLevel) - this.raise(this.start, "'import' and 'export' may only appear at the top level") + { this.raise(this.start, "'import' and 'export' may only appear at the top level"); } if (!this.inModule) - this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'") + { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); } } - return starttype === tt._import ? this.parseImport(node) : this.parseExport(node, exports) + return starttype === types._import ? this.parseImport(node) : this.parseExport(node, exports) // If the statement does not start with a statement keyword or a // brace, it's an ExpressionStatement or LabeledStatement. We @@ -760,62 +804,64 @@ // next token is a colon and the expression was a simple // Identifier node, we switch to interpreting it as a label. default: - if (this.isAsyncFunction() && declaration) { - this.next() + if (this.isAsyncFunction()) { + if (!declaration) { this.unexpected(); } + this.next(); return this.parseFunctionStatement(node, true) } - var maybeName = this.value, expr = this.parseExpression() - if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) - return this.parseLabeledStatement(node, maybeName, expr) - else return this.parseExpressionStatement(node, expr) + var maybeName = this.value, expr = this.parseExpression(); + if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) + { return this.parseLabeledStatement(node, maybeName, expr) } + else { return this.parseExpressionStatement(node, expr) } } -} +}; pp$1.parseBreakContinueStatement = function(node, keyword) { var this$1 = this; - var isBreak = keyword == "break" - this.next() - if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null - else if (this.type !== tt.name) this.unexpected() + var isBreak = keyword == "break"; + this.next(); + if (this.eat(types.semi) || this.insertSemicolon()) { node.label = null; } + else if (this.type !== types.name) { this.unexpected(); } else { - node.label = this.parseIdent() - this.semicolon() + node.label = this.parseIdent(); + this.semicolon(); } // Verify that there is an actual destination to break or // continue to. - for (var i = 0; i < this.labels.length; ++i) { - var lab = this$1.labels[i] + var i = 0; + for (; i < this.labels.length; ++i) { + var lab = this$1.labels[i]; if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break - if (node.label && isBreak) break + if (lab.kind != null && (isBreak || lab.kind === "loop")) { break } + if (node.label && isBreak) { break } } } - if (i === this.labels.length) this.raise(node.start, "Unsyntactic " + keyword) + if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); } return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement") -} +}; pp$1.parseDebuggerStatement = function(node) { - this.next() - this.semicolon() + this.next(); + this.semicolon(); return this.finishNode(node, "DebuggerStatement") -} +}; pp$1.parseDoStatement = function(node) { - this.next() - this.labels.push(loopLabel) - node.body = this.parseStatement(false) - this.labels.pop() - this.expect(tt._while) - node.test = this.parseParenExpression() + this.next(); + this.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.labels.pop(); + this.expect(types._while); + node.test = this.parseParenExpression(); if (this.options.ecmaVersion >= 6) - this.eat(tt.semi) + { this.eat(types.semi); } else - this.semicolon() + { this.semicolon(); } return this.finishNode(node, "DoWhileStatement") -} +}; // Disambiguating between a `for` and a `for`/`in` or `for`/`of` // loop is non-trivial. Basically, we have to parse the init `var` @@ -826,312 +872,358 @@ // is a regular `for` loop. pp$1.parseForStatement = function(node) { - this.next() - this.labels.push(loopLabel) - this.expect(tt.parenL) - if (this.type === tt.semi) return this.parseFor(node, null) - var isLet = this.isLet() - if (this.type === tt._var || this.type === tt._const || isLet) { - var init$1 = this.startNode(), kind = isLet ? "let" : this.value - this.next() - this.parseVar(init$1, true, kind) - this.finishNode(init$1, "VariableDeclaration") - if ((this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 && - !(kind !== "var" && init$1.declarations[0].init)) + this.next(); + var awaitAt = (this.options.ecmaVersion >= 9 && this.inAsync && this.eatContextual("await")) ? this.lastTokStart : -1; + this.labels.push(loopLabel); + this.enterLexicalScope(); + this.expect(types.parenL); + if (this.type === types.semi) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + return this.parseFor(node, null) + } + var isLet = this.isLet(); + if (this.type === types._var || this.type === types._const || isLet) { + var init$1 = this.startNode(), kind = isLet ? "let" : this.value; + this.next(); + this.parseVar(init$1, true, kind); + this.finishNode(init$1, "VariableDeclaration"); + if ((this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init$1.declarations.length === 1 && + !(kind !== "var" && init$1.declarations[0].init)) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } return this.parseForIn(node, init$1) + } + if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init$1) } - var refDestructuringErrors = new DestructuringErrors - var init = this.parseExpression(true, refDestructuringErrors) - if (this.type === tt._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - this.checkPatternErrors(refDestructuringErrors, true) - this.toAssignable(init) - this.checkLVal(init) + var refDestructuringErrors = new DestructuringErrors; + var init = this.parseExpression(true, refDestructuringErrors); + if (this.type === types._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) { + if (this.options.ecmaVersion >= 9) { + if (this.type === types._in) { + if (awaitAt > -1) { this.unexpected(awaitAt); } + } else { node.await = awaitAt > -1; } + } + this.toAssignable(init, false, refDestructuringErrors); + this.checkLVal(init); return this.parseForIn(node, init) } else { - this.checkExpressionErrors(refDestructuringErrors, true) + this.checkExpressionErrors(refDestructuringErrors, true); } + if (awaitAt > -1) { this.unexpected(awaitAt); } return this.parseFor(node, init) -} +}; pp$1.parseFunctionStatement = function(node, isAsync) { - this.next() + this.next(); return this.parseFunction(node, true, false, isAsync) -} - -pp$1.isFunction = function() { - return this.type === tt._function || this.isAsyncFunction() -} +}; pp$1.parseIfStatement = function(node) { - this.next() - node.test = this.parseParenExpression() + this.next(); + node.test = this.parseParenExpression(); // allow function declarations in branches, but only in non-strict mode - node.consequent = this.parseStatement(!this.strict && this.isFunction()) - node.alternate = this.eat(tt._else) ? this.parseStatement(!this.strict && this.isFunction()) : null + node.consequent = this.parseStatement(!this.strict && this.type == types._function); + node.alternate = this.eat(types._else) ? this.parseStatement(!this.strict && this.type == types._function) : null; return this.finishNode(node, "IfStatement") -} +}; pp$1.parseReturnStatement = function(node) { if (!this.inFunction && !this.options.allowReturnOutsideFunction) - this.raise(this.start, "'return' outside of function") - this.next() + { this.raise(this.start, "'return' outside of function"); } + this.next(); // In `return` (and `break`/`continue`), the keywords with // optional arguments, we eagerly look for a semicolon or the // possibility to insert one. - if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null - else { node.argument = this.parseExpression(); this.semicolon() } + if (this.eat(types.semi) || this.insertSemicolon()) { node.argument = null; } + else { node.argument = this.parseExpression(); this.semicolon(); } return this.finishNode(node, "ReturnStatement") -} +}; pp$1.parseSwitchStatement = function(node) { var this$1 = this; - this.next() - node.discriminant = this.parseParenExpression() - node.cases = [] - this.expect(tt.braceL) - this.labels.push(switchLabel) + this.next(); + node.discriminant = this.parseParenExpression(); + node.cases = []; + this.expect(types.braceL); + this.labels.push(switchLabel); + this.enterLexicalScope(); // Statements under must be grouped (by label) in SwitchCase // nodes. `cur` is used to keep the node that we are currently // adding statements to. - for (var cur, sawDefault = false; this.type != tt.braceR;) { - if (this$1.type === tt._case || this$1.type === tt._default) { - var isCase = this$1.type === tt._case - if (cur) this$1.finishNode(cur, "SwitchCase") - node.cases.push(cur = this$1.startNode()) - cur.consequent = [] - this$1.next() + var cur; + for (var sawDefault = false; this.type != types.braceR;) { + if (this$1.type === types._case || this$1.type === types._default) { + var isCase = this$1.type === types._case; + if (cur) { this$1.finishNode(cur, "SwitchCase"); } + node.cases.push(cur = this$1.startNode()); + cur.consequent = []; + this$1.next(); if (isCase) { - cur.test = this$1.parseExpression() + cur.test = this$1.parseExpression(); } else { - if (sawDefault) this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses") - sawDefault = true - cur.test = null + if (sawDefault) { this$1.raiseRecoverable(this$1.lastTokStart, "Multiple default clauses"); } + sawDefault = true; + cur.test = null; } - this$1.expect(tt.colon) + this$1.expect(types.colon); } else { - if (!cur) this$1.unexpected() - cur.consequent.push(this$1.parseStatement(true)) + if (!cur) { this$1.unexpected(); } + cur.consequent.push(this$1.parseStatement(true)); } } - if (cur) this.finishNode(cur, "SwitchCase") - this.next() // Closing brace - this.labels.pop() + this.exitLexicalScope(); + if (cur) { this.finishNode(cur, "SwitchCase"); } + this.next(); // Closing brace + this.labels.pop(); return this.finishNode(node, "SwitchStatement") -} +}; pp$1.parseThrowStatement = function(node) { - this.next() + this.next(); if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) - this.raise(this.lastTokEnd, "Illegal newline after throw") - node.argument = this.parseExpression() - this.semicolon() + { this.raise(this.lastTokEnd, "Illegal newline after throw"); } + node.argument = this.parseExpression(); + this.semicolon(); return this.finishNode(node, "ThrowStatement") -} +}; // Reused empty array added for node fields that are always empty. -var empty = [] +var empty = []; pp$1.parseTryStatement = function(node) { - this.next() - node.block = this.parseBlock() - node.handler = null - if (this.type === tt._catch) { - var clause = this.startNode() - this.next() - this.expect(tt.parenL) - clause.param = this.parseBindingAtom() - this.checkLVal(clause.param, true) - this.expect(tt.parenR) - clause.body = this.parseBlock() - node.handler = this.finishNode(clause, "CatchClause") + this.next(); + node.block = this.parseBlock(); + node.handler = null; + if (this.type === types._catch) { + var clause = this.startNode(); + this.next(); + this.expect(types.parenL); + clause.param = this.parseBindingAtom(); + this.enterLexicalScope(); + this.checkLVal(clause.param, "let"); + this.expect(types.parenR); + clause.body = this.parseBlock(false); + this.exitLexicalScope(); + node.handler = this.finishNode(clause, "CatchClause"); } - node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null + node.finalizer = this.eat(types._finally) ? this.parseBlock() : null; if (!node.handler && !node.finalizer) - this.raise(node.start, "Missing catch or finally clause") + { this.raise(node.start, "Missing catch or finally clause"); } return this.finishNode(node, "TryStatement") -} +}; pp$1.parseVarStatement = function(node, kind) { - this.next() - this.parseVar(node, false, kind) - this.semicolon() + this.next(); + this.parseVar(node, false, kind); + this.semicolon(); return this.finishNode(node, "VariableDeclaration") -} +}; pp$1.parseWhileStatement = function(node) { - this.next() - node.test = this.parseParenExpression() - this.labels.push(loopLabel) - node.body = this.parseStatement(false) - this.labels.pop() + this.next(); + node.test = this.parseParenExpression(); + this.labels.push(loopLabel); + node.body = this.parseStatement(false); + this.labels.pop(); return this.finishNode(node, "WhileStatement") -} +}; pp$1.parseWithStatement = function(node) { - if (this.strict) this.raise(this.start, "'with' in strict mode") - this.next() - node.object = this.parseParenExpression() - node.body = this.parseStatement(false) + if (this.strict) { this.raise(this.start, "'with' in strict mode"); } + this.next(); + node.object = this.parseParenExpression(); + node.body = this.parseStatement(false); return this.finishNode(node, "WithStatement") -} +}; pp$1.parseEmptyStatement = function(node) { - this.next() + this.next(); return this.finishNode(node, "EmptyStatement") -} +}; pp$1.parseLabeledStatement = function(node, maybeName, expr) { var this$1 = this; - for (var i = 0; i < this.labels.length; ++i) - if (this$1.labels[i].name === maybeName) this$1.raise(expr.start, "Label '" + maybeName + "' is already declared") - var kind = this.type.isLoop ? "loop" : this.type === tt._switch ? "switch" : null - for (var i$1 = this.labels.length - 1; i$1 >= 0; i$1--) { - var label = this$1.labels[i$1] - if (label.statementStart == node.start) { - label.statementStart = this$1.start - label.kind = kind - } else break + for (var i$1 = 0, list = this$1.labels; i$1 < list.length; i$1 += 1) + { + var label = list[i$1]; + + if (label.name === maybeName) + { this$1.raise(expr.start, "Label '" + maybeName + "' is already declared"); + } } + var kind = this.type.isLoop ? "loop" : this.type === types._switch ? "switch" : null; + for (var i = this.labels.length - 1; i >= 0; i--) { + var label$1 = this$1.labels[i]; + if (label$1.statementStart == node.start) { + // Update information about previous labels on this node + label$1.statementStart = this$1.start; + label$1.kind = kind; + } else { break } } - this.labels.push({name: maybeName, kind: kind, statementStart: this.start}) - node.body = this.parseStatement(true) - this.labels.pop() - node.label = expr + this.labels.push({name: maybeName, kind: kind, statementStart: this.start}); + node.body = this.parseStatement(true); + if (node.body.type == "ClassDeclaration" || + node.body.type == "VariableDeclaration" && node.body.kind != "var" || + node.body.type == "FunctionDeclaration" && (this.strict || node.body.generator)) + { this.raiseRecoverable(node.body.start, "Invalid labeled declaration"); } + this.labels.pop(); + node.label = expr; return this.finishNode(node, "LabeledStatement") -} +}; pp$1.parseExpressionStatement = function(node, expr) { - node.expression = expr - this.semicolon() + node.expression = expr; + this.semicolon(); return this.finishNode(node, "ExpressionStatement") -} +}; // Parse a semicolon-enclosed block of statements, handling `"use // strict"` declarations when `allowStrict` is true (used for // function bodies). -pp$1.parseBlock = function(allowStrict) { +pp$1.parseBlock = function(createNewLexicalScope) { var this$1 = this; + if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true; - var node = this.startNode(), first = true, oldStrict - node.body = [] - this.expect(tt.braceL) - while (!this.eat(tt.braceR)) { - var stmt = this$1.parseStatement(true) - node.body.push(stmt) - if (first && allowStrict && this$1.isUseStrict(stmt)) { - oldStrict = this$1.strict - this$1.setStrict(this$1.strict = true) - } - first = false + var node = this.startNode(); + node.body = []; + this.expect(types.braceL); + if (createNewLexicalScope) { + this.enterLexicalScope(); } - if (oldStrict === false) this.setStrict(false) + while (!this.eat(types.braceR)) { + var stmt = this$1.parseStatement(true); + node.body.push(stmt); + } + if (createNewLexicalScope) { + this.exitLexicalScope(); + } return this.finishNode(node, "BlockStatement") -} +}; // Parse a regular `for` loop. The disambiguation code in // `parseStatement` will already have parsed the init statement or // expression. pp$1.parseFor = function(node, init) { - node.init = init - this.expect(tt.semi) - node.test = this.type === tt.semi ? null : this.parseExpression() - this.expect(tt.semi) - node.update = this.type === tt.parenR ? null : this.parseExpression() - this.expect(tt.parenR) - node.body = this.parseStatement(false) - this.labels.pop() + node.init = init; + this.expect(types.semi); + node.test = this.type === types.semi ? null : this.parseExpression(); + this.expect(types.semi); + node.update = this.type === types.parenR ? null : this.parseExpression(); + this.expect(types.parenR); + this.exitLexicalScope(); + node.body = this.parseStatement(false); + this.labels.pop(); return this.finishNode(node, "ForStatement") -} +}; // Parse a `for`/`in` and `for`/`of` loop, which are almost // same from parser's perspective. pp$1.parseForIn = function(node, init) { - var type = this.type === tt._in ? "ForInStatement" : "ForOfStatement" - this.next() - node.left = init - node.right = this.parseExpression() - this.expect(tt.parenR) - node.body = this.parseStatement(false) - this.labels.pop() + var type = this.type === types._in ? "ForInStatement" : "ForOfStatement"; + this.next(); + if (type == "ForInStatement") { + if (init.type === "AssignmentPattern" || + (init.type === "VariableDeclaration" && init.declarations[0].init != null && + (this.strict || init.declarations[0].id.type !== "Identifier"))) + { this.raise(init.start, "Invalid assignment in for-in loop head"); } + } + node.left = init; + node.right = type == "ForInStatement" ? this.parseExpression() : this.parseMaybeAssign(); + this.expect(types.parenR); + this.exitLexicalScope(); + node.body = this.parseStatement(false); + this.labels.pop(); return this.finishNode(node, type) -} +}; // Parse a list of variable declarations. pp$1.parseVar = function(node, isFor, kind) { var this$1 = this; - node.declarations = [] - node.kind = kind + node.declarations = []; + node.kind = kind; for (;;) { - var decl = this$1.startNode() - this$1.parseVarId(decl) - if (this$1.eat(tt.eq)) { - decl.init = this$1.parseMaybeAssign(isFor) - } else if (kind === "const" && !(this$1.type === tt._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) { - this$1.unexpected() - } else if (decl.id.type != "Identifier" && !(isFor && (this$1.type === tt._in || this$1.isContextual("of")))) { - this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value") + var decl = this$1.startNode(); + this$1.parseVarId(decl, kind); + if (this$1.eat(types.eq)) { + decl.init = this$1.parseMaybeAssign(isFor); + } else if (kind === "const" && !(this$1.type === types._in || (this$1.options.ecmaVersion >= 6 && this$1.isContextual("of")))) { + this$1.unexpected(); + } else if (decl.id.type != "Identifier" && !(isFor && (this$1.type === types._in || this$1.isContextual("of")))) { + this$1.raise(this$1.lastTokEnd, "Complex binding patterns require an initialization value"); } else { - decl.init = null + decl.init = null; } - node.declarations.push(this$1.finishNode(decl, "VariableDeclarator")) - if (!this$1.eat(tt.comma)) break + node.declarations.push(this$1.finishNode(decl, "VariableDeclarator")); + if (!this$1.eat(types.comma)) { break } } return node -} +}; -pp$1.parseVarId = function(decl) { - decl.id = this.parseBindingAtom() - this.checkLVal(decl.id, true) -} +pp$1.parseVarId = function(decl, kind) { + decl.id = this.parseBindingAtom(kind); + this.checkLVal(decl.id, kind, false); +}; // Parse a function declaration or literal (depending on the // `isStatement` parameter). pp$1.parseFunction = function(node, isStatement, allowExpressionBody, isAsync) { - this.initFunction(node) - if (this.options.ecmaVersion >= 6 && !isAsync) - node.generator = this.eat(tt.star) + this.initFunction(node); + if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) + { node.generator = this.eat(types.star); } if (this.options.ecmaVersion >= 8) - node.async = !!isAsync + { node.async = !!isAsync; } - if (isStatement) - node.id = this.parseIdent() + if (isStatement) { + node.id = isStatement === "nullableID" && this.type != types.name ? null : this.parseIdent(); + if (node.id) { + this.checkLVal(node.id, "var"); + } + } - var oldInGen = this.inGenerator, oldInAsync = this.inAsync, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos - this.inGenerator = node.generator - this.inAsync = node.async - this.yieldPos = 0 - this.awaitPos = 0 + var oldInGen = this.inGenerator, oldInAsync = this.inAsync, + oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; + this.inGenerator = node.generator; + this.inAsync = node.async; + this.yieldPos = 0; + this.awaitPos = 0; + this.inFunction = true; + this.enterFunctionScope(); - if (!isStatement && this.type === tt.name) - node.id = this.parseIdent() - this.parseFunctionParams(node) - this.parseFunctionBody(node, allowExpressionBody) + if (!isStatement) + { node.id = this.type == types.name ? this.parseIdent() : null; } - this.inGenerator = oldInGen - this.inAsync = oldInAsync - this.yieldPos = oldYieldPos - this.awaitPos = oldAwaitPos + this.parseFunctionParams(node); + this.parseFunctionBody(node, allowExpressionBody); + + this.inGenerator = oldInGen; + this.inAsync = oldInAsync; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.inFunction = oldInFunc; return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression") -} +}; pp$1.parseFunctionParams = function(node) { - this.expect(tt.parenL) - node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8, true) - this.checkYieldAwaitInDefaultParams() -} + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); +}; // Parse a class declaration or literal (depending on the // `isStatement` parameter). @@ -1139,490 +1231,571 @@ pp$1.parseClass = function(node, isStatement) { var this$1 = this; - this.next() - this.parseClassId(node, isStatement) - this.parseClassSuper(node) - var classBody = this.startNode() - var hadConstructor = false - classBody.body = [] - this.expect(tt.braceL) - while (!this.eat(tt.braceR)) { - if (this$1.eat(tt.semi)) continue - var method = this$1.startNode() - var isGenerator = this$1.eat(tt.star) - var isAsync = false - var isMaybeStatic = this$1.type === tt.name && this$1.value === "static" - this$1.parsePropertyName(method) - method.static = isMaybeStatic && this$1.type !== tt.parenL - if (method.static) { - if (isGenerator) this$1.unexpected() - isGenerator = this$1.eat(tt.star) - this$1.parsePropertyName(method) - } - if (this$1.options.ecmaVersion >= 8 && !isGenerator && !method.computed && - method.key.type === "Identifier" && method.key.name === "async" && this$1.type !== tt.parenL && - !this$1.canInsertSemicolon()) { - isAsync = true - this$1.parsePropertyName(method) - } - method.kind = "method" - var isGetSet = false - if (!method.computed) { - var key = method.key; - if (!isGenerator && !isAsync && key.type === "Identifier" && this$1.type !== tt.parenL && (key.name === "get" || key.name === "set")) { - isGetSet = true - method.kind = key.name - key = this$1.parsePropertyName(method) - } - if (!method.static && (key.type === "Identifier" && key.name === "constructor" || - key.type === "Literal" && key.value === "constructor")) { - if (hadConstructor) this$1.raise(key.start, "Duplicate constructor in the same class") - if (isGetSet) this$1.raise(key.start, "Constructor can't have get/set modifier") - if (isGenerator) this$1.raise(key.start, "Constructor can't be a generator") - if (isAsync) this$1.raise(key.start, "Constructor can't be an async method") - method.kind = "constructor" - hadConstructor = true - } - } - this$1.parseClassMethod(classBody, method, isGenerator, isAsync) - if (isGetSet) { - var paramCount = method.kind === "get" ? 0 : 1 - if (method.value.params.length !== paramCount) { - var start = method.value.start - if (method.kind === "get") - this$1.raiseRecoverable(start, "getter should have no params") - else - this$1.raiseRecoverable(start, "setter should have exactly one param") - } else { - if (method.kind === "set" && method.value.params[0].type === "RestElement") - this$1.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params") - } + this.next(); + + this.parseClassId(node, isStatement); + this.parseClassSuper(node); + var classBody = this.startNode(); + var hadConstructor = false; + classBody.body = []; + this.expect(types.braceL); + while (!this.eat(types.braceR)) { + var member = this$1.parseClassMember(classBody); + if (member && member.type === "MethodDefinition" && member.kind === "constructor") { + if (hadConstructor) { this$1.raise(member.start, "Duplicate constructor in the same class"); } + hadConstructor = true; } } - node.body = this.finishNode(classBody, "ClassBody") + node.body = this.finishNode(classBody, "ClassBody"); return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression") -} +}; + +pp$1.parseClassMember = function(classBody) { + var this$1 = this; + + if (this.eat(types.semi)) { return null } + + var method = this.startNode(); + var tryContextual = function (k, noLineBreak) { + if ( noLineBreak === void 0 ) noLineBreak = false; + + var start = this$1.start, startLoc = this$1.startLoc; + if (!this$1.eatContextual(k)) { return false } + if (this$1.type !== types.parenL && (!noLineBreak || !this$1.canInsertSemicolon())) { return true } + if (method.key) { this$1.unexpected(); } + method.computed = false; + method.key = this$1.startNodeAt(start, startLoc); + method.key.name = k; + this$1.finishNode(method.key, "Identifier"); + return false + }; + + method.kind = "method"; + method.static = tryContextual("static"); + var isGenerator = this.eat(types.star); + var isAsync = false; + if (!isGenerator) { + if (this.options.ecmaVersion >= 8 && tryContextual("async", true)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + } else if (tryContextual("get")) { + method.kind = "get"; + } else if (tryContextual("set")) { + method.kind = "set"; + } + } + if (!method.key) { this.parsePropertyName(method); } + var key = method.key; + if (!method.computed && !method.static && (key.type === "Identifier" && key.name === "constructor" || + key.type === "Literal" && key.value === "constructor")) { + if (method.kind !== "method") { this.raise(key.start, "Constructor can't have get/set modifier"); } + if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); } + if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); } + method.kind = "constructor"; + } else if (method.static && key.type === "Identifier" && key.name === "prototype") { + this.raise(key.start, "Classes may not have a static property named prototype"); + } + this.parseClassMethod(classBody, method, isGenerator, isAsync); + if (method.kind === "get" && method.value.params.length !== 0) + { this.raiseRecoverable(method.value.start, "getter should have no params"); } + if (method.kind === "set" && method.value.params.length !== 1) + { this.raiseRecoverable(method.value.start, "setter should have exactly one param"); } + if (method.kind === "set" && method.value.params[0].type === "RestElement") + { this.raiseRecoverable(method.value.params[0].start, "Setter cannot use rest params"); } + return method +}; pp$1.parseClassMethod = function(classBody, method, isGenerator, isAsync) { - method.value = this.parseMethod(isGenerator, isAsync) - classBody.body.push(this.finishNode(method, "MethodDefinition")) -} + method.value = this.parseMethod(isGenerator, isAsync); + classBody.body.push(this.finishNode(method, "MethodDefinition")); +}; pp$1.parseClassId = function(node, isStatement) { - node.id = this.type === tt.name ? this.parseIdent() : isStatement ? this.unexpected() : null -} + node.id = this.type === types.name ? this.parseIdent() : isStatement === true ? this.unexpected() : null; +}; pp$1.parseClassSuper = function(node) { - node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null -} + node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null; +}; // Parses module export declaration. pp$1.parseExport = function(node, exports) { var this$1 = this; - this.next() + this.next(); // export * from '...' - if (this.eat(tt.star)) { - this.expectContextual("from") - node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected() - this.semicolon() + if (this.eat(types.star)) { + this.expectContextual("from"); + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); + this.semicolon(); return this.finishNode(node, "ExportAllDeclaration") } - if (this.eat(tt._default)) { // export default ... - this.checkExport(exports, "default", this.lastTokStart) - var parens = this.type == tt.parenL - var expr = this.parseMaybeAssign() - var needsSemi = true - if (!parens && (expr.type == "FunctionExpression" || - expr.type == "ClassExpression")) { - needsSemi = false - if (expr.id) { - expr.type = expr.type == "FunctionExpression" - ? "FunctionDeclaration" - : "ClassDeclaration" - } + if (this.eat(types._default)) { // export default ... + this.checkExport(exports, "default", this.lastTokStart); + var isAsync; + if (this.type === types._function || (isAsync = this.isAsyncFunction())) { + var fNode = this.startNode(); + this.next(); + if (isAsync) { this.next(); } + node.declaration = this.parseFunction(fNode, "nullableID", false, isAsync); + } else if (this.type === types._class) { + var cNode = this.startNode(); + node.declaration = this.parseClass(cNode, "nullableID"); + } else { + node.declaration = this.parseMaybeAssign(); + this.semicolon(); } - node.declaration = expr - if (needsSemi) this.semicolon() return this.finishNode(node, "ExportDefaultDeclaration") } // export var|const|let|function|class ... if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(true) + node.declaration = this.parseStatement(true); if (node.declaration.type === "VariableDeclaration") - this.checkVariableExport(exports, node.declaration.declarations) + { this.checkVariableExport(exports, node.declaration.declarations); } else - this.checkExport(exports, node.declaration.id.name, node.declaration.id.start) - node.specifiers = [] - node.source = null + { this.checkExport(exports, node.declaration.id.name, node.declaration.id.start); } + node.specifiers = []; + node.source = null; } else { // export { x, y as z } [from '...'] - node.declaration = null - node.specifiers = this.parseExportSpecifiers(exports) + node.declaration = null; + node.specifiers = this.parseExportSpecifiers(exports); if (this.eatContextual("from")) { - node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected() + if (this.type !== types.string) { this.unexpected(); } + node.source = this.parseExprAtom(); } else { // check for keywords used as local names - for (var i = 0; i < node.specifiers.length; i++) { - if (this$1.keywords.test(node.specifiers[i].local.name) || this$1.reservedWords.test(node.specifiers[i].local.name)) { - this$1.unexpected(node.specifiers[i].local.start) - } + for (var i = 0, list = node.specifiers; i < list.length; i += 1) { + var spec = list[i]; + + this$1.checkUnreserved(spec.local); } - node.source = null + node.source = null; } - this.semicolon() + this.semicolon(); } return this.finishNode(node, "ExportNamedDeclaration") -} +}; pp$1.checkExport = function(exports, name, pos) { - if (!exports) return - if (Object.prototype.hasOwnProperty.call(exports, name)) - this.raiseRecoverable(pos, "Duplicate export '" + name + "'") - exports[name] = true -} + if (!exports) { return } + if (has(exports, name)) + { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); } + exports[name] = true; +}; pp$1.checkPatternExport = function(exports, pat) { var this$1 = this; - var type = pat.type + var type = pat.type; if (type == "Identifier") - this.checkExport(exports, pat.name, pat.start) + { this.checkExport(exports, pat.name, pat.start); } else if (type == "ObjectPattern") - for (var i = 0; i < pat.properties.length; ++i) - this$1.checkPatternExport(exports, pat.properties[i].value) + { for (var i = 0, list = pat.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkPatternExport(exports, prop); + } } else if (type == "ArrayPattern") - for (var i$1 = 0; i$1 < pat.elements.length; ++i$1) { - var elt = pat.elements[i$1] - if (elt) this$1.checkPatternExport(exports, elt) - } + { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) { + var elt = list$1[i$1]; + + if (elt) { this$1.checkPatternExport(exports, elt); } + } } + else if (type == "Property") + { this.checkPatternExport(exports, pat.value); } else if (type == "AssignmentPattern") - this.checkPatternExport(exports, pat.left) + { this.checkPatternExport(exports, pat.left); } + else if (type == "RestElement") + { this.checkPatternExport(exports, pat.argument); } else if (type == "ParenthesizedExpression") - this.checkPatternExport(exports, pat.expression) -} + { this.checkPatternExport(exports, pat.expression); } +}; pp$1.checkVariableExport = function(exports, decls) { var this$1 = this; - if (!exports) return - for (var i = 0; i < decls.length; i++) - this$1.checkPatternExport(exports, decls[i].id) -} + if (!exports) { return } + for (var i = 0, list = decls; i < list.length; i += 1) + { + var decl = list[i]; + + this$1.checkPatternExport(exports, decl.id); + } +}; pp$1.shouldParseExportStatement = function() { - return this.type.keyword || this.isLet() || this.isAsyncFunction() -} + return this.type.keyword === "var" || + this.type.keyword === "const" || + this.type.keyword === "class" || + this.type.keyword === "function" || + this.isLet() || + this.isAsyncFunction() +}; // Parses a comma-separated list of module exports. pp$1.parseExportSpecifiers = function(exports) { var this$1 = this; - var nodes = [], first = true + var nodes = [], first = true; // export { x, y as z } [from '...'] - this.expect(tt.braceL) - while (!this.eat(tt.braceR)) { + this.expect(types.braceL); + while (!this.eat(types.braceR)) { if (!first) { - this$1.expect(tt.comma) - if (this$1.afterTrailingComma(tt.braceR)) break - } else first = false + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } - var node = this$1.startNode() - node.local = this$1.parseIdent(this$1.type === tt._default) - node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local - this$1.checkExport(exports, node.exported.name, node.exported.start) - nodes.push(this$1.finishNode(node, "ExportSpecifier")) + var node = this$1.startNode(); + node.local = this$1.parseIdent(true); + node.exported = this$1.eatContextual("as") ? this$1.parseIdent(true) : node.local; + this$1.checkExport(exports, node.exported.name, node.exported.start); + nodes.push(this$1.finishNode(node, "ExportSpecifier")); } return nodes -} +}; // Parses import declaration. pp$1.parseImport = function(node) { - this.next() + this.next(); // import '...' - if (this.type === tt.string) { - node.specifiers = empty - node.source = this.parseExprAtom() + if (this.type === types.string) { + node.specifiers = empty; + node.source = this.parseExprAtom(); } else { - node.specifiers = this.parseImportSpecifiers() - this.expectContextual("from") - node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected() + node.specifiers = this.parseImportSpecifiers(); + this.expectContextual("from"); + node.source = this.type === types.string ? this.parseExprAtom() : this.unexpected(); } - this.semicolon() + this.semicolon(); return this.finishNode(node, "ImportDeclaration") -} +}; // Parses a comma-separated list of module imports. pp$1.parseImportSpecifiers = function() { var this$1 = this; - var nodes = [], first = true - if (this.type === tt.name) { + var nodes = [], first = true; + if (this.type === types.name) { // import defaultObj, { x, y as z } from '...' - var node = this.startNode() - node.local = this.parseIdent() - this.checkLVal(node.local, true) - nodes.push(this.finishNode(node, "ImportDefaultSpecifier")) - if (!this.eat(tt.comma)) return nodes + var node = this.startNode(); + node.local = this.parseIdent(); + this.checkLVal(node.local, "let"); + nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); + if (!this.eat(types.comma)) { return nodes } } - if (this.type === tt.star) { - var node$1 = this.startNode() - this.next() - this.expectContextual("as") - node$1.local = this.parseIdent() - this.checkLVal(node$1.local, true) - nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")) + if (this.type === types.star) { + var node$1 = this.startNode(); + this.next(); + this.expectContextual("as"); + node$1.local = this.parseIdent(); + this.checkLVal(node$1.local, "let"); + nodes.push(this.finishNode(node$1, "ImportNamespaceSpecifier")); return nodes } - this.expect(tt.braceL) - while (!this.eat(tt.braceR)) { + this.expect(types.braceL); + while (!this.eat(types.braceR)) { if (!first) { - this$1.expect(tt.comma) - if (this$1.afterTrailingComma(tt.braceR)) break - } else first = false + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } - var node$2 = this$1.startNode() - node$2.imported = this$1.parseIdent(true) + var node$2 = this$1.startNode(); + node$2.imported = this$1.parseIdent(true); if (this$1.eatContextual("as")) { - node$2.local = this$1.parseIdent() + node$2.local = this$1.parseIdent(); } else { - node$2.local = node$2.imported - if (this$1.isKeyword(node$2.local.name)) this$1.unexpected(node$2.local.start) - if (this$1.reservedWordsStrict.test(node$2.local.name)) this$1.raiseRecoverable(node$2.local.start, "The keyword '" + node$2.local.name + "' is reserved") + this$1.checkUnreserved(node$2.imported); + node$2.local = node$2.imported; } - this$1.checkLVal(node$2.local, true) - nodes.push(this$1.finishNode(node$2, "ImportSpecifier")) + this$1.checkLVal(node$2.local, "let"); + nodes.push(this$1.finishNode(node$2, "ImportSpecifier")); } return nodes -} +}; -var pp$2 = Parser.prototype +// Set `ExpressionStatement#directive` property for directive prologues. +pp$1.adaptDirectivePrologue = function(statements) { + for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) { + statements[i].directive = statements[i].expression.raw.slice(1, -1); + } +}; +pp$1.isDirectiveCandidate = function(statement) { + return ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" && + typeof statement.expression.value === "string" && + // Reject parenthesized strings. + (this.input[statement.start] === "\"" || this.input[statement.start] === "'") + ) +}; + +var pp$2 = Parser.prototype; // Convert existing expression atom to assignable pattern // if possible. -pp$2.toAssignable = function(node, isBinding) { +pp$2.toAssignable = function(node, isBinding, refDestructuringErrors) { var this$1 = this; if (this.options.ecmaVersion >= 6 && node) { switch (node.type) { - case "Identifier": + case "Identifier": if (this.inAsync && node.name === "await") - this.raise(node.start, "Can not use 'await' as identifier inside an async function") + { this.raise(node.start, "Can not use 'await' as identifier inside an async function"); } break case "ObjectPattern": case "ArrayPattern": + case "RestElement": break case "ObjectExpression": - node.type = "ObjectPattern" - for (var i = 0; i < node.properties.length; i++) { - var prop = node.properties[i] - if (prop.kind !== "init") this$1.raise(prop.key.start, "Object pattern can't contain getter or setter") - this$1.toAssignable(prop.value, isBinding) + node.type = "ObjectPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + for (var i = 0, list = node.properties; i < list.length; i += 1) { + var prop = list[i]; + + this$1.toAssignable(prop, isBinding); + // Early error: + // AssignmentRestProperty[Yield, Await] : + // `...` DestructuringAssignmentTarget[Yield, Await] + // + // It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|. + if ( + prop.type === "RestElement" && + (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern") + ) { + this$1.raise(prop.argument.start, "Unexpected token"); + } } break + case "Property": + // AssignmentProperty has type == "Property" + if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); } + this.toAssignable(node.value, isBinding); + break + case "ArrayExpression": - node.type = "ArrayPattern" - this.toAssignableList(node.elements, isBinding) + node.type = "ArrayPattern"; + if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } + this.toAssignableList(node.elements, isBinding); + break + + case "SpreadElement": + node.type = "RestElement"; + this.toAssignable(node.argument, isBinding); + if (node.argument.type === "AssignmentPattern") + { this.raise(node.argument.start, "Rest elements cannot have a default value"); } break case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern" - delete node.operator - this.toAssignable(node.left, isBinding) - // falls through to AssignmentPattern - } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value.") - break - } + if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); } + node.type = "AssignmentPattern"; + delete node.operator; + this.toAssignable(node.left, isBinding); + // falls through to AssignmentPattern case "AssignmentPattern": break case "ParenthesizedExpression": - node.expression = this.toAssignable(node.expression, isBinding) + this.toAssignable(node.expression, isBinding); break case "MemberExpression": - if (!isBinding) break + if (!isBinding) { break } default: - this.raise(node.start, "Assigning to rvalue") + this.raise(node.start, "Assigning to rvalue"); } - } + } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); } return node -} +}; // Convert list of expression atoms to binding list. pp$2.toAssignableList = function(exprList, isBinding) { var this$1 = this; - var end = exprList.length - if (end) { - var last = exprList[end - 1] - if (last && last.type == "RestElement") { - --end - } else if (last && last.type == "SpreadElement") { - last.type = "RestElement" - var arg = last.argument - this.toAssignable(arg, isBinding) - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") - this.unexpected(arg.start) - --end - } - - if (isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") - this.unexpected(last.argument.start) - } + var end = exprList.length; for (var i = 0; i < end; i++) { - var elt = exprList[i] - if (elt) this$1.toAssignable(elt, isBinding) + var elt = exprList[i]; + if (elt) { this$1.toAssignable(elt, isBinding); } + } + if (end) { + var last = exprList[end - 1]; + if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier") + { this.unexpected(last.argument.start); } } return exprList -} +}; // Parses spread element. pp$2.parseSpread = function(refDestructuringErrors) { - var node = this.startNode() - this.next() - node.argument = this.parseMaybeAssign(false, refDestructuringErrors) + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeAssign(false, refDestructuringErrors); return this.finishNode(node, "SpreadElement") -} +}; -pp$2.parseRest = function(allowNonIdent) { - var node = this.startNode() - this.next() +pp$2.parseRestBinding = function() { + var node = this.startNode(); + this.next(); // RestElement inside of a function parameter must be an identifier - if (allowNonIdent) node.argument = this.type === tt.name ? this.parseIdent() : this.unexpected() - else node.argument = this.type === tt.name || this.type === tt.bracketL ? this.parseBindingAtom() : this.unexpected() + if (this.options.ecmaVersion === 6 && this.type !== types.name) + { this.unexpected(); } + + node.argument = this.parseBindingAtom(); return this.finishNode(node, "RestElement") -} +}; // Parses lvalue (assignable) atom. pp$2.parseBindingAtom = function() { - if (this.options.ecmaVersion < 6) return this.parseIdent() - switch (this.type) { - case tt.name: - return this.parseIdent() + if (this.options.ecmaVersion >= 6) { + switch (this.type) { + case types.bracketL: + var node = this.startNode(); + this.next(); + node.elements = this.parseBindingList(types.bracketR, true, true); + return this.finishNode(node, "ArrayPattern") - case tt.bracketL: - var node = this.startNode() - this.next() - node.elements = this.parseBindingList(tt.bracketR, true, true) - return this.finishNode(node, "ArrayPattern") - - case tt.braceL: - return this.parseObj(true) - - default: - this.unexpected() + case types.braceL: + return this.parseObj(true) + } } -} + return this.parseIdent() +}; -pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowNonIdent) { +pp$2.parseBindingList = function(close, allowEmpty, allowTrailingComma) { var this$1 = this; - var elts = [], first = true + var elts = [], first = true; while (!this.eat(close)) { - if (first) first = false - else this$1.expect(tt.comma) - if (allowEmpty && this$1.type === tt.comma) { - elts.push(null) + if (first) { first = false; } + else { this$1.expect(types.comma); } + if (allowEmpty && this$1.type === types.comma) { + elts.push(null); } else if (allowTrailingComma && this$1.afterTrailingComma(close)) { break - } else if (this$1.type === tt.ellipsis) { - var rest = this$1.parseRest(allowNonIdent) - this$1.parseBindingListItem(rest) - elts.push(rest) - if (this$1.type === tt.comma) this$1.raise(this$1.start, "Comma is not permitted after the rest element") - this$1.expect(close) + } else if (this$1.type === types.ellipsis) { + var rest = this$1.parseRestBinding(); + this$1.parseBindingListItem(rest); + elts.push(rest); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } + this$1.expect(close); break } else { - var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc) - this$1.parseBindingListItem(elem) - elts.push(elem) + var elem = this$1.parseMaybeDefault(this$1.start, this$1.startLoc); + this$1.parseBindingListItem(elem); + elts.push(elem); } } return elts -} +}; pp$2.parseBindingListItem = function(param) { return param -} +}; // Parses assignment pattern around given atom if possible. pp$2.parseMaybeDefault = function(startPos, startLoc, left) { - left = left || this.parseBindingAtom() - if (this.options.ecmaVersion < 6 || !this.eat(tt.eq)) return left - var node = this.startNodeAt(startPos, startLoc) - node.left = left - node.right = this.parseMaybeAssign() + left = left || this.parseBindingAtom(); + if (this.options.ecmaVersion < 6 || !this.eat(types.eq)) { return left } + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.right = this.parseMaybeAssign(); return this.finishNode(node, "AssignmentPattern") -} +}; // Verify that a node is an lval — something that can be assigned // to. +// bindingType can be either: +// 'var' indicating that the lval creates a 'var' binding +// 'let' indicating that the lval creates a lexical ('let' or 'const') binding +// 'none' indicating that the binding should be checked for illegal identifiers, but not for duplicate references -pp$2.checkLVal = function(expr, isBinding, checkClashes) { +pp$2.checkLVal = function(expr, bindingType, checkClashes) { var this$1 = this; switch (expr.type) { case "Identifier": if (this.strict && this.reservedWordsStrictBind.test(expr.name)) - this.raiseRecoverable(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode") + { this.raiseRecoverable(expr.start, (bindingType ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); } if (checkClashes) { if (has(checkClashes, expr.name)) - this.raiseRecoverable(expr.start, "Argument name clash") - checkClashes[expr.name] = true + { this.raiseRecoverable(expr.start, "Argument name clash"); } + checkClashes[expr.name] = true; + } + if (bindingType && bindingType !== "none") { + if ( + bindingType === "var" && !this.canDeclareVarName(expr.name) || + bindingType !== "var" && !this.canDeclareLexicalName(expr.name) + ) { + this.raiseRecoverable(expr.start, ("Identifier '" + (expr.name) + "' has already been declared")); + } + if (bindingType === "var") { + this.declareVarName(expr.name); + } else { + this.declareLexicalName(expr.name); + } } break case "MemberExpression": - if (isBinding) this.raiseRecoverable(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression") + if (bindingType) { this.raiseRecoverable(expr.start, "Binding member expression"); } break case "ObjectPattern": - for (var i = 0; i < expr.properties.length; i++) - this$1.checkLVal(expr.properties[i].value, isBinding, checkClashes) + for (var i = 0, list = expr.properties; i < list.length; i += 1) + { + var prop = list[i]; + + this$1.checkLVal(prop, bindingType, checkClashes); + } + break + + case "Property": + // AssignmentProperty has type == "Property" + this.checkLVal(expr.value, bindingType, checkClashes); break case "ArrayPattern": - for (var i$1 = 0; i$1 < expr.elements.length; i$1++) { - var elem = expr.elements[i$1] - if (elem) this$1.checkLVal(elem, isBinding, checkClashes) + for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) { + var elem = list$1[i$1]; + + if (elem) { this$1.checkLVal(elem, bindingType, checkClashes); } } break case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes) + this.checkLVal(expr.left, bindingType, checkClashes); break case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes) + this.checkLVal(expr.argument, bindingType, checkClashes); break case "ParenthesizedExpression": - this.checkLVal(expr.expression, isBinding, checkClashes) + this.checkLVal(expr.expression, bindingType, checkClashes); break default: - this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue") + this.raise(expr.start, (bindingType ? "Binding" : "Assigning to") + " rvalue"); } -} +}; // A recursive descent parser operates by defining functions for all // syntactic elements, and recursively calling those, each function @@ -1642,18 +1815,20 @@ // // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser -var pp$3 = Parser.prototype +var pp$3 = Parser.prototype; // Check if property name clashes with already added. // Object/class getters and setters are not allowed to clash — // either with each other or with an init property — and in // strict mode, init properties are also not allowed to be repeated. -pp$3.checkPropClash = function(prop, propHash) { +pp$3.checkPropClash = function(prop, propHash, refDestructuringErrors) { + if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement") + { return } if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand)) - return + { return } var key = prop.key; - var name + var name; switch (key.type) { case "Identifier": name = key.name; break case "Literal": name = String(key.value); break @@ -1662,26 +1837,35 @@ var kind = prop.kind; if (this.options.ecmaVersion >= 6) { if (name === "__proto__" && kind === "init") { - if (propHash.proto) this.raiseRecoverable(key.start, "Redefinition of __proto__ property") - propHash.proto = true + if (propHash.proto) { + if (refDestructuringErrors && refDestructuringErrors.doubleProto < 0) { refDestructuringErrors.doubleProto = key.start; } + // Backwards-compat kludge. Can be removed in version 6.0 + else { this.raiseRecoverable(key.start, "Redefinition of __proto__ property"); } + } + propHash.proto = true; } return } - name = "$" + name - var other = propHash[name] + name = "$" + name; + var other = propHash[name]; if (other) { - var isGetSet = kind !== "init" - if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) - this.raiseRecoverable(key.start, "Redefinition of property") + var redefinition; + if (kind === "init") { + redefinition = this.strict && other.init || other.get || other.set; + } else { + redefinition = other.init || other[kind]; + } + if (redefinition) + { this.raiseRecoverable(key.start, "Redefinition of property"); } } else { other = propHash[name] = { init: false, get: false, set: false - } + }; } - other[kind] = true -} + other[kind] = true; +}; // ### Expression parsing @@ -1701,75 +1885,81 @@ pp$3.parseExpression = function(noIn, refDestructuringErrors) { var this$1 = this; - var startPos = this.start, startLoc = this.startLoc - var expr = this.parseMaybeAssign(noIn, refDestructuringErrors) - if (this.type === tt.comma) { - var node = this.startNodeAt(startPos, startLoc) - node.expressions = [expr] - while (this.eat(tt.comma)) node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors)) + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeAssign(noIn, refDestructuringErrors); + if (this.type === types.comma) { + var node = this.startNodeAt(startPos, startLoc); + node.expressions = [expr]; + while (this.eat(types.comma)) { node.expressions.push(this$1.parseMaybeAssign(noIn, refDestructuringErrors)); } return this.finishNode(node, "SequenceExpression") } return expr -} +}; // Parse an assignment expression. This includes applications of // operators like `+=`. pp$3.parseMaybeAssign = function(noIn, refDestructuringErrors, afterLeftParse) { - if (this.inGenerator && this.isContextual("yield")) return this.parseYield() + if (this.inGenerator && this.isContextual("yield")) { return this.parseYield() } - var ownDestructuringErrors = false - if (!refDestructuringErrors) { - refDestructuringErrors = new DestructuringErrors - ownDestructuringErrors = true + var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1; + if (refDestructuringErrors) { + oldParenAssign = refDestructuringErrors.parenthesizedAssign; + oldTrailingComma = refDestructuringErrors.trailingComma; + refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1; + } else { + refDestructuringErrors = new DestructuringErrors; + ownDestructuringErrors = true; } - var startPos = this.start, startLoc = this.startLoc - if (this.type == tt.parenL || this.type == tt.name) - this.potentialArrowAt = this.start - var left = this.parseMaybeConditional(noIn, refDestructuringErrors) - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc) + + var startPos = this.start, startLoc = this.startLoc; + if (this.type == types.parenL || this.type == types.name) + { this.potentialArrowAt = this.start; } + var left = this.parseMaybeConditional(noIn, refDestructuringErrors); + if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); } if (this.type.isAssign) { - this.checkPatternErrors(refDestructuringErrors, true) - if (!ownDestructuringErrors) DestructuringErrors.call(refDestructuringErrors) - var node = this.startNodeAt(startPos, startLoc) - node.operator = this.value - node.left = this.type === tt.eq ? this.toAssignable(left) : left - refDestructuringErrors.shorthandAssign = 0 // reset because shorthand default was used correctly - this.checkLVal(left) - this.next() - node.right = this.parseMaybeAssign(noIn) + var node = this.startNodeAt(startPos, startLoc); + node.operator = this.value; + node.left = this.type === types.eq ? this.toAssignable(left, false, refDestructuringErrors) : left; + if (!ownDestructuringErrors) { DestructuringErrors.call(refDestructuringErrors); } + refDestructuringErrors.shorthandAssign = -1; // reset because shorthand default was used correctly + this.checkLVal(left); + this.next(); + node.right = this.parseMaybeAssign(noIn); return this.finishNode(node, "AssignmentExpression") } else { - if (ownDestructuringErrors) this.checkExpressionErrors(refDestructuringErrors, true) + if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); } } + if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; } + if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; } return left -} +}; // Parse a ternary conditional (`?:`) operator. pp$3.parseMaybeConditional = function(noIn, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc - var expr = this.parseExprOps(noIn, refDestructuringErrors) - if (this.checkExpressionErrors(refDestructuringErrors)) return expr - if (this.eat(tt.question)) { - var node = this.startNodeAt(startPos, startLoc) - node.test = expr - node.consequent = this.parseMaybeAssign() - this.expect(tt.colon) - node.alternate = this.parseMaybeAssign(noIn) + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprOps(noIn, refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + if (this.eat(types.question)) { + var node = this.startNodeAt(startPos, startLoc); + node.test = expr; + node.consequent = this.parseMaybeAssign(); + this.expect(types.colon); + node.alternate = this.parseMaybeAssign(noIn); return this.finishNode(node, "ConditionalExpression") } return expr -} +}; // Start the precedence parser. pp$3.parseExprOps = function(noIn, refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc - var expr = this.parseMaybeUnary(refDestructuringErrors, false) - if (this.checkExpressionErrors(refDestructuringErrors)) return expr - return this.parseExprOp(expr, startPos, startLoc, -1, noIn) -} + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseMaybeUnary(refDestructuringErrors, false); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } + return expr.start == startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, noIn) +}; // Parse binary operators with the operator precedence parsing // algorithm. `left` is the left-hand side of the operator. @@ -1778,128 +1968,128 @@ // operator that has a lower precedence than the set it is parsing. pp$3.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, noIn) { - var prec = this.type.binop - if (prec != null && (!noIn || this.type !== tt._in)) { + var prec = this.type.binop; + if (prec != null && (!noIn || this.type !== types._in)) { if (prec > minPrec) { - var logical = this.type === tt.logicalOR || this.type === tt.logicalAND - var op = this.value - this.next() - var startPos = this.start, startLoc = this.startLoc - var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn) - var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical) + var logical = this.type === types.logicalOR || this.type === types.logicalAND; + var op = this.value; + this.next(); + var startPos = this.start, startLoc = this.startLoc; + var right = this.parseExprOp(this.parseMaybeUnary(null, false), startPos, startLoc, prec, noIn); + var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical); return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn) } } return left -} +}; pp$3.buildBinary = function(startPos, startLoc, left, right, op, logical) { - var node = this.startNodeAt(startPos, startLoc) - node.left = left - node.operator = op - node.right = right + var node = this.startNodeAt(startPos, startLoc); + node.left = left; + node.operator = op; + node.right = right; return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression") -} +}; // Parse unary operators, both prefix and postfix. pp$3.parseMaybeUnary = function(refDestructuringErrors, sawUnary) { var this$1 = this; - var startPos = this.start, startLoc = this.startLoc, expr + var startPos = this.start, startLoc = this.startLoc, expr; if (this.inAsync && this.isContextual("await")) { - expr = this.parseAwait(refDestructuringErrors) - sawUnary = true + expr = this.parseAwait(); + sawUnary = true; } else if (this.type.prefix) { - var node = this.startNode(), update = this.type === tt.incDec - node.operator = this.value - node.prefix = true - this.next() - node.argument = this.parseMaybeUnary(null, true) - this.checkExpressionErrors(refDestructuringErrors, true) - if (update) this.checkLVal(node.argument) + var node = this.startNode(), update = this.type === types.incDec; + node.operator = this.value; + node.prefix = true; + this.next(); + node.argument = this.parseMaybeUnary(null, true); + this.checkExpressionErrors(refDestructuringErrors, true); + if (update) { this.checkLVal(node.argument); } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") - this.raiseRecoverable(node.start, "Deleting local variable in strict mode") - else sawUnary = true - expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression") + { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); } + else { sawUnary = true; } + expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); } else { - expr = this.parseExprSubscripts(refDestructuringErrors) - if (this.checkExpressionErrors(refDestructuringErrors)) return expr + expr = this.parseExprSubscripts(refDestructuringErrors); + if (this.checkExpressionErrors(refDestructuringErrors)) { return expr } while (this.type.postfix && !this.canInsertSemicolon()) { - var node$1 = this$1.startNodeAt(startPos, startLoc) - node$1.operator = this$1.value - node$1.prefix = false - node$1.argument = expr - this$1.checkLVal(expr) - this$1.next() - expr = this$1.finishNode(node$1, "UpdateExpression") + var node$1 = this$1.startNodeAt(startPos, startLoc); + node$1.operator = this$1.value; + node$1.prefix = false; + node$1.argument = expr; + this$1.checkLVal(expr); + this$1.next(); + expr = this$1.finishNode(node$1, "UpdateExpression"); } } - if (!sawUnary && this.eat(tt.starstar)) - return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) + if (!sawUnary && this.eat(types.starstar)) + { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false), "**", false) } else - return expr -} + { return expr } +}; // Parse call, dot, and `[]`-subscript expressions. pp$3.parseExprSubscripts = function(refDestructuringErrors) { - var startPos = this.start, startLoc = this.startLoc - var expr = this.parseExprAtom(refDestructuringErrors) - var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")" - if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) return expr - return this.parseSubscripts(expr, startPos, startLoc) -} + var startPos = this.start, startLoc = this.startLoc; + var expr = this.parseExprAtom(refDestructuringErrors); + var skipArrowSubscripts = expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")"; + if (this.checkExpressionErrors(refDestructuringErrors) || skipArrowSubscripts) { return expr } + var result = this.parseSubscripts(expr, startPos, startLoc); + if (refDestructuringErrors && result.type === "MemberExpression") { + if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; } + if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; } + } + return result +}; pp$3.parseSubscripts = function(base, startPos, startLoc, noCalls) { var this$1 = this; - for (;;) { - var maybeAsyncArrow = this$1.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && !this$1.canInsertSemicolon() - if (this$1.eat(tt.dot)) { - var node = this$1.startNodeAt(startPos, startLoc) - node.object = base - node.property = this$1.parseIdent(true) - node.computed = false - base = this$1.finishNode(node, "MemberExpression") - } else if (this$1.eat(tt.bracketL)) { - var node$1 = this$1.startNodeAt(startPos, startLoc) - node$1.object = base - node$1.property = this$1.parseExpression() - node$1.computed = true - this$1.expect(tt.bracketR) - base = this$1.finishNode(node$1, "MemberExpression") - } else if (!noCalls && this$1.eat(tt.parenL)) { - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this$1.yieldPos, oldAwaitPos = this$1.awaitPos - this$1.yieldPos = 0 - this$1.awaitPos = 0 - var exprList = this$1.parseExprList(tt.parenR, this$1.options.ecmaVersion >= 8, false, refDestructuringErrors) - if (maybeAsyncArrow && !this$1.canInsertSemicolon() && this$1.eat(tt.arrow)) { - this$1.checkPatternErrors(refDestructuringErrors, true) - this$1.checkYieldAwaitInDefaultParams() - this$1.yieldPos = oldYieldPos - this$1.awaitPos = oldAwaitPos + var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" && + this.lastTokEnd == base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async"; + for (var computed = (void 0);;) { + if ((computed = this$1.eat(types.bracketL)) || this$1.eat(types.dot)) { + var node = this$1.startNodeAt(startPos, startLoc); + node.object = base; + node.property = computed ? this$1.parseExpression() : this$1.parseIdent(true); + node.computed = !!computed; + if (computed) { this$1.expect(types.bracketR); } + base = this$1.finishNode(node, "MemberExpression"); + } else if (!noCalls && this$1.eat(types.parenL)) { + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this$1.yieldPos, oldAwaitPos = this$1.awaitPos; + this$1.yieldPos = 0; + this$1.awaitPos = 0; + var exprList = this$1.parseExprList(types.parenR, this$1.options.ecmaVersion >= 8, false, refDestructuringErrors); + if (maybeAsyncArrow && !this$1.canInsertSemicolon() && this$1.eat(types.arrow)) { + this$1.checkPatternErrors(refDestructuringErrors, false); + this$1.checkYieldAwaitInDefaultParams(); + this$1.yieldPos = oldYieldPos; + this$1.awaitPos = oldAwaitPos; return this$1.parseArrowExpression(this$1.startNodeAt(startPos, startLoc), exprList, true) } - this$1.checkExpressionErrors(refDestructuringErrors, true) - this$1.yieldPos = oldYieldPos || this$1.yieldPos - this$1.awaitPos = oldAwaitPos || this$1.awaitPos - var node$2 = this$1.startNodeAt(startPos, startLoc) - node$2.callee = base - node$2.arguments = exprList - base = this$1.finishNode(node$2, "CallExpression") - } else if (this$1.type === tt.backQuote) { - var node$3 = this$1.startNodeAt(startPos, startLoc) - node$3.tag = base - node$3.quasi = this$1.parseTemplate() - base = this$1.finishNode(node$3, "TaggedTemplateExpression") + this$1.checkExpressionErrors(refDestructuringErrors, true); + this$1.yieldPos = oldYieldPos || this$1.yieldPos; + this$1.awaitPos = oldAwaitPos || this$1.awaitPos; + var node$1 = this$1.startNodeAt(startPos, startLoc); + node$1.callee = base; + node$1.arguments = exprList; + base = this$1.finishNode(node$1, "CallExpression"); + } else if (this$1.type === types.backQuote) { + var node$2 = this$1.startNodeAt(startPos, startLoc); + node$2.tag = base; + node$2.quasi = this$1.parseTemplate({isTagged: true}); + base = this$1.finishNode(node$2, "TaggedTemplateExpression"); } else { return base } } -} +}; // Parse an atomic expression — either a single token that is an // expression, an expression started by a keyword like `function` or @@ -1907,171 +2097,184 @@ // or `{}`. pp$3.parseExprAtom = function(refDestructuringErrors) { - var node, canBeArrow = this.potentialArrowAt == this.start + var node, canBeArrow = this.potentialArrowAt == this.start; switch (this.type) { - case tt._super: + case types._super: if (!this.inFunction) - this.raise(this.start, "'super' outside of function or class") + { this.raise(this.start, "'super' outside of function or class"); } + node = this.startNode(); + this.next(); + // The `super` keyword can appear at below: + // SuperProperty: + // super [ Expression ] + // super . IdentifierName + // SuperCall: + // super Arguments + if (this.type !== types.dot && this.type !== types.bracketL && this.type !== types.parenL) + { this.unexpected(); } + return this.finishNode(node, "Super") - case tt._this: - var type = this.type === tt._this ? "ThisExpression" : "Super" - node = this.startNode() - this.next() - return this.finishNode(node, type) + case types._this: + node = this.startNode(); + this.next(); + return this.finishNode(node, "ThisExpression") - case tt.name: - var startPos = this.start, startLoc = this.startLoc - var id = this.parseIdent(this.type !== tt.name) - if (this.options.ecmaVersion >= 8 && id.name === "async" && !this.canInsertSemicolon() && this.eat(tt._function)) - return this.parseFunction(this.startNodeAt(startPos, startLoc), false, false, true) + case types.name: + var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc; + var id = this.parseIdent(this.type !== types.name); + if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types._function)) + { return this.parseFunction(this.startNodeAt(startPos, startLoc), false, false, true) } if (canBeArrow && !this.canInsertSemicolon()) { - if (this.eat(tt.arrow)) - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) - if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === tt.name) { - id = this.parseIdent() - if (this.canInsertSemicolon() || !this.eat(tt.arrow)) - this.unexpected() + if (this.eat(types.arrow)) + { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false) } + if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types.name && !containsEsc) { + id = this.parseIdent(); + if (this.canInsertSemicolon() || !this.eat(types.arrow)) + { this.unexpected(); } return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true) } } return id - case tt.regexp: - var value = this.value - node = this.parseLiteral(value.value) - node.regex = {pattern: value.pattern, flags: value.flags} + case types.regexp: + var value = this.value; + node = this.parseLiteral(value.value); + node.regex = {pattern: value.pattern, flags: value.flags}; return node - case tt.num: case tt.string: + case types.num: case types.string: return this.parseLiteral(this.value) - case tt._null: case tt._true: case tt._false: - node = this.startNode() - node.value = this.type === tt._null ? null : this.type === tt._true - node.raw = this.type.keyword - this.next() + case types._null: case types._true: case types._false: + node = this.startNode(); + node.value = this.type === types._null ? null : this.type === types._true; + node.raw = this.type.keyword; + this.next(); return this.finishNode(node, "Literal") - case tt.parenL: - return this.parseParenAndDistinguishExpression(canBeArrow) + case types.parenL: + var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow); + if (refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr)) + { refDestructuringErrors.parenthesizedAssign = start; } + if (refDestructuringErrors.parenthesizedBind < 0) + { refDestructuringErrors.parenthesizedBind = start; } + } + return expr - case tt.bracketL: - node = this.startNode() - this.next() - node.elements = this.parseExprList(tt.bracketR, true, true, refDestructuringErrors) + case types.bracketL: + node = this.startNode(); + this.next(); + node.elements = this.parseExprList(types.bracketR, true, true, refDestructuringErrors); return this.finishNode(node, "ArrayExpression") - case tt.braceL: + case types.braceL: return this.parseObj(false, refDestructuringErrors) - case tt._function: - node = this.startNode() - this.next() + case types._function: + node = this.startNode(); + this.next(); return this.parseFunction(node, false) - case tt._class: + case types._class: return this.parseClass(this.startNode(), false) - case tt._new: + case types._new: return this.parseNew() - case tt.backQuote: + case types.backQuote: return this.parseTemplate() default: - this.unexpected() + this.unexpected(); } -} +}; pp$3.parseLiteral = function(value) { - var node = this.startNode() - node.value = value - node.raw = this.input.slice(this.start, this.end) - this.next() + var node = this.startNode(); + node.value = value; + node.raw = this.input.slice(this.start, this.end); + this.next(); return this.finishNode(node, "Literal") -} +}; pp$3.parseParenExpression = function() { - this.expect(tt.parenL) - var val = this.parseExpression() - this.expect(tt.parenR) + this.expect(types.parenL); + var val = this.parseExpression(); + this.expect(types.parenR); return val -} +}; pp$3.parseParenAndDistinguishExpression = function(canBeArrow) { var this$1 = this; - var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8 + var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8; if (this.options.ecmaVersion >= 6) { - this.next() + this.next(); - var innerStartPos = this.start, innerStartLoc = this.startLoc - var exprList = [], first = true, lastIsComma = false - var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart, innerParenStart - this.yieldPos = 0 - this.awaitPos = 0 - while (this.type !== tt.parenR) { - first ? first = false : this$1.expect(tt.comma) - if (allowTrailingComma && this$1.afterTrailingComma(tt.parenR, true)) { - lastIsComma = true + var innerStartPos = this.start, innerStartLoc = this.startLoc; + var exprList = [], first = true, lastIsComma = false; + var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart; + this.yieldPos = 0; + this.awaitPos = 0; + while (this.type !== types.parenR) { + first ? first = false : this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(types.parenR, true)) { + lastIsComma = true; break - } else if (this$1.type === tt.ellipsis) { - spreadStart = this$1.start - exprList.push(this$1.parseParenItem(this$1.parseRest())) - if (this$1.type === tt.comma) this$1.raise(this$1.start, "Comma is not permitted after the rest element") + } else if (this$1.type === types.ellipsis) { + spreadStart = this$1.start; + exprList.push(this$1.parseParenItem(this$1.parseRestBinding())); + if (this$1.type === types.comma) { this$1.raise(this$1.start, "Comma is not permitted after the rest element"); } break } else { - if (this$1.type === tt.parenL && !innerParenStart) { - innerParenStart = this$1.start - } - exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem)) + exprList.push(this$1.parseMaybeAssign(false, refDestructuringErrors, this$1.parseParenItem)); } } - var innerEndPos = this.start, innerEndLoc = this.startLoc - this.expect(tt.parenR) + var innerEndPos = this.start, innerEndLoc = this.startLoc; + this.expect(types.parenR); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { - this.checkPatternErrors(refDestructuringErrors, true) - this.checkYieldAwaitInDefaultParams() - if (innerParenStart) this.unexpected(innerParenStart) - this.yieldPos = oldYieldPos - this.awaitPos = oldAwaitPos + if (canBeArrow && !this.canInsertSemicolon() && this.eat(types.arrow)) { + this.checkPatternErrors(refDestructuringErrors, false); + this.checkYieldAwaitInDefaultParams(); + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; return this.parseParenArrowList(startPos, startLoc, exprList) } - if (!exprList.length || lastIsComma) this.unexpected(this.lastTokStart) - if (spreadStart) this.unexpected(spreadStart) - this.checkExpressionErrors(refDestructuringErrors, true) - this.yieldPos = oldYieldPos || this.yieldPos - this.awaitPos = oldAwaitPos || this.awaitPos + if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); } + if (spreadStart) { this.unexpected(spreadStart); } + this.checkExpressionErrors(refDestructuringErrors, true); + this.yieldPos = oldYieldPos || this.yieldPos; + this.awaitPos = oldAwaitPos || this.awaitPos; if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc) - val.expressions = exprList - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc) + val = this.startNodeAt(innerStartPos, innerStartLoc); + val.expressions = exprList; + this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); } else { - val = exprList[0] + val = exprList[0]; } } else { - val = this.parseParenExpression() + val = this.parseParenExpression(); } if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc) - par.expression = val + var par = this.startNodeAt(startPos, startLoc); + par.expression = val; return this.finishNode(par, "ParenthesizedExpression") } else { return val } -} +}; pp$3.parseParenItem = function(item) { return item -} +}; pp$3.parseParenArrowList = function(startPos, startLoc, exprList) { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList) -} +}; // New's precedence is slightly tricky. It must allow its argument to // be a `[]` or dot subscript expression, but not a call — at least, @@ -2079,279 +2282,351 @@ // argument to parseSubscripts to prevent it from consuming the // argument list. -var empty$1 = [] +var empty$1 = []; pp$3.parseNew = function() { - var node = this.startNode() - var meta = this.parseIdent(true) - if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) { - node.meta = meta - node.property = this.parseIdent(true) - if (node.property.name !== "target") - this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target") + var node = this.startNode(); + var meta = this.parseIdent(true); + if (this.options.ecmaVersion >= 6 && this.eat(types.dot)) { + node.meta = meta; + var containsEsc = this.containsEsc; + node.property = this.parseIdent(true); + if (node.property.name !== "target" || containsEsc) + { this.raiseRecoverable(node.property.start, "The only valid meta property for new is new.target"); } if (!this.inFunction) - this.raiseRecoverable(node.start, "new.target can only be used in functions") + { this.raiseRecoverable(node.start, "new.target can only be used in functions"); } return this.finishNode(node, "MetaProperty") } - var startPos = this.start, startLoc = this.startLoc - node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true) - if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, this.options.ecmaVersion >= 8, false) - else node.arguments = empty$1 + var startPos = this.start, startLoc = this.startLoc; + node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); + if (this.eat(types.parenL)) { node.arguments = this.parseExprList(types.parenR, this.options.ecmaVersion >= 8, false); } + else { node.arguments = empty$1; } return this.finishNode(node, "NewExpression") -} +}; // Parse template expression. -pp$3.parseTemplateElement = function() { - var elem = this.startNode() - elem.value = { - raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, '\n'), - cooked: this.value +pp$3.parseTemplateElement = function(ref) { + var isTagged = ref.isTagged; + + var elem = this.startNode(); + if (this.type === types.invalidTemplate) { + if (!isTagged) { + this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"); + } + elem.value = { + raw: this.value, + cooked: null + }; + } else { + elem.value = { + raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"), + cooked: this.value + }; } - this.next() - elem.tail = this.type === tt.backQuote + this.next(); + elem.tail = this.type === types.backQuote; return this.finishNode(elem, "TemplateElement") -} +}; -pp$3.parseTemplate = function() { +pp$3.parseTemplate = function(ref) { var this$1 = this; + if ( ref === void 0 ) ref = {}; + var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false; - var node = this.startNode() - this.next() - node.expressions = [] - var curElt = this.parseTemplateElement() - node.quasis = [curElt] + var node = this.startNode(); + this.next(); + node.expressions = []; + var curElt = this.parseTemplateElement({isTagged: isTagged}); + node.quasis = [curElt]; while (!curElt.tail) { - this$1.expect(tt.dollarBraceL) - node.expressions.push(this$1.parseExpression()) - this$1.expect(tt.braceR) - node.quasis.push(curElt = this$1.parseTemplateElement()) + this$1.expect(types.dollarBraceL); + node.expressions.push(this$1.parseExpression()); + this$1.expect(types.braceR); + node.quasis.push(curElt = this$1.parseTemplateElement({isTagged: isTagged})); } - this.next() + this.next(); return this.finishNode(node, "TemplateLiteral") -} +}; + +pp$3.isAsyncProp = function(prop) { + return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && + (this.type === types.name || this.type === types.num || this.type === types.string || this.type === types.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types.star)) && + !lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) +}; // Parse an object literal or binding pattern. pp$3.parseObj = function(isPattern, refDestructuringErrors) { var this$1 = this; - var node = this.startNode(), first = true, propHash = {} - node.properties = [] - this.next() - while (!this.eat(tt.braceR)) { + var node = this.startNode(), first = true, propHash = {}; + node.properties = []; + this.next(); + while (!this.eat(types.braceR)) { if (!first) { - this$1.expect(tt.comma) - if (this$1.afterTrailingComma(tt.braceR)) break - } else first = false + this$1.expect(types.comma); + if (this$1.afterTrailingComma(types.braceR)) { break } + } else { first = false; } - var prop = this$1.startNode(), isGenerator, isAsync, startPos, startLoc - if (this$1.options.ecmaVersion >= 6) { - prop.method = false - prop.shorthand = false - if (isPattern || refDestructuringErrors) { - startPos = this$1.start - startLoc = this$1.startLoc - } - if (!isPattern) - isGenerator = this$1.eat(tt.star) - } - this$1.parsePropertyName(prop) - if (!isPattern && this$1.options.ecmaVersion >= 8 && !isGenerator && !prop.computed && - prop.key.type === "Identifier" && prop.key.name === "async" && this$1.type !== tt.parenL && - this$1.type !== tt.colon && !this$1.canInsertSemicolon()) { - isAsync = true - this$1.parsePropertyName(prop, refDestructuringErrors) - } else { - isAsync = false - } - this$1.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors) - this$1.checkPropClash(prop, propHash) - node.properties.push(this$1.finishNode(prop, "Property")) + var prop = this$1.parseProperty(isPattern, refDestructuringErrors); + if (!isPattern) { this$1.checkPropClash(prop, propHash, refDestructuringErrors); } + node.properties.push(prop); } return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression") -} +}; -pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors) { - if ((isGenerator || isAsync) && this.type === tt.colon) - this.unexpected() +pp$3.parseProperty = function(isPattern, refDestructuringErrors) { + var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc; + if (this.options.ecmaVersion >= 9 && this.eat(types.ellipsis)) { + if (isPattern) { + prop.argument = this.parseIdent(false); + if (this.type === types.comma) { + this.raise(this.start, "Comma is not permitted after the rest element"); + } + return this.finishNode(prop, "RestElement") + } + // To disallow parenthesized identifier via `this.toAssignable()`. + if (this.type === types.parenL && refDestructuringErrors) { + if (refDestructuringErrors.parenthesizedAssign < 0) { + refDestructuringErrors.parenthesizedAssign = this.start; + } + if (refDestructuringErrors.parenthesizedBind < 0) { + refDestructuringErrors.parenthesizedBind = this.start; + } + } + // Parse argument. + prop.argument = this.parseMaybeAssign(false, refDestructuringErrors); + // To disallow trailing comma via `this.toAssignable()`. + if (this.type === types.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) { + refDestructuringErrors.trailingComma = this.start; + } + // Finish + return this.finishNode(prop, "SpreadElement") + } + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; + if (isPattern || refDestructuringErrors) { + startPos = this.start; + startLoc = this.startLoc; + } + if (!isPattern) + { isGenerator = this.eat(types.star); } + } + var containsEsc = this.containsEsc; + this.parsePropertyName(prop); + if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) { + isAsync = true; + isGenerator = this.options.ecmaVersion >= 9 && this.eat(types.star); + this.parsePropertyName(prop, refDestructuringErrors); + } else { + isAsync = false; + } + this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc); + return this.finishNode(prop, "Property") +}; - if (this.eat(tt.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors) - prop.kind = "init" - } else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) { - if (isPattern) this.unexpected() - prop.kind = "init" - prop.method = true - prop.value = this.parseMethod(isGenerator, isAsync) - } else if (this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && +pp$3.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) { + if ((isGenerator || isAsync) && this.type === types.colon) + { this.unexpected(); } + + if (this.eat(types.colon)) { + prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors); + prop.kind = "init"; + } else if (this.options.ecmaVersion >= 6 && this.type === types.parenL) { + if (isPattern) { this.unexpected(); } + prop.kind = "init"; + prop.method = true; + prop.value = this.parseMethod(isGenerator, isAsync); + } else if (!isPattern && !containsEsc && + this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && - (this.type != tt.comma && this.type != tt.braceR)) { - if (isGenerator || isAsync || isPattern) this.unexpected() - prop.kind = prop.key.name - this.parsePropertyName(prop) - prop.value = this.parseMethod(false) - var paramCount = prop.kind === "get" ? 0 : 1 + (this.type != types.comma && this.type != types.braceR)) { + if (isGenerator || isAsync) { this.unexpected(); } + prop.kind = prop.key.name; + this.parsePropertyName(prop); + prop.value = this.parseMethod(false); + var paramCount = prop.kind === "get" ? 0 : 1; if (prop.value.params.length !== paramCount) { - var start = prop.value.start + var start = prop.value.start; if (prop.kind === "get") - this.raiseRecoverable(start, "getter should have no params") + { this.raiseRecoverable(start, "getter should have no params"); } else - this.raiseRecoverable(start, "setter should have exactly one param") + { this.raiseRecoverable(start, "setter should have exactly one param"); } } else { if (prop.kind === "set" && prop.value.params[0].type === "RestElement") - this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params") + { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); } } } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { - if (this.keywords.test(prop.key.name) || - (this.strict ? this.reservedWordsStrict : this.reservedWords).test(prop.key.name) || - (this.inGenerator && prop.key.name == "yield") || - (this.inAsync && prop.key.name == "await")) - this.raiseRecoverable(prop.key.start, "'" + prop.key.name + "' can not be used as shorthand property") - prop.kind = "init" + this.checkUnreserved(prop.key); + prop.kind = "init"; if (isPattern) { - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key) - } else if (this.type === tt.eq && refDestructuringErrors) { - if (!refDestructuringErrors.shorthandAssign) - refDestructuringErrors.shorthandAssign = this.start - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key) + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); + } else if (this.type === types.eq && refDestructuringErrors) { + if (refDestructuringErrors.shorthandAssign < 0) + { refDestructuringErrors.shorthandAssign = this.start; } + prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); } else { - prop.value = prop.key + prop.value = prop.key; } - prop.shorthand = true - } else this.unexpected() -} + prop.shorthand = true; + } else { this.unexpected(); } +}; pp$3.parsePropertyName = function(prop) { if (this.options.ecmaVersion >= 6) { - if (this.eat(tt.bracketL)) { - prop.computed = true - prop.key = this.parseMaybeAssign() - this.expect(tt.bracketR) + if (this.eat(types.bracketL)) { + prop.computed = true; + prop.key = this.parseMaybeAssign(); + this.expect(types.bracketR); return prop.key } else { - prop.computed = false + prop.computed = false; } } - return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(true) -} + return prop.key = this.type === types.num || this.type === types.string ? this.parseExprAtom() : this.parseIdent(true) +}; // Initialize empty function node. pp$3.initFunction = function(node) { - node.id = null + node.id = null; if (this.options.ecmaVersion >= 6) { - node.generator = false - node.expression = false + node.generator = false; + node.expression = false; } if (this.options.ecmaVersion >= 8) - node.async = false -} + { node.async = false; } +}; // Parse object or class method. pp$3.parseMethod = function(isGenerator, isAsync) { - var node = this.startNode(), oldInGen = this.inGenerator, oldInAsync = this.inAsync, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos + var node = this.startNode(), oldInGen = this.inGenerator, oldInAsync = this.inAsync, + oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; - this.initFunction(node) + this.initFunction(node); if (this.options.ecmaVersion >= 6) - node.generator = isGenerator + { node.generator = isGenerator; } if (this.options.ecmaVersion >= 8) - node.async = !!isAsync + { node.async = !!isAsync; } - this.inGenerator = node.generator - this.inAsync = node.async - this.yieldPos = 0 - this.awaitPos = 0 + this.inGenerator = node.generator; + this.inAsync = node.async; + this.yieldPos = 0; + this.awaitPos = 0; + this.inFunction = true; + this.enterFunctionScope(); - this.expect(tt.parenL) - node.params = this.parseBindingList(tt.parenR, false, this.options.ecmaVersion >= 8) - this.checkYieldAwaitInDefaultParams() - this.parseFunctionBody(node, false) + this.expect(types.parenL); + node.params = this.parseBindingList(types.parenR, false, this.options.ecmaVersion >= 8); + this.checkYieldAwaitInDefaultParams(); + this.parseFunctionBody(node, false); - this.inGenerator = oldInGen - this.inAsync = oldInAsync - this.yieldPos = oldYieldPos - this.awaitPos = oldAwaitPos + this.inGenerator = oldInGen; + this.inAsync = oldInAsync; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.inFunction = oldInFunc; return this.finishNode(node, "FunctionExpression") -} +}; // Parse arrow function expression with given parameters. pp$3.parseArrowExpression = function(node, params, isAsync) { - var oldInGen = this.inGenerator, oldInAsync = this.inAsync, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos + var oldInGen = this.inGenerator, oldInAsync = this.inAsync, + oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldInFunc = this.inFunction; - this.initFunction(node) + this.enterFunctionScope(); + this.initFunction(node); if (this.options.ecmaVersion >= 8) - node.async = !!isAsync + { node.async = !!isAsync; } - this.inGenerator = false - this.inAsync = node.async - this.yieldPos = 0 - this.awaitPos = 0 + this.inGenerator = false; + this.inAsync = node.async; + this.yieldPos = 0; + this.awaitPos = 0; + this.inFunction = true; - node.params = this.toAssignableList(params, true) - this.parseFunctionBody(node, true) + node.params = this.toAssignableList(params, true); + this.parseFunctionBody(node, true); - this.inGenerator = oldInGen - this.inAsync = oldInAsync - this.yieldPos = oldYieldPos - this.awaitPos = oldAwaitPos + this.inGenerator = oldInGen; + this.inAsync = oldInAsync; + this.yieldPos = oldYieldPos; + this.awaitPos = oldAwaitPos; + this.inFunction = oldInFunc; return this.finishNode(node, "ArrowFunctionExpression") -} +}; // Parse function body and check parameters. pp$3.parseFunctionBody = function(node, isArrowFunction) { - var isExpression = isArrowFunction && this.type !== tt.braceL + var isExpression = isArrowFunction && this.type !== types.braceL; + var oldStrict = this.strict, useStrict = false; if (isExpression) { - node.body = this.parseMaybeAssign() - node.expression = true + node.body = this.parseMaybeAssign(); + node.expression = true; + this.checkParams(node, false); } else { + var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params); + if (!oldStrict || nonSimple) { + useStrict = this.strictDirective(this.end); + // If this is a strict mode function, verify that argument names + // are not repeated, and it does not try to bind the words `eval` + // or `arguments`. + if (useStrict && nonSimple) + { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); } + } // Start a new scope with regard to labels and the `inFunction` // flag (restore them to their old value afterwards). - var oldInFunc = this.inFunction, oldLabels = this.labels - this.inFunction = true; this.labels = [] - node.body = this.parseBlock(true) - node.expression = false - this.inFunction = oldInFunc; this.labels = oldLabels - } + var oldLabels = this.labels; + this.labels = []; + if (useStrict) { this.strict = true; } - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - var useStrict = (!isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) ? node.body.body[0] : null - if (useStrict && this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params)) - this.raiseRecoverable(useStrict.start, "Illegal 'use strict' directive in function with non-simple parameter list") - - if (this.strict || useStrict) { - var oldStrict = this.strict - this.strict = true - if (node.id) - this.checkLVal(node.id, true) - this.checkParams(node) - this.strict = oldStrict - } else if (isArrowFunction || !this.isSimpleParamList(node.params)) { - this.checkParams(node) + // Add the params to varDeclaredNames to ensure that an error is thrown + // if a let/const declaration in the function clashes with one of the params. + this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && this.isSimpleParamList(node.params)); + node.body = this.parseBlock(false); + node.expression = false; + this.adaptDirectivePrologue(node.body.body); + this.labels = oldLabels; } -} + this.exitFunctionScope(); + + if (this.strict && node.id) { + // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval' + this.checkLVal(node.id, "none"); + } + this.strict = oldStrict; +}; pp$3.isSimpleParamList = function(params) { - for (var i = 0; i < params.length; i++) - if (params[i].type !== "Identifier") return false + for (var i = 0, list = params; i < list.length; i += 1) + { + var param = list[i]; + + if (param.type !== "Identifier") { return false + } } return true -} +}; // Checks function params for various disallowed patterns such as using "eval" // or "arguments" and duplicate parameters. -pp$3.checkParams = function(node) { +pp$3.checkParams = function(node, allowDuplicates) { var this$1 = this; - var nameHash = {} - for (var i = 0; i < node.params.length; i++) this$1.checkLVal(node.params[i], true, nameHash) -} + var nameHash = {}; + for (var i = 0, list = node.params; i < list.length; i += 1) + { + var param = list[i]; + + this$1.checkLVal(param, "var", allowDuplicates ? null : nameHash); + } +}; // Parses a comma-separated list of expressions, and returns them as // an array. `close` is the token type that ends the list, and @@ -2362,81 +2637,105 @@ pp$3.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) { var this$1 = this; - var elts = [], first = true + var elts = [], first = true; while (!this.eat(close)) { if (!first) { - this$1.expect(tt.comma) - if (allowTrailingComma && this$1.afterTrailingComma(close)) break - } else first = false + this$1.expect(types.comma); + if (allowTrailingComma && this$1.afterTrailingComma(close)) { break } + } else { first = false; } - var elt - if (allowEmpty && this$1.type === tt.comma) - elt = null - else if (this$1.type === tt.ellipsis) { - elt = this$1.parseSpread(refDestructuringErrors) - if (this$1.type === tt.comma && refDestructuringErrors && !refDestructuringErrors.trailingComma) { - refDestructuringErrors.trailingComma = this$1.start - } - } else - elt = this$1.parseMaybeAssign(false, refDestructuringErrors) - elts.push(elt) + var elt = (void 0); + if (allowEmpty && this$1.type === types.comma) + { elt = null; } + else if (this$1.type === types.ellipsis) { + elt = this$1.parseSpread(refDestructuringErrors); + if (refDestructuringErrors && this$1.type === types.comma && refDestructuringErrors.trailingComma < 0) + { refDestructuringErrors.trailingComma = this$1.start; } + } else { + elt = this$1.parseMaybeAssign(false, refDestructuringErrors); + } + elts.push(elt); } return elts -} +}; + +pp$3.checkUnreserved = function(ref) { + var start = ref.start; + var end = ref.end; + var name = ref.name; + + if (this.inGenerator && name === "yield") + { this.raiseRecoverable(start, "Can not use 'yield' as identifier inside a generator"); } + if (this.inAsync && name === "await") + { this.raiseRecoverable(start, "Can not use 'await' as identifier inside an async function"); } + if (this.isKeyword(name)) + { this.raise(start, ("Unexpected keyword '" + name + "'")); } + if (this.options.ecmaVersion < 6 && + this.input.slice(start, end).indexOf("\\") != -1) { return } + var re = this.strict ? this.reservedWordsStrict : this.reservedWords; + if (re.test(name)) { + if (!this.inAsync && name === "await") + { this.raiseRecoverable(start, "Can not use keyword 'await' outside an async function"); } + this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved")); + } +}; // Parse the next token as an identifier. If `liberal` is true (used // when parsing properties), it will also convert keywords into // identifiers. -pp$3.parseIdent = function(liberal) { - var node = this.startNode() - if (liberal && this.options.allowReserved == "never") liberal = false - if (this.type === tt.name) { - if (!liberal && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(this.value) && - (this.options.ecmaVersion >= 6 || - this.input.slice(this.start, this.end).indexOf("\\") == -1)) - this.raiseRecoverable(this.start, "The keyword '" + this.value + "' is reserved") - if (this.inGenerator && this.value === "yield") - this.raiseRecoverable(this.start, "Can not use 'yield' as identifier inside a generator") - if (this.inAsync && this.value === "await") - this.raiseRecoverable(this.start, "Can not use 'await' as identifier inside an async function") - node.name = this.value - } else if (liberal && this.type.keyword) { - node.name = this.type.keyword +pp$3.parseIdent = function(liberal, isBinding) { + var node = this.startNode(); + if (liberal && this.options.allowReserved == "never") { liberal = false; } + if (this.type === types.name) { + node.name = this.value; + } else if (this.type.keyword) { + node.name = this.type.keyword; + + // To fix https://github.com/acornjs/acorn/issues/575 + // `class` and `function` keywords push new context into this.context. + // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name. + // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword + if ((node.name === "class" || node.name === "function") && + (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) { + this.context.pop(); + } } else { - this.unexpected() + this.unexpected(); } - this.next() - return this.finishNode(node, "Identifier") -} + this.next(); + this.finishNode(node, "Identifier"); + if (!liberal) { this.checkUnreserved(node); } + return node +}; // Parses yield expression inside generator. pp$3.parseYield = function() { - if (!this.yieldPos) this.yieldPos = this.start + if (!this.yieldPos) { this.yieldPos = this.start; } - var node = this.startNode() - this.next() - if (this.type == tt.semi || this.canInsertSemicolon() || (this.type != tt.star && !this.type.startsExpr)) { - node.delegate = false - node.argument = null + var node = this.startNode(); + this.next(); + if (this.type == types.semi || this.canInsertSemicolon() || (this.type != types.star && !this.type.startsExpr)) { + node.delegate = false; + node.argument = null; } else { - node.delegate = this.eat(tt.star) - node.argument = this.parseMaybeAssign() + node.delegate = this.eat(types.star); + node.argument = this.parseMaybeAssign(); } return this.finishNode(node, "YieldExpression") -} +}; pp$3.parseAwait = function() { - if (!this.awaitPos) this.awaitPos = this.start + if (!this.awaitPos) { this.awaitPos = this.start; } - var node = this.startNode() - this.next() - node.argument = this.parseMaybeUnary(null, true) + var node = this.startNode(); + this.next(); + node.argument = this.parseMaybeUnary(null, true); return this.finishNode(node, "AwaitExpression") -} +}; -var pp$4 = Parser.prototype +var pp$4 = Parser.prototype; // This function is used to raise exceptions on parse errors. It // takes an offset integer (into the current `input`) to indicate @@ -2445,372 +2744,1982 @@ // message. pp$4.raise = function(pos, message) { - var loc = getLineInfo(this.input, pos) - message += " (" + loc.line + ":" + loc.column + ")" - var err = new SyntaxError(message) - err.pos = pos; err.loc = loc; err.raisedAt = this.pos + var loc = getLineInfo(this.input, pos); + message += " (" + loc.line + ":" + loc.column + ")"; + var err = new SyntaxError(message); + err.pos = pos; err.loc = loc; err.raisedAt = this.pos; throw err -} +}; -pp$4.raiseRecoverable = pp$4.raise +pp$4.raiseRecoverable = pp$4.raise; pp$4.curPosition = function() { if (this.options.locations) { return new Position(this.curLine, this.pos - this.lineStart) } -} +}; + +var pp$5 = Parser.prototype; + +// Object.assign polyfill +var assign = Object.assign || function(target) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + for (var i = 0, list = sources; i < list.length; i += 1) { + var source = list[i]; + + for (var key in source) { + if (has(source, key)) { + target[key] = source[key]; + } + } + } + return target +}; + +// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names. + +pp$5.enterFunctionScope = function() { + // var: a hash of var-declared names in the current lexical scope + // lexical: a hash of lexically-declared names in the current lexical scope + // childVar: a hash of var-declared names in all child lexical scopes of the current lexical scope (within the current function scope) + // parentLexical: a hash of lexically-declared names in all parent lexical scopes of the current lexical scope (within the current function scope) + this.scopeStack.push({var: {}, lexical: {}, childVar: {}, parentLexical: {}}); +}; + +pp$5.exitFunctionScope = function() { + this.scopeStack.pop(); +}; + +pp$5.enterLexicalScope = function() { + var parentScope = this.scopeStack[this.scopeStack.length - 1]; + var childScope = {var: {}, lexical: {}, childVar: {}, parentLexical: {}}; + + this.scopeStack.push(childScope); + assign(childScope.parentLexical, parentScope.lexical, parentScope.parentLexical); +}; + +pp$5.exitLexicalScope = function() { + var childScope = this.scopeStack.pop(); + var parentScope = this.scopeStack[this.scopeStack.length - 1]; + + assign(parentScope.childVar, childScope.var, childScope.childVar); +}; + +/** + * A name can be declared with `var` if there are no variables with the same name declared with `let`/`const` + * in the current lexical scope or any of the parent lexical scopes in this function. + */ +pp$5.canDeclareVarName = function(name) { + var currentScope = this.scopeStack[this.scopeStack.length - 1]; + + return !has(currentScope.lexical, name) && !has(currentScope.parentLexical, name) +}; + +/** + * A name can be declared with `let`/`const` if there are no variables with the same name declared with `let`/`const` + * in the current scope, and there are no variables with the same name declared with `var` in the current scope or in + * any child lexical scopes in this function. + */ +pp$5.canDeclareLexicalName = function(name) { + var currentScope = this.scopeStack[this.scopeStack.length - 1]; + + return !has(currentScope.lexical, name) && !has(currentScope.var, name) && !has(currentScope.childVar, name) +}; + +pp$5.declareVarName = function(name) { + this.scopeStack[this.scopeStack.length - 1].var[name] = true; +}; + +pp$5.declareLexicalName = function(name) { + this.scopeStack[this.scopeStack.length - 1].lexical[name] = true; +}; var Node = function Node(parser, pos, loc) { - this.type = "" - this.start = pos - this.end = 0 + this.type = ""; + this.start = pos; + this.end = 0; if (parser.options.locations) - this.loc = new SourceLocation(parser, loc) + { this.loc = new SourceLocation(parser, loc); } if (parser.options.directSourceFile) - this.sourceFile = parser.options.directSourceFile + { this.sourceFile = parser.options.directSourceFile; } if (parser.options.ranges) - this.range = [pos, 0] + { this.range = [pos, 0]; } }; // Start an AST node, attaching a start offset. -var pp$5 = Parser.prototype +var pp$6 = Parser.prototype; -pp$5.startNode = function() { +pp$6.startNode = function() { return new Node(this, this.start, this.startLoc) -} +}; -pp$5.startNodeAt = function(pos, loc) { +pp$6.startNodeAt = function(pos, loc) { return new Node(this, pos, loc) -} +}; // Finish an AST node, adding `type` and `end` properties. function finishNodeAt(node, type, pos, loc) { - node.type = type - node.end = pos + node.type = type; + node.end = pos; if (this.options.locations) - node.loc.end = loc + { node.loc.end = loc; } if (this.options.ranges) - node.range[1] = pos + { node.range[1] = pos; } return node } -pp$5.finishNode = function(node, type) { +pp$6.finishNode = function(node, type) { return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc) -} +}; // Finish node at given position -pp$5.finishNodeAt = function(node, type, pos, loc) { +pp$6.finishNodeAt = function(node, type, pos, loc) { return finishNodeAt.call(this, node, type, pos, loc) -} +}; // The algorithm used to determine whether a regexp can appear at a // given point in the program is loosely based on sweet.js' approach. // See https://github.com/mozilla/sweet.js/wiki/design -var TokContext = function TokContext(token, isExpr, preserveSpace, override) { - this.token = token - this.isExpr = !!isExpr - this.preserveSpace = !!preserveSpace - this.override = override +var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) { + this.token = token; + this.isExpr = !!isExpr; + this.preserveSpace = !!preserveSpace; + this.override = override; + this.generator = !!generator; }; -var types = { +var types$1 = { b_stat: new TokContext("{", false), b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", true), + b_tmpl: new TokContext("${", false), p_stat: new TokContext("(", false), p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { return p.readTmplToken(); }), - f_expr: new TokContext("function", true) -} + q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }), + f_stat: new TokContext("function", false), + f_expr: new TokContext("function", true), + f_expr_gen: new TokContext("function", true, false, null, true), + f_gen: new TokContext("function", false, false, null, true) +}; -var pp$6 = Parser.prototype +var pp$7 = Parser.prototype; -pp$6.initialContext = function() { - return [types.b_stat] -} +pp$7.initialContext = function() { + return [types$1.b_stat] +}; -pp$6.braceIsBlock = function(prevType) { - if (prevType === tt.colon) { - var parent = this.curContext() - if (parent === types.b_stat || parent === types.b_expr) - return !parent.isExpr - } - if (prevType === tt._return) - return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) - if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof || prevType === tt.parenR) - return true - if (prevType == tt.braceL) - return this.curContext() === types.b_stat +pp$7.braceIsBlock = function(prevType) { + var parent = this.curContext(); + if (parent === types$1.f_expr || parent === types$1.f_stat) + { return true } + if (prevType === types.colon && (parent === types$1.b_stat || parent === types$1.b_expr)) + { return !parent.isExpr } + + // The check for `tt.name && exprAllowed` detects whether we are + // after a `yield` or `of` construct. See the `updateContext` for + // `tt.name`. + if (prevType === types._return || prevType == types.name && this.exprAllowed) + { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) } + if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType == types.arrow) + { return true } + if (prevType == types.braceL) + { return parent === types$1.b_stat } + if (prevType == types._var || prevType == types.name) + { return false } return !this.exprAllowed -} +}; -pp$6.updateContext = function(prevType) { - var update, type = this.type - if (type.keyword && prevType == tt.dot) - this.exprAllowed = false +pp$7.inGeneratorContext = function() { + var this$1 = this; + + for (var i = this.context.length - 1; i >= 1; i--) { + var context = this$1.context[i]; + if (context.token === "function") + { return context.generator } + } + return false +}; + +pp$7.updateContext = function(prevType) { + var update, type = this.type; + if (type.keyword && prevType == types.dot) + { this.exprAllowed = false; } else if (update = type.updateContext) - update.call(this, prevType) + { update.call(this, prevType); } else - this.exprAllowed = type.beforeExpr -} + { this.exprAllowed = type.beforeExpr; } +}; // Token-specific context update code -tt.parenR.updateContext = tt.braceR.updateContext = function() { +types.parenR.updateContext = types.braceR.updateContext = function() { if (this.context.length == 1) { - this.exprAllowed = true + this.exprAllowed = true; return } - var out = this.context.pop() - if (out === types.b_stat && this.curContext() === types.f_expr) { - this.context.pop() - this.exprAllowed = false - } else if (out === types.b_tmpl) { - this.exprAllowed = true - } else { - this.exprAllowed = !out.isExpr + var out = this.context.pop(); + if (out === types$1.b_stat && this.curContext().token === "function") { + out = this.context.pop(); } -} + this.exprAllowed = !out.isExpr; +}; -tt.braceL.updateContext = function(prevType) { - this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr) - this.exprAllowed = true -} +types.braceL.updateContext = function(prevType) { + this.context.push(this.braceIsBlock(prevType) ? types$1.b_stat : types$1.b_expr); + this.exprAllowed = true; +}; -tt.dollarBraceL.updateContext = function() { - this.context.push(types.b_tmpl) - this.exprAllowed = true -} +types.dollarBraceL.updateContext = function() { + this.context.push(types$1.b_tmpl); + this.exprAllowed = true; +}; -tt.parenL.updateContext = function(prevType) { - var statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while - this.context.push(statementParens ? types.p_stat : types.p_expr) - this.exprAllowed = true -} +types.parenL.updateContext = function(prevType) { + var statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while; + this.context.push(statementParens ? types$1.p_stat : types$1.p_expr); + this.exprAllowed = true; +}; -tt.incDec.updateContext = function() { +types.incDec.updateContext = function() { // tokExprAllowed stays unchanged -} +}; -tt._function.updateContext = function(prevType) { - if (prevType.beforeExpr && prevType !== tt.semi && prevType !== tt._else && - !((prevType === tt.colon || prevType === tt.braceL) && this.curContext() === types.b_stat)) - this.context.push(types.f_expr) - this.exprAllowed = false -} - -tt.backQuote.updateContext = function() { - if (this.curContext() === types.q_tmpl) - this.context.pop() +types._function.updateContext = types._class.updateContext = function(prevType) { + if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && + !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) + { this.context.push(types$1.f_expr); } else - this.context.push(types.q_tmpl) - this.exprAllowed = false + { this.context.push(types$1.f_stat); } + this.exprAllowed = false; +}; + +types.backQuote.updateContext = function() { + if (this.curContext() === types$1.q_tmpl) + { this.context.pop(); } + else + { this.context.push(types$1.q_tmpl); } + this.exprAllowed = false; +}; + +types.star.updateContext = function(prevType) { + if (prevType == types._function) { + var index = this.context.length - 1; + if (this.context[index] === types$1.f_expr) + { this.context[index] = types$1.f_expr_gen; } + else + { this.context[index] = types$1.f_gen; } + } + this.exprAllowed = true; +}; + +types.name.updateContext = function(prevType) { + var allowed = false; + if (this.options.ecmaVersion >= 6) { + if (this.value == "of" && !this.exprAllowed || + this.value == "yield" && this.inGeneratorContext()) + { allowed = true; } + } + this.exprAllowed = allowed; +}; + +var data = { + "$LONE": [ + "ASCII", + "ASCII_Hex_Digit", + "AHex", + "Alphabetic", + "Alpha", + "Any", + "Assigned", + "Bidi_Control", + "Bidi_C", + "Bidi_Mirrored", + "Bidi_M", + "Case_Ignorable", + "CI", + "Cased", + "Changes_When_Casefolded", + "CWCF", + "Changes_When_Casemapped", + "CWCM", + "Changes_When_Lowercased", + "CWL", + "Changes_When_NFKC_Casefolded", + "CWKCF", + "Changes_When_Titlecased", + "CWT", + "Changes_When_Uppercased", + "CWU", + "Dash", + "Default_Ignorable_Code_Point", + "DI", + "Deprecated", + "Dep", + "Diacritic", + "Dia", + "Emoji", + "Emoji_Component", + "Emoji_Modifier", + "Emoji_Modifier_Base", + "Emoji_Presentation", + "Extender", + "Ext", + "Grapheme_Base", + "Gr_Base", + "Grapheme_Extend", + "Gr_Ext", + "Hex_Digit", + "Hex", + "IDS_Binary_Operator", + "IDSB", + "IDS_Trinary_Operator", + "IDST", + "ID_Continue", + "IDC", + "ID_Start", + "IDS", + "Ideographic", + "Ideo", + "Join_Control", + "Join_C", + "Logical_Order_Exception", + "LOE", + "Lowercase", + "Lower", + "Math", + "Noncharacter_Code_Point", + "NChar", + "Pattern_Syntax", + "Pat_Syn", + "Pattern_White_Space", + "Pat_WS", + "Quotation_Mark", + "QMark", + "Radical", + "Regional_Indicator", + "RI", + "Sentence_Terminal", + "STerm", + "Soft_Dotted", + "SD", + "Terminal_Punctuation", + "Term", + "Unified_Ideograph", + "UIdeo", + "Uppercase", + "Upper", + "Variation_Selector", + "VS", + "White_Space", + "space", + "XID_Continue", + "XIDC", + "XID_Start", + "XIDS" + ], + "General_Category": [ + "Cased_Letter", + "LC", + "Close_Punctuation", + "Pe", + "Connector_Punctuation", + "Pc", + "Control", + "Cc", + "cntrl", + "Currency_Symbol", + "Sc", + "Dash_Punctuation", + "Pd", + "Decimal_Number", + "Nd", + "digit", + "Enclosing_Mark", + "Me", + "Final_Punctuation", + "Pf", + "Format", + "Cf", + "Initial_Punctuation", + "Pi", + "Letter", + "L", + "Letter_Number", + "Nl", + "Line_Separator", + "Zl", + "Lowercase_Letter", + "Ll", + "Mark", + "M", + "Combining_Mark", + "Math_Symbol", + "Sm", + "Modifier_Letter", + "Lm", + "Modifier_Symbol", + "Sk", + "Nonspacing_Mark", + "Mn", + "Number", + "N", + "Open_Punctuation", + "Ps", + "Other", + "C", + "Other_Letter", + "Lo", + "Other_Number", + "No", + "Other_Punctuation", + "Po", + "Other_Symbol", + "So", + "Paragraph_Separator", + "Zp", + "Private_Use", + "Co", + "Punctuation", + "P", + "punct", + "Separator", + "Z", + "Space_Separator", + "Zs", + "Spacing_Mark", + "Mc", + "Surrogate", + "Cs", + "Symbol", + "S", + "Titlecase_Letter", + "Lt", + "Unassigned", + "Cn", + "Uppercase_Letter", + "Lu" + ], + "Script": [ + "Adlam", + "Adlm", + "Ahom", + "Anatolian_Hieroglyphs", + "Hluw", + "Arabic", + "Arab", + "Armenian", + "Armn", + "Avestan", + "Avst", + "Balinese", + "Bali", + "Bamum", + "Bamu", + "Bassa_Vah", + "Bass", + "Batak", + "Batk", + "Bengali", + "Beng", + "Bhaiksuki", + "Bhks", + "Bopomofo", + "Bopo", + "Brahmi", + "Brah", + "Braille", + "Brai", + "Buginese", + "Bugi", + "Buhid", + "Buhd", + "Canadian_Aboriginal", + "Cans", + "Carian", + "Cari", + "Caucasian_Albanian", + "Aghb", + "Chakma", + "Cakm", + "Cham", + "Cherokee", + "Cher", + "Common", + "Zyyy", + "Coptic", + "Copt", + "Qaac", + "Cuneiform", + "Xsux", + "Cypriot", + "Cprt", + "Cyrillic", + "Cyrl", + "Deseret", + "Dsrt", + "Devanagari", + "Deva", + "Duployan", + "Dupl", + "Egyptian_Hieroglyphs", + "Egyp", + "Elbasan", + "Elba", + "Ethiopic", + "Ethi", + "Georgian", + "Geor", + "Glagolitic", + "Glag", + "Gothic", + "Goth", + "Grantha", + "Gran", + "Greek", + "Grek", + "Gujarati", + "Gujr", + "Gurmukhi", + "Guru", + "Han", + "Hani", + "Hangul", + "Hang", + "Hanunoo", + "Hano", + "Hatran", + "Hatr", + "Hebrew", + "Hebr", + "Hiragana", + "Hira", + "Imperial_Aramaic", + "Armi", + "Inherited", + "Zinh", + "Qaai", + "Inscriptional_Pahlavi", + "Phli", + "Inscriptional_Parthian", + "Prti", + "Javanese", + "Java", + "Kaithi", + "Kthi", + "Kannada", + "Knda", + "Katakana", + "Kana", + "Kayah_Li", + "Kali", + "Kharoshthi", + "Khar", + "Khmer", + "Khmr", + "Khojki", + "Khoj", + "Khudawadi", + "Sind", + "Lao", + "Laoo", + "Latin", + "Latn", + "Lepcha", + "Lepc", + "Limbu", + "Limb", + "Linear_A", + "Lina", + "Linear_B", + "Linb", + "Lisu", + "Lycian", + "Lyci", + "Lydian", + "Lydi", + "Mahajani", + "Mahj", + "Malayalam", + "Mlym", + "Mandaic", + "Mand", + "Manichaean", + "Mani", + "Marchen", + "Marc", + "Masaram_Gondi", + "Gonm", + "Meetei_Mayek", + "Mtei", + "Mende_Kikakui", + "Mend", + "Meroitic_Cursive", + "Merc", + "Meroitic_Hieroglyphs", + "Mero", + "Miao", + "Plrd", + "Modi", + "Mongolian", + "Mong", + "Mro", + "Mroo", + "Multani", + "Mult", + "Myanmar", + "Mymr", + "Nabataean", + "Nbat", + "New_Tai_Lue", + "Talu", + "Newa", + "Nko", + "Nkoo", + "Nushu", + "Nshu", + "Ogham", + "Ogam", + "Ol_Chiki", + "Olck", + "Old_Hungarian", + "Hung", + "Old_Italic", + "Ital", + "Old_North_Arabian", + "Narb", + "Old_Permic", + "Perm", + "Old_Persian", + "Xpeo", + "Old_South_Arabian", + "Sarb", + "Old_Turkic", + "Orkh", + "Oriya", + "Orya", + "Osage", + "Osge", + "Osmanya", + "Osma", + "Pahawh_Hmong", + "Hmng", + "Palmyrene", + "Palm", + "Pau_Cin_Hau", + "Pauc", + "Phags_Pa", + "Phag", + "Phoenician", + "Phnx", + "Psalter_Pahlavi", + "Phlp", + "Rejang", + "Rjng", + "Runic", + "Runr", + "Samaritan", + "Samr", + "Saurashtra", + "Saur", + "Sharada", + "Shrd", + "Shavian", + "Shaw", + "Siddham", + "Sidd", + "SignWriting", + "Sgnw", + "Sinhala", + "Sinh", + "Sora_Sompeng", + "Sora", + "Soyombo", + "Soyo", + "Sundanese", + "Sund", + "Syloti_Nagri", + "Sylo", + "Syriac", + "Syrc", + "Tagalog", + "Tglg", + "Tagbanwa", + "Tagb", + "Tai_Le", + "Tale", + "Tai_Tham", + "Lana", + "Tai_Viet", + "Tavt", + "Takri", + "Takr", + "Tamil", + "Taml", + "Tangut", + "Tang", + "Telugu", + "Telu", + "Thaana", + "Thaa", + "Thai", + "Tibetan", + "Tibt", + "Tifinagh", + "Tfng", + "Tirhuta", + "Tirh", + "Ugaritic", + "Ugar", + "Vai", + "Vaii", + "Warang_Citi", + "Wara", + "Yi", + "Yiii", + "Zanabazar_Square", + "Zanb" + ] +}; +Array.prototype.push.apply(data.$LONE, data.General_Category); +data.gc = data.General_Category; +data.sc = data.Script_Extensions = data.scx = data.Script; + +var pp$9 = Parser.prototype; + +var RegExpValidationState = function RegExpValidationState(parser) { + this.parser = parser; + this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : ""); + this.source = ""; + this.flags = ""; + this.start = 0; + this.switchU = false; + this.switchN = false; + this.pos = 0; + this.lastIntValue = 0; + this.lastStringValue = ""; + this.lastAssertionIsQuantifiable = false; + this.numCapturingParens = 0; + this.maxBackReference = 0; + this.groupNames = []; + this.backReferenceNames = []; +}; + +RegExpValidationState.prototype.reset = function reset (start, pattern, flags) { + var unicode = flags.indexOf("u") !== -1; + this.start = start | 0; + this.source = pattern + ""; + this.flags = flags; + this.switchU = unicode && this.parser.options.ecmaVersion >= 6; + this.switchN = unicode && this.parser.options.ecmaVersion >= 9; +}; + +RegExpValidationState.prototype.raise = function raise (message) { + this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message)); +}; + +// If u flag is given, this returns the code point at the index (it combines a surrogate pair). +// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair). +RegExpValidationState.prototype.at = function at (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return -1 + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return c + } + return (c << 10) + s.charCodeAt(i + 1) - 0x35FDC00 +}; + +RegExpValidationState.prototype.nextIndex = function nextIndex (i) { + var s = this.source; + var l = s.length; + if (i >= l) { + return l + } + var c = s.charCodeAt(i); + if (!this.switchU || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) { + return i + 1 + } + return i + 2 +}; + +RegExpValidationState.prototype.current = function current () { + return this.at(this.pos) +}; + +RegExpValidationState.prototype.lookahead = function lookahead () { + return this.at(this.nextIndex(this.pos)) +}; + +RegExpValidationState.prototype.advance = function advance () { + this.pos = this.nextIndex(this.pos); +}; + +RegExpValidationState.prototype.eat = function eat (ch) { + if (this.current() === ch) { + this.advance(); + return true + } + return false +}; + +function codePointToString$1(ch) { + if (ch <= 0xFFFF) { return String.fromCharCode(ch) } + ch -= 0x10000; + return String.fromCharCode((ch >> 10) + 0xD800, (ch & 0x03FF) + 0xDC00) } +/** + * Validate the flags part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ +pp$9.validateRegExpFlags = function(state) { + var this$1 = this; + + var validFlags = state.validFlags; + var flags = state.flags; + + for (var i = 0; i < flags.length; i++) { + var flag = flags.charAt(i); + if (validFlags.indexOf(flag) == -1) { + this$1.raise(state.start, "Invalid regular expression flag"); + } + if (flags.indexOf(flag, i + 1) > -1) { + this$1.raise(state.start, "Duplicate regular expression flag"); + } + } +}; + +/** + * Validate the pattern part of a given RegExpLiteral. + * + * @param {RegExpValidationState} state The state to validate RegExp. + * @returns {void} + */ +pp$9.validateRegExpPattern = function(state) { + this.regexp_pattern(state); + + // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of + // parsing contains a |GroupName|, reparse with the goal symbol + // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError* + // exception if _P_ did not conform to the grammar, if any elements of _P_ + // were not matched by the parse, or if any Early Error conditions exist. + if (!state.switchN && this.options.ecmaVersion >= 9 && state.groupNames.length > 0) { + state.switchN = true; + this.regexp_pattern(state); + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern +pp$9.regexp_pattern = function(state) { + state.pos = 0; + state.lastIntValue = 0; + state.lastStringValue = ""; + state.lastAssertionIsQuantifiable = false; + state.numCapturingParens = 0; + state.maxBackReference = 0; + state.groupNames.length = 0; + state.backReferenceNames.length = 0; + + this.regexp_disjunction(state); + + if (state.pos !== state.source.length) { + // Make the same messages as V8. + if (state.eat(0x29 /* ) */)) { + state.raise("Unmatched ')'"); + } + if (state.eat(0x5D /* [ */) || state.eat(0x7D /* } */)) { + state.raise("Lone quantifier brackets"); + } + } + if (state.maxBackReference > state.numCapturingParens) { + state.raise("Invalid escape"); + } + for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) { + var name = list[i]; + + if (state.groupNames.indexOf(name) === -1) { + state.raise("Invalid named capture referenced"); + } + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction +pp$9.regexp_disjunction = function(state) { + var this$1 = this; + + this.regexp_alternative(state); + while (state.eat(0x7C /* | */)) { + this$1.regexp_alternative(state); + } + + // Make the same message as V8. + if (this.regexp_eatQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + if (state.eat(0x7B /* { */)) { + state.raise("Lone quantifier brackets"); + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative +pp$9.regexp_alternative = function(state) { + while (state.pos < state.source.length && this.regexp_eatTerm(state)) + { } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term +pp$9.regexp_eatTerm = function(state) { + if (this.regexp_eatAssertion(state)) { + // Handle `QuantifiableAssertion Quantifier` alternative. + // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion + // is a QuantifiableAssertion. + if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) { + // Make the same message as V8. + if (state.switchU) { + state.raise("Invalid quantifier"); + } + } + return true + } + + if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) { + this.regexp_eatQuantifier(state); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion +pp$9.regexp_eatAssertion = function(state) { + var start = state.pos; + state.lastAssertionIsQuantifiable = false; + + // ^, $ + if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) { + return true + } + + // \b \B + if (state.eat(0x5C /* \ */)) { + if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) { + return true + } + state.pos = start; + } + + // Lookahead / Lookbehind + if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) { + var lookbehind = false; + if (this.options.ecmaVersion >= 9) { + lookbehind = state.eat(0x3C /* < */); + } + if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) { + this.regexp_disjunction(state); + if (!state.eat(0x29 /* ) */)) { + state.raise("Unterminated group"); + } + state.lastAssertionIsQuantifiable = !lookbehind; + return true + } + } + + state.pos = start; + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier +pp$9.regexp_eatQuantifier = function(state, noError) { + if ( noError === void 0 ) noError = false; + + if (this.regexp_eatQuantifierPrefix(state, noError)) { + state.eat(0x3F /* ? */); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix +pp$9.regexp_eatQuantifierPrefix = function(state, noError) { + return ( + state.eat(0x2A /* * */) || + state.eat(0x2B /* + */) || + state.eat(0x3F /* ? */) || + this.regexp_eatBracedQuantifier(state, noError) + ) +}; +pp$9.regexp_eatBracedQuantifier = function(state, noError) { + var start = state.pos; + if (state.eat(0x7B /* { */)) { + var min = 0, max = -1; + if (this.regexp_eatDecimalDigits(state)) { + min = state.lastIntValue; + if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) { + max = state.lastIntValue; + } + if (state.eat(0x7D /* } */)) { + // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term + if (max !== -1 && max < min && !noError) { + state.raise("numbers out of order in {} quantifier"); + } + return true + } + } + if (state.switchU && !noError) { + state.raise("Incomplete quantifier"); + } + state.pos = start; + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom +pp$9.regexp_eatAtom = function(state) { + return ( + this.regexp_eatPatternCharacters(state) || + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) + ) +}; +pp$9.regexp_eatReverseSolidusAtomEscape = function(state) { + var start = state.pos; + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatAtomEscape(state)) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatUncapturingGroup = function(state) { + var start = state.pos; + if (state.eat(0x28 /* ( */)) { + if (state.eat(0x3F /* ? */) && state.eat(0x3A /* : */)) { + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + return true + } + state.raise("Unterminated group"); + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatCapturingGroup = function(state) { + if (state.eat(0x28 /* ( */)) { + if (this.options.ecmaVersion >= 9) { + this.regexp_groupSpecifier(state); + } else if (state.current() === 0x3F /* ? */) { + state.raise("Invalid group"); + } + this.regexp_disjunction(state); + if (state.eat(0x29 /* ) */)) { + state.numCapturingParens += 1; + return true + } + state.raise("Unterminated group"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom +pp$9.regexp_eatExtendedAtom = function(state) { + return ( + state.eat(0x2E /* . */) || + this.regexp_eatReverseSolidusAtomEscape(state) || + this.regexp_eatCharacterClass(state) || + this.regexp_eatUncapturingGroup(state) || + this.regexp_eatCapturingGroup(state) || + this.regexp_eatInvalidBracedQuantifier(state) || + this.regexp_eatExtendedPatternCharacter(state) + ) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier +pp$9.regexp_eatInvalidBracedQuantifier = function(state) { + if (this.regexp_eatBracedQuantifier(state, true)) { + state.raise("Nothing to repeat"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter +pp$9.regexp_eatSyntaxCharacter = function(state) { + var ch = state.current(); + if (isSyntaxCharacter(ch)) { + state.lastIntValue = ch; + state.advance(); + return true + } + return false +}; +function isSyntaxCharacter(ch) { + return ( + ch === 0x24 /* $ */ || + ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ || + ch === 0x2E /* . */ || + ch === 0x3F /* ? */ || + ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ || + ch >= 0x7B /* { */ && ch <= 0x7D /* } */ + ) +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter +// But eat eager. +pp$9.regexp_eatPatternCharacters = function(state) { + var start = state.pos; + var ch = 0; + while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) { + state.advance(); + } + return state.pos !== start +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter +pp$9.regexp_eatExtendedPatternCharacter = function(state) { + var ch = state.current(); + if ( + ch !== -1 && + ch !== 0x24 /* $ */ && + !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) && + ch !== 0x2E /* . */ && + ch !== 0x3F /* ? */ && + ch !== 0x5B /* [ */ && + ch !== 0x5E /* ^ */ && + ch !== 0x7C /* | */ + ) { + state.advance(); + return true + } + return false +}; + +// GroupSpecifier[U] :: +// [empty] +// `?` GroupName[?U] +pp$9.regexp_groupSpecifier = function(state) { + if (state.eat(0x3F /* ? */)) { + if (this.regexp_eatGroupName(state)) { + if (state.groupNames.indexOf(state.lastStringValue) !== -1) { + state.raise("Duplicate capture group name"); + } + state.groupNames.push(state.lastStringValue); + return + } + state.raise("Invalid group"); + } +}; + +// GroupName[U] :: +// `<` RegExpIdentifierName[?U] `>` +// Note: this updates `state.lastStringValue` property with the eaten name. +pp$9.regexp_eatGroupName = function(state) { + state.lastStringValue = ""; + if (state.eat(0x3C /* < */)) { + if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) { + return true + } + state.raise("Invalid capture group name"); + } + return false +}; + +// RegExpIdentifierName[U] :: +// RegExpIdentifierStart[?U] +// RegExpIdentifierName[?U] RegExpIdentifierPart[?U] +// Note: this updates `state.lastStringValue` property with the eaten name. +pp$9.regexp_eatRegExpIdentifierName = function(state) { + state.lastStringValue = ""; + if (this.regexp_eatRegExpIdentifierStart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + while (this.regexp_eatRegExpIdentifierPart(state)) { + state.lastStringValue += codePointToString$1(state.lastIntValue); + } + return true + } + return false +}; + +// RegExpIdentifierStart[U] :: +// UnicodeIDStart +// `$` +// `_` +// `\` RegExpUnicodeEscapeSequence[?U] +pp$9.regexp_eatRegExpIdentifierStart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierStart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false +}; +function isRegExpIdentifierStart(ch) { + return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ +} + +// RegExpIdentifierPart[U] :: +// UnicodeIDContinue +// `$` +// `_` +// `\` RegExpUnicodeEscapeSequence[?U] +// <ZWNJ> +// <ZWJ> +pp$9.regexp_eatRegExpIdentifierPart = function(state) { + var start = state.pos; + var ch = state.current(); + state.advance(); + + if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state)) { + ch = state.lastIntValue; + } + if (isRegExpIdentifierPart(ch)) { + state.lastIntValue = ch; + return true + } + + state.pos = start; + return false +}; +function isRegExpIdentifierPart(ch) { + return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape +pp$9.regexp_eatAtomEscape = function(state) { + if ( + this.regexp_eatBackReference(state) || + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) || + (state.switchN && this.regexp_eatKGroupName(state)) + ) { + return true + } + if (state.switchU) { + // Make the same message as V8. + if (state.current() === 0x63 /* c */) { + state.raise("Invalid unicode escape"); + } + state.raise("Invalid escape"); + } + return false +}; +pp$9.regexp_eatBackReference = function(state) { + var start = state.pos; + if (this.regexp_eatDecimalEscape(state)) { + var n = state.lastIntValue; + if (state.switchU) { + // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape + if (n > state.maxBackReference) { + state.maxBackReference = n; + } + return true + } + if (n <= state.numCapturingParens) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatKGroupName = function(state) { + if (state.eat(0x6B /* k */)) { + if (this.regexp_eatGroupName(state)) { + state.backReferenceNames.push(state.lastStringValue); + return true + } + state.raise("Invalid named reference"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape +pp$9.regexp_eatCharacterEscape = function(state) { + return ( + this.regexp_eatControlEscape(state) || + this.regexp_eatCControlLetter(state) || + this.regexp_eatZero(state) || + this.regexp_eatHexEscapeSequence(state) || + this.regexp_eatRegExpUnicodeEscapeSequence(state) || + (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) || + this.regexp_eatIdentityEscape(state) + ) +}; +pp$9.regexp_eatCControlLetter = function(state) { + var start = state.pos; + if (state.eat(0x63 /* c */)) { + if (this.regexp_eatControlLetter(state)) { + return true + } + state.pos = start; + } + return false +}; +pp$9.regexp_eatZero = function(state) { + if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) { + state.lastIntValue = 0; + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape +pp$9.regexp_eatControlEscape = function(state) { + var ch = state.current(); + if (ch === 0x74 /* t */) { + state.lastIntValue = 0x09; /* \t */ + state.advance(); + return true + } + if (ch === 0x6E /* n */) { + state.lastIntValue = 0x0A; /* \n */ + state.advance(); + return true + } + if (ch === 0x76 /* v */) { + state.lastIntValue = 0x0B; /* \v */ + state.advance(); + return true + } + if (ch === 0x66 /* f */) { + state.lastIntValue = 0x0C; /* \f */ + state.advance(); + return true + } + if (ch === 0x72 /* r */) { + state.lastIntValue = 0x0D; /* \r */ + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter +pp$9.regexp_eatControlLetter = function(state) { + var ch = state.current(); + if (isControlLetter(ch)) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false +}; +function isControlLetter(ch) { + return ( + (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) || + (ch >= 0x61 /* a */ && ch <= 0x7A /* z */) + ) +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence +pp$9.regexp_eatRegExpUnicodeEscapeSequence = function(state) { + var start = state.pos; + + if (state.eat(0x75 /* u */)) { + if (this.regexp_eatFixedHexDigits(state, 4)) { + var lead = state.lastIntValue; + if (state.switchU && lead >= 0xD800 && lead <= 0xDBFF) { + var leadSurrogateEnd = state.pos; + if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) { + var trail = state.lastIntValue; + if (trail >= 0xDC00 && trail <= 0xDFFF) { + state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000; + return true + } + } + state.pos = leadSurrogateEnd; + state.lastIntValue = lead; + } + return true + } + if ( + state.switchU && + state.eat(0x7B /* { */) && + this.regexp_eatHexDigits(state) && + state.eat(0x7D /* } */) && + isValidUnicode(state.lastIntValue) + ) { + return true + } + if (state.switchU) { + state.raise("Invalid unicode escape"); + } + state.pos = start; + } + + return false +}; +function isValidUnicode(ch) { + return ch >= 0 && ch <= 0x10FFFF +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape +pp$9.regexp_eatIdentityEscape = function(state) { + if (state.switchU) { + if (this.regexp_eatSyntaxCharacter(state)) { + return true + } + if (state.eat(0x2F /* / */)) { + state.lastIntValue = 0x2F; /* / */ + return true + } + return false + } + + var ch = state.current(); + if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape +pp$9.regexp_eatDecimalEscape = function(state) { + state.lastIntValue = 0; + var ch = state.current(); + if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) { + do { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape +pp$9.regexp_eatCharacterClassEscape = function(state) { + var ch = state.current(); + + if (isCharacterClassEscape(ch)) { + state.lastIntValue = -1; + state.advance(); + return true + } + + if ( + state.switchU && + this.options.ecmaVersion >= 9 && + (ch === 0x50 /* P */ || ch === 0x70 /* p */) + ) { + state.lastIntValue = -1; + state.advance(); + if ( + state.eat(0x7B /* { */) && + this.regexp_eatUnicodePropertyValueExpression(state) && + state.eat(0x7D /* } */) + ) { + return true + } + state.raise("Invalid property name"); + } + + return false +}; +function isCharacterClassEscape(ch) { + return ( + ch === 0x64 /* d */ || + ch === 0x44 /* D */ || + ch === 0x73 /* s */ || + ch === 0x53 /* S */ || + ch === 0x77 /* w */ || + ch === 0x57 /* W */ + ) +} + +// UnicodePropertyValueExpression :: +// UnicodePropertyName `=` UnicodePropertyValue +// LoneUnicodePropertyNameOrValue +pp$9.regexp_eatUnicodePropertyValueExpression = function(state) { + var start = state.pos; + + // UnicodePropertyName `=` UnicodePropertyValue + if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) { + var name = state.lastStringValue; + if (this.regexp_eatUnicodePropertyValue(state)) { + var value = state.lastStringValue; + this.regexp_validateUnicodePropertyNameAndValue(state, name, value); + return true + } + } + state.pos = start; + + // LoneUnicodePropertyNameOrValue + if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) { + var nameOrValue = state.lastStringValue; + this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue); + return true + } + return false +}; +pp$9.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) { + if (!data.hasOwnProperty(name) || data[name].indexOf(value) === -1) { + state.raise("Invalid property name"); + } +}; +pp$9.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) { + if (data.$LONE.indexOf(nameOrValue) === -1) { + state.raise("Invalid property name"); + } +}; + +// UnicodePropertyName :: +// UnicodePropertyNameCharacters +pp$9.regexp_eatUnicodePropertyName = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyNameCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" +}; +function isUnicodePropertyNameCharacter(ch) { + return isControlLetter(ch) || ch === 0x5F /* _ */ +} + +// UnicodePropertyValue :: +// UnicodePropertyValueCharacters +pp$9.regexp_eatUnicodePropertyValue = function(state) { + var ch = 0; + state.lastStringValue = ""; + while (isUnicodePropertyValueCharacter(ch = state.current())) { + state.lastStringValue += codePointToString$1(ch); + state.advance(); + } + return state.lastStringValue !== "" +}; +function isUnicodePropertyValueCharacter(ch) { + return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch) +} + +// LoneUnicodePropertyNameOrValue :: +// UnicodePropertyValueCharacters +pp$9.regexp_eatLoneUnicodePropertyNameOrValue = function(state) { + return this.regexp_eatUnicodePropertyValue(state) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass +pp$9.regexp_eatCharacterClass = function(state) { + if (state.eat(0x5B /* [ */)) { + state.eat(0x5E /* ^ */); + this.regexp_classRanges(state); + if (state.eat(0x5D /* [ */)) { + return true + } + // Unreachable since it threw "unterminated regular expression" error before. + state.raise("Unterminated character class"); + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges +// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges +// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash +pp$9.regexp_classRanges = function(state) { + var this$1 = this; + + while (this.regexp_eatClassAtom(state)) { + var left = state.lastIntValue; + if (state.eat(0x2D /* - */) && this$1.regexp_eatClassAtom(state)) { + var right = state.lastIntValue; + if (state.switchU && (left === -1 || right === -1)) { + state.raise("Invalid character class"); + } + if (left !== -1 && right !== -1 && left > right) { + state.raise("Range out of order in character class"); + } + } + } +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom +// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash +pp$9.regexp_eatClassAtom = function(state) { + var start = state.pos; + + if (state.eat(0x5C /* \ */)) { + if (this.regexp_eatClassEscape(state)) { + return true + } + if (state.switchU) { + // Make the same message as V8. + var ch$1 = state.current(); + if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) { + state.raise("Invalid class escape"); + } + state.raise("Invalid escape"); + } + state.pos = start; + } + + var ch = state.current(); + if (ch !== 0x5D /* [ */) { + state.lastIntValue = ch; + state.advance(); + return true + } + + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape +pp$9.regexp_eatClassEscape = function(state) { + var start = state.pos; + + if (state.eat(0x62 /* b */)) { + state.lastIntValue = 0x08; /* <BS> */ + return true + } + + if (state.switchU && state.eat(0x2D /* - */)) { + state.lastIntValue = 0x2D; /* - */ + return true + } + + if (!state.switchU && state.eat(0x63 /* c */)) { + if (this.regexp_eatClassControlLetter(state)) { + return true + } + state.pos = start; + } + + return ( + this.regexp_eatCharacterClassEscape(state) || + this.regexp_eatCharacterEscape(state) + ) +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter +pp$9.regexp_eatClassControlLetter = function(state) { + var ch = state.current(); + if (isDecimalDigit(ch) || ch === 0x5F /* _ */) { + state.lastIntValue = ch % 0x20; + state.advance(); + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence +pp$9.regexp_eatHexEscapeSequence = function(state) { + var start = state.pos; + if (state.eat(0x78 /* x */)) { + if (this.regexp_eatFixedHexDigits(state, 2)) { + return true + } + if (state.switchU) { + state.raise("Invalid escape"); + } + state.pos = start; + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits +pp$9.regexp_eatDecimalDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isDecimalDigit(ch = state.current())) { + state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */); + state.advance(); + } + return state.pos !== start +}; +function isDecimalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits +pp$9.regexp_eatHexDigits = function(state) { + var start = state.pos; + var ch = 0; + state.lastIntValue = 0; + while (isHexDigit(ch = state.current())) { + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return state.pos !== start +}; +function isHexDigit(ch) { + return ( + (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) || + (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) || + (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) + ) +} +function hexToInt(ch) { + if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) { + return 10 + (ch - 0x41 /* A */) + } + if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) { + return 10 + (ch - 0x61 /* a */) + } + return ch - 0x30 /* 0 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence +// Allows only 0-377(octal) i.e. 0-255(decimal). +pp$9.regexp_eatLegacyOctalEscapeSequence = function(state) { + if (this.regexp_eatOctalDigit(state)) { + var n1 = state.lastIntValue; + if (this.regexp_eatOctalDigit(state)) { + var n2 = state.lastIntValue; + if (n1 <= 3 && this.regexp_eatOctalDigit(state)) { + state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue; + } else { + state.lastIntValue = n1 * 8 + n2; + } + } else { + state.lastIntValue = n1; + } + return true + } + return false +}; + +// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit +pp$9.regexp_eatOctalDigit = function(state) { + var ch = state.current(); + if (isOctalDigit(ch)) { + state.lastIntValue = ch - 0x30; /* 0 */ + state.advance(); + return true + } + state.lastIntValue = 0; + return false +}; +function isOctalDigit(ch) { + return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */ +} + +// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits +// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit +// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence +pp$9.regexp_eatFixedHexDigits = function(state, length) { + var start = state.pos; + state.lastIntValue = 0; + for (var i = 0; i < length; ++i) { + var ch = state.current(); + if (!isHexDigit(ch)) { + state.pos = start; + return false + } + state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch); + state.advance(); + } + return true +}; + // Object type used to represent tokens. Note that normally, tokens // simply exist as properties on the parser object. This is only // used for the onToken callback and the external tokenizer. var Token = function Token(p) { - this.type = p.type - this.value = p.value - this.start = p.start - this.end = p.end + this.type = p.type; + this.value = p.value; + this.start = p.start; + this.end = p.end; if (p.options.locations) - this.loc = new SourceLocation(p, p.startLoc, p.endLoc) + { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); } if (p.options.ranges) - this.range = [p.start, p.end] + { this.range = [p.start, p.end]; } }; // ## Tokenizer -var pp$7 = Parser.prototype - -// Are we running under Rhino? -var isRhino = typeof Packages == "object" && Object.prototype.toString.call(Packages) == "[object JavaPackage]" +var pp$8 = Parser.prototype; // Move to the next token -pp$7.next = function() { +pp$8.next = function() { if (this.options.onToken) - this.options.onToken(new Token(this)) + { this.options.onToken(new Token(this)); } - this.lastTokEnd = this.end - this.lastTokStart = this.start - this.lastTokEndLoc = this.endLoc - this.lastTokStartLoc = this.startLoc - this.nextToken() -} + this.lastTokEnd = this.end; + this.lastTokStart = this.start; + this.lastTokEndLoc = this.endLoc; + this.lastTokStartLoc = this.startLoc; + this.nextToken(); +}; -pp$7.getToken = function() { - this.next() +pp$8.getToken = function() { + this.next(); return new Token(this) -} +}; // If we're in an ES6 environment, make parsers iterable if (typeof Symbol !== "undefined") - pp$7[Symbol.iterator] = function () { - var self = this - return {next: function () { - var token = self.getToken() - return { - done: token.type === tt.eof, - value: token + { pp$8[Symbol.iterator] = function() { + var this$1 = this; + + return { + next: function () { + var token = this$1.getToken(); + return { + done: token.type === types.eof, + value: token + } } - }} - } + } + }; } // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). -pp$7.setStrict = function(strict) { - var this$1 = this; - - this.strict = strict - if (this.type !== tt.num && this.type !== tt.string) return - this.pos = this.start - if (this.options.locations) { - while (this.pos < this.lineStart) { - this$1.lineStart = this$1.input.lastIndexOf("\n", this$1.lineStart - 2) + 1 - --this$1.curLine - } - } - this.nextToken() -} - -pp$7.curContext = function() { +pp$8.curContext = function() { return this.context[this.context.length - 1] -} +}; // Read a single token, updating the parser object's token-related // properties. -pp$7.nextToken = function() { - var curContext = this.curContext() - if (!curContext || !curContext.preserveSpace) this.skipSpace() +pp$8.nextToken = function() { + var curContext = this.curContext(); + if (!curContext || !curContext.preserveSpace) { this.skipSpace(); } - this.start = this.pos - if (this.options.locations) this.startLoc = this.curPosition() - if (this.pos >= this.input.length) return this.finishToken(tt.eof) + this.start = this.pos; + if (this.options.locations) { this.startLoc = this.curPosition(); } + if (this.pos >= this.input.length) { return this.finishToken(types.eof) } - if (curContext.override) return curContext.override(this) - else this.readToken(this.fullCharCodeAtPos()) -} + if (curContext.override) { return curContext.override(this) } + else { this.readToken(this.fullCharCodeAtPos()); } +}; -pp$7.readToken = function(code) { +pp$8.readToken = function(code) { // Identifier or keyword. '\uXXXX' sequences are allowed in // identifiers, so '\' also dispatches to that. if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) - return this.readWord() + { return this.readWord() } return this.getTokenFromCode(code) -} +}; -pp$7.fullCharCodeAtPos = function() { - var code = this.input.charCodeAt(this.pos) - if (code <= 0xd7ff || code >= 0xe000) return code - var next = this.input.charCodeAt(this.pos + 1) +pp$8.fullCharCodeAtPos = function() { + var code = this.input.charCodeAt(this.pos); + if (code <= 0xd7ff || code >= 0xe000) { return code } + var next = this.input.charCodeAt(this.pos + 1); return (code << 10) + next - 0x35fdc00 -} +}; -pp$7.skipBlockComment = function() { +pp$8.skipBlockComment = function() { var this$1 = this; - var startLoc = this.options.onComment && this.curPosition() - var start = this.pos, end = this.input.indexOf("*/", this.pos += 2) - if (end === -1) this.raise(this.pos - 2, "Unterminated comment") - this.pos = end + 2 + var startLoc = this.options.onComment && this.curPosition(); + var start = this.pos, end = this.input.indexOf("*/", this.pos += 2); + if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); } + this.pos = end + 2; if (this.options.locations) { - lineBreakG.lastIndex = start - var match + lineBreakG.lastIndex = start; + var match; while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { - ++this$1.curLine - this$1.lineStart = match.index + match[0].length + ++this$1.curLine; + this$1.lineStart = match.index + match[0].length; } } if (this.options.onComment) - this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, - startLoc, this.curPosition()) -} + { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, + startLoc, this.curPosition()); } +}; -pp$7.skipLineComment = function(startSkip) { +pp$8.skipLineComment = function(startSkip) { var this$1 = this; - var start = this.pos - var startLoc = this.options.onComment && this.curPosition() - var ch = this.input.charCodeAt(this.pos+=startSkip) - while (this.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { - ++this$1.pos - ch = this$1.input.charCodeAt(this$1.pos) + var start = this.pos; + var startLoc = this.options.onComment && this.curPosition(); + var ch = this.input.charCodeAt(this.pos += startSkip); + while (this.pos < this.input.length && !isNewLine(ch)) { + ch = this$1.input.charCodeAt(++this$1.pos); } if (this.options.onComment) - this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, - startLoc, this.curPosition()) -} + { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, + startLoc, this.curPosition()); } +}; // Called at the start of the parse and after every token. Skips // whitespace and comments, and. -pp$7.skipSpace = function() { +pp$8.skipSpace = function() { var this$1 = this; loop: while (this.pos < this.input.length) { - var ch = this$1.input.charCodeAt(this$1.pos) + var ch = this$1.input.charCodeAt(this$1.pos); switch (ch) { - case 32: case 160: // ' ' - ++this$1.pos + case 32: case 160: // ' ' + ++this$1.pos; + break + case 13: + if (this$1.input.charCodeAt(this$1.pos + 1) === 10) { + ++this$1.pos; + } + case 10: case 8232: case 8233: + ++this$1.pos; + if (this$1.options.locations) { + ++this$1.curLine; + this$1.lineStart = this$1.pos; + } + break + case 47: // '/' + switch (this$1.input.charCodeAt(this$1.pos + 1)) { + case 42: // '*' + this$1.skipBlockComment(); break - case 13: - if (this$1.input.charCodeAt(this$1.pos + 1) === 10) { - ++this$1.pos - } - case 10: case 8232: case 8233: - ++this$1.pos - if (this$1.options.locations) { - ++this$1.curLine - this$1.lineStart = this$1.pos - } - break - case 47: // '/' - switch (this$1.input.charCodeAt(this$1.pos + 1)) { - case 42: // '*' - this$1.skipBlockComment() - break - case 47: - this$1.skipLineComment(2) - break - default: - break loop - } + case 47: + this$1.skipLineComment(2); break default: - if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this$1.pos - } else { - break loop - } + break loop + } + break + default: + if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { + ++this$1.pos; + } else { + break loop + } } } -} +}; // Called at the end of every token. Sets `end`, `val`, and // maintains `context` and `exprAllowed`, and skips the space after // the token, so that the next one's `start` will point at the // right position. -pp$7.finishToken = function(type, val) { - this.end = this.pos - if (this.options.locations) this.endLoc = this.curPosition() - var prevType = this.type - this.type = type - this.value = val +pp$8.finishToken = function(type, val) { + this.end = this.pos; + if (this.options.locations) { this.endLoc = this.curPosition(); } + var prevType = this.type; + this.type = type; + this.value = val; - this.updateContext(prevType) -} + this.updateContext(prevType); +}; // ### Token reading @@ -2821,145 +4730,145 @@ // // All in the name of speed. // -pp$7.readToken_dot = function() { - var next = this.input.charCodeAt(this.pos + 1) - if (next >= 48 && next <= 57) return this.readNumber(true) - var next2 = this.input.charCodeAt(this.pos + 2) +pp$8.readToken_dot = function() { + var next = this.input.charCodeAt(this.pos + 1); + if (next >= 48 && next <= 57) { return this.readNumber(true) } + var next2 = this.input.charCodeAt(this.pos + 2); if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.' - this.pos += 3 - return this.finishToken(tt.ellipsis) + this.pos += 3; + return this.finishToken(types.ellipsis) } else { - ++this.pos - return this.finishToken(tt.dot) + ++this.pos; + return this.finishToken(types.dot) } -} +}; -pp$7.readToken_slash = function() { // '/' - var next = this.input.charCodeAt(this.pos + 1) - if (this.exprAllowed) {++this.pos; return this.readRegexp()} - if (next === 61) return this.finishOp(tt.assign, 2) - return this.finishOp(tt.slash, 1) -} +pp$8.readToken_slash = function() { // '/' + var next = this.input.charCodeAt(this.pos + 1); + if (this.exprAllowed) { ++this.pos; return this.readRegexp() } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.slash, 1) +}; -pp$7.readToken_mult_modulo_exp = function(code) { // '%*' - var next = this.input.charCodeAt(this.pos + 1) - var size = 1 - var tokentype = code === 42 ? tt.star : tt.modulo +pp$8.readToken_mult_modulo_exp = function(code) { // '%*' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; + var tokentype = code === 42 ? types.star : types.modulo; // exponentiation operator ** and **= - if (this.options.ecmaVersion >= 7 && next === 42) { - ++size - tokentype = tt.starstar - next = this.input.charCodeAt(this.pos + 2) + if (this.options.ecmaVersion >= 7 && code == 42 && next === 42) { + ++size; + tokentype = types.starstar; + next = this.input.charCodeAt(this.pos + 2); } - if (next === 61) return this.finishOp(tt.assign, size + 1) + if (next === 61) { return this.finishOp(types.assign, size + 1) } return this.finishOp(tokentype, size) -} +}; -pp$7.readToken_pipe_amp = function(code) { // '|&' - var next = this.input.charCodeAt(this.pos + 1) - if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2) - if (next === 61) return this.finishOp(tt.assign, 2) - return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1) -} +pp$8.readToken_pipe_amp = function(code) { // '|&' + var next = this.input.charCodeAt(this.pos + 1); + if (next === code) { return this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2) } + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1) +}; -pp$7.readToken_caret = function() { // '^' - var next = this.input.charCodeAt(this.pos + 1) - if (next === 61) return this.finishOp(tt.assign, 2) - return this.finishOp(tt.bitwiseXOR, 1) -} +pp$8.readToken_caret = function() { // '^' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.bitwiseXOR, 1) +}; -pp$7.readToken_plus_min = function(code) { // '+-' - var next = this.input.charCodeAt(this.pos + 1) +pp$8.readToken_plus_min = function(code) { // '+-' + var next = this.input.charCodeAt(this.pos + 1); if (next === code) { - if (next == 45 && this.input.charCodeAt(this.pos + 2) == 62 && - lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) { + if (next == 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) == 62 && + (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) { // A `-->` line comment - this.skipLineComment(3) - this.skipSpace() + this.skipLineComment(3); + this.skipSpace(); return this.nextToken() } - return this.finishOp(tt.incDec, 2) + return this.finishOp(types.incDec, 2) } - if (next === 61) return this.finishOp(tt.assign, 2) - return this.finishOp(tt.plusMin, 1) -} + if (next === 61) { return this.finishOp(types.assign, 2) } + return this.finishOp(types.plusMin, 1) +}; -pp$7.readToken_lt_gt = function(code) { // '<>' - var next = this.input.charCodeAt(this.pos + 1) - var size = 1 +pp$8.readToken_lt_gt = function(code) { // '<>' + var next = this.input.charCodeAt(this.pos + 1); + var size = 1; if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 - if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) - return this.finishOp(tt.bitShift, size) + size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; + if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types.assign, size + 1) } + return this.finishOp(types.bitShift, size) } - if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && + if (next == 33 && code == 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) == 45 && this.input.charCodeAt(this.pos + 3) == 45) { - if (this.inModule) this.unexpected() // `<!--`, an XML-style comment that should be interpreted as a line comment - this.skipLineComment(4) - this.skipSpace() + this.skipLineComment(4); + this.skipSpace(); return this.nextToken() } - if (next === 61) size = 2 - return this.finishOp(tt.relational, size) -} + if (next === 61) { size = 2; } + return this.finishOp(types.relational, size) +}; -pp$7.readToken_eq_excl = function(code) { // '=!' - var next = this.input.charCodeAt(this.pos + 1) - if (next === 61) return this.finishOp(tt.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) +pp$8.readToken_eq_excl = function(code) { // '=!' + var next = this.input.charCodeAt(this.pos + 1); + if (next === 61) { return this.finishOp(types.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) } if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>' - this.pos += 2 - return this.finishToken(tt.arrow) + this.pos += 2; + return this.finishToken(types.arrow) } - return this.finishOp(code === 61 ? tt.eq : tt.prefix, 1) -} + return this.finishOp(code === 61 ? types.eq : types.prefix, 1) +}; -pp$7.getTokenFromCode = function(code) { +pp$8.getTokenFromCode = function(code) { switch (code) { - // The interpretation of a dot depends on whether it is followed - // by a digit or another two dots. + // The interpretation of a dot depends on whether it is followed + // by a digit or another two dots. case 46: // '.' return this.readToken_dot() - // Punctuation tokens. - case 40: ++this.pos; return this.finishToken(tt.parenL) - case 41: ++this.pos; return this.finishToken(tt.parenR) - case 59: ++this.pos; return this.finishToken(tt.semi) - case 44: ++this.pos; return this.finishToken(tt.comma) - case 91: ++this.pos; return this.finishToken(tt.bracketL) - case 93: ++this.pos; return this.finishToken(tt.bracketR) - case 123: ++this.pos; return this.finishToken(tt.braceL) - case 125: ++this.pos; return this.finishToken(tt.braceR) - case 58: ++this.pos; return this.finishToken(tt.colon) - case 63: ++this.pos; return this.finishToken(tt.question) + // Punctuation tokens. + case 40: ++this.pos; return this.finishToken(types.parenL) + case 41: ++this.pos; return this.finishToken(types.parenR) + case 59: ++this.pos; return this.finishToken(types.semi) + case 44: ++this.pos; return this.finishToken(types.comma) + case 91: ++this.pos; return this.finishToken(types.bracketL) + case 93: ++this.pos; return this.finishToken(types.bracketR) + case 123: ++this.pos; return this.finishToken(types.braceL) + case 125: ++this.pos; return this.finishToken(types.braceR) + case 58: ++this.pos; return this.finishToken(types.colon) + case 63: ++this.pos; return this.finishToken(types.question) case 96: // '`' - if (this.options.ecmaVersion < 6) break - ++this.pos - return this.finishToken(tt.backQuote) + if (this.options.ecmaVersion < 6) { break } + ++this.pos; + return this.finishToken(types.backQuote) case 48: // '0' - var next = this.input.charCodeAt(this.pos + 1) - if (next === 120 || next === 88) return this.readRadixNumber(16) // '0x', '0X' - hex number + var next = this.input.charCodeAt(this.pos + 1); + if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number if (this.options.ecmaVersion >= 6) { - if (next === 111 || next === 79) return this.readRadixNumber(8) // '0o', '0O' - octal number - if (next === 98 || next === 66) return this.readRadixNumber(2) // '0b', '0B' - binary number + if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number + if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number } - // Anything else beginning with a digit is an integer, octal - // number, or float. + + // Anything else beginning with a digit is an integer, octal + // number, or float. case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9 return this.readNumber(false) - // Quotes produce strings. + // Quotes produce strings. case 34: case 39: // '"', "'" return this.readString(code) - // Operators are parsed inline in tiny state machines. '=' (61) is - // often referred to. `finishOp` simply skips the amount of - // characters it is given as second argument, and returns a token - // of the type given by its first argument. + // Operators are parsed inline in tiny state machines. '=' (61) is + // often referred to. `finishOp` simply skips the amount of + // characters it is given as second argument, and returns a token + // of the type given by its first argument. case 47: // '/' return this.readToken_slash() @@ -2983,255 +4892,265 @@ return this.readToken_eq_excl(code) case 126: // '~' - return this.finishOp(tt.prefix, 1) + return this.finishOp(types.prefix, 1) } - this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'") -} + this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'"); +}; -pp$7.finishOp = function(type, size) { - var str = this.input.slice(this.pos, this.pos + size) - this.pos += size +pp$8.finishOp = function(type, size) { + var str = this.input.slice(this.pos, this.pos + size); + this.pos += size; return this.finishToken(type, str) -} +}; -// Parse a regular expression. Some context-awareness is necessary, -// since a '/' inside a '[]' set does not end the expression. - -function tryCreateRegexp(src, flags, throwErrorAt, parser) { - try { - return new RegExp(src, flags) - } catch (e) { - if (throwErrorAt !== undefined) { - if (e instanceof SyntaxError) parser.raise(throwErrorAt, "Error parsing regular expression: " + e.message) - throw e - } - } -} - -var regexpUnicodeSupport = !!tryCreateRegexp("\uffff", "u") - -pp$7.readRegexp = function() { +pp$8.readRegexp = function() { var this$1 = this; - var escaped, inClass, start = this.pos + var escaped, inClass, start = this.pos; for (;;) { - if (this$1.pos >= this$1.input.length) this$1.raise(start, "Unterminated regular expression") - var ch = this$1.input.charAt(this$1.pos) - if (lineBreak.test(ch)) this$1.raise(start, "Unterminated regular expression") + if (this$1.pos >= this$1.input.length) { this$1.raise(start, "Unterminated regular expression"); } + var ch = this$1.input.charAt(this$1.pos); + if (lineBreak.test(ch)) { this$1.raise(start, "Unterminated regular expression"); } if (!escaped) { - if (ch === "[") inClass = true - else if (ch === "]" && inClass) inClass = false - else if (ch === "/" && !inClass) break - escaped = ch === "\\" - } else escaped = false - ++this$1.pos + if (ch === "[") { inClass = true; } + else if (ch === "]" && inClass) { inClass = false; } + else if (ch === "/" && !inClass) { break } + escaped = ch === "\\"; + } else { escaped = false; } + ++this$1.pos; } - var content = this.input.slice(start, this.pos) - ++this.pos - // Need to use `readWord1` because '\uXXXX' sequences are allowed - // here (don't ask). - var mods = this.readWord1() - var tmp = content, tmpFlags = "" - if (mods) { - var validFlags = /^[gim]*$/ - if (this.options.ecmaVersion >= 6) validFlags = /^[gimuy]*$/ - if (!validFlags.test(mods)) this.raise(start, "Invalid regular expression flag") - if (mods.indexOf("u") >= 0) { - if (regexpUnicodeSupport) { - tmpFlags = "u" - } else { - // Replace each astral symbol and every Unicode escape sequence that - // possibly represents an astral symbol or a paired surrogate with a - // single ASCII symbol to avoid throwing on regular expressions that - // are only valid in combination with the `/u` flag. - // Note: replacing with the ASCII symbol `x` might cause false - // negatives in unlikely scenarios. For example, `[\u{61}-b]` is a - // perfectly valid pattern that is equivalent to `[a-b]`, but it would - // be replaced by `[x-b]` which throws an error. - tmp = tmp.replace(/\\u\{([0-9a-fA-F]+)\}/g, function (_match, code, offset) { - code = Number("0x" + code) - if (code > 0x10FFFF) this$1.raise(start + offset + 3, "Code point out of bounds") - return "x" - }) - tmp = tmp.replace(/\\u([a-fA-F0-9]{4})|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "x") - tmpFlags = tmpFlags.replace("u", "") - } - } + var pattern = this.input.slice(start, this.pos); + ++this.pos; + var flagsStart = this.pos; + var flags = this.readWord1(); + if (this.containsEsc) { this.unexpected(flagsStart); } + + // Validate pattern + var state = this.regexpState || (this.regexpState = new RegExpValidationState(this)); + state.reset(start, pattern, flags); + this.validateRegExpFlags(state); + this.validateRegExpPattern(state); + + // Create Literal#value property value. + var value = null; + try { + value = new RegExp(pattern, flags); + } catch (e) { + // ESTree requires null if it failed to instantiate RegExp object. + // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral } - // Detect invalid regular expressions. - var value = null - // Rhino's regular expression parser is flaky and throws uncatchable exceptions, - // so don't do detection if we are running under Rhino - if (!isRhino) { - tryCreateRegexp(tmp, tmpFlags, start, this) - // Get a regular expression object for this pattern-flag pair, or `null` in - // case the current environment doesn't support the flags it uses. - value = tryCreateRegexp(content, mods) - } - return this.finishToken(tt.regexp, {pattern: content, flags: mods, value: value}) -} + + return this.finishToken(types.regexp, {pattern: pattern, flags: flags, value: value}) +}; // Read an integer in the given radix. Return null if zero digits // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. -pp$7.readInt = function(radix, len) { +pp$8.readInt = function(radix, len) { var this$1 = this; - var start = this.pos, total = 0 + var start = this.pos, total = 0; for (var i = 0, e = len == null ? Infinity : len; i < e; ++i) { - var code = this$1.input.charCodeAt(this$1.pos), val - if (code >= 97) val = code - 97 + 10 // a - else if (code >= 65) val = code - 65 + 10 // A - else if (code >= 48 && code <= 57) val = code - 48 // 0-9 - else val = Infinity - if (val >= radix) break - ++this$1.pos - total = total * radix + val + var code = this$1.input.charCodeAt(this$1.pos), val = (void 0); + if (code >= 97) { val = code - 97 + 10; } // a + else if (code >= 65) { val = code - 65 + 10; } // A + else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9 + else { val = Infinity; } + if (val >= radix) { break } + ++this$1.pos; + total = total * radix + val; } - if (this.pos === start || len != null && this.pos - start !== len) return null + if (this.pos === start || len != null && this.pos - start !== len) { return null } return total -} +}; -pp$7.readRadixNumber = function(radix) { - this.pos += 2 // 0x - var val = this.readInt(radix) - if (val == null) this.raise(this.start + 2, "Expected number in radix " + radix) - if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number") - return this.finishToken(tt.num, val) -} +pp$8.readRadixNumber = function(radix) { + this.pos += 2; // 0x + var val = this.readInt(radix); + if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); } + if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } + return this.finishToken(types.num, val) +}; // Read an integer, octal integer, or floating-point number. -pp$7.readNumber = function(startsWithDot) { - var start = this.pos, isFloat = false, octal = this.input.charCodeAt(this.pos) === 48 - if (!startsWithDot && this.readInt(10) === null) this.raise(start, "Invalid number") - if (octal && this.pos == start + 1) octal = false - var next = this.input.charCodeAt(this.pos) +pp$8.readNumber = function(startsWithDot) { + var start = this.pos; + if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); } + var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48; + if (octal && this.strict) { this.raise(start, "Invalid number"); } + if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; } + var next = this.input.charCodeAt(this.pos); if (next === 46 && !octal) { // '.' - ++this.pos - this.readInt(10) - isFloat = true - next = this.input.charCodeAt(this.pos) + ++this.pos; + this.readInt(10); + next = this.input.charCodeAt(this.pos); } if ((next === 69 || next === 101) && !octal) { // 'eE' - next = this.input.charCodeAt(++this.pos) - if (next === 43 || next === 45) ++this.pos // '+-' - if (this.readInt(10) === null) this.raise(start, "Invalid number") - isFloat = true + next = this.input.charCodeAt(++this.pos); + if (next === 43 || next === 45) { ++this.pos; } // '+-' + if (this.readInt(10) === null) { this.raise(start, "Invalid number"); } } - if (isIdentifierStart(this.fullCharCodeAtPos())) this.raise(this.pos, "Identifier directly after number") + if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); } - var str = this.input.slice(start, this.pos), val - if (isFloat) val = parseFloat(str) - else if (!octal || str.length === 1) val = parseInt(str, 10) - else if (/[89]/.test(str) || this.strict) this.raise(start, "Invalid number") - else val = parseInt(str, 8) - return this.finishToken(tt.num, val) -} + var str = this.input.slice(start, this.pos); + var val = octal ? parseInt(str, 8) : parseFloat(str); + return this.finishToken(types.num, val) +}; // Read a string value, interpreting backslash-escapes. -pp$7.readCodePoint = function() { - var ch = this.input.charCodeAt(this.pos), code +pp$8.readCodePoint = function() { + var ch = this.input.charCodeAt(this.pos), code; - if (ch === 123) { - if (this.options.ecmaVersion < 6) this.unexpected() - var codePos = ++this.pos - code = this.readHexChar(this.input.indexOf('}', this.pos) - this.pos) - ++this.pos - if (code > 0x10FFFF) this.raise(codePos, "Code point out of bounds") + if (ch === 123) { // '{' + if (this.options.ecmaVersion < 6) { this.unexpected(); } + var codePos = ++this.pos; + code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos); + ++this.pos; + if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); } } else { - code = this.readHexChar(4) + code = this.readHexChar(4); } return code -} +}; function codePointToString(code) { // UTF-16 Decoding - if (code <= 0xFFFF) return String.fromCharCode(code) - code -= 0x10000 + if (code <= 0xFFFF) { return String.fromCharCode(code) } + code -= 0x10000; return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00) } -pp$7.readString = function(quote) { +pp$8.readString = function(quote) { var this$1 = this; - var out = "", chunkStart = ++this.pos + var out = "", chunkStart = ++this.pos; for (;;) { - if (this$1.pos >= this$1.input.length) this$1.raise(this$1.start, "Unterminated string constant") - var ch = this$1.input.charCodeAt(this$1.pos) - if (ch === quote) break + if (this$1.pos >= this$1.input.length) { this$1.raise(this$1.start, "Unterminated string constant"); } + var ch = this$1.input.charCodeAt(this$1.pos); + if (ch === quote) { break } if (ch === 92) { // '\' - out += this$1.input.slice(chunkStart, this$1.pos) - out += this$1.readEscapedChar(false) - chunkStart = this$1.pos + out += this$1.input.slice(chunkStart, this$1.pos); + out += this$1.readEscapedChar(false); + chunkStart = this$1.pos; } else { - if (isNewLine(ch)) this$1.raise(this$1.start, "Unterminated string constant") - ++this$1.pos + if (isNewLine(ch)) { this$1.raise(this$1.start, "Unterminated string constant"); } + ++this$1.pos; } } - out += this.input.slice(chunkStart, this.pos++) - return this.finishToken(tt.string, out) -} + out += this.input.slice(chunkStart, this.pos++); + return this.finishToken(types.string, out) +}; // Reads template string tokens. -pp$7.readTmplToken = function() { - var this$1 = this; +var INVALID_TEMPLATE_ESCAPE_ERROR = {}; - var out = "", chunkStart = this.pos - for (;;) { - if (this$1.pos >= this$1.input.length) this$1.raise(this$1.start, "Unterminated template") - var ch = this$1.input.charCodeAt(this$1.pos) - if (ch === 96 || ch === 36 && this$1.input.charCodeAt(this$1.pos + 1) === 123) { // '`', '${' - if (this$1.pos === this$1.start && this$1.type === tt.template) { - if (ch === 36) { - this$1.pos += 2 - return this$1.finishToken(tt.dollarBraceL) - } else { - ++this$1.pos - return this$1.finishToken(tt.backQuote) - } - } - out += this$1.input.slice(chunkStart, this$1.pos) - return this$1.finishToken(tt.template, out) - } - if (ch === 92) { // '\' - out += this$1.input.slice(chunkStart, this$1.pos) - out += this$1.readEscapedChar(true) - chunkStart = this$1.pos - } else if (isNewLine(ch)) { - out += this$1.input.slice(chunkStart, this$1.pos) - ++this$1.pos - switch (ch) { - case 13: - if (this$1.input.charCodeAt(this$1.pos) === 10) ++this$1.pos - case 10: - out += "\n" - break - default: - out += String.fromCharCode(ch) - break - } - if (this$1.options.locations) { - ++this$1.curLine - this$1.lineStart = this$1.pos - } - chunkStart = this$1.pos +pp$8.tryReadTemplateToken = function() { + this.inTemplateElement = true; + try { + this.readTmplToken(); + } catch (err) { + if (err === INVALID_TEMPLATE_ESCAPE_ERROR) { + this.readInvalidTemplateToken(); } else { - ++this$1.pos + throw err } } -} + + this.inTemplateElement = false; +}; + +pp$8.invalidStringToken = function(position, message) { + if (this.inTemplateElement && this.options.ecmaVersion >= 9) { + throw INVALID_TEMPLATE_ESCAPE_ERROR + } else { + this.raise(position, message); + } +}; + +pp$8.readTmplToken = function() { + var this$1 = this; + + var out = "", chunkStart = this.pos; + for (;;) { + if (this$1.pos >= this$1.input.length) { this$1.raise(this$1.start, "Unterminated template"); } + var ch = this$1.input.charCodeAt(this$1.pos); + if (ch === 96 || ch === 36 && this$1.input.charCodeAt(this$1.pos + 1) === 123) { // '`', '${' + if (this$1.pos === this$1.start && (this$1.type === types.template || this$1.type === types.invalidTemplate)) { + if (ch === 36) { + this$1.pos += 2; + return this$1.finishToken(types.dollarBraceL) + } else { + ++this$1.pos; + return this$1.finishToken(types.backQuote) + } + } + out += this$1.input.slice(chunkStart, this$1.pos); + return this$1.finishToken(types.template, out) + } + if (ch === 92) { // '\' + out += this$1.input.slice(chunkStart, this$1.pos); + out += this$1.readEscapedChar(true); + chunkStart = this$1.pos; + } else if (isNewLine(ch)) { + out += this$1.input.slice(chunkStart, this$1.pos); + ++this$1.pos; + switch (ch) { + case 13: + if (this$1.input.charCodeAt(this$1.pos) === 10) { ++this$1.pos; } + case 10: + out += "\n"; + break + default: + out += String.fromCharCode(ch); + break + } + if (this$1.options.locations) { + ++this$1.curLine; + this$1.lineStart = this$1.pos; + } + chunkStart = this$1.pos; + } else { + ++this$1.pos; + } + } +}; + +// Reads a template token to search for the end, without validating any escape sequences +pp$8.readInvalidTemplateToken = function() { + var this$1 = this; + + for (; this.pos < this.input.length; this.pos++) { + switch (this$1.input[this$1.pos]) { + case "\\": + ++this$1.pos; + break + + case "$": + if (this$1.input[this$1.pos + 1] !== "{") { + break + } + // falls through + + case "`": + return this$1.finishToken(types.invalidTemplate, this$1.input.slice(this$1.start, this$1.pos)) + + // no default + } + } + this.raise(this.start, "Unterminated template"); +}; // Used to read escaped characters -pp$7.readEscapedChar = function(inTemplate) { - var ch = this.input.charCodeAt(++this.pos) - ++this.pos +pp$8.readEscapedChar = function(inTemplate) { + var ch = this.input.charCodeAt(++this.pos); + ++this.pos; switch (ch) { case 110: return "\n" // 'n' -> '\n' case 114: return "\r" // 'r' -> '\r' @@ -3241,36 +5160,42 @@ case 98: return "\b" // 'b' -> '\b' case 118: return "\u000b" // 'v' -> '\u000b' case 102: return "\f" // 'f' -> '\f' - case 13: if (this.input.charCodeAt(this.pos) === 10) ++this.pos // '\r\n' + case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n' case 10: // ' \n' - if (this.options.locations) { this.lineStart = this.pos; ++this.curLine } + if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; } return "" default: if (ch >= 48 && ch <= 55) { - var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0] - var octal = parseInt(octalStr, 8) + var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0]; + var octal = parseInt(octalStr, 8); if (octal > 255) { - octalStr = octalStr.slice(0, -1) - octal = parseInt(octalStr, 8) + octalStr = octalStr.slice(0, -1); + octal = parseInt(octalStr, 8); } - if (octalStr !== "0" && (this.strict || inTemplate)) { - this.raise(this.pos - 2, "Octal literal in strict mode") + this.pos += octalStr.length - 1; + ch = this.input.charCodeAt(this.pos); + if ((octalStr !== "0" || ch == 56 || ch == 57) && (this.strict || inTemplate)) { + this.invalidStringToken( + this.pos - 1 - octalStr.length, + inTemplate + ? "Octal literal in template string" + : "Octal literal in strict mode" + ); } - this.pos += octalStr.length - 1 return String.fromCharCode(octal) } return String.fromCharCode(ch) } -} +}; // Used to read character escape sequences ('\x', '\u', '\U'). -pp$7.readHexChar = function(len) { - var codePos = this.pos - var n = this.readInt(16, len) - if (n === null) this.raise(codePos, "Bad character escape sequence") +pp$8.readHexChar = function(len) { + var codePos = this.pos; + var n = this.readInt(16, len); + if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); } return n -} +}; // Read an identifier, and return it as a string. Sets `this.containsEsc` // to whether the word contained a '\u' escape. @@ -3278,46 +5203,48 @@ // Incrementally adds only escaped chars, adding other chunks as-is // as a micro-optimization. -pp$7.readWord1 = function() { +pp$8.readWord1 = function() { var this$1 = this; - this.containsEsc = false - var word = "", first = true, chunkStart = this.pos - var astral = this.options.ecmaVersion >= 6 + this.containsEsc = false; + var word = "", first = true, chunkStart = this.pos; + var astral = this.options.ecmaVersion >= 6; while (this.pos < this.input.length) { - var ch = this$1.fullCharCodeAtPos() + var ch = this$1.fullCharCodeAtPos(); if (isIdentifierChar(ch, astral)) { - this$1.pos += ch <= 0xffff ? 1 : 2 + this$1.pos += ch <= 0xffff ? 1 : 2; } else if (ch === 92) { // "\" - this$1.containsEsc = true - word += this$1.input.slice(chunkStart, this$1.pos) - var escStart = this$1.pos + this$1.containsEsc = true; + word += this$1.input.slice(chunkStart, this$1.pos); + var escStart = this$1.pos; if (this$1.input.charCodeAt(++this$1.pos) != 117) // "u" - this$1.raise(this$1.pos, "Expecting Unicode escape sequence \\uXXXX") - ++this$1.pos - var esc = this$1.readCodePoint() + { this$1.invalidStringToken(this$1.pos, "Expecting Unicode escape sequence \\uXXXX"); } + ++this$1.pos; + var esc = this$1.readCodePoint(); if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral)) - this$1.raise(escStart, "Invalid Unicode escape") - word += codePointToString(esc) - chunkStart = this$1.pos + { this$1.invalidStringToken(escStart, "Invalid Unicode escape"); } + word += codePointToString(esc); + chunkStart = this$1.pos; } else { break } - first = false + first = false; } return word + this.input.slice(chunkStart, this.pos) -} +}; // Read an identifier or keyword token. Will check for reserved // words when necessary. -pp$7.readWord = function() { - var word = this.readWord1() - var type = tt.name - if ((this.options.ecmaVersion >= 6 || !this.containsEsc) && this.keywords.test(word)) - type = keywordTypes[word] +pp$8.readWord = function() { + var word = this.readWord1(); + var type = types.name; + if (this.keywords.test(word)) { + if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword " + word); } + type = keywords$1[word]; + } return this.finishToken(type, word) -} +}; // Acorn is a tiny, fast JavaScript parser written in JavaScript. // @@ -3327,11 +5254,11 @@ // Git repositories for Acorn are available at // // http://marijnhaverbeke.nl/git/acorn -// https://github.com/ternjs/acorn.git +// https://github.com/acornjs/acorn.git // // Please use the [github bug tracker][ghbt] to report issues. // -// [ghbt]: https://github.com/ternjs/acorn/issues +// [ghbt]: https://github.com/acornjs/acorn/issues // // This file defines the main parser interface. The library also comes // with a [error-tolerant parser][dammit] and an @@ -3340,7 +5267,7 @@ // [dammit]: acorn_loose.js // [walk]: util/walk.js -var version = "4.0.3" +var version = "5.5.3"; // The main exported interface (under `self.acorn` when in the // browser) is a `parse` function that takes a code string and @@ -3358,8 +5285,8 @@ // that embed JavaScript expressions. function parseExpressionAt(input, pos, options) { - var p = new Parser(options, input, pos) - p.nextToken() + var p = new Parser(options, input, pos); + p.nextToken(); return p.parseExpression() } @@ -3373,10 +5300,11 @@ // This is a terrible kludge to support the existing, pre-ES6 // interface where the loose parser module retroactively adds exports // to this module. -function addLooseExports(parse, Parser, plugins) { - exports.parse_dammit = parse - exports.LooseParser = Parser - exports.pluginsLoose = plugins + // eslint-disable-line camelcase +function addLooseExports(parse, Parser$$1, plugins$$1) { + exports.parse_dammit = parse; // eslint-disable-line camelcase + exports.LooseParser = Parser$$1; + exports.pluginsLoose = plugins$$1; } exports.version = version; @@ -3392,17 +5320,18 @@ exports.getLineInfo = getLineInfo; exports.Node = Node; exports.TokenType = TokenType; -exports.tokTypes = tt; +exports.tokTypes = types; +exports.keywordTypes = keywords$1; exports.TokContext = TokContext; -exports.tokContexts = types; +exports.tokContexts = types$1; exports.isIdentifierChar = isIdentifierChar; exports.isIdentifierStart = isIdentifierStart; exports.Token = Token; exports.isNewLine = isNewLine; exports.lineBreak = lineBreak; exports.lineBreakG = lineBreakG; +exports.nonASCIIwhitespace = nonASCIIwhitespace; Object.defineProperty(exports, '__esModule', { value: true }); }))); -// clang-format on
diff --git a/third_party/WebKit/Source/devtools/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js b/third_party/WebKit/Source/devtools/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js index a91c1cf..7ee4ee2 100644 --- a/third_party/WebKit/Source/devtools/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js +++ b/third_party/WebKit/Source/devtools/front_end/heap_profiler_test_runner/HeapProfilerTestRunner.js
@@ -117,7 +117,8 @@ 'regexp': 'regexp', 'number': 'number', 'native': 'native', - 'synthetic': 'synthetic' + 'synthetic': 'synthetic', + 'bigint': 'bigint' }; HeapProfilerTestRunner.HeapNode.prototype = {
diff --git a/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js b/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js index 608df475..4a2850d 100644 --- a/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js +++ b/third_party/WebKit/Source/devtools/front_end/object_ui/JavaScriptAutocomplete.js
@@ -236,7 +236,9 @@ completions = await object.callFunctionJSONPromise(getCompletions, [SDK.RemoteObject.toCallArgument(object.subtype)]) || []; - } else if (object.type === 'string' || object.type === 'number' || object.type === 'boolean') { + } else if ( + object.type === 'string' || object.type === 'number' || object.type === 'boolean' || + object.type === 'bigint') { const evaluateResult = await executionContext.evaluate( { expression: '(' + getCompletions + ')("' + object.type + '")', @@ -283,6 +285,9 @@ object = new String(''); else if (type === 'number') object = new Number(0); + // Object-wrapped BigInts cannot be constructed via `new BigInt`. + else if (type === 'bigint') + object = Object(BigInt(0)); else if (type === 'boolean') object = new Boolean(false); else
diff --git a/third_party/WebKit/Source/devtools/front_end/object_ui/objectValue.css b/third_party/WebKit/Source/devtools/front_end/object_ui/objectValue.css index 6cdc72a7..6d75996 100644 --- a/third_party/WebKit/Source/devtools/front_end/object_ui/objectValue.css +++ b/third_party/WebKit/Source/devtools/front_end/object_ui/objectValue.css
@@ -41,6 +41,10 @@ color: rgb(28, 0, 207); } +.object-value-bigint { + color: rgb(0, 93, 0); +} + .object-value-string, .object-value-regexp, .object-value-symbol {
diff --git a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js index 9a1a7b3..c2e0d78 100644 --- a/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js +++ b/third_party/WebKit/Source/devtools/front_end/profiler/HeapSnapshotGridNodes.js
@@ -536,6 +536,9 @@ value = value + '()'; valueStyle = 'function'; break; + case 'bigint': + valueStyle = 'bigint'; + break; case 'number': valueStyle = 'number'; break;
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js index 2ddbd54..8ab3a32 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
@@ -84,7 +84,7 @@ } /** - * @param {!Protocol.Runtime.RemoteObject|!SDK.RemoteObject|number|string|boolean|undefined|null} object + * @param {!Protocol.Runtime.RemoteObject|!SDK.RemoteObject|number|string|boolean|undefined|null|bigint} object * @return {!Protocol.Runtime.CallArgument} */ static toCallArgument(object) { @@ -94,24 +94,27 @@ if (type === 'number') { const description = String(object); if (object === 0 && 1 / object < 0) - return {unserializableValue: Protocol.Runtime.UnserializableValue.Negative0}; - if (description === 'NaN') - return {unserializableValue: Protocol.Runtime.UnserializableValue.NaN}; - if (description === 'Infinity') - return {unserializableValue: Protocol.Runtime.UnserializableValue.Infinity}; - if (description === '-Infinity') - return {unserializableValue: Protocol.Runtime.UnserializableValue.NegativeInfinity}; + return {unserializableValue: SDK.RemoteObject.UnserializableNumber.Negative0}; + if (description === SDK.RemoteObject.UnserializableNumber.NaN || + description === SDK.RemoteObject.UnserializableNumber.Infinity || + description === SDK.RemoteObject.UnserializableNumber.NegativeInfinity) + return {unserializableValue: description}; return {value: object}; } + if (type === 'bigint') { + const value = String(object) + 'n'; + return {unserializableValue: /** @type {!Protocol.Runtime.UnserializableValue} */ (value)}; + } if (type === 'string' || type === 'boolean') return {value: object}; if (!object) return {value: null}; - if (typeof object.unserializableValue !== 'undefined') + const isSDKRemoteObject = object instanceof SDK.RemoteObjectImpl; + if (!isSDKRemoteObject && typeof object.unserializableValue !== 'undefined') return {unserializableValue: object.unserializableValue}; - if (object instanceof SDK.RemoteObjectImpl && typeof object._unserializableValue !== 'undefined') + if (isSDKRemoteObject && typeof object._unserializableValue !== 'undefined') return {unserializableValue: object._unserializableValue}; if (typeof object.objectId !== 'undefined') @@ -213,6 +216,11 @@ } /** @return {string|undefined} */ + unserializableValue() { + throw 'Not implemented'; + } + + /** @return {string|undefined} */ get description() { throw 'Not implemented'; } @@ -443,13 +451,15 @@ if (!this._description && (typeof value !== 'object' || value === null)) this._description = value + ''; this._hasChildren = false; - if (typeof unserializableValue !== 'undefined') { + if (typeof unserializableValue === 'string') { this._unserializableValue = unserializableValue; - if (unserializableValue === Protocol.Runtime.UnserializableValue.Infinity || - unserializableValue === Protocol.Runtime.UnserializableValue.NegativeInfinity || - unserializableValue === Protocol.Runtime.UnserializableValue.Negative0 || - unserializableValue === Protocol.Runtime.UnserializableValue.NaN) + if (unserializableValue === SDK.RemoteObject.UnserializableNumber.Infinity || + unserializableValue === SDK.RemoteObject.UnserializableNumber.NegativeInfinity || + unserializableValue === SDK.RemoteObject.UnserializableNumber.Negative0 || + unserializableValue === SDK.RemoteObject.UnserializableNumber.NaN) this._value = Number(unserializableValue); + else if (type === 'bigint' && unserializableValue.endsWith('n')) + this._value = BigInt(unserializableValue.substring(0, unserializableValue.length - 1)); else this._value = unserializableValue; @@ -504,6 +514,14 @@ * @override * @return {string|undefined} */ + unserializableValue() { + return this._unserializableValue; + } + + /** + * @override + * @return {string|undefined} + */ get description() { return this._description; } @@ -1389,3 +1407,14 @@ * @type {!RegExp} */ SDK.RemoteObject._descriptionLengthSquareRegex = /\[([0-9]+)\]/; + +/** + * @const + * @enum {!Protocol.Runtime.UnserializableValue} + */ +SDK.RemoteObject.UnserializableNumber = { + Negative0: /** @type {!Protocol.Runtime.UnserializableValue} */ ('-0'), + NaN: /** @type {!Protocol.Runtime.UnserializableValue} */ ('NaN'), + Infinity: /** @type {!Protocol.Runtime.UnserializableValue} */ ('Infinity'), + NegativeInfinity: /** @type {!Protocol.Runtime.UnserializableValue} */ ('-Infinity') +};
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js index 302ff45..f77e34b 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/RuntimeModel.js
@@ -187,25 +187,26 @@ } /** - * @param {number|string|boolean|undefined} value + * @param {number|string|boolean|undefined|bigint} value * @return {!SDK.RemoteObject} */ createRemoteObjectFromPrimitiveValue(value) { const type = typeof value; let unserializableValue = undefined; - if (typeof value === 'number') { + if (type === 'number') { const description = String(value); if (value === 0 && 1 / value < 0) - unserializableValue = Protocol.Runtime.UnserializableValue.Negative0; - if (description === 'NaN') - unserializableValue = Protocol.Runtime.UnserializableValue.NaN; - if (description === 'Infinity') - unserializableValue = Protocol.Runtime.UnserializableValue.Infinity; - if (description === '-Infinity') - unserializableValue = Protocol.Runtime.UnserializableValue.NegativeInfinity; - if (typeof unserializableValue !== 'undefined') - value = undefined; + unserializableValue = SDK.RemoteObject.UnserializableNumber.Negative0; + else if ( + description === SDK.RemoteObject.UnserializableNumber.NaN || + description === SDK.RemoteObject.UnserializableNumber.Infinity || + description === SDK.RemoteObject.UnserializableNumber.NegativeInfinity) + unserializableValue = description; } + if (type === 'bigint') + unserializableValue = /** @type {!Protocol.Runtime.UnserializableValue} */ (String(value) + 'n'); + if (typeof unserializableValue !== 'undefined') + value = undefined; return new SDK.RemoteObjectImpl(this, undefined, type, undefined, value, unserializableValue); } @@ -357,7 +358,7 @@ */ _copyRequested(object) { if (!object.objectId) { - InspectorFrontendHost.copyText(object.value); + InspectorFrontendHost.copyText(object.unserializableValue() || object.value); return; } object.callFunctionJSON(
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp index a168321..eef0b87 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -29,7 +29,7 @@ #include "modules/accessibility/AXLayoutObject.h" #include "bindings/core/v8/ExceptionState.h" -#include "core/CSSPropertyNames.h" +#include "core/css_property_names.h" #include "core/dom/AccessibleNode.h" #include "core/dom/ElementTraversal.h" #include "core/dom/Range.h"
diff --git a/third_party/WebKit/Source/modules/accessibility/AccessibilityObjectModelTest.cpp b/third_party/WebKit/Source/modules/accessibility/AccessibilityObjectModelTest.cpp index 1fbc108..baf85d8 100644 --- a/third_party/WebKit/Source/modules/accessibility/AccessibilityObjectModelTest.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AccessibilityObjectModelTest.cpp
@@ -11,7 +11,7 @@ #include "modules/accessibility/AXTable.h" #include "modules/accessibility/AXTableCell.h" #include "modules/accessibility/AXTableRow.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp index 1f8a3c6c..92ad1a0 100644 --- a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp +++ b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2D.cpp
@@ -36,11 +36,11 @@ #include "bindings/core/v8/ExceptionMessages.h" #include "bindings/core/v8/ExceptionState.h" #include "bindings/modules/v8/rendering_context.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSFontSelector.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/StyleEngine.h" #include "core/css/resolver/StyleResolver.h" +#include "core/css_property_names.h" #include "core/dom/AXObjectCache.h" #include "core/dom/events/Event.h" #include "core/events/MouseEvent.h"
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp index d6ae39d..18a7470 100644 --- a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp +++ b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -30,8 +30,8 @@ #include "platform/graphics/test/FakeGLES2Interface.h" #include "platform/graphics/test/FakeWebGraphicsContext3DProvider.h" #include "platform/loader/fetch/MemoryCache.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupportWithMockScheduler.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/ByteSwap.h" #include "public/platform/scheduler/test/renderer_scheduler_test_support.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasStyle.cpp b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasStyle.cpp index 107511bf..367e8c4 100644 --- a/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasStyle.cpp +++ b/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasStyle.cpp
@@ -29,9 +29,9 @@ #include "modules/canvas/canvas2d/CanvasStyle.h" #include "base/memory/scoped_refptr.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSPropertyValueSet.h" #include "core/css/parser/CSSParser.h" +#include "core/css_property_names.h" #include "core/html/canvas/HTMLCanvasElement.h" #include "core/html/parser/HTMLParserIdioms.h" #include "modules/canvas/canvas2d/CanvasGradient.h"
diff --git a/third_party/WebKit/Source/modules/clipboard/ClipboardPromise.cpp b/third_party/WebKit/Source/modules/clipboard/ClipboardPromise.cpp index 3da363d..b07d22b 100644 --- a/third_party/WebKit/Source/modules/clipboard/ClipboardPromise.cpp +++ b/third_party/WebKit/Source/modules/clipboard/ClipboardPromise.cpp
@@ -7,6 +7,7 @@ #include "bindings/core/v8/ScriptPromiseResolver.h" #include "core/clipboard/DataObject.h" #include "core/clipboard/DataTransfer.h" +#include "core/clipboard/DataTransferAccessPolicy.h" #include "core/clipboard/DataTransferItem.h" #include "core/clipboard/DataTransferItemList.h" #include "core/dom/ExecutionContext.h" @@ -155,8 +156,7 @@ const DataTransfer::DataTransferType type = DataTransfer::DataTransferType::kCopyAndPaste; - const DataTransferAccessPolicy access = - DataTransferAccessPolicy::kDataTransferReadable; + const DataTransferAccessPolicy access = DataTransferAccessPolicy::kReadable; DataObject* data = DataObject::CreateFromString(plain_text); DataTransfer* dt = DataTransfer::Create(type, access, data); script_promise_resolver_->Resolve(dt);
diff --git a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h index 10b30a5..8baf957 100644 --- a/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h +++ b/third_party/WebKit/Source/modules/csspaint/CSSPaintDefinition.h
@@ -5,9 +5,9 @@ #ifndef CSSPaintDefinition_h #define CSSPaintDefinition_h -#include "core/CSSPropertyNames.h" #include "core/css/CSSSyntaxDescriptor.h" #include "core/css/cssom/CSSStyleValue.h" +#include "core/css_property_names.h" #include "modules/ModulesExport.h" #include "modules/csspaint/PaintRenderingContext2DSettings.h" #include "platform/bindings/ScriptWrappable.h"
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp index 109b9c24..92896c5 100644 --- a/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp +++ b/third_party/WebKit/Source/modules/csspaint/PaintWorkletGlobalScope.cpp
@@ -9,8 +9,8 @@ #include "bindings/core/v8/V8ObjectParser.h" #include "bindings/core/v8/WorkerOrWorkletScriptController.h" #include "bindings/modules/v8/V8PaintRenderingContext2DSettings.h" -#include "core/CSSPropertyNames.h" #include "core/css/CSSSyntaxDescriptor.h" +#include "core/css_property_names.h" #include "core/dom/ExceptionCode.h" #include "core/frame/LocalDOMWindow.h" #include "core/frame/LocalFrame.h"
diff --git a/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractorTest.cpp b/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractorTest.cpp index d3284294..33400e0 100644 --- a/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractorTest.cpp +++ b/third_party/WebKit/Source/modules/document_metadata/CopylessPasteExtractorTest.cpp
@@ -4,7 +4,6 @@ #include <memory> -#include <string> #include <utility> #include "core/dom/Element.h" #include "core/testing/PageTestBase.h"
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImplTest.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImplTest.cpp index 963e4e35..d22f698 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImplTest.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImplTest.cpp
@@ -35,9 +35,9 @@ #include "platform/heap/Handle.h" #include "platform/testing/EmptyWebMediaPlayer.h" #include "platform/testing/HistogramTester.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupportWithMockScheduler.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/WebMouseEvent.h" #include "public/platform/WebScreenInfo.h" #include "public/platform/WebSize.h"
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegateTest.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegateTest.cpp index 8ada889..1c9e0b7 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegateTest.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsOrientationLockDelegateTest.cpp
@@ -26,8 +26,8 @@ #include "platform/LayoutTestSupport.h" #include "platform/geometry/IntRect.h" #include "platform/testing/EmptyWebMediaPlayer.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/WebSize.h" #include "public/platform/modules/screen_orientation/WebLockOrientationCallback.h" #include "services/device/public/mojom/screen_orientation.mojom-blink.h"
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegateTest.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegateTest.cpp index 0b5defc5..48fcc51 100644 --- a/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegateTest.cpp +++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsRotateToFullscreenDelegateTest.cpp
@@ -23,8 +23,8 @@ #include "modules/screen_orientation/ScreenOrientationControllerImpl.h" #include "mojo/public/cpp/bindings/associated_interface_ptr.h" #include "platform/testing/EmptyWebMediaPlayer.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/text/AtomicString.h" #include "public/platform/WebSize.h" #include "public/platform/modules/screen_orientation/WebScreenOrientationType.h"
diff --git a/third_party/WebKit/Source/modules/modules_idl_files.gni b/third_party/WebKit/Source/modules/modules_idl_files.gni index 454e35a5..7f247ff 100644 --- a/third_party/WebKit/Source/modules/modules_idl_files.gni +++ b/third_party/WebKit/Source/modules/modules_idl_files.gni
@@ -568,6 +568,11 @@ "peerconnection/RTCOfferAnswerOptions.idl", "peerconnection/RTCOfferOptions.idl", "peerconnection/RTCPeerConnectionIceEventInit.idl", + "peerconnection/RTCRtcpParameters.idl", + "peerconnection/RTCRtpCodecParameters.idl", + "peerconnection/RTCRtpEncodingParameters.idl", + "peerconnection/RTCRtpHeaderExtensionParameters.idl", + "peerconnection/RTCRtpParameters.idl", "peerconnection/RTCSessionDescriptionInit.idl", "peerconnection/RTCTrackEventInit.idl", "permissions/ClipboardPermissionDescriptor.idl",
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtcpParameters.idl b/third_party/WebKit/Source/modules/peerconnection/RTCRtcpParameters.idl new file mode 100644 index 0000000..a0c78d9d --- /dev/null +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtcpParameters.idl
@@ -0,0 +1,9 @@ +// 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. + +// https://w3c.github.io/webrtc-pc/#rtcrtcpparameters* +dictionary RTCRtcpParameters { + DOMString cname; + boolean reducedSize; +}; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpCodecParameters.idl b/third_party/WebKit/Source/modules/peerconnection/RTCRtpCodecParameters.idl new file mode 100644 index 0000000..4f1cb44 --- /dev/null +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpCodecParameters.idl
@@ -0,0 +1,12 @@ +// 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. + +// https://w3c.github.io/webrtc-pc/#rtcrtpcodecparameters* +dictionary RTCRtpCodecParameters { + octet payloadType; + DOMString mimeType; + unsigned long clockRate; + unsigned short channels; + DOMString sdpFmtpLine; +}; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpEncodingParameters.idl b/third_party/WebKit/Source/modules/peerconnection/RTCRtpEncodingParameters.idl new file mode 100644 index 0000000..6e19c5b5 --- /dev/null +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpEncodingParameters.idl
@@ -0,0 +1,30 @@ +// 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. + +// https://w3c.github.io/webrtc-pc/#rtcprioritytype-enum +enum RTCPriorityType { + "very-low", + "low", + "medium", + "high" +}; + +// https://w3c.github.io/webrtc-pc/#rtcdtxstatus* +enum RTCDtxStatus { + "disabled", + "enabled" +}; + +// https://w3c.github.io/webrtc-pc/#rtcrtpencodingparameters* +dictionary RTCRtpEncodingParameters { + octet codecPayloadType; + RTCDtxStatus dtx; + boolean active = true; + RTCPriorityType priority = "low"; + unsigned long ptime; + unsigned long maxBitrate; + double maxFramerate; + DOMString rid; + double scaleResolutionDownBy; +}; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpHeaderExtensionParameters.idl b/third_party/WebKit/Source/modules/peerconnection/RTCRtpHeaderExtensionParameters.idl new file mode 100644 index 0000000..ddd11620 --- /dev/null +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpHeaderExtensionParameters.idl
@@ -0,0 +1,10 @@ +// 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. + +// https://w3c.github.io/webrtc-pc/#rtcrtpheaderextensionparameters* +dictionary RTCRtpHeaderExtensionParameters { + DOMString uri; + unsigned short id; + boolean encrypted; +}; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpParameters.idl b/third_party/WebKit/Source/modules/peerconnection/RTCRtpParameters.idl new file mode 100644 index 0000000..764e787 --- /dev/null +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpParameters.idl
@@ -0,0 +1,20 @@ +// 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. + +// https://w3c.github.io/webrtc-pc/#rtcdegradationpreference* +enum RTCDegradationPreference { + "maintain-framerate", + "maintain-resolution", + "balanced" +}; + +// https://w3c.github.io/webrtc-pc/#rtcrtpparameters* +dictionary RTCRtpParameters { + DOMString transactionId; + sequence<RTCRtpEncodingParameters> encodings; + sequence<RTCRtpHeaderExtensionParameters> headerExtensions; + RTCRtcpParameters rtcp; + sequence<RTCRtpCodecParameters> codecs; + RTCDegradationPreference degradationPreference; +}; \ No newline at end of file
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.cpp index 9b938e3e..5be0a35 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.cpp
@@ -9,6 +9,7 @@ #include "modules/mediastream/MediaStreamTrack.h" #include "modules/peerconnection/RTCDTMFSender.h" #include "modules/peerconnection/RTCPeerConnection.h" +#include "modules/peerconnection/RTCRtpParameters.h" #include "platform/peerconnection/RTCVoidRequest.h" #include "public/platform/WebRTCDTMFSenderHandler.h" @@ -87,6 +88,69 @@ return promise; } +void RTCRtpSender::getParameters(RTCRtpParameters& parameters) { + // TODO(orphis): Forward missing fields from the WebRTC library: + // transactionId, rtcp, headerExtensions, degradationPreference + std::unique_ptr<WebRTCRtpParameters> web_parameters = + sender_->GetParameters(); + + HeapVector<RTCRtpEncodingParameters> encodings; + encodings.ReserveCapacity(web_parameters->Encodings().size()); + for (const auto& web_encoding : web_parameters->Encodings()) { + // TODO(orphis): Forward missing fields from the WebRTC library: + // codecPayloadType, dtx, ptime, maxFramerate, scaleResolutionDownBy, rid + encodings.emplace_back(); + RTCRtpEncodingParameters& encoding = encodings.back(); + encoding.setActive(web_encoding.Active()); + if (web_encoding.MaxBitrate()) + encoding.setMaxBitrate(web_encoding.MaxBitrate().value()); + + const char* priority = ""; + switch (web_encoding.Priority()) { + case WebRTCPriorityType::VeryLow: + priority = "very-low"; + break; + case WebRTCPriorityType::Low: + priority = "low"; + break; + case WebRTCPriorityType::Medium: + priority = "medium"; + break; + case WebRTCPriorityType::High: + priority = "high"; + break; + default: + NOTREACHED(); + } + encoding.setPriority(priority); + } + parameters.setEncodings(encodings); + + HeapVector<RTCRtpCodecParameters> codecs; + codecs.ReserveCapacity(web_parameters->Codecs().size()); + for (const auto& web_codec : web_parameters->Codecs()) { + // TODO(orphis): Forward missing field from the WebRTC library: sdpFmtpLine + codecs.emplace_back(); + RTCRtpCodecParameters& codec = codecs.back(); + if (web_codec.PayloadType()) + codec.setPayloadType(web_codec.PayloadType().value()); + if (web_codec.MimeType()) + codec.setMimeType(web_codec.MimeType().value()); + if (web_codec.ClockRate()) + codec.setClockRate(web_codec.ClockRate().value()); + if (web_codec.Channels()) + codec.setChannels(web_codec.Channels().value()); + } + parameters.setCodecs(codecs); +} + +ScriptPromise RTCRtpSender::setParameters(ScriptState* script_state, + const RTCRtpParameters&) { + return ScriptPromise::RejectWithDOMException( + script_state, + DOMException::Create(kNotSupportedError, "Method not implemented")); +} + WebRTCRtpSender* RTCRtpSender::web_sender() { return sender_.get(); }
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.h b/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.h index 3bda8ef3..cc936d66 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.h +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.h
@@ -19,6 +19,7 @@ class MediaStreamTrack; class RTCDTMFSender; class RTCPeerConnection; +class RTCRtpParameters; // https://w3c.github.io/webrtc-pc/#rtcrtpsender-interface class RTCRtpSender final : public ScriptWrappable { @@ -35,6 +36,8 @@ MediaStreamTrack* track(); ScriptPromise replaceTrack(ScriptState*, MediaStreamTrack*); RTCDTMFSender* dtmf(); + void getParameters(RTCRtpParameters&); + ScriptPromise setParameters(ScriptState*, const RTCRtpParameters&); WebRTCRtpSender* web_sender(); // Sets the track. This must be called when the |WebRTCRtpSender| has its
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.idl b/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.idl index 5b6502f..31a45c5 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.idl +++ b/third_party/WebKit/Source/modules/peerconnection/RTCRtpSender.idl
@@ -6,6 +6,8 @@ [Exposed=Window] interface RTCRtpSender { readonly attribute MediaStreamTrack? track; + [RuntimeEnabled=RTCRtpSenderParameters, CallWith=ScriptState] Promise<void> setParameters(optional RTCRtpParameters parameters); + [RuntimeEnabled=RTCRtpSenderParameters] RTCRtpParameters getParameters(); [Measure, CallWith=ScriptState] Promise<void> replaceTrack(MediaStreamTrack? withTrack); [Measure] readonly attribute RTCDTMFSender? dtmf; // TODO(hbos): Implement the rest of RTCRtpSender, https://crbug.com/700916.
diff --git a/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp b/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp index d645386..fd452279 100644 --- a/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp +++ b/third_party/WebKit/Source/modules/remoteplayback/RemotePlaybackTest.cpp
@@ -15,8 +15,8 @@ #include "modules/presentation/MockWebPresentationClient.h" #include "modules/presentation/PresentationController.h" #include "modules/remoteplayback/HTMLMediaElementRemotePlayback.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/modules/presentation/WebPresentationClient.h" #include "public/platform/modules/remoteplayback/WebRemotePlaybackState.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp index f21779f..31e4afe 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorker.cpp
@@ -78,8 +78,8 @@ return; } - handle_->ServiceWorker()->PostMessageToWorker( - client->Provider(), ToTransferableMessage(std::move(msg)), + handle_->ServiceWorker()->PostMessage( + ToTransferableMessage(std::move(msg)), WebSecurityOrigin(GetExecutionContext()->GetSecurityOrigin())); }
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContentSettingsProxy.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContentSettingsProxy.cpp index 1da5ff82..7dd607d 100644 --- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContentSettingsProxy.cpp +++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerContentSettingsProxy.cpp
@@ -5,7 +5,6 @@ #include "modules/serviceworkers/ServiceWorkerContentSettingsProxy.h" #include <memory> -#include <string> namespace blink {
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp index e02b877..739c96a3 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -1019,9 +1019,14 @@ AudioWorkletGlobalScope* global_scope = ToAudioWorkletGlobalScope( worklet_backing_worker_thread_->GlobalScope()); - DCHECK(global_scope); - global_scope->SetCurrentFrame(CurrentSampleFrame()); + // When BaseAudioContext is being torn down, AudioWorkletGlobalScope might + // be already gone at this point because it's destroyed on the main thread + // but the audio thread may not have stopped. So we check |global_scope| + // before we update it. + if (global_scope) { + global_scope->SetCurrentFrame(CurrentSampleFrame()); + } } }
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn index aca0f8b..4f256d0d 100644 --- a/third_party/WebKit/Source/platform/BUILD.gn +++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -46,18 +46,17 @@ script = "../build/scripts/make_runtime_features.py" runtime_enabled_features_json5 = "runtime_enabled_features.json5" - inputs = - scripts_for_json5_files + [ - runtime_enabled_features_json5, - "../build/scripts/templates/runtime_enabled_features.cc.tmpl", - "../build/scripts/templates/runtime_enabled_features.h.tmpl", - "../build/scripts/templates/RuntimeEnabledFeaturesTestHelpers.h.tmpl", - ] + inputs = scripts_for_json5_files + [ + runtime_enabled_features_json5, + "../build/scripts/templates/runtime_enabled_features.cc.tmpl", + "../build/scripts/templates/runtime_enabled_features.h.tmpl", + "../build/scripts/templates/runtime_enabled_features_test_helpers.h.tmpl", + ] outputs = [ "$blink_platform_output_dir/runtime_enabled_features.cc", "$blink_platform_output_dir/runtime_enabled_features.h", - "$blink_platform_output_dir/testing/RuntimeEnabledFeaturesTestHelpers.h", + "$blink_platform_output_dir/testing/runtime_enabled_features_test_helpers.h", ] args = [ @@ -1378,7 +1377,6 @@ "speech/PlatformSpeechSynthesisVoice.h", "speech/PlatformSpeechSynthesizer.cpp", "speech/PlatformSpeechSynthesizer.h", - "text/BidiCharacterRun.cpp", "text/BidiCharacterRun.h", "text/BidiContext.cpp", "text/BidiContext.h",
diff --git a/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp b/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp index e54c0ff..1dce0ab 100644 --- a/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp +++ b/third_party/WebKit/Source/platform/animation/TimingFunctionTest.cpp
@@ -32,7 +32,7 @@ #include <sstream> #include <string> -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/text/WTFString.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/audio/PushPullFIFOMultithreadTest.cpp b/third_party/WebKit/Source/platform/audio/PushPullFIFOMultithreadTest.cpp index 95f2bdc..a2922a4 100644 --- a/third_party/WebKit/Source/platform/audio/PushPullFIFOMultithreadTest.cpp +++ b/third_party/WebKit/Source/platform/audio/PushPullFIFOMultithreadTest.cpp
@@ -5,7 +5,6 @@ #include "platform/audio/PushPullFIFO.h" #include <memory> -#include <vector> #include "platform/CrossThreadFunctional.h" #include "platform/WaitableEvent.h" #include "platform/WebTaskRunner.h"
diff --git a/third_party/WebKit/Source/platform/bindings/RuntimeCallStatsTest.cpp b/third_party/WebKit/Source/platform/bindings/RuntimeCallStatsTest.cpp index 322332c9..58ad9da 100644 --- a/third_party/WebKit/Source/platform/bindings/RuntimeCallStatsTest.cpp +++ b/third_party/WebKit/Source/platform/bindings/RuntimeCallStatsTest.cpp
@@ -5,7 +5,7 @@ #include "platform/bindings/RuntimeCallStats.h" #include "base/test/simple_test_tick_clock.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/Time.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp b/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp index d9180771..ef09339 100644 --- a/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp +++ b/third_party/WebKit/Source/platform/exported/WebRuntimeFeatures.cpp
@@ -260,6 +260,10 @@ RuntimeEnabledFeatures::SetPreloadDefaultIsMetadataEnabled(enable); } +void WebRuntimeFeatures::EnableRasterInducingScroll(bool enable) { + RuntimeEnabledFeatures::SetRasterInducingScrollEnabled(enable); +} + void WebRuntimeFeatures::EnableScriptedSpeech(bool enable) { RuntimeEnabledFeatures::SetScriptedSpeechEnabled(enable); }
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp index d6800df2..1e71a095 100644 --- a/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/BitmapImageTest.cpp
@@ -40,9 +40,9 @@ #include "platform/graphics/test/MockImageDecoder.h" #include "platform/scheduler/test/fake_task_runner.h" #include "platform/testing/HistogramTester.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupportWithMockScheduler.h" #include "platform/testing/UnitTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/StdLibExtras.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkColor.h"
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp index 74dd5b1..cd6e187 100644 --- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp
@@ -51,8 +51,8 @@ #include "platform/graphics/test/FakeGLES2Interface.h" #include "platform/graphics/test/FakeWebGraphicsContext3DProvider.h" #include "platform/scheduler/child/web_scheduler.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupport.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/Platform.h" #include "public/platform/WebThread.h" #include "skia/ext/texture_handle.h"
diff --git a/third_party/WebKit/Source/platform/graphics/CanvasColorParamsTest.cpp b/third_party/WebKit/Source/platform/graphics/CanvasColorParamsTest.cpp index 697db68..caeceaf 100644 --- a/third_party/WebKit/Source/platform/graphics/CanvasColorParamsTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/CanvasColorParamsTest.cpp
@@ -5,7 +5,7 @@ #include "platform/graphics/CanvasColorParams.h" #include "platform/graphics/ColorCorrectionTestUtils.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkColorSpaceXform.h" #include "ui/gfx/color_space.h"
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/CompositedLayerRasterInvalidatorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/CompositedLayerRasterInvalidatorTest.cpp index e459393c..7624036 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/CompositedLayerRasterInvalidatorTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/CompositedLayerRasterInvalidatorTest.cpp
@@ -5,7 +5,7 @@ #include "platform/graphics/compositing/CompositedLayerRasterInvalidator.h" #include "platform/testing/FakeDisplayItemClient.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/dtoa/utils.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/ContentLayerClientImpl.cpp b/third_party/WebKit/Source/platform/graphics/compositing/ContentLayerClientImpl.cpp index 33678c6..79e57dc 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/ContentLayerClientImpl.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/ContentLayerClientImpl.cpp
@@ -188,7 +188,7 @@ paint_chunks, layer_state, layer_bounds.OffsetFromOrigin(), paint_artifact.GetDisplayItemList(), cc::DisplayItemList::kTopLevelDisplayItemList, - params ? &*params : nullptr); + WTF::OptionalOrNullptr(params)); if (paint_chunks[0]->size()) { cc_picture_layer_->SetBackgroundColor(DisplayItemBackgroundColor(
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp index 7dd6a5f..9d9f823 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -6,7 +6,6 @@ #include <memory> #include <utility> -#include <vector> #include "cc/layers/layer.h" #include "cc/layers/picture_layer.h"
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp index 83227c2..b7d0d88 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositorTest.cpp
@@ -23,9 +23,9 @@ #include "platform/testing/FakeDisplayItemClient.h" #include "platform/testing/PaintPropertyTestHelpers.h" #include "platform/testing/PictureMatchers.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestPaintArtifact.h" #include "platform/testing/WebLayerTreeViewImplForTesting.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/WebLayerScrollClient.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayerTest.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayerTest.cpp index 7d3941c..0dde3ff 100644 --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayerTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintChunksToCcLayerTest.cpp
@@ -17,7 +17,7 @@ #include "platform/graphics/paint/TransformPaintPropertyNode.h" #include "platform/testing/FakeDisplayItemClient.h" #include "platform/testing/PaintPropertyTestHelpers.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp index e7fcc81..d820c0e 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBufferTest.cpp
@@ -40,8 +40,8 @@ #include "gpu/command_buffer/common/sync_token.h" #include "platform/graphics/CanvasColorParams.h" #include "platform/graphics/gpu/DrawingBufferTestHelpers.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupport.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/wtf/PtrUtil.h" #include "public/platform/Platform.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/graphics/paint/CullRectTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/CullRectTest.cpp index 1bee59f3..0703c9e 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/CullRectTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/CullRectTest.cpp
@@ -6,7 +6,7 @@ #include "platform/geometry/FloatRect.h" #include "platform/geometry/LayoutRect.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp index d4a2a17..0f4801278 100644 --- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp +++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunkerTest.cpp
@@ -5,7 +5,7 @@ #include "platform/graphics/paint/PaintChunker.h" #include "platform/testing/PaintPropertyTestHelpers.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/loader/SubresourceIntegrityTest.cpp b/third_party/WebKit/Source/platform/loader/SubresourceIntegrityTest.cpp index f1abfc77..f87ae5d 100644 --- a/third_party/WebKit/Source/platform/loader/SubresourceIntegrityTest.cpp +++ b/third_party/WebKit/Source/platform/loader/SubresourceIntegrityTest.cpp
@@ -16,7 +16,7 @@ #include "platform/loader/testing/CryptoTestingPlatformSupport.h" #include "platform/loader/testing/MockFetchContext.h" #include "platform/runtime_enabled_features.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/Vector.h"
diff --git a/third_party/WebKit/Source/platform/runtime_enabled_features.json5 b/third_party/WebKit/Source/platform/runtime_enabled_features.json5 index eddd2649..f000442e 100644 --- a/third_party/WebKit/Source/platform/runtime_enabled_features.json5 +++ b/third_party/WebKit/Source/platform/runtime_enabled_features.json5
@@ -881,6 +881,10 @@ name: "PWAFullCodeCache" }, { + name: "RasterInducingScroll", + status: "experimental", + }, + { name: "ReducedReferrerGranularity", }, { @@ -940,6 +944,10 @@ status: "experimental", }, { + name: "RTCRtpSenderParameters", + status: "experimental", + }, + { name: "RTCUnifiedPlan", status: "experimental", },
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc index 604f7dce..e3b829cc 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
@@ -24,7 +24,7 @@ #include "platform/scheduler/renderer/budget_pool.h" #include "platform/scheduler/renderer/web_frame_scheduler_impl.h" #include "platform/scheduler/test/create_task_queue_manager_for_test.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/public/common/page/launching_process_state.h"
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl_unittest.cc index cd8018e01..d8997aa1 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_frame_scheduler_impl_unittest.cc
@@ -15,7 +15,7 @@ #include "platform/scheduler/renderer/renderer_scheduler_impl.h" #include "platform/scheduler/renderer/web_view_scheduler_impl.h" #include "platform/scheduler/test/create_task_queue_manager_for_test.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gtest/include/gtest/gtest.h" namespace blink {
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc index 326ae82..994cb16 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/web_view_scheduler_impl_unittest.cc
@@ -18,7 +18,7 @@ #include "platform/scheduler/renderer/renderer_scheduler_impl.h" #include "platform/scheduler/renderer/web_frame_scheduler_impl.h" #include "platform/scheduler/test/create_task_queue_manager_for_test.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp index 7367c0e..03db129 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollableAreaTest.cpp
@@ -12,8 +12,8 @@ #include "platform/scroll/ScrollbarThemeOverlayMock.h" #include "platform/testing/FakeGraphicsLayer.h" #include "platform/testing/FakeGraphicsLayerClient.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" #include "platform/testing/TestingPlatformSupportWithMockScheduler.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "public/platform/Platform.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/platform/testing/PaintTestConfigurations.h b/third_party/WebKit/Source/platform/testing/PaintTestConfigurations.h index e86cd9e..fb9e5b18 100644 --- a/third_party/WebKit/Source/platform/testing/PaintTestConfigurations.h +++ b/third_party/WebKit/Source/platform/testing/PaintTestConfigurations.h
@@ -6,7 +6,7 @@ #define PaintTestConfigurations_h #include <gtest/gtest.h> -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.cpp b/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.cpp index d7caae4..c22d414 100644 --- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.cpp +++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupportWithWebRTC.cpp
@@ -31,6 +31,9 @@ std::unique_ptr<WebRTCDTMFSenderHandler> GetDtmfSender() const override { return nullptr; } + std::unique_ptr<WebRTCRtpParameters> GetParameters() const override { + return std::unique_ptr<WebRTCRtpParameters>(); + } private: const uintptr_t id_;
diff --git a/third_party/WebKit/Source/platform/testing/UseMockScrollbarSettings.h b/third_party/WebKit/Source/platform/testing/UseMockScrollbarSettings.h index 58aa6cf..437a302f 100644 --- a/third_party/WebKit/Source/platform/testing/UseMockScrollbarSettings.h +++ b/third_party/WebKit/Source/platform/testing/UseMockScrollbarSettings.h
@@ -6,7 +6,7 @@ #define UseMockScrollbarSettings_h #include "platform/scroll/ScrollbarTheme.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" namespace blink {
diff --git a/third_party/WebKit/Source/platform/text/BidiCharacterRun.cpp b/third_party/WebKit/Source/platform/text/BidiCharacterRun.cpp deleted file mode 100644 index 046b4a0..0000000 --- a/third_party/WebKit/Source/platform/text/BidiCharacterRun.cpp +++ /dev/null
@@ -1,38 +0,0 @@ -/** - * Copyright (C) 1999 Lars Knoll (knoll@kde.org) - * (C) 1999 Antti Koivisto (koivisto@kde.org) - * Copyright (C) 2003, 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. - * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "platform/text/BidiCharacterRun.h" - -#include "platform/wtf/allocator/Partitions.h" - -namespace blink { -void* BidiCharacterRun::operator new(size_t sz) { - return WTF::Partitions::LayoutPartition()->Alloc( - sz, WTF_HEAP_PROFILER_TYPE_NAME(BidiCharacterRun)); -} - -void BidiCharacterRun::operator delete(void* ptr) { - WTF::PartitionFree(ptr); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/platform/text/BidiCharacterRun.h b/third_party/WebKit/Source/platform/text/BidiCharacterRun.h index fd8aa7ab..1540348 100644 --- a/third_party/WebKit/Source/platform/text/BidiCharacterRun.h +++ b/third_party/WebKit/Source/platform/text/BidiCharacterRun.h
@@ -28,6 +28,9 @@ namespace blink { struct BidiCharacterRun { + USING_FAST_MALLOC(BidiCharacterRun); + + public: BidiCharacterRun(bool override, unsigned char level, int start, @@ -67,10 +70,6 @@ start_(start), stop_(stop) {} - // BidiCharacterRun are allocated out of the rendering partition. - PLATFORM_EXPORT void* operator new(size_t); - PLATFORM_EXPORT void operator delete(void*); - int Start() const { return start_; } int Stop() const { return stop_; } unsigned char Level() const { return level_; }
diff --git a/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.cpp b/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.cpp index 0ffd17b..39ce331 100644 --- a/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.cpp +++ b/third_party/WebKit/Source/platform/text/hyphenation/HyphenatorAOSP.cpp
@@ -19,7 +19,6 @@ #include <vector> #include <memory> #include <algorithm> -#include <string> #include <unicode/uchar.h> // HACK: for reading pattern file
diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp index 5f839d88..8a682727 100644 --- a/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOriginTest.cpp
@@ -33,7 +33,7 @@ #include <stdint.h> #include "platform/blob/BlobURL.h" -#include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" +#include "platform/testing/runtime_enabled_features_test_helpers.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityPolicy.h" #include "platform/wtf/text/StringBuilder.h"
diff --git a/third_party/WebKit/Source/platform/wtf/DEPS b/third_party/WebKit/Source/platform/wtf/DEPS index bccf1e08..af5fb7a4 100644 --- a/third_party/WebKit/Source/platform/wtf/DEPS +++ b/third_party/WebKit/Source/platform/wtf/DEPS
@@ -15,6 +15,7 @@ "+base/optional.h", "+base/process/process_metrics.h", "+base/rand_util.h", + "+base/stl_util.h", "+base/strings", "+base/template_util.h", "+base/threading/thread_checker.h",
diff --git a/third_party/WebKit/Source/platform/wtf/Optional.h b/third_party/WebKit/Source/platform/wtf/Optional.h index c5a6b67f..5c5935d8 100644 --- a/third_party/WebKit/Source/platform/wtf/Optional.h +++ b/third_party/WebKit/Source/platform/wtf/Optional.h
@@ -6,6 +6,7 @@ #define Optional_h #include "base/optional.h" +#include "base/stl_util.h" namespace WTF { @@ -24,6 +25,11 @@ return base::make_optional(std::forward<T>(value)); } +template <typename T> +T* OptionalOrNullptr(Optional<T>& optional) { + return base::OptionalOrNullptr(optional); +} + } // namespace WTF using WTF::Optional;
diff --git a/third_party/WebKit/common/origin_trials/trial_token.cc b/third_party/WebKit/common/origin_trials/trial_token.cc index 372f6b3..1a0a428 100644 --- a/third_party/WebKit/common/origin_trials/trial_token.cc +++ b/third_party/WebKit/common/origin_trials/trial_token.cc
@@ -4,8 +4,6 @@ #include "third_party/WebKit/public/common/origin_trials/trial_token.h" -#include <vector> - #include "base/base64.h" #include "base/big_endian.h" #include "base/json/json_reader.h"
diff --git a/third_party/WebKit/public/BUILD.gn b/third_party/WebKit/public/BUILD.gn index cfdc0009..6c2f1fa 100644 --- a/third_party/WebKit/public/BUILD.gn +++ b/third_party/WebKit/public/BUILD.gn
@@ -788,6 +788,7 @@ "//components/payments/mojom", "//device/bluetooth/public/mojom", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//services/device/public/mojom", "//services/network/public/mojom", "//services/service_manager/public/mojom", @@ -835,6 +836,7 @@ public_deps = [ "//components/payments/mojom", "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//ui/gfx/geometry/mojo", "//url/mojom:url_mojom_gurl", ]
diff --git a/third_party/WebKit/public/mojom/BUILD.gn b/third_party/WebKit/public/mojom/BUILD.gn index b024aca..3ee6b12 100644 --- a/third_party/WebKit/public/mojom/BUILD.gn +++ b/third_party/WebKit/public/mojom/BUILD.gn
@@ -29,9 +29,7 @@ "service_worker/service_worker_error_type.mojom", "service_worker/service_worker_event_status.mojom", "service_worker/service_worker_installed_scripts_manager.mojom", - "service_worker/service_worker_object.mojom", "service_worker/service_worker_provider_type.mojom", - "service_worker/service_worker_registration.mojom", "service_worker/service_worker_state.mojom", "service_worker/service_worker_stream_handle.mojom", "shared_worker/shared_worker_creation_context_type.mojom", @@ -39,6 +37,7 @@ public_deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//services/network/public/mojom", "//ui/gfx/geometry/mojo", "//url/mojom:url_mojom_gurl", @@ -57,14 +56,24 @@ # This target can include mojom interfaces which do use types that are # typemapped to a type in Source/core. This also means these interfaces are not # available from Source/platform. +# Note that service_worker_registration.mojom depends on +# service_worker_object.mojom which depends on message_port.mojom, so we put +# these two service worker mojom files here rather than mojom_platform target. +# In future we may have a separate mojom target for the things that may have +# modules dependencies if it looks necessary, at that time we can put all of +# those high-level service worker mojom files there. mojom("mojom_core") { sources = [ "message_port/message_port.mojom", + "service_worker/service_worker_object.mojom", + "service_worker/service_worker_registration.mojom", ] public_deps = [ ":mojom_platform", "//skia/public/interfaces", + "//url/mojom:url_mojom_gurl", + "//url/mojom:url_mojom_origin", ] overridden_deps_blink = [ ":mojom_platform" ]
diff --git a/third_party/WebKit/public/mojom/service_worker/service_worker_object.mojom b/third_party/WebKit/public/mojom/service_worker/service_worker_object.mojom index 6c0cbf7..d7a07cd 100644 --- a/third_party/WebKit/public/mojom/service_worker/service_worker_object.mojom +++ b/third_party/WebKit/public/mojom/service_worker/service_worker_object.mojom
@@ -4,7 +4,9 @@ module blink.mojom; +import "third_party/WebKit/public/mojom/message_port/message_port.mojom"; import "third_party/WebKit/public/mojom/service_worker/service_worker_state.mojom"; +import "url/mojom/origin.mojom"; import "url/mojom/url.mojom"; const int32 kInvalidServiceWorkerHandleId = -1; @@ -35,10 +37,13 @@ // uses this interface to ask the browser process to do operations needed to // implement ServiceWorker methods. interface ServiceWorkerObjectHost { - // TODO(leonhsl): Implement all methods. - // Replace ServiceWorkerHostMsg_PostMessageToWorker. - // PostMessage(string message, url.mojom.Origin source_origin, - // array<handle<message_pipe>> sent_message_ports); + // Corresponds to ServiceWorker#postMessage(). + // TODO(leonhsl): Remove |source_origin| by having the browser process keep + // track of the origin of this endpoint at binding time. The original legacy + // IPC code this is converted from sent the origin in the IPC message, so it + // was kept as a convenience during migration to Mojo, but we should remove it + // now. + PostMessage(TransferableMessage message, url.mojom.Origin source_origin); // Tells the browser process to terminate the service worker. Used in layout // tests to verify behavior when a service worker isn't running. The callback
diff --git a/third_party/WebKit/public/platform/WebRTCRtpParameters.h b/third_party/WebKit/public/platform/WebRTCRtpParameters.h new file mode 100644 index 0000000..369b9a5e --- /dev/null +++ b/third_party/WebKit/public/platform/WebRTCRtpParameters.h
@@ -0,0 +1,190 @@ +// 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. + +#ifndef WebRTCRtpParameters_h +#define WebRTCRtpParameters_h + +#include <memory> +#include <string> +#include <vector> + +#include "WebCommon.h" +#include "WebString.h" +#include "WebVector.h" +#include "base/optional.h" + +namespace blink { + +enum class WebRTCPriorityType { + VeryLow, + Low, + Medium, + High, +}; + +enum class WebRTCDegradationPreference { + MaintainFramerate, + MaintainResolution, + Balanced, +}; + +enum class WebRTCDtxStatus { + Disabled, + Enabled, +}; + +class BLINK_PLATFORM_EXPORT WebRTCRtpEncodingParameters { + public: + WebRTCRtpEncodingParameters(); + WebRTCRtpEncodingParameters( + const base::Optional<uint8_t>& codec_payload_type, + const base::Optional<WebRTCDtxStatus>& dtx, + bool active, + WebRTCPriorityType priority, + const base::Optional<uint32_t>& ptime, + const base::Optional<uint32_t>& max_bitrate, + const base::Optional<uint32_t>& max_framerate, + const base::Optional<double>& scale_resolution_down_by, + const base::Optional<WebString>& rid) + : codec_payload_type_(codec_payload_type), + dtx_(dtx), + active_(active), + priority_(priority), + ptime_(ptime), + max_bitrate_(max_bitrate), + max_framerate_(max_framerate), + scale_resolution_down_by_(scale_resolution_down_by), + rid_(rid) {} + + const base::Optional<uint8_t>& CodecPayloadType() const { + return codec_payload_type_; + } + const base::Optional<WebRTCDtxStatus>& Dtx() const { return dtx_; } + bool Active() const { return active_; } + WebRTCPriorityType Priority() const { return priority_; } + const base::Optional<uint32_t>& Ptime() const { return ptime_; } + const base::Optional<uint32_t>& MaxBitrate() const { return max_bitrate_; } + const base::Optional<uint32_t>& MaxFramerate() const { + return max_framerate_; + } + const base::Optional<double>& ScaleResolutionDownBy() const { + return scale_resolution_down_by_; + } + const base::Optional<WebString> Rid() const { return rid_; } + + private: + base::Optional<uint8_t> codec_payload_type_; + base::Optional<WebRTCDtxStatus> dtx_; + bool active_; + WebRTCPriorityType priority_; + base::Optional<uint32_t> ptime_; + base::Optional<uint32_t> max_bitrate_; + base::Optional<uint32_t> max_framerate_; + base::Optional<double> scale_resolution_down_by_; + base::Optional<WebString> rid_; +}; + +class BLINK_PLATFORM_EXPORT WebRTCRtpHeaderExtensionParameters { + public: + WebRTCRtpHeaderExtensionParameters(); + WebRTCRtpHeaderExtensionParameters(const base::Optional<WebString>& uri, + const base::Optional<uint16_t>& id, + const base::Optional<bool>& encrypted) + : uri_(uri), id_(id), encrypted_(encrypted) {} + + const base::Optional<WebString>& URI() const { return uri_; } + const base::Optional<uint16_t>& Id() const { return id_; } + const base::Optional<bool>& Encrypted() const { return encrypted_; } + + private: + base::Optional<WebString> uri_; + base::Optional<uint16_t> id_; + base::Optional<bool> encrypted_; +}; + +class BLINK_PLATFORM_EXPORT WebRTCRtcpParameters { + public: + const base::Optional<WebString>& Cname() const; + const base::Optional<bool>& ReducedSize() const; + + private: + base::Optional<WebString> cname_; + base::Optional<bool> reduced_size_; +}; + +class BLINK_PLATFORM_EXPORT WebRTCRtpCodecParameters { + public: + WebRTCRtpCodecParameters() = default; + WebRTCRtpCodecParameters(const base::Optional<uint8_t>& payload_type, + const base::Optional<WebString>& mime_type, + const base::Optional<uint32_t>& clock_rate, + const base::Optional<uint16_t>& channels, + const base::Optional<WebString>& sdp_fmtp_line) + : payload_type_(payload_type), + mime_type_(mime_type), + clock_rate_(clock_rate), + channels_(channels), + sdp_fmtp_line_(sdp_fmtp_line) {} + + const base::Optional<uint8_t>& PayloadType() const { return payload_type_; } + const base::Optional<WebString>& MimeType() const { return mime_type_; } + const base::Optional<uint32_t>& ClockRate() const { return clock_rate_; } + const base::Optional<uint16_t>& Channels() const { return channels_; } + const base::Optional<WebString>& SdpFmtpLine() const { + return sdp_fmtp_line_; + } + + private: + base::Optional<uint8_t> payload_type_; + base::Optional<WebString> mime_type_; + base::Optional<uint32_t> clock_rate_; + base::Optional<uint16_t> channels_; + base::Optional<WebString> sdp_fmtp_line_; +}; + +class BLINK_PLATFORM_EXPORT WebRTCRtpParameters { + public: + WebRTCRtpParameters( + const base::Optional<WebString>& transaction_id, + const WebRTCRtcpParameters& rtcp, + const WebVector<WebRTCRtpEncodingParameters>& encodings, + const WebVector<WebRTCRtpHeaderExtensionParameters>& header_extensions, + const WebVector<WebRTCRtpCodecParameters>& codecs, + const base::Optional<WebRTCDegradationPreference>& degradation_preference) + : transaction_id_(transaction_id), + rtcp_(rtcp), + encodings_(encodings), + header_extensions_(header_extensions), + codecs_(codecs), + degradation_preference_(degradation_preference) {} + + const base::Optional<WebString>& TransactionId() const { + return transaction_id_; + } + const WebVector<WebRTCRtpEncodingParameters>& Encodings() const { + return encodings_; + } + const WebVector<WebRTCRtpHeaderExtensionParameters>& HeaderExtensions() + const { + return header_extensions_; + } + const WebRTCRtcpParameters& Rtcp() const { return rtcp_; } + const WebVector<WebRTCRtpCodecParameters>& Codecs() const { return codecs_; } + const base::Optional<WebRTCDegradationPreference>& DegradationPreference() + const { + return degradation_preference_; + } + + private: + base::Optional<WebString> transaction_id_; + WebRTCRtcpParameters rtcp_; + WebVector<WebRTCRtpEncodingParameters> encodings_; + WebVector<WebRTCRtpHeaderExtensionParameters> header_extensions_; + WebVector<WebRTCRtpCodecParameters> codecs_; + base::Optional<WebRTCDegradationPreference> degradation_preference_; +}; + +} // namespace blink + +#endif // WebRTCRtpParameters_h
diff --git a/third_party/WebKit/public/platform/WebRTCRtpSender.h b/third_party/WebKit/public/platform/WebRTCRtpSender.h index 9619623..8035f5d 100644 --- a/third_party/WebKit/public/platform/WebRTCRtpSender.h +++ b/third_party/WebKit/public/platform/WebRTCRtpSender.h
@@ -6,6 +6,7 @@ #define WebRTCRtpSender_h #include "WebCommon.h" +#include "WebRTCRtpParameters.h" #include "WebRTCVoidRequest.h" #include "WebString.h" @@ -32,6 +33,7 @@ // https://crbug.com/790007 virtual void ReplaceTrack(WebMediaStreamTrack, WebRTCVoidRequest) = 0; virtual std::unique_ptr<WebRTCDTMFSenderHandler> GetDtmfSender() const = 0; + virtual std::unique_ptr<WebRTCRtpParameters> GetParameters() const = 0; }; } // namespace blink
diff --git a/third_party/WebKit/public/platform/WebRTCStats.h b/third_party/WebKit/public/platform/WebRTCStats.h index e7e67b43..b559bd4 100644 --- a/third_party/WebKit/public/platform/WebRTCStats.h +++ b/third_party/WebKit/public/platform/WebRTCStats.h
@@ -5,13 +5,12 @@ #ifndef WebRTCStats_h #define WebRTCStats_h +#include <memory> + #include "WebCommon.h" #include "WebString.h" #include "WebVector.h" -#include <memory> -#include <string> -#include <vector> namespace blink {
diff --git a/third_party/WebKit/public/platform/WebRuntimeFeatures.h b/third_party/WebKit/public/platform/WebRuntimeFeatures.h index 3223d50a..172ece05 100644 --- a/third_party/WebKit/public/platform/WebRuntimeFeatures.h +++ b/third_party/WebKit/public/platform/WebRuntimeFeatures.h
@@ -118,6 +118,7 @@ BLINK_PLATFORM_EXPORT static void EnablePrintBrowser(bool); BLINK_PLATFORM_EXPORT static void EnablePresentationAPI(bool); BLINK_PLATFORM_EXPORT static void EnablePushMessaging(bool); + BLINK_PLATFORM_EXPORT static void EnableRasterInducingScroll(bool); BLINK_PLATFORM_EXPORT static void EnableReducedReferrerGranularity(bool); BLINK_PLATFORM_EXPORT static void EnableRemotePlaybackAPI(bool); BLINK_PLATFORM_EXPORT static void EnableRenderingPipelineThrottling(bool);
diff --git a/third_party/WebKit/public/platform/modules/indexeddb/WebIDBValue.h b/third_party/WebKit/public/platform/modules/indexeddb/WebIDBValue.h index c008dcad..a3c8b25f 100644 --- a/third_party/WebKit/public/platform/modules/indexeddb/WebIDBValue.h +++ b/third_party/WebKit/public/platform/modules/indexeddb/WebIDBValue.h
@@ -5,8 +5,8 @@ #ifndef WebIDBValue_h #define WebIDBValue_h -#include <string> -#include <vector> +#include <memory> +#include <utility> #include "public/platform/WebBlobInfo.h" #include "public/platform/WebCommon.h"
diff --git a/third_party/WebKit/public/platform/modules/installedapp/installed_app_provider.mojom b/third_party/WebKit/public/platform/modules/installedapp/installed_app_provider.mojom index 27734040..2097492e 100644 --- a/third_party/WebKit/public/platform/modules/installedapp/installed_app_provider.mojom +++ b/third_party/WebKit/public/platform/modules/installedapp/installed_app_provider.mojom
@@ -5,7 +5,7 @@ [JavaPackage="org.chromium.installedapp.mojom"] module blink.mojom; -import "related_application.mojom"; +import "third_party/WebKit/public/platform/modules/installedapp/related_application.mojom"; // Mojo service for the getInstalledRelatedApps implementation. interface InstalledAppProvider {
diff --git a/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorker.h b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorker.h index 23b2a006..072885d6 100644 --- a/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorker.h +++ b/third_party/WebKit/public/platform/modules/serviceworker/WebServiceWorker.h
@@ -42,7 +42,6 @@ namespace blink { class WebSecurityOrigin; -class WebServiceWorkerProvider; class WebServiceWorkerProxy; class WebServiceWorker { @@ -71,11 +70,7 @@ return mojom::ServiceWorkerState::kUnknown; } - // The message is only valid during this method call, unless callee calls - // EnsureDataIsOwned on the message. - virtual void PostMessageToWorker(WebServiceWorkerProvider*, - TransferableMessage, - const WebSecurityOrigin&) = 0; + virtual void PostMessage(TransferableMessage, const WebSecurityOrigin&) = 0; using TerminateForTestingCallback = WebCallbacks<void, void>; virtual void TerminateForTesting(
diff --git a/third_party/blink/tools/move_blink_source.py b/third_party/blink/tools/move_blink_source.py index 5f4fb74..20e667f 100755 --- a/third_party/blink/tools/move_blink_source.py +++ b/third_party/blink/tools/move_blink_source.py
@@ -124,10 +124,10 @@ 'src/third_party/blink/renderer/devtools')]), ('WATCHLISTS', [('third_party/WebKit/Source', 'third_party/blink/renderer'), - ('third_party/WebKit/public', 'third_party/blink/renderer/public')]), + ('third_party/WebKit/public', 'third_party/blink/public')]), ('build/check_gn_headers_whitelist.txt', [('third_party/WebKit/Source', 'third_party/blink/renderer'), - ('third_party/WebKit/public', 'third_party/blink/renderer/public'), + ('third_party/WebKit/public', 'third_party/blink/public'), self._update_basename]), ('chrome/browser/resources/chromeos/chromevox/tools/jsbundler.py', [('third_party/WebKit/Source', 'third_party/blink/renderer')]), @@ -135,7 +135,7 @@ [('third_party/WebKit/Source', 'third_party/blink/renderer')]), ('third_party/WebKit/Source/BUILD.gn', [('$root_gen_dir/third_party/WebKit', - '$root_gen_dir/third_party/blink/renderer')]), + '$root_gen_dir/third_party/blink')]), ('third_party/WebKit/Source/config.gni', [('snake_case_source_files = false', 'snake_case_source_files = true')]), @@ -159,13 +159,13 @@ [self._update_basename]), ('third_party/WebKit/public/BUILD.gn', [('$root_gen_dir/third_party/WebKit', - '$root_gen_dir/third_party/blink/renderer')]), + '$root_gen_dir/third_party/blink')]), ('third_party/WebKit/public/blink_resources.grd', - [('../Source/', '../')]), + [('../Source/', '../renderer/')]), ('third_party/blink/tools/compile_devtools_frontend.py', [('\'WebKit\', \'Source\'', '\'blink\', \'renderer\'')]), ('tools/android/eclipse/.classpath', - [('third_party/WebKit/public', 'third_party/blink/renderer/public')]), + [('third_party/WebKit/public', 'third_party/blink/public')]), ('tools/android/loading/cloud/backend/deploy.sh', [('third_party/WebKit/Source', 'third_party/blink/renderer')]), ('tools/android/loading/emulation_unittest.py', @@ -175,7 +175,7 @@ ('tools/android/loading/request_track.py', [('third_party/WebKit/Source', 'third_party/blink/renderer')]), ('tools/gritsettings/resource_ids', - [('third_party/WebKit/public', 'third_party/blink/renderer/public'), + [('third_party/WebKit/public', 'third_party/blink/public'), ('third_party/WebKit/Source', 'third_party/blink/renderer')]), ('tools/metrics/actions/extract_actions.py', [('third_party/WebKit/Source', 'third_party/blink/renderer')]), @@ -186,7 +186,7 @@ [('third_party/WebKit/Source/core/frame/UseCounter.cpp', 'third_party/blink/renderer/core/frame/use_counter.cc')]), ('tools/metrics/histograms/update_use_counter_feature_enum.py', - [('third_party/WebKit/public', 'third_party/blink/renderer/public')]), + [('third_party/WebKit/public', 'third_party/blink/public')]), ] for file_path, replacement_list in file_replacement_list: if not apply_only or file_path in apply_only: @@ -361,10 +361,10 @@ def _update_build(self, content): content = content.replace('//third_party/WebKit/Source', '//third_party/blink/renderer') content = content.replace('//third_party/WebKit/common', '//third_party/blink/common') - content = content.replace('//third_party/WebKit/public', '//third_party/blink/renderer/public') + content = content.replace('//third_party/WebKit/public', '//third_party/blink/public') # export_header_blink exists outside of Blink too. content = content.replace('export_header_blink = "third_party/WebKit/public/platform/WebCommon.h"', - 'export_header_blink = "third_party/blink/renderer/public/platform/web_common.h"') + 'export_header_blink = "third_party/blink/public/platform/web_common.h"') return content def _update_blink_build(self, content): @@ -373,7 +373,7 @@ # Update visibility=[...] content = content.replace('//third_party/WebKit/*', '//third_party/blink/*') content = content.replace('//third_party/WebKit/Source/*', '//third_party/blink/renderer/*') - content = content.replace('//third_party/WebKit/public/*', '//third_party/blink/renderer/public/*') + content = content.replace('//third_party/WebKit/public/*', '//third_party/blink/public/*') # Update mojom variables content = content.replace('export_header = "third_party/WebKit/common', @@ -385,28 +385,28 @@ def _update_owners(self, content): content = content.replace('//third_party/WebKit/Source', '//third_party/blink/renderer') content = content.replace('//third_party/WebKit/common', '//third_party/blink/common') - content = content.replace('//third_party/WebKit/public', '//third_party/blink/renderer/public') + content = content.replace('//third_party/WebKit/public', '//third_party/blink/public') return content def _update_deps(self, content): original_content = content content = content.replace('third_party/WebKit/Source', 'third_party/blink/renderer') content = content.replace('third_party/WebKit/common', 'third_party/blink/common') - content = content.replace('third_party/WebKit/public', 'third_party/blink/renderer/public') + content = content.replace('third_party/WebKit/public', 'third_party/blink/public') content = content.replace('third_party/WebKit', 'third_party/blink') if original_content == content: return content return self._update_basename(content) def _update_mojom(self, content): - content = content.replace('third_party/WebKit/public', 'third_party/blink/renderer/public') + content = content.replace('third_party/WebKit/public', 'third_party/blink/public') content = content.replace('third_party/WebKit/common', 'third_party/blink/common') return content def _update_typemap(self, content): content = content.replace('//third_party/WebKit/Source', '//third_party/blink/renderer') content = content.replace('//third_party/WebKit/common', '//third_party/blink/common') - content = content.replace('//third_party/WebKit/public', '//third_party/blink/renderer/public') + content = content.replace('//third_party/WebKit/public', '//third_party/blink/public') return self._update_basename(content) def _update_blink_build_py(self, content): @@ -513,16 +513,19 @@ if path.startswith('third_party/WebKit'): path = path.replace('third_party/WebKit/Source', 'third_party/blink/renderer') path = path.replace('third_party/WebKit/common', 'third_party/blink/common') - path = path.replace('third_party/WebKit/public', 'third_party/blink/renderer/public') + path = path.replace('third_party/WebKit/public', 'third_party/blink/public') path = self._update_basename(path) return '#%s "%s"' % (include_or_import, path) match = self._checked_in_header_re.search(path) if match: + new_relative_path = path if match.group(1) in self._basename_map: - path = 'third_party/blink/renderer/' + path[:match.start(1)] + self._basename_map[match.group(1)] + new_relative_path = path[:match.start(1)] + self._basename_map[match.group(1)] + if path.startswith('public'): + path = 'third_party/blink/' + new_relative_path else: - path = 'third_party/blink/renderer/' + path + path = 'third_party/blink/renderer/' + new_relative_path elif 'core/inspector/protocol/' not in path: basename_start = path.rfind('/') + 1 basename = path[basename_start:] @@ -540,7 +543,7 @@ def _replace_basename_only_include(self, subdir, source_path, match): source_basename = match.group(1) if source_basename in self._basename_map: - return '#include "third_party/blink/renderer/public/%s/%s"' % (subdir, self._basename_map[source_basename]) + return '#include "third_party/blink/public/%s/%s"' % (subdir, self._basename_map[source_basename]) _log.warning('Basename-only %s in %s', match.group(0), self._shorten_path(source_path)) return match.group(0) @@ -548,7 +551,7 @@ if not source_path.endswith('.h') or '/third_party/WebKit/public/' not in source_path.replace('\\', '/'): return # In public/ header files, we should replace |#include "WebFoo.h"| - # with |#include "third_party/blink/renderer/public/platform-or-web/web_foo.h"| + # with |#include "third_party/blink/public/platform-or-web/web_foo.h"| subdir = self._fs.basename(self._fs.dirname(source_path)) # subdir is 'web' or 'platform'. return re.sub(r'#include\s+"(\w+\.h)"',
diff --git a/third_party/blink/tools/plan_blink_move.py b/third_party/blink/tools/plan_blink_move.py index 4d2642e..4170879 100755 --- a/third_party/blink/tools/plan_blink_move.py +++ b/third_party/blink/tools/plan_blink_move.py
@@ -20,11 +20,9 @@ is relative to third_party/blink. """ dest = None - if filename.startswith('public'): - dest = re.sub(r'^public', 'renderer' + fs.sep + 'public', filename) - elif filename.startswith('Source'): + if filename.startswith('Source'): dest = re.sub(r'^Source', 'renderer', filename) - elif filename.startswith('common'): + elif filename.startswith('common') or filename.startswith('public'): dest = filename else: raise ValueError('|filename| must start with "common", "public", or "Source": %s' % filename)
diff --git a/third_party/feed/BUILD.gn b/third_party/feed/BUILD.gn index 2f082526..44abf224 100644 --- a/third_party/feed/BUILD.gn +++ b/third_party/feed/BUILD.gn
@@ -122,6 +122,8 @@ "src/src/main/java/com/google/android/libraries/feed/host/storage/StorageMutation.java", "src/src/main/java/com/google/android/libraries/feed/host/storage/StorageOperation.java", "src/src/main/java/com/google/android/libraries/feed/host/storage/StorageOperationListSimplifier.java", + "src/src/main/java/com/google/android/libraries/feed/hostimpl/logging/LoggingApiImpl.java", + "src/src/main/java/com/google/android/libraries/feed/hostimpl/scheduler/SchedulerApiImpl.java", "src/src/main/java/com/google/android/libraries/feed/mocknetworkclient/MockServerNetworkClient.java", "src/src/main/java/com/google/android/libraries/feed/piet/AdapterFactory.java", "src/src/main/java/com/google/android/libraries/feed/piet/AdapterParameters.java",
diff --git a/third_party/feed/README.chromium b/third_party/feed/README.chromium index acfcbf8b..c6a67f8 100644 --- a/third_party/feed/README.chromium +++ b/third_party/feed/README.chromium
@@ -2,7 +2,7 @@ Short name: feed URL: https://chromium.googlesource.com/feed Version: 0 -Revision: 4dedff6189bbd8f3dc594ba3e2159ccdf929359a +Revision: 6dd696995de00102e0fd9e3433e8ace87247b6d4 License: Apache 2.0 License File: LICENSE Security Critical: yes
diff --git a/third_party/gvr-android-sdk/BUILD.gn b/third_party/gvr-android-sdk/BUILD.gn index f4d372da..7e7a013 100644 --- a/third_party/gvr-android-sdk/BUILD.gn +++ b/third_party/gvr-android-sdk/BUILD.gn
@@ -35,6 +35,8 @@ "*google/vr/cardboard/FrameMonitor.class", "*google/vr/cardboard/IsEmulator.class", "*google/vr/cardboard/PackageUtils.class", + "*google/vr/cardboard/StoragePermissionUtils.class", + "*google/vr/cardboard/UiUtils.class", "*google/vr/cardboard/VrContextWrapper.class", "*google/vr/cardboard/VrCoreLibraryLoader.class", "*google/vr/cardboard/VrParamsProvider.class",
diff --git a/third_party/minigbm/BUILD.gn b/third_party/minigbm/BUILD.gn index 0b401b7..5e0c948 100644 --- a/third_party/minigbm/BUILD.gn +++ b/third_party/minigbm/BUILD.gn
@@ -14,11 +14,11 @@ use_system_minigbm = false use_amdgpu_minigbm = false - use_amlogic_minigbm = false use_exynos_minigbm = false use_intel_minigbm = false use_marvell_minigbm = false use_mediatek_minigbm = false + use_meson_minigbm = false use_msm_minigbm = false use_radeon_minigbm = false use_rockchip_minigbm = false @@ -33,9 +33,6 @@ if (use_amdgpu_minigbm) { defines += [ "DRV_AMDGPU" ] } - if (use_amlogic_minigbm) { - defines += [ "DRV_AMLOGIC" ] - } if (use_exynos_minigbm) { defines += [ "DRV_EXYNOS" ] } @@ -48,8 +45,8 @@ if (use_mediatek_minigbm) { defines += [ "DRV_MEDIATEK" ] } - if (use_msm_minigbm) { - defines += [ "DRV_MSM" ] + if (use_meson_minigbm) { + defines += [ "DRV_MESON" ] } if (use_msm_minigbm) { defines += [ "DRV_MSM" ] @@ -71,7 +68,6 @@ shared_library("minigbm") { sources = [ "src/amdgpu.c", - "src/amlogic.c", "src/drv.c", "src/evdi.c", "src/exynos.c", @@ -82,6 +78,7 @@ "src/i915.c", "src/marvell.c", "src/mediatek.c", + "src/meson.c", "src/msm.c", "src/nouveau.c", "src/radeon.c", @@ -106,6 +103,14 @@ all_dependent_configs = [ "//build/config/gcc:rpath_for_built_shared_libraries" ] } + + # This target is used for Chromecast build, which expects the resulting lib + # to have a name <GN target name> + .so + group("libminigbm") { + deps = [ + ":minigbm", + ] + } } if (use_system_minigbm) {
diff --git a/tools/gn/command_clean.cc b/tools/gn/command_clean.cc index f4b64af..8165aaa 100644 --- a/tools/gn/command_clean.cc +++ b/tools/gn/command_clean.cc
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/files/file_enumerator.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/strings/string_split.h" @@ -93,24 +94,14 @@ return 1; } - // Read the args.gn file, if any. Not all GN builds have one. - base::FilePath gn_args_file = build_dir.AppendASCII("args.gn"); - std::string args_contents; - base::ReadFileToString(gn_args_file, &args_contents); - - base::DeleteFile(build_dir, true); - - // Put back the args.gn file (if any). - base::CreateDirectory(build_dir); - if (!args_contents.empty()) { - if (base::WriteFile(gn_args_file, args_contents.data(), - static_cast<int>(args_contents.size())) == -1) { - // Print the previous contents of args.gn since otherwise it is lost for - // good which can be quite frustrating. - Err(Location(), - "Failed to write args.gn. Old contents was:\n\n" + args_contents) - .PrintToStdout(); - return 1; + base::FileEnumerator traversal( + build_dir, false, + base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES); + for (base::FilePath current = traversal.Next(); !current.empty(); + current = traversal.Next()) { + if (!base::FilePath::CompareEqualIgnoreCase(current.BaseName().value(), + FILE_PATH_LITERAL("args.gn"))) { + base::DeleteFile(current, true); } }
diff --git a/tools/gritsettings/translation_expectations.pyl b/tools/gritsettings/translation_expectations.pyl index 8961c2bc..cb6e8d2 100644 --- a/tools/gritsettings/translation_expectations.pyl +++ b/tools/gritsettings/translation_expectations.pyl
@@ -88,6 +88,8 @@ "tools/grit/grit/testdata/substitute_tmpl.grd": "Test data", "tools/grit/grit/testdata/whitelist_resources.grd": "Test data", "tools/grit/grit/testdata/whitelist_strings.grd": "Test data", + "tools/translation/testdata/not_translated.grd": "Test data", + "tools/translation/testdata/test.grd": "Test data", "ui/strings/app_locale_settings.grd": "Not UI strings; localized separately", }, }
diff --git a/tools/json_schema_compiler/test/BUILD.gn b/tools/json_schema_compiler/test/BUILD.gn index 20dc149..2fe531e1 100644 --- a/tools/json_schema_compiler/test/BUILD.gn +++ b/tools/json_schema_compiler/test/BUILD.gn
@@ -3,7 +3,7 @@ # found in the LICENSE file. import("//build/config/features.gni") -import("//extensions/features/features.gni") +import("//extensions/buildflags/buildflags.gni") import("//tools/json_schema_compiler/json_features.gni") import("//tools/json_schema_compiler/json_schema_api.gni") @@ -38,7 +38,7 @@ root_namespace = "test::api::%(namespace)s" deps = [ - "//extensions/features", + "//extensions/buildflags", ] }
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index bbd1ae2..a9705a6 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -233,7 +233,6 @@ 'Linux ARM (dbg)': 'debug_bot_arm', 'Linux ARM64': 'release_bot_arm64', 'Linux ARM64 (dbg)': 'debug_bot_arm64', - 'linux-blink-heap-incremental-marking': 'debug_bot_enable_blink_heap_incremental_marking', 'Linux Clang Analyzer': 'linux_chromium_analysis', 'Linux deterministic': 'release_bot', 'Linux deterministic (dbg)': 'debug_bot', @@ -242,6 +241,8 @@ 'Linux Viz': 'release_trybot', 'Linux Xenial': 'release_bot', 'linux-annotator-rel': 'release_bot', + 'linux-blink-heap-incremental-marking': 'debug_bot_enable_blink_heap_incremental_marking', + 'linux-blink-heap-verification': 'release_bot_enable_blink_heap_verification', 'Mac deterministic': 'release_bot_mac_strip', 'Mac deterministic (dbg)': 'debug_bot', 'Mojo ChromiumOS': 'chromeos_with_codecs_release_trybot', @@ -1519,6 +1520,10 @@ 'release_bot', 'chrome_with_codecs', ], + 'release_bot_enable_blink_heap_verification': [ + 'release_bot', 'enable_blink_heap_verification', + ], + 'release_bot_fuchsia': [ 'release_bot', 'fuchsia', ], @@ -1916,6 +1921,10 @@ 'gn_args': 'enable_blink_heap_incremental_marking=true', }, + 'enable_blink_heap_verification': { + 'gn_args': 'enable_blink_heap_verification=true', + }, + # This config enable compression on main waterfall win builder to reduce the # size of chrome installer which are downloaded by bysecting script many # times.
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 58038ae..0f99594 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -4725,7 +4725,7 @@ <int value="0" label="Root Certificate"/> </enum> -<enum name="CertificateReportOutcome"> +<enum name="CertificateErrorReportEvent"> <int value="0" label="Submitted"/> <int value="1" label="Failed"/> <int value="2" label="Successful"/> @@ -26497,7 +26497,6 @@ <int value="11698808" label="enable-dom-distiller-button-animation"/> <int value="23556595" label="MarkHttpAs:enabled"/> <int value="27507364" label="apps-keep-chrome-alive"/> - <int value="28272521" label="ash-enable-display-move-window-accels"/> <int value="31848187" label="ViewsTaskManager:disabled"/> <int value="33778663" label="OriginTrials:enabled"/> <int value="37024318" label="disable-affiliation-based-matching"/> @@ -26529,6 +26528,7 @@ <int value="84911198" label="ScanCardsInWebPayments:disabled"/> <int value="88437020" label="FeaturePolicy:enabled"/> <int value="91938915" label="enable-suggestions-service"/> + <int value="92327255" label="DisplayMoveWindowAccels:disabled"/> <int value="98134240" label="material-design-ink-drop-animation-speed"/> <int value="103932290" label="show-autofill-type-predictions"/> <int value="105046382" label="ParallelDownloading:disabled"/> @@ -27283,6 +27283,7 @@ <int value="1966730288" label="disable-threaded-compositing"/> <int value="1969604362" label="enable-pinch-virtual-viewport"/> <int value="1971964569" label="NewEncodeCpuLoadEstimator:disabled"/> + <int value="1972232935" label="DisplayMoveWindowAccels:enabled"/> <int value="1980011075" label="debug-packed-apps"/> <int value="1980648371" label="PointerEventV1SpecCapturing:enabled"/> <int value="1988506961" label="EnableManualSaving:enabled"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 366f2dd..0102332c 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -14946,6 +14946,9 @@ </histogram> <histogram name="DelayNavigationThrottle.Delay.Actual" units="ms"> + <obsolete> + Deprecated March 2018 + </obsolete> <owner>bmcquade@chromium.org</owner> <summary> The actual delay added to main frame navigations by DelayNavigationThrottle. @@ -14953,6 +14956,9 @@ </histogram> <histogram name="DelayNavigationThrottle.Delay.Delta" units="ms"> + <obsolete> + Deprecated March 2018 + </obsolete> <owner>bmcquade@chromium.org</owner> <summary> The absolute delta between the specified and actual delays added to main @@ -14961,6 +14967,9 @@ </histogram> <histogram name="DelayNavigationThrottle.Delay.Specified" units="ms"> + <obsolete> + Deprecated March 2018 + </obsolete> <owner>bmcquade@chromium.org</owner> <summary> The specified delay added to main frame navigations by @@ -37645,6 +37654,16 @@ <summary>Various usage counts for media galleries.</summary> </histogram> +<histogram base="true" name="MediaRouter.Cast.App.Availability" units="ms"> +<!-- Name completed by histogram_suffixes name="MediaRouterSuccess" --> + + <owner>imcheng@chromium.org</owner> + <summary> + Round trip time for a Cast app availability request. Can be suffixed with + Success or Failure. + </summary> +</histogram> + <histogram name="MediaRouter.Cast.Channel.ConnectResult" enum="BooleanSuccess"> <owner>zhaobin@chromium.org</owner> <summary> @@ -38244,6 +38263,9 @@ </histogram> <histogram name="Memory.Experimental.Browser.PurgedMemory" units="MB"> + <obsolete> + Deprecated 03/2018. + </obsolete> <owner>bashi@chromium.org</owner> <summary> Amount of reclaimed memory (in terms of the private working set size) after @@ -49120,6 +49142,14 @@ </summary> </histogram> +<histogram name="Net.SSL_Connection_Latency_PQPadding" units="ms"> + <owner>agl@chromium.org</owner> + <summary> + Time from when the Connect() starts until it completes for any server that + echos a dummy post-quantum padding extension. + </summary> +</histogram> + <histogram name="Net.SSL_Connection_Latency_Resume_Handshake" units="ms"> <owner>agl@chromium.org</owner> <summary> @@ -59476,6 +59506,9 @@ </histogram> <histogram name="PageLoad.Clients.DelayNavigation.Delay.Actual" units="ms"> + <obsolete> + Deprecated March 2018 + </obsolete> <owner>bmcquade@chromium.org</owner> <summary> The actual delay added to page loads by DelayNavigationThrottle, for page @@ -59485,6 +59518,9 @@ </histogram> <histogram name="PageLoad.Clients.DelayNavigation.Delay.Delta" units="ms"> + <obsolete> + Deprecated March 2018 + </obsolete> <owner>bmcquade@chromium.org</owner> <summary> The absolute delta between the specified and actual delays added to main @@ -59494,6 +59530,9 @@ </histogram> <histogram name="PageLoad.Clients.DelayNavigation.Delay.Specified" units="ms"> + <obsolete> + Deprecated March 2018 + </obsolete> <owner>bmcquade@chromium.org</owner> <summary> The specified delay added to main frame navigations by @@ -61568,6 +61607,16 @@ </summary> </histogram> +<histogram name="PasswordManager.BlacklistedSites.NeedToBeCleaned" + enum="BooleanNeedsClearing"> + <owner>vasilii@chromium.org</owner> + <summary> + Records once on startup whether the blacklisted sites in the password store + need to be updated to remove username/password. Can be removed around Chrome + M69 (https://crbug.com/817754). + </summary> +</histogram> + <histogram name="PasswordManager.CertificateErrorsWhileSeeingForms" enum="PasswordCertificateError"> <owner>battre@chromium.org</owner> @@ -86372,16 +86421,8 @@ </summary> </histogram> -<histogram name="SSL.CertificateErrorReportFailure" enum="NetErrorCodes"> - <owner>estark@chromium.org</owner> - <summary> - Users can opt in to send reports of certificate validation errors to Google. - This records the error code whenever Chrome fails to send such a report. - </summary> -</histogram> - -<histogram name="SSL.CertificateErrorReportOutcome" - enum="CertificateReportOutcome"> +<histogram name="SSL.CertificateErrorReportEvent" + enum="CertificateErrorReportEvent"> <owner>meacer@chromium.org</owner> <summary> Users can opt in to send reports of certificate validation errors to Google. @@ -86392,6 +86433,14 @@ </summary> </histogram> +<histogram name="SSL.CertificateErrorReportFailure" enum="NetErrorCodes"> + <owner>estark@chromium.org</owner> + <summary> + Users can opt in to send reports of certificate validation errors to Google. + This records the error code whenever Chrome fails to send such a report. + </summary> +</histogram> + <histogram name="SSL.ExpectCTReportFailure" enum="NetErrorCodes"> <obsolete> Deprecated as of 07/2016. Replaced with SSL.ExpectCTReportFailure2. @@ -107780,6 +107829,12 @@ <affected-histogram name="Media.RebuffersCount"/> </histogram_suffixes> +<histogram_suffixes name="MediaRouterSuccess" separator="."> + <suffix name="Failure" label="Failure"/> + <suffix name="Success" label="Success"/> + <affected-histogram name="MediaRouter.Cast.App.Availability"/> +</histogram_suffixes> + <histogram_suffixes name="MediaTimelineWidths" separator="."> <suffix name="32_47"/> <suffix name="48_79"/>
diff --git a/tools/perf/BUILD.gn b/tools/perf/BUILD.gn index 39e01e25..0a481c8 100644 --- a/tools/perf/BUILD.gn +++ b/tools/perf/BUILD.gn
@@ -61,7 +61,16 @@ "//tools/json_comment_eater/", "//tools/json_to_struct/", - # For Pylib used by benchmarks + # For blink_perf benchmarks. + "//third_party/WebKit/PerformanceTests/", + + # For smoothness.tough_canvas_cases + "//chrome/test/data/perf/", + + # For image_decoding.measurement + "//chrome/test/data/image_decoding/", + + # For Pylib used by VR tests "//build/android/pylib/", ] }
diff --git a/tools/perf/core/benchmark_android_bot_map.json b/tools/perf/core/benchmark_android_bot_map.json index 88fc3ac..5120648 100644 --- a/tools/perf/core/benchmark_android_bot_map.json +++ b/tools/perf/core/benchmark_android_bot_map.json
@@ -1,184 +1,256 @@ { "0": { "benchmarks": [ - "system_health.memory_desktop", - "system_health.memory_mobile" + "battor.steady_state", + "smoothness.desktop_tough_pinch_zoom_cases", + "tab_switching.typical_25" ] }, "1": { "benchmarks": [ - "loading.desktop", - "smoothness.key_silk_cases", - "smoothness.simple_mobile_sites" - ] - }, - "2": { - "benchmarks": [ - "blink_perf.image_decoder", - "blink_perf.owp_storage", - "wasm" - ] - }, - "3": { - "benchmarks": [ - "speedometer-future", - "speedometer2-future", - "v8.browsing_desktop-future", - "v8.browsing_mobile-future" - ] - }, - "4": { - "benchmarks": [ - "system_health.common_desktop", - "v8.browsing_mobile" - ] - }, - "5": { - "benchmarks": [ - "dromaeo.domcoretraverse", - "memory.desktop", - "power.typical_10_mobile", - "smoothness.tough_animation_cases", - "thread_times.key_mobile_sites_smooth", - "webrtc" - ] - }, - "6": { - "benchmarks": [ - "blink_perf.shadow_dom", - "dromaeo.domcorequery", - "power.idle_platform", - "smoothness.gpu_rasterization_and_decoding.image_decoding_cases" - ] - }, - "7": { - "benchmarks": [ "battor.trivial_pages", - "media.desktop", - "octane", - "smoothness.gpu_rasterization.tough_scrolling_cases", - "smoothness.tough_filters_cases", - "thread_times.key_hit_test_cases", - "thread_times.key_idle_power_cases", - "v8.runtimestats.browsing_mobile" - ] - }, - "8": { - "benchmarks": [ - "dummy_benchmark.histogram_benchmark_1", - "dummy_benchmark.noisy_benchmark_1", - "jetstream", - "smoothness.tough_texture_upload_cases", - "speedometer", - "speedometer2" - ] - }, - "9": { - "benchmarks": [ - "memory.top_10_mobile", - "smoothness.gpu_rasterization.tough_filters_cases", - "smoothness.image_decoding_cases", - "smoothness.pathological_mobile_sites", - "smoothness.tough_pinch_zoom_cases", - "v8.detached_context_age_in_gc" + "smoothness.gpu_rasterization.polymer", + "thread_times.key_hit_test_cases" ] }, "10": { "benchmarks": [ - "blink_perf.bindings", - "blink_perf.canvas", - "rasterize_and_record_micro.partial_invalidation", - "smoothness.gpu_rasterization.polymer", - "start_with_url.cold.startup_pages", - "system_health.webview_startup" + "blink_perf.paint", + "smoothness.key_mobile_sites_smooth", + "v8.browsing_desktop" ] }, "11": { "benchmarks": [ - "blink_perf.layout", - "dromaeo", - "dromaeo.domcoreattr", - "oortonline_tbmv2", - "smoothness.maps", - "smoothness.tough_webgl_cases", - "thread_times.simple_mobile_sites" + "blink_perf.parser", + "smoothness.key_silk_cases", + "v8.browsing_desktop-future" ] }, "12": { "benchmarks": [ - "battor.steady_state", - "blink_perf.svg", - "memory.long_running_idle_gmail_background_tbmv2", - "smoothness.gpu_rasterization.top_25_smooth", - "smoothness.gpu_rasterization.tough_path_rendering_cases", - "thread_times.key_noop_cases" + "blink_perf.shadow_dom", + "smoothness.maps", + "v8.browsing_mobile" ] }, "13": { "benchmarks": [ - "memory.long_running_idle_gmail_tbmv2", - "system_health.common_mobile" + "blink_perf.svg", + "smoothness.pathological_mobile_sites", + "v8.browsing_mobile-future" ] }, "14": { "benchmarks": [ - "loading.mobile", - "media.mobile", - "smoothness.tough_webgl_ad_cases", - "tab_switching.typical_25", - "v8.browsing_desktop" + "dromaeo", + "smoothness.simple_mobile_sites", + "v8.detached_context_age_in_gc" ] }, "15": { "benchmarks": [ - "blink_perf.events", - "dummy_benchmark.stable_benchmark_1", - "smoothness.top_25_smooth", - "smoothness.tough_ad_cases" + "dromaeo.domcoreattr", + "smoothness.sync_scroll.key_mobile_sites_smooth", + "v8.runtime_stats.top_25" ] }, "16": { "benchmarks": [ "dromaeo.domcoremodify", - "smoothness.key_desktop_move_cases", - "smoothness.sync_scroll.key_mobile_sites_smooth", - "thread_times.tough_compositor_cases", - "thread_times.tough_scrolling_cases" + "smoothness.top_25_smooth", + "v8.runtimestats.browsing_desktop" ] }, "17": { "benchmarks": [ - "blink_perf.dom", - "rasterize_and_record_micro.top_25", - "smoothness.tough_canvas_cases", - "thread_times.key_silk_cases" + "dromaeo.domcorequery", + "smoothness.tough_ad_cases", + "v8.runtimestats.browsing_mobile" ] }, "18": { "benchmarks": [ - "blink_perf.css", - "blink_perf.parser", - "scheduler.tough_scheduling_cases", - "smoothness.gpu_rasterization.tough_pinch_zoom_cases", - "smoothness.tough_image_decode_cases", - "start_with_url.warm.startup_pages" + "dromaeo.domcoretraverse", + "smoothness.tough_animation_cases", + "wasm" ] }, "19": { "benchmarks": [ - "blink_perf.paint", - "kraken", - "smoothness.key_mobile_sites_smooth", - "tracing.tracing_with_background_memory_infra" + "dummy_benchmark.histogram_benchmark_1", + "smoothness.tough_canvas_cases", + "webrtc" + ] + }, + "2": { + "benchmarks": [ + "blink_perf.bindings", + "smoothness.gpu_rasterization.top_25_smooth", + "thread_times.key_idle_power_cases" ] }, "20": { "benchmarks": [ - "smoothness.desktop_tough_pinch_zoom_cases", - "smoothness.tough_path_rendering_cases", - "smoothness.tough_scrolling_cases", - "v8.runtime_stats.top_25", - "v8.runtimestats.browsing_desktop" + "dummy_benchmark.noisy_benchmark_1", + "smoothness.tough_filters_cases" + ] + }, + "21": { + "benchmarks": [ + "dummy_benchmark.stable_benchmark_1", + "smoothness.tough_image_decode_cases" + ] + }, + "22": { + "benchmarks": [ + "jetstream", + "smoothness.tough_path_rendering_cases" + ] + }, + "23": { + "benchmarks": [ + "kraken", + "smoothness.tough_pinch_zoom_cases" + ] + }, + "24": { + "benchmarks": [ + "loading.desktop", + "smoothness.tough_scrolling_cases" + ] + }, + "25": { + "benchmarks": [ + "loading.mobile", + "smoothness.tough_texture_upload_cases" + ] + }, + "26": { + "benchmarks": [ + "media.desktop", + "smoothness.tough_webgl_ad_cases" + ] + }, + "27": { + "benchmarks": [ + "media.mobile", + "smoothness.tough_webgl_cases" + ] + }, + "28": { + "benchmarks": [ + "memory.desktop", + "speedometer" + ] + }, + "29": { + "benchmarks": [ + "memory.long_running_idle_gmail_background_tbmv2", + "speedometer-future" + ] + }, + "3": { + "benchmarks": [ + "blink_perf.canvas", + "smoothness.gpu_rasterization.tough_filters_cases", + "thread_times.key_mobile_sites_smooth" + ] + }, + "30": { + "benchmarks": [ + "memory.long_running_idle_gmail_tbmv2", + "speedometer2" + ] + }, + "31": { + "benchmarks": [ + "memory.top_10_mobile", + "speedometer2-future" + ] + }, + "32": { + "benchmarks": [ + "octane", + "start_with_url.cold.startup_pages" + ] + }, + "33": { + "benchmarks": [ + "oortonline_tbmv2", + "start_with_url.warm.startup_pages" + ] + }, + "34": { + "benchmarks": [ + "power.idle_platform", + "system_health.common_desktop" + ] + }, + "35": { + "benchmarks": [ + "power.typical_10_mobile", + "system_health.common_mobile" + ] + }, + "36": { + "benchmarks": [ + "rasterize_and_record_micro.partial_invalidation", + "system_health.memory_desktop" + ] + }, + "37": { + "benchmarks": [ + "rasterize_and_record_micro.top_25", + "system_health.memory_mobile" + ] + }, + "38": { + "benchmarks": [ + "scheduler.tough_scheduling_cases", + "system_health.webview_startup" + ] + }, + "4": { + "benchmarks": [ + "blink_perf.css", + "smoothness.gpu_rasterization.tough_path_rendering_cases", + "thread_times.key_noop_cases" + ] + }, + "5": { + "benchmarks": [ + "blink_perf.dom", + "smoothness.gpu_rasterization.tough_pinch_zoom_cases", + "thread_times.key_silk_cases" + ] + }, + "6": { + "benchmarks": [ + "blink_perf.events", + "smoothness.gpu_rasterization.tough_scrolling_cases", + "thread_times.simple_mobile_sites" + ] + }, + "7": { + "benchmarks": [ + "blink_perf.image_decoder", + "smoothness.gpu_rasterization_and_decoding.image_decoding_cases", + "thread_times.tough_compositor_cases" + ] + }, + "8": { + "benchmarks": [ + "blink_perf.layout", + "smoothness.image_decoding_cases", + "thread_times.tough_scrolling_cases" + ] + }, + "9": { + "benchmarks": [ + "blink_perf.owp_storage", + "smoothness.key_desktop_move_cases", + "tracing.tracing_with_background_memory_infra" ] } }
diff --git a/tools/perf/core/benchmark_desktop_bot_map.json b/tools/perf/core/benchmark_desktop_bot_map.json index 86e19ea..958c98f 100644 --- a/tools/perf/core/benchmark_desktop_bot_map.json +++ b/tools/perf/core/benchmark_desktop_bot_map.json
@@ -1,120 +1,204 @@ { "0": { "benchmarks": [ - "blink_perf.dom", - "blink_perf.paint", - "dromaeo.domcoremodify", - "dummy_benchmark.stable_benchmark_1", - "media.mobile", - "memory.top_10_mobile", - "scheduler.tough_scheduling_cases", - "smoothness.key_desktop_move_cases", - "smoothness.key_mobile_sites_smooth", - "smoothness.tough_ad_cases", - "smoothness.tough_image_decode_cases", - "system_health.memory_desktop", - "thread_times.key_mobile_sites_smooth", - "thread_times.key_silk_cases", - "v8.runtime_stats.top_25" + "battor.steady_state", + "media.desktop", + "smoothness.pathological_mobile_sites", + "tab_switching.typical_25" ] }, "1": { "benchmarks": [ - "blink_perf.bindings", - "blink_perf.canvas", - "blink_perf.image_decoder", - "blink_perf.owp_storage", - "dummy_benchmark.histogram_benchmark_1", - "dummy_benchmark.noisy_benchmark_1", - "loading.desktop", - "octane", - "oortonline_tbmv2", - "power.idle_platform", - "smoothness.key_silk_cases", - "smoothness.pathological_mobile_sites", - "smoothness.top_25_smooth", + "battor.trivial_pages", + "media.mobile", + "smoothness.simple_mobile_sites", + "thread_times.key_hit_test_cases" + ] + }, + "10": { + "benchmarks": [ + "blink_perf.paint", + "rasterize_and_record_micro.partial_invalidation", + "smoothness.tough_pinch_zoom_cases", + "v8.browsing_desktop" + ] + }, + "11": { + "benchmarks": [ + "blink_perf.parser", + "rasterize_and_record_micro.top_25", + "smoothness.tough_scrolling_cases", + "v8.browsing_desktop-future" + ] + }, + "12": { + "benchmarks": [ + "blink_perf.shadow_dom", + "scheduler.tough_scheduling_cases", + "smoothness.tough_texture_upload_cases", + "v8.browsing_mobile" + ] + }, + "13": { + "benchmarks": [ + "blink_perf.svg", + "smoothness.desktop_tough_pinch_zoom_cases", + "smoothness.tough_webgl_ad_cases", + "v8.browsing_mobile-future" + ] + }, + "14": { + "benchmarks": [ + "dromaeo", + "smoothness.gpu_rasterization.polymer", "smoothness.tough_webgl_cases", - "system_health.common_mobile", - "system_health.memory_mobile", - "thread_times.key_hit_test_cases", - "thread_times.key_noop_cases", - "thread_times.tough_scrolling_cases", - "tracing.tracing_with_background_memory_infra", - "v8.browsing_mobile", + "v8.detached_context_age_in_gc" + ] + }, + "15": { + "benchmarks": [ + "dromaeo.domcoreattr", + "smoothness.gpu_rasterization.top_25_smooth", + "speedometer", + "v8.runtime_stats.top_25" + ] + }, + "16": { + "benchmarks": [ + "dromaeo.domcoremodify", + "smoothness.gpu_rasterization.tough_filters_cases", + "speedometer-future", + "v8.runtimestats.browsing_desktop" + ] + }, + "17": { + "benchmarks": [ + "dromaeo.domcorequery", + "smoothness.gpu_rasterization.tough_path_rendering_cases", + "speedometer2", + "v8.runtimestats.browsing_mobile" + ] + }, + "18": { + "benchmarks": [ + "dromaeo.domcoretraverse", + "smoothness.gpu_rasterization.tough_pinch_zoom_cases", + "speedometer2-future", + "wasm" + ] + }, + "19": { + "benchmarks": [ + "dummy_benchmark.histogram_benchmark_1", + "smoothness.gpu_rasterization.tough_scrolling_cases", + "start_with_url.cold.startup_pages", "webrtc" ] }, "2": { "benchmarks": [ - "battor.trivial_pages", - "blink_perf.layout", - "dromaeo", - "dromaeo.domcoreattr", - "memory.long_running_idle_gmail_background_tbmv2", - "rasterize_and_record_micro.top_25", - "smoothness.gpu_rasterization.polymer", - "smoothness.gpu_rasterization.top_25_smooth", + "blink_perf.bindings", + "memory.desktop", + "smoothness.sync_scroll.key_mobile_sites_smooth", + "thread_times.key_idle_power_cases" + ] + }, + "20": { + "benchmarks": [ + "dummy_benchmark.noisy_benchmark_1", "smoothness.gpu_rasterization_and_decoding.image_decoding_cases", + "start_with_url.warm.startup_pages" + ] + }, + "21": { + "benchmarks": [ + "dummy_benchmark.stable_benchmark_1", "smoothness.image_decoding_cases", - "smoothness.simple_mobile_sites", - "smoothness.tough_filters_cases", - "smoothness.tough_path_rendering_cases", - "smoothness.tough_scrolling_cases", - "speedometer", - "speedometer2", - "tab_switching.typical_25", - "thread_times.tough_compositor_cases", - "v8.browsing_desktop-future", - "v8.browsing_mobile-future", - "wasm" + "system_health.common_desktop" + ] + }, + "22": { + "benchmarks": [ + "jetstream", + "smoothness.key_desktop_move_cases", + "system_health.common_mobile" + ] + }, + "23": { + "benchmarks": [ + "kraken", + "smoothness.key_mobile_sites_smooth", + "system_health.memory_desktop" + ] + }, + "24": { + "benchmarks": [ + "loading.desktop", + "smoothness.key_silk_cases", + "system_health.memory_mobile" + ] + }, + "25": { + "benchmarks": [ + "loading.mobile", + "smoothness.maps", + "system_health.webview_startup" ] }, "3": { "benchmarks": [ - "blink_perf.parser", - "blink_perf.svg", - "dromaeo.domcorequery", - "dromaeo.domcoretraverse", - "jetstream", - "memory.desktop", - "power.typical_10_mobile", - "smoothness.gpu_rasterization.tough_filters_cases", - "smoothness.gpu_rasterization.tough_pinch_zoom_cases", - "smoothness.tough_canvas_cases", - "smoothness.tough_pinch_zoom_cases", - "speedometer-future", - "speedometer2-future", - "start_with_url.cold.startup_pages", - "v8.browsing_desktop", - "v8.detached_context_age_in_gc", - "v8.runtimestats.browsing_desktop" + "blink_perf.canvas", + "memory.long_running_idle_gmail_background_tbmv2", + "smoothness.top_25_smooth", + "thread_times.key_mobile_sites_smooth" ] }, "4": { "benchmarks": [ - "battor.steady_state", "blink_perf.css", - "blink_perf.events", - "blink_perf.shadow_dom", - "kraken", - "loading.mobile", - "media.desktop", "memory.long_running_idle_gmail_tbmv2", - "rasterize_and_record_micro.partial_invalidation", - "smoothness.desktop_tough_pinch_zoom_cases", - "smoothness.gpu_rasterization.tough_path_rendering_cases", - "smoothness.gpu_rasterization.tough_scrolling_cases", - "smoothness.maps", - "smoothness.sync_scroll.key_mobile_sites_smooth", + "smoothness.tough_ad_cases", + "thread_times.key_noop_cases" + ] + }, + "5": { + "benchmarks": [ + "blink_perf.dom", + "memory.top_10_mobile", "smoothness.tough_animation_cases", - "smoothness.tough_texture_upload_cases", - "smoothness.tough_webgl_ad_cases", - "start_with_url.warm.startup_pages", - "system_health.common_desktop", - "system_health.webview_startup", - "thread_times.key_idle_power_cases", - "thread_times.simple_mobile_sites", - "v8.runtimestats.browsing_mobile" + "thread_times.key_silk_cases" + ] + }, + "6": { + "benchmarks": [ + "blink_perf.events", + "octane", + "smoothness.tough_canvas_cases", + "thread_times.simple_mobile_sites" + ] + }, + "7": { + "benchmarks": [ + "blink_perf.image_decoder", + "oortonline_tbmv2", + "smoothness.tough_filters_cases", + "thread_times.tough_compositor_cases" + ] + }, + "8": { + "benchmarks": [ + "blink_perf.layout", + "power.idle_platform", + "smoothness.tough_image_decode_cases", + "thread_times.tough_scrolling_cases" + ] + }, + "9": { + "benchmarks": [ + "blink_perf.owp_storage", + "power.typical_10_mobile", + "smoothness.tough_path_rendering_cases", + "tracing.tracing_with_background_memory_infra" ] } }
diff --git a/tools/perf/core/perf_data_generator.py b/tools/perf/core/perf_data_generator.py index c3eaaad..a7919f6 100755 --- a/tools/perf/core/perf_data_generator.py +++ b/tools/perf/core/perf_data_generator.py
@@ -294,7 +294,7 @@ swarming=[ { 'gpu': '8086:1616', - 'os': 'Windows-10-10240', + 'os': 'Windows-10-16299.248', 'pool': 'Chrome-perf', 'device_ids': [ 'build117-b1', 'build118-b1',
diff --git a/tools/perf/page_sets/data/tough_webgl_cases.json b/tools/perf/page_sets/data/tough_webgl_cases.json index 1d72a52..449fe38 100644 --- a/tools/perf/page_sets/data/tough_webgl_cases.json +++ b/tools/perf/page_sets/data/tough_webgl_cases.json
@@ -1,37 +1,34 @@ { "archives": { - "http://helloracer.com/racer-s/": { - "DEFAULT": "tough_webgl_cases_000.wprgo" + "aquarium_20k": { + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://kenrussell.github.io/webgl-animometer/Animometer/tests/3d/webgl.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" - }, - "http://montagestudio.com/demos/eco-homes/": { - "DEFAULT": "tough_webgl_cases_000.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://webglsamples.org/aquarium/aquarium.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://webglsamples.org/blob/blob.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://webglsamples.org/dynamic-cubemap/dynamic-cubemap.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://www.khronos.org/registry/webgl/sdk/demos/google/nvidia-vertex-buffer-object/index.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://www.khronos.org/registry/webgl/sdk/demos/google/particles/index.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://www.khronos.org/registry/webgl/sdk/demos/google/san-angeles/index.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" }, "http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.html": { - "DEFAULT": "tough_webgl_cases_005.wprgo" + "DEFAULT": "tough_webgl_cases_006.wprgo" } }, "description": "Describes the Web Page Replay archives for a story set. Don't edit by hand! Use record_wpr for updating.",
diff --git a/tools/perf/page_sets/data/tough_webgl_cases_006.wprgo.sha1 b/tools/perf/page_sets/data/tough_webgl_cases_006.wprgo.sha1 new file mode 100644 index 0000000..e7cf7a5 --- /dev/null +++ b/tools/perf/page_sets/data/tough_webgl_cases_006.wprgo.sha1
@@ -0,0 +1 @@ +7fcc3ca13fa01e90d62be4ffe5568c680a61b9c0 \ No newline at end of file
diff --git a/tools/perf/page_sets/tough_webgl_cases.py b/tools/perf/page_sets/tough_webgl_cases.py index 2407ea4..abc7295 100644 --- a/tools/perf/page_sets/tough_webgl_cases.py +++ b/tools/perf/page_sets/tough_webgl_cases.py
@@ -10,13 +10,13 @@ class ToughWebglCasesPage(page_module.Page): - def __init__(self, url, page_set): + def __init__(self, url, page_set, name): super(ToughWebglCasesPage, self).__init__( url=url, page_set=page_set, shared_page_state_class=( webgl_supported_shared_state.WebGLSupportedSharedState), make_javascript_deterministic=False, - name=url) + name=name) @property @@ -49,20 +49,32 @@ urls_list = [ # pylint: disable=line-too-long - 'http://www.khronos.org/registry/webgl/sdk/demos/google/nvidia-vertex-buffer-object/index.html', + ('http://www.khronos.org/registry/webgl/sdk/demos/google/nvidia-vertex-buffer-object/index.html', + None), # pylint: disable=line-too-long - 'http://www.khronos.org/registry/webgl/sdk/demos/google/san-angeles/index.html', + ('http://www.khronos.org/registry/webgl/sdk/demos/google/san-angeles/index.html', + None), # pylint: disable=line-too-long - 'http://www.khronos.org/registry/webgl/sdk/demos/google/particles/index.html', - 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html', + ('http://www.khronos.org/registry/webgl/sdk/demos/google/particles/index.html', + None), + ('http://www.khronos.org/registry/webgl/sdk/demos/webkit/Earth.html', + None), # pylint: disable=line-too-long - 'http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.html', - 'http://webglsamples.org/aquarium/aquarium.html', - 'http://webglsamples.org/blob/blob.html', + ('http://www.khronos.org/registry/webgl/sdk/demos/webkit/ManyPlanetsDeep.html', + None), + ('http://webglsamples.org/aquarium/aquarium.html', + None), + ('http://webglsamples.org/aquarium/aquarium.html?numFish=20000', + 'aquarium_20k'), + ('http://webglsamples.org/blob/blob.html', None), # pylint: disable=line-too-long - 'http://webglsamples.org/dynamic-cubemap/dynamic-cubemap.html', + ('http://webglsamples.org/dynamic-cubemap/dynamic-cubemap.html', + None), # pylint: disable=line-too-long - 'http://kenrussell.github.io/webgl-animometer/Animometer/tests/3d/webgl.html', + ('http://kenrussell.github.io/webgl-animometer/Animometer/tests/3d/webgl.html', + None) ] - for url in urls_list: - self.AddStory(ToughWebglCasesPage(url, self)) + for url, name in urls_list: + if name is None: + name = url + self.AddStory(ToughWebglCasesPage(url, self, name))
diff --git a/tools/perf/process_perf_results.py b/tools/perf/process_perf_results.py index 5184774..052caca 100755 --- a/tools/perf/process_perf_results.py +++ b/tools/perf/process_perf_results.py
@@ -92,36 +92,39 @@ # We need to keep track of disabled benchmarks so we don't try to # upload the results. - disabled_benchmarks = [] test_results_list = [] tmpfile_dir = tempfile.mkdtemp('resultscache') try: - for directory in benchmark_directory_list: - with open(join(directory, 'test_results.json')) as json_data: - json_results = json.load(json_data) - if json_results.get('version') == 3: - # Non-telemetry tests don't have written json results but - # if they are executing then they are enabled and will generate - # chartjson results. - if not bool(json_results.get('tests')): - disabled_benchmarks.append(directory) - if '.reference' in directory: - # We don't need to upload reference build data to the - # flakiness dashboard since we don't monitor the ref build - continue - test_results_list.append(json_results) - _merge_json_output(output_json, test_results_list) - with oauth_api.with_access_token(service_account_file) as oauth_file: for directory in benchmark_directory_list: - print 'Uploading perf results from %s benchmark' % directory - if directory in disabled_benchmarks: + disabled = False + with open(join(directory, 'test_results.json')) as json_data: + json_results = json.load(json_data) + if not json_results: + # Output is null meaning the test didn't produce any results. + # Want to output an error and continue loading the rest of the + # test results. + print 'No results produced for %s, skipping upload' % directory + continue + if json_results.get('version') == 3: + # Non-telemetry tests don't have written json results but + # if they are executing then they are enabled and will generate + # chartjson results. + if not bool(json_results.get('tests')): + disabled = True + if not '.reference' in directory: + # We don't need to upload reference build data to the + # flakiness dashboard since we don't monitor the ref build + test_results_list.append(json_results) + if disabled: # We don't upload disabled benchmarks print 'Benchmark %s disabled' % directory continue + print 'Uploading perf results from %s benchmark' % directory _upload_perf_results(join(directory, 'perf_results.json'), directory, configuration_name, build_properties, oauth_file, tmpfile_dir) + _merge_json_output(output_json, test_results_list) finally: shutil.rmtree(tmpfile_dir) return 0
diff --git a/tools/perf/record_wpr b/tools/perf/record_wpr index 465163e9..dfe3d4d 100755 --- a/tools/perf/record_wpr +++ b/tools/perf/record_wpr
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
diff --git a/tools/perf/run_benchmark b/tools/perf/run_benchmark index 0a6e183c..91095101 100755 --- a/tools/perf/run_benchmark +++ b/tools/perf/run_benchmark
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
diff --git a/tools/perf/run_telemetry_tests b/tools/perf/run_telemetry_tests index 0abbd8a..0d970e4f 100755 --- a/tools/perf/run_telemetry_tests +++ b/tools/perf/run_telemetry_tests
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # 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.
diff --git a/tools/perf/run_tests b/tools/perf/run_tests index 152fa85..2ad55a0 100755 --- a/tools/perf/run_tests +++ b/tools/perf/run_tests
@@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env vpython # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.
diff --git a/tools/perf/scripts_smoke_unittest.py b/tools/perf/scripts_smoke_unittest.py index 374ec22..d99bc0b2 100644 --- a/tools/perf/scripts_smoke_unittest.py +++ b/tools/perf/scripts_smoke_unittest.py
@@ -16,11 +16,8 @@ perf_dir = os.path.dirname(__file__) - def RunPerfScript(self, command, venv=False): + def RunPerfScript(self, command): main_command = [sys.executable] - # TODO(crbug.com/805552): Remove if/else block - if venv: - main_command = ['vpython'] args = main_command + command.split(' ') proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=self.perf_dir) @@ -50,8 +47,7 @@ @decorators.Disabled('chromeos') # crbug.com/814068 def testRunRecordWprList(self): - return_code, stdout = self.RunPerfScript('record_wpr --list-benchmarks', - venv=True) + return_code, stdout = self.RunPerfScript('record_wpr --list-benchmarks') # TODO(nednguyen): Remove this once we figure out why importing # small_profile_extender fails on Android dbg. # crbug.com/561668
diff --git a/tools/translation/OWNERS b/tools/translation/OWNERS new file mode 100644 index 0000000..1840860 --- /dev/null +++ b/tools/translation/OWNERS
@@ -0,0 +1,2 @@ +anthonyvd@chromium.org +meacer@chromium.org
diff --git a/tools/translation/PRESUBMIT.py b/tools/translation/PRESUBMIT.py new file mode 100644 index 0000000..d8120cd --- /dev/null +++ b/tools/translation/PRESUBMIT.py
@@ -0,0 +1,26 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + + +def _CommonChecks(input_api, output_api, run_tests=False): + results = [] + + # Run Pylint over the files in the directory. + pylint_checks = input_api.canned_checks.GetPylint(input_api, output_api) + results.extend(input_api.RunTests(pylint_checks)) + + # Run unittests. + if run_tests: + results.extend(input_api.canned_checks.RunUnitTestsInDirectory( + input_api, output_api, '.', [ r'^.+_unittest\.py$'])) + + return results + + +def CheckChangeOnUpload(input_api, output_api): + return _CommonChecks(input_api, output_api) + + +def CheckChangeOnCommit(input_api, output_api): + return _CommonChecks(input_api, output_api, run_tests=True)
diff --git a/tools/translation/README.md b/tools/translation/README.md new file mode 100644 index 0000000..37b149d4 --- /dev/null +++ b/tools/translation/README.md
@@ -0,0 +1,24 @@ +# Translation Tools + +This directory contains tools for Chrome's UI translations. + +## upload_screenshots.py + +This tool uploads translation screenshots to a content-addressed Google Cloud +Storage bucket. + +Translation screenshots are .png files provided by Chrome Developers to give +translators more context about UI changes. Developers take screenshots of their +UI changes, add them under a specific directory (derived from the path of the +.grd or .grdp file that contains the UI string) and run this tool. The tool +uploads the images, generates SHA1 fingerprints of the screenshots, and asks the +developer if they want to add the fingerprints to the CL. + +Example: For a file at path/to/test.grd, the screenshot directory will be +path/to/test_grd. In the upstream Chrome repository, this directory will only +contain .png.sha1 files previously generated by this tool. In local working +repositories, it may contain .png files generated by Chrome developers, such as +path/to/test_grd/IDS_MESSAGE.png. + +For more information, see go/chrome-translation-screenshots (Google internal +link).
diff --git a/tools/translation/helper/__init__.py b/tools/translation/helper/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tools/translation/helper/__init__.py
diff --git a/tools/translation/helper/translation_helper.py b/tools/translation/helper/translation_helper.py new file mode 100644 index 0000000..f9c61b6 --- /dev/null +++ b/tools/translation/helper/translation_helper.py
@@ -0,0 +1,217 @@ +# 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. + +"""Helpers for dealing with translation files.""" + +import ast +import os +import re +import xml.etree.cElementTree as ElementTree + + +class GRDFile(object): + """Class representing a grd xml file. + + Attributes: + path: the path to the grd file. + dir: the path to the the grd's parent directery. + name: the base name of the grd file. + grdp_paths: the list of grdp files included in the grd via <part>. + structure_paths: the paths of any <structure> elements in the grd file. + xtb_paths: the xtb paths where the grd's translations live. + lang_to_xtb_path: maps each language to the xtb path for that language. + appears_translatable: whether the contents of the grd indicate that it's + supposed to be translated. + expected_languages: the languages that this grd is expected to have + translations for, based on the translation expectations file. + """ + + def __init__(self, path): + self.path = path + self.dir, self.name = os.path.split(path) + dom, self.grdp_paths = _parse_grd_file(path) + self.structure_paths = [os.path.join(self.dir, s.get('file')) + for s in dom.findall('.//structure')] + self.xtb_paths = [os.path.join(self.dir, f.get('path')) + for f in dom.findall('.//file')] + self.lang_to_xtb_path = {} + self.appears_translatable = (len(self.xtb_paths) != 0 or + dom.find('.//message') is not None) + self.expected_languages = None + + def _populate_lang_to_xtb_path(self, errors): + """Populates the lang_to_xtb_path attribute.""" + grd_root = os.path.splitext(self.name)[0] + lang_pattern = re.compile(r'%s_([^_]+)\.xtb$' % re.escape(grd_root)) + for xtb_path in self.xtb_paths: + xtb_basename = os.path.basename(xtb_path) + xtb_lang_match = re.match(lang_pattern, xtb_basename) + if not xtb_lang_match: + errors.append('%s: invalid xtb name: %s. xtb name must be %s_<lang>' + '.xtb where <lang> is the language code.' % + (self.name, xtb_basename, grd_root)) + continue + xtb_lang = xtb_lang_match.group(1) + if xtb_lang in self.lang_to_xtb_path: + errors.append('%s: %s is listed twice' % (self.name, xtb_basename)) + continue + self.lang_to_xtb_path[xtb_lang] = xtb_path + + return errors + + +def get_translatable_grds(repo_root, all_grd_paths, + translation_expectations_path): + """Returns all the grds that should be translated as a list of GRDFiles. + + This verifies that every grd file that appears translatable is listed in + the translation expectations, and that every grd in the translation + expectations actually exists. + + Args: + repo_root: The path to the root of the repository. + all_grd_paths: All grd paths in the repository relative to repo_root. + translation_expectations_path: The path to the translation expectations + file, which specifies which grds to translate and into which languages. + """ + grd_to_langs, untranslated_grds = _parse_translation_expectations( + translation_expectations_path) + + # Check that every grd that appears translatable is listed in + # the translation expectations. + grds_with_expectations = set(grd_to_langs.keys()).union(untranslated_grds) + all_grds = {p: GRDFile(os.path.join(repo_root, p)) for p in all_grd_paths} + errors = [] + for path, grd in all_grds.iteritems(): + if grd.appears_translatable: + if path not in grds_with_expectations: + errors.append('%s appears to be translatable (because it contains ' + '<file> or <message> elements), but is not listed in the ' + 'translation expectations.' % path) + + # Check that every file in translation_expectations exists. + for path in grds_with_expectations: + if path not in all_grd_paths: + errors.append('%s is listed in the translation expectations, but this ' + 'grd file does not exist.' % path) + + if errors: + raise Exception('%s needs to be updated. Please fix these issues:\n - %s' % + (translation_expectations_path, '\n - '.join(errors))) + + translatable_grds = [] + for path, expected_languages_list in grd_to_langs.iteritems(): + grd = all_grds[path] + grd.expected_languages = expected_languages_list + grd._populate_lang_to_xtb_path(errors) + translatable_grds.append(grd) + + # Ensure each grd lists the expected languages. + expected_languages = set(expected_languages_list) + actual_languages = set(grd.lang_to_xtb_path.keys()) + if expected_languages.difference(actual_languages): + errors.append('%s: missing translations for these languages: %s. Add ' + '<file> and <output> elements to the grd file, or update ' + 'the translation expectations.' % (grd.name, + sorted(expected_languages.difference(actual_languages)))) + if actual_languages.difference(expected_languages): + errors.append('%s: references translations for unexpected languages: %s. ' + 'Remove the offending <file> and <output> elements from the' + ' grd file, or update the translation expectations.' + % (grd.name, + sorted(actual_languages.difference(expected_languages)))) + + if errors: + raise Exception('Please fix these issues:\n - %s' % + ('\n - '.join(errors))) + + return translatable_grds + + +def _parse_grd_file(grd_path): + """Reads a grd(p) file and any subfiles included via <part file="..." />. + + Args: + grd_path: The path of the .grd or .grdp file. + Returns: + A tuple (grd_dom, grdp_paths). dom is an ElementTree DOM for the grd file, + with the <part> elements inlined. grdp_paths is the list of grdp files that + were included via <part> elements. + """ + grdp_paths = [] + grd_dom = ElementTree.parse(grd_path) + # We modify grd in the loop, so listify this iterable to be safe. + part_nodes = list(grd_dom.findall('.//part')) + for part_node in part_nodes: + grdp_rel_path = part_node.get('file') + grdp_path = os.path.join(os.path.dirname(grd_path), grdp_rel_path) + grdp_paths.append(grdp_path) + grdp_dom, grdp_grpd_paths = _parse_grd_file(grdp_path) + grdp_paths.extend(grdp_grpd_paths) + part_node.append(grdp_dom.getroot()) + return grd_dom, grdp_paths + + +def _parse_translation_expectations(path): + """Parses a translations expectations file. + + Example translations expectations file: + { + "desktop_grds": { + "languages": ["es", "fr"], + "files": [ + "ash/ash_strings.grd", + "ui/strings/ui_strings.grd", + ], + }, + "android_grds": { + "languages": ["de", "pt-BR"], + "files": [ + "chrome/android/android_chrome_strings.grd", + }, + "untranslated_grds": { + "chrome/locale_settings.grd": "Not UI strings; localized separately", + "chrome/locale_settings_mac.grd": "Not UI strings; localized separately", + }, + } + + Returns: + A tuple (grd_to_langs, untranslated_grds). grd_to_langs maps each grd path + to the list of languages into which that grd should be translated. + untranslated_grds is a list of grds that "appear translatable" but should + not be translated. + """ + with open(path) as f: + file_contents = f.read() + + def assert_list_of_strings(l, name): + assert isinstance(l, list) and all(isinstance(s, basestring) for s in l), ( + '%s must be a list of strings' % name) + + try: + translations_expectations = ast.literal_eval(file_contents) + assert isinstance(translations_expectations, dict), ( + '%s must be a python dict' % path) + + grd_to_langs = {} + untranslated_grds = [] + + for group_name, settings in translations_expectations.iteritems(): + if group_name == 'untranslated_grds': + untranslated_grds = list(settings.keys()) + assert_list_of_strings(untranslated_grds, 'untranslated_grds') + continue + + languages = settings['languages'] + files = settings['files'] + assert_list_of_strings(languages, group_name + '.languages') + assert_list_of_strings(files, group_name + '.files') + for grd in files: + grd_to_langs[grd] = languages + + return grd_to_langs, untranslated_grds + + except Exception: + print 'Error: failed to parse', path + raise
diff --git a/tools/translation/helper/translation_helper_unittest.py b/tools/translation/helper/translation_helper_unittest.py new file mode 100644 index 0000000..efed978 --- /dev/null +++ b/tools/translation/helper/translation_helper_unittest.py
@@ -0,0 +1,43 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Unit tests for translation_helper.py.""" +import unittest +import os +import sys + +# pylint: disable=relative-import +import translation_helper + +here = os.path.realpath(__file__) +testdata_path = os.path.normpath(os.path.join(here, '..', '..', 'testdata')) + + +class TcHelperTest(unittest.TestCase): + + def test_get_translatable_grds(self): + grds = translation_helper.get_translatable_grds( + testdata_path, ['test.grd', 'not_translated.grd'], + os.path.join(testdata_path, 'translation_expectations.pyl')) + self.assertEqual(1, len(grds)) + + # There should be no references to not_translated.grd (mentioning the + # filename here so that it doesn't appear unused). + grd = grds[0] + self.assertEqual(os.path.join(testdata_path, 'test.grd'), grd.path) + self.assertEqual(testdata_path, grd.dir) + self.assertEqual('test.grd', grd.name) + self.assertEqual([os.path.join(testdata_path, 'part.grdp')], grd.grdp_paths) + self.assertEqual([], grd.structure_paths) + self.assertEqual([os.path.join(testdata_path, 'test_en-GB.xtb')], + grd.xtb_paths) + self.assertEqual({ + 'en-GB': os.path.join(testdata_path, 'test_en-GB.xtb') + }, grd.lang_to_xtb_path) + self.assertTrue(grd.appears_translatable) + self.assertEquals(['en-GB'], grd.expected_languages) + + +if __name__ == '__main__': + unittest.main()
diff --git a/tools/translation/testdata/not_translated.grd b/tools/translation/testdata/not_translated.grd new file mode 100644 index 0000000..c36d67d0 --- /dev/null +++ b/tools/translation/testdata/not_translated.grd
@@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<grit latest_public_release="0" current_release="1" output_all_resource_defines="false"> + <outputs> + <output filename="locale_settings_en-GB.pak" type="data_package" lang="en-GB" /> + </outputs> + <translations> + <file path="locale_settings_en-GB.xtb" lang="en-GB" /> + </translations> + <release seq="1" allow_pseudo="false"> + <messages fallback_to_english="true"> + <message name="IDS_NOT_TRANSLATED" use_name_for_id="true"> + Not translated + </message> + </messages> + </release> +</grit> \ No newline at end of file
diff --git a/tools/translation/testdata/part.grdp b/tools/translation/testdata/part.grdp new file mode 100644 index 0000000..e626d15c --- /dev/null +++ b/tools/translation/testdata/part.grdp
@@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<grit-part> + <message name="IDS_PART_STRING1"> + This is part string 1 + </message> + <message name="IDS_PART_STRING2"> + This is part string 2 + </message> + <message name="IDS_PART_STRING_NON_TRANSLATEABLE" translateable="false"> + This is a non translateable part string + </message> +</grit-part>
diff --git a/tools/translation/testdata/test.grd b/tools/translation/testdata/test.grd new file mode 100644 index 0000000..02023a7e --- /dev/null +++ b/tools/translation/testdata/test.grd
@@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<grit latest_public_release="1" current_release="1"> + <translations> + <file path="test_en-GB.xtb" lang="en-GB" /> + </translations> + <release seq="1"> + <messages> + <message name="IDS_TEST_STRING1"> + Test string 1 + </message> + <message name="IDS_TEST_STRING2"> + Test string 2 + </message> + <message name="IDS_TEST_STRING_NON_TRANSLATEABLE" translateable="false"> + This is a non translateable string + </message> + <part file="part.grdp" /> + </messages> + </release> +</grit>
diff --git a/tools/translation/testdata/test_en-GB.xtb b/tools/translation/testdata/test_en-GB.xtb new file mode 100644 index 0000000..8c00bd05 --- /dev/null +++ b/tools/translation/testdata/test_en-GB.xtb
@@ -0,0 +1,6 @@ +<?xml version="1.0" ?> +<!DOCTYPE translationbundle> +<translationbundle lang="en-GB"> +<translation id="123">Test String 1</translation> +<translation id="456">Test String 2</translation> +</translationbundle> \ No newline at end of file
diff --git a/tools/translation/testdata/test_grd/IDS_TEST_STRING1.png b/tools/translation/testdata/test_grd/IDS_TEST_STRING1.png new file mode 100644 index 0000000..b33ff0c8 --- /dev/null +++ b/tools/translation/testdata/test_grd/IDS_TEST_STRING1.png Binary files differ
diff --git a/tools/translation/testdata/translation_expectations.pyl b/tools/translation/testdata/translation_expectations.pyl new file mode 100644 index 0000000..1d43fc0 --- /dev/null +++ b/tools/translation/testdata/translation_expectations.pyl
@@ -0,0 +1,28 @@ +# 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. +# +# This is a .pyl, or "Python Literal", file. You can treat it just like a +# .json file, with the following exceptions: +# * all keys must be quoted (use single quotes, please); +# * comments are allowed, using '#' syntax; and +# * trailing commas are allowed. +# +# Specifies which grd files should be translated and into which languages they +# should be translated. Used by the internal translation process. +{ + "desktop_grds": { + "languages": [ + "en-GB" + ], + "files": [ + "test.grd", + ], + }, + # Grd files that contain <message> or <translations> elements, but that + # shouldn't be translated as part of the normal translation process. Each + # entry needs an explanation for why it shouldn't be translated. + "untranslated_grds": { + "not_translated.grd": "Not translated" + }, +} \ No newline at end of file
diff --git a/tools/translation/upload_screenshots.py b/tools/translation/upload_screenshots.py new file mode 100755 index 0000000..78d93c6 --- /dev/null +++ b/tools/translation/upload_screenshots.py
@@ -0,0 +1,191 @@ +#!/usr/bin/env python +# 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. + +"""A tool to upload translation screenshots to Google Cloud Storage. + +This tool searches the current repo for .png files associated with .grd or +.grdp files. It uploads the images to a Cloud Storage bucket and generates .sha1 +files. Finally, it asks the user if they want to add the .sha1 files to their +CL. + +Images must be named the same as the UI strings they represent +(e.g. IDS_HELLO.png for IDS_HELLO). The tool does NOT try to parse .grd/.grdp +files, so it doesn't know whether an image file corresponds to a message or not. +It will attempt to upload the image anyways. +""" + +import argparse +import sys +import os +import subprocess + +import helper.translation_helper as translation_helper + +here = os.path.dirname(os.path.realpath(__file__)) +src_path = os.path.normpath(os.path.join(here, '..', '..')) + +depot_tools_path = os.path.normpath( + os.path.join(src_path, 'third_party', 'depot_tools')) +sys.path.insert(0, depot_tools_path) + +import upload_to_google_storage +import download_from_google_storage + +sys.path.remove(depot_tools_path) + +# Translation expectations file for the Chromium repo. +TRANSLATION_EXPECTATIONS_PATH = os.path.join('tools', 'gritsettings', + 'translation_expectations.pyl') + +# URL of the bucket used for storing screenshots. +BUCKET_URL = 'gs://chrome-screenshots' + + + +def query_yes_no(question, default='yes'): + """Ask a yes/no question via raw_input() and return their answer. + + "question" is a string that is presented to the user. + "default" is the presumed answer if the user just hits <Enter>. + It must be "yes" (the default), "no" or None (meaning + an answer is required of the user). + + The "answer" return value is True for "yes" or False for "no". + """ + if default is None: + prompt = '[y/n] ' + elif default == 'yes': + prompt = '[Y/n] ' + elif default == 'no': + prompt = '[y/N] ' + else: + raise ValueError("invalid default answer: '%s'" % default) + + valid = {'yes': True, 'y': True, 'ye': True, 'no': False, 'n': False} + while True: + print question, prompt + choice = raw_input().lower() + if default is not None and choice == '': + return valid[default] + elif choice in valid: + return valid[choice] + else: + print "Please respond with 'yes' or 'no' (or 'y' or 'n')." + + +def list_grds_in_repository(repo_path): + """Returns a list of all the grd files in the current git repository.""" + # This works because git does its own glob expansion even though there is no + # shell to do it. + output = subprocess.check_output( + ['git', 'ls-files', '--', '*.grd'], cwd=repo_path) + return output.strip().splitlines() + + +def git_add(files, repo_root): + """Adds relative paths given in files to the current CL.""" + # Upload in batches in order to not exceed command line length limit. + BATCH_SIZE = 50 + added_count = 0 + while added_count < len(files): + batch = files[added_count:added_count+BATCH_SIZE] + command = ['git', 'add'] + batch + subprocess.check_call(command, cwd=repo_root) + added_count += len(batch) + + +def find_screenshots(repo_root, translation_expectations): + grd_files = translation_helper.get_translatable_grds( + repo_root, list_grds_in_repository(repo_root), translation_expectations) + + screenshots = [] + for grd_file in grd_files: + grd_path = grd_file.path + # Convert grd_path.grd to grd_path_grd/ directory. + name, ext = os.path.splitext(os.path.basename(grd_path)) + relative_screenshots_dir = os.path.relpath( + os.path.dirname(grd_path), repo_root) + screenshots_dir = os.path.realpath( + os.path.join(repo_root, + os.path.join(relative_screenshots_dir, + name + ext.replace('.', '_')))) + # Grab all the .png files under the screenshot directory. On a clean + # checkout this should be an empty list, as the repo should only contain + # .sha1 files of previously uploaded screenshots. + if not os.path.exists(screenshots_dir): + continue + for f in os.listdir(screenshots_dir): + if f.endswith('.sha1'): + continue + if not f.endswith('.png'): + print 'File with unexpected extension: %s in %s' % (f, screenshots_dir) + continue + screenshots.append(os.path.join(screenshots_dir, f)) + return screenshots + + +def main(): + parser = argparse.ArgumentParser( + description='Upload translation screenshots to Google Cloud Storage') + parser.add_argument( + '-n', + '--dry-run', + action='store_true', + help='Don\'t actually upload the images') + args = parser.parse_args() + + screenshots = find_screenshots(src_path, + os.path.join(src_path, + TRANSLATION_EXPECTATIONS_PATH)) + if not screenshots: + print 'No screenshots found, exiting.' + + print 'Found %d updated screenshot(s): ' % len(screenshots) + for s in screenshots: + print ' %s' % s + print + if not query_yes_no('Do you want to upload these to Google Cloud Storage?'): + exit(0) + + # Creating a standard gsutil object, assuming there are depot_tools + # and everything related is set up already. + gsutil_path = os.path.abspath(os.path.join(depot_tools_path, 'gsutil.py')) + gsutil = download_from_google_storage.Gsutil(gsutil_path, boto_path=None) + + if not args.dry_run: + if upload_to_google_storage.upload_to_google_storage( + input_filenames=screenshots, + base_url=BUCKET_URL, + gsutil=gsutil, + force=False, + use_md5=False, + num_threads=1, + skip_hashing=False, + gzip=None) != 0: + print 'Error uploading screenshots, exiting.' + exit(1) + + print + print 'Images are uploaded and their signatures are calculated:' + + signatures = ['%s.sha1' % s for s in screenshots] + for s in signatures: + print ' %s' % s + print + + # Always ask if the .sha1 files should be added to the CL, even if they are + # already part of the CL. If the files are not modified, adding again is a + # no-op. + if not query_yes_no('Do you want to add these files to your CL?'): + exit(0) + + if not args.dry_run: + git_add(signatures, src_path) + + print 'DONE.' + + +if __name__ == '__main__': + main()
diff --git a/tools/translation/upload_screenshots_unittest.py b/tools/translation/upload_screenshots_unittest.py new file mode 100755 index 0000000..3235e3a --- /dev/null +++ b/tools/translation/upload_screenshots_unittest.py
@@ -0,0 +1,29 @@ +#!/usr/bin/env python +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import unittest +import os +import sys + +here = os.path.realpath(__file__) +testdata_path = os.path.normpath(os.path.join(here, '..', 'testdata')) + +import upload_screenshots + + +class UploadTests(unittest.TestCase): + + def test_find_screenshots(self): + screenshots = upload_screenshots.find_screenshots( + testdata_path, + os.path.join(testdata_path, 'translation_expectations.pyl')) + self.assertEquals(1, len(screenshots)) + self.assertEquals( + os.path.join(testdata_path, 'test_grd', 'IDS_TEST_STRING1.png'), + screenshots[0]) + + +if __name__ == '__main__': + unittest.main()
diff --git a/ui/android/java/src/org/chromium/ui/UiUtils.java b/ui/android/java/src/org/chromium/ui/UiUtils.java index df99c22..3a426cf 100644 --- a/ui/android/java/src/org/chromium/ui/UiUtils.java +++ b/ui/android/java/src/org/chromium/ui/UiUtils.java
@@ -239,7 +239,7 @@ // keyboard height. In certain cases this also means including the height of the // Android navigation. final float density = context.getResources().getDisplayMetrics().density; - bottomMargin -= KEYBOARD_DETECT_BOTTOM_THRESHOLD_DP * density; + bottomMargin = (int) (bottomMargin - KEYBOARD_DETECT_BOTTOM_THRESHOLD_DP * density); } }
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java index 3999bd8..8c556e76 100644 --- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java +++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
@@ -138,6 +138,13 @@ void onContextMenuClosed(); } + /** + * Gets the view for readback. + */ + public View getReadbackView() { + return null; + } + private final ObserverList<OnCloseContextMenuListener> mContextMenuCloseListeners = new ObserverList<>();
diff --git a/ui/app_list/BUILD.gn b/ui/app_list/BUILD.gn index 56706f2..2c4586d 100644 --- a/ui/app_list/BUILD.gn +++ b/ui/app_list/BUILD.gn
@@ -26,18 +26,6 @@ "pagination_model.cc", "pagination_model.h", "pagination_model_observer.h", - "search/dictionary_data_store.cc", - "search/dictionary_data_store.h", - "search/history.cc", - "search/history.h", - "search/history_data.cc", - "search/history_data.h", - "search/history_data_observer.h", - "search/history_data_store.cc", - "search/history_data_store.h", - "search/history_types.h", - "search_provider.cc", - "search_provider.h", "views/app_list_drag_and_drop_host.h", "views/app_list_folder_view.cc", "views/app_list_folder_view.h", @@ -190,15 +178,8 @@ test("app_list_unittests") { sources = [ - "app_list_item_list_unittest.cc", - "app_list_model_unittest.cc", "folder_image_unittest.cc", "pagination_model_unittest.cc", - "search/history_data_store_unittest.cc", - "search/term_break_iterator_unittest.cc", - "search/tokenized_string_char_iterator_unittest.cc", - "search/tokenized_string_match_unittest.cc", - "search/tokenized_string_unittest.cc", "test/run_all_unittests.cc", "views/app_list_main_view_unittest.cc", "views/app_list_view_unittest.cc",
diff --git a/ui/app_list/views/app_list_folder_view.cc b/ui/app_list/views/app_list_folder_view.cc index 35548a5..d47d243 100644 --- a/ui/app_list/views/app_list_folder_view.cc +++ b/ui/app_list/views/app_list_folder_view.cc
@@ -505,7 +505,6 @@ gfx::Size AppListFolderView::CalculatePreferredSize() const { gfx::Size size = items_grid_view_->GetTileGridSizeWithoutPadding(); gfx::Size header_size = folder_header_view_->GetPreferredSize(); - size.set_width(std::max(size.width(), header_size.width())); size.Enlarge(0, kItemGridsBottomPadding + header_size.height()); size.Enlarge(kFolderPadding * 2, kFolderPadding * 2); return size;
diff --git a/ui/aura/OWNERS b/ui/aura/OWNERS index ff3f8762..7958658c 100644 --- a/ui/aura/OWNERS +++ b/ui/aura/OWNERS
@@ -1,5 +1,5 @@ sky@chromium.org sadrul@chromium.org -per-file *x11.cc=erg@chromium.org -per-file *x11.h=erg@chromium.org +per-file *x11.cc=thomasanderson@chromium.org +per-file *x11.h=thomasanderson@chromium.org
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn index a540b61..ceaaea0 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn
@@ -735,6 +735,8 @@ "ime/dummy_input_method.h", "ime/dummy_text_input_client.cc", "ime/dummy_text_input_client.h", + "ime/win/mock_tsf_bridge.cc", + "ime/win/mock_tsf_bridge.h", ] deps += [ @@ -883,6 +885,7 @@ "ime/input_method_chromeos_unittest.cc", "ime/win/imm32_manager_unittest.cc", "ime/win/tsf_input_scope_unittest.cc", + "ime/win/tsf_text_store_unittest.cc", ] if (is_linux && use_aura && !is_chromeos) { sources += [ "ime/input_method_auralinux_unittest.cc" ]
diff --git a/ui/base/ime/BUILD.gn b/ui/base/ime/BUILD.gn index a8a36ea..ee63a81 100644 --- a/ui/base/ime/BUILD.gn +++ b/ui/base/ime/BUILD.gn
@@ -96,8 +96,14 @@ "ui_base_ime_export.h", "win/imm32_manager.cc", "win/imm32_manager.h", + "win/tsf_bridge.cc", + "win/tsf_bridge.h", + "win/tsf_event_router.cc", + "win/tsf_event_router.h", "win/tsf_input_scope.cc", "win/tsf_input_scope.h", + "win/tsf_text_store.cc", + "win/tsf_text_store.h", ] # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. @@ -179,6 +185,12 @@ cflags = [ "/wd4324" ] # Structure was padded due to __declspec(align()), which is # uninteresting. + sources += [ + "input_method_win_base.cc", + "input_method_win_base.h", + "input_method_win_tsf.cc", + "input_method_win_tsf.h", + ] libs = [ "imm32.lib" ] }
diff --git a/ui/base/ime/input_method_base.cc b/ui/base/ime/input_method_base.cc index 7d4747b..3ff2cd09 100644 --- a/ui/base/ime/input_method_base.cc +++ b/ui/base/ime/input_method_base.cc
@@ -22,9 +22,9 @@ return nullptr; } -InputMethodBase::InputMethodBase() +InputMethodBase::InputMethodBase(internal::InputMethodDelegate* delegate) : sending_key_event_(false), - delegate_(nullptr), + delegate_(delegate), text_input_client_(nullptr) {} InputMethodBase::~InputMethodBase() {
diff --git a/ui/base/ime/input_method_base.h b/ui/base/ime/input_method_base.h index 6a26900..145735c 100644 --- a/ui/base/ime/input_method_base.h +++ b/ui/base/ime/input_method_base.h
@@ -34,7 +34,7 @@ public base::SupportsWeakPtr<InputMethodBase>, public IMEInputContextHandlerInterface { public: - InputMethodBase(); + explicit InputMethodBase(internal::InputMethodDelegate* delegate = nullptr); ~InputMethodBase() override; // Overriden from InputMethod.
diff --git a/ui/base/ime/input_method_factory.cc b/ui/base/ime/input_method_factory.cc index a1b1798..d93dd27 100644 --- a/ui/base/ime/input_method_factory.cc +++ b/ui/base/ime/input_method_factory.cc
@@ -8,12 +8,14 @@ #include "base/memory/ptr_util.h" #include "build/build_config.h" #include "ui/base/ime/mock_input_method.h" +#include "ui/base/ui_base_features.h" #include "ui/gfx/switches.h" #if defined(OS_CHROMEOS) #include "ui/base/ime/input_method_chromeos.h" #elif defined(OS_WIN) #include "ui/base/ime/input_method_win.h" +#include "ui/base/ime/input_method_win_tsf.h" #elif defined(OS_MACOSX) #include "ui/base/ime/input_method_mac.h" #elif defined(USE_AURA) && defined(USE_X11) @@ -55,6 +57,8 @@ #if defined(OS_CHROMEOS) return std::make_unique<InputMethodChromeOS>(delegate); #elif defined(OS_WIN) + if (base::FeatureList::IsEnabled(features::kTSFImeSupport)) + return std::make_unique<InputMethodWinTSF>(delegate, widget); return std::make_unique<InputMethodWin>(delegate, widget); #elif defined(OS_MACOSX) return std::make_unique<InputMethodMac>(delegate);
diff --git a/ui/base/ime/input_method_initializer.cc b/ui/base/ime/input_method_initializer.cc index 026b564..b64f362a 100644 --- a/ui/base/ime/input_method_initializer.cc +++ b/ui/base/ime/input_method_initializer.cc
@@ -11,6 +11,9 @@ #elif defined(USE_AURA) && defined(OS_LINUX) #include "base/logging.h" #include "ui/base/ime/linux/fake_input_method_context_factory.h" +#elif defined(OS_WIN) +#include "ui/base/ime/input_method_factory.h" +#include "ui/base/ime/win/tsf_bridge.h" #endif namespace { @@ -27,12 +30,16 @@ void InitializeInputMethod() { #if defined(OS_CHROMEOS) IMEBridge::Initialize(); +#elif defined(OS_WIN) + TSFBridge::Initialize(); #endif } void ShutdownInputMethod() { #if defined(OS_CHROMEOS) IMEBridge::Shutdown(); +#elif defined(OS_WIN) + TSFBridge::Shutdown(); #endif } @@ -50,6 +57,10 @@ << "else."; LinuxInputMethodContextFactory::SetInstance( g_linux_input_method_context_factory_for_testing); +#elif defined(OS_WIN) + // Make sure COM is initialized because TSF depends on COM. + CoInitialize(nullptr); + TSFBridge::Initialize(); #endif } @@ -64,6 +75,9 @@ LinuxInputMethodContextFactory::SetInstance(NULL); delete g_linux_input_method_context_factory_for_testing; g_linux_input_method_context_factory_for_testing = NULL; +#elif defined(OS_WIN) + TSFBridge::Shutdown(); + CoUninitialize(); #endif }
diff --git a/ui/base/ime/input_method_win.cc b/ui/base/ime/input_method_win.cc index 06f88312..b9c0ad8 100644 --- a/ui/base/ime/input_method_win.cc +++ b/ui/base/ime/input_method_win.cc
@@ -25,10 +25,6 @@ namespace ui { namespace { -// Extra number of chars before and after selection (or composition) range which -// is returned to IME for improving conversion accuracy. -static const size_t kExtraNumberOfChars = 20; - ui::EventDispatchDetails DispatcherDestroyedDetails() { ui::EventDispatchDetails dispatcher_details; dispatcher_details.dispatcher_destroyed = true; @@ -39,14 +35,12 @@ InputMethodWin::InputMethodWin(internal::InputMethodDelegate* delegate, HWND toplevel_window_handle) - : toplevel_window_handle_(toplevel_window_handle), + : InputMethodWinBase(delegate, toplevel_window_handle), pending_requested_direction_(base::i18n::UNKNOWN_DIRECTION), - accept_carriage_return_(false), enabled_(false), is_candidate_popup_open_(false), composing_window_handle_(NULL), weak_ptr_factory_(this) { - SetDelegate(delegate); imm32_manager_.SetInputLanguage(); } @@ -313,44 +307,7 @@ // bounds has not changed. OnCaretBoundsChanged(focused); } - if (focused_before != focused) - accept_carriage_return_ = false; -} - -LRESULT InputMethodWin::OnChar(HWND window_handle, - UINT message, - WPARAM wparam, - LPARAM lparam, - const base::NativeEvent& event, - BOOL* handled) { - *handled = TRUE; - - // We need to send character events to the focused text input client event if - // its text input type is ui::TEXT_INPUT_TYPE_NONE. - if (GetTextInputClient()) { - const base::char16 kCarriageReturn = L'\r'; - const base::char16 ch = static_cast<base::char16>(wparam); - // A mask to determine the previous key state from |lparam|. The value is 1 - // if the key is down before the message is sent, or it is 0 if the key is - // up. - const uint32_t kPrevKeyDownBit = 0x40000000; - if (ch == kCarriageReturn && !(lparam & kPrevKeyDownBit)) - accept_carriage_return_ = true; - // Conditionally ignore '\r' events to work around crbug.com/319100. - // TODO(yukawa, IME): Figure out long-term solution. - if (ch != kCarriageReturn || accept_carriage_return_) { - ui::KeyEvent char_event(event); - GetTextInputClient()->InsertChar(char_event); - } - } - - // Explicitly show the system menu at a good location on [Alt]+[Space]. - // Note: Setting |handled| to FALSE for DefWindowProc triggering of the system - // menu causes undesirable titlebar artifacts in the classic theme. - if (message == WM_SYSCHAR && wparam == VK_SPACE) - gfx::ShowSystemMenu(window_handle); - - return 0; + InputMethodWinBase::OnDidChangeFocusedClient(focused_before, focused); } LRESULT InputMethodWin::OnImeSetContext(HWND window_handle, @@ -481,188 +438,6 @@ return 0; } -LRESULT InputMethodWin::OnImeRequest(UINT message, - WPARAM wparam, - LPARAM lparam, - BOOL* handled) { - *handled = FALSE; - - // Should not receive WM_IME_REQUEST message, if IME is disabled. - const ui::TextInputType type = GetTextInputType(); - if (type == ui::TEXT_INPUT_TYPE_NONE || - type == ui::TEXT_INPUT_TYPE_PASSWORD) { - return 0; - } - - switch (wparam) { - case IMR_RECONVERTSTRING: - *handled = TRUE; - return OnReconvertString(reinterpret_cast<RECONVERTSTRING*>(lparam)); - case IMR_DOCUMENTFEED: - *handled = TRUE; - return OnDocumentFeed(reinterpret_cast<RECONVERTSTRING*>(lparam)); - case IMR_QUERYCHARPOSITION: - *handled = TRUE; - return OnQueryCharPosition(reinterpret_cast<IMECHARPOSITION*>(lparam)); - default: - return 0; - } -} - -LRESULT InputMethodWin::OnDocumentFeed(RECONVERTSTRING* reconv) { - ui::TextInputClient* client = GetTextInputClient(); - if (!client) - return 0; - - gfx::Range text_range; - if (!client->GetTextRange(&text_range) || text_range.is_empty()) - return 0; - - bool result = false; - gfx::Range target_range; - if (client->HasCompositionText()) - result = client->GetCompositionTextRange(&target_range); - - if (!result || target_range.is_empty()) { - if (!client->GetSelectionRange(&target_range) || - !target_range.IsValid()) { - return 0; - } - } - - if (!text_range.Contains(target_range)) - return 0; - - if (target_range.GetMin() - text_range.start() > kExtraNumberOfChars) - text_range.set_start(target_range.GetMin() - kExtraNumberOfChars); - - if (text_range.end() - target_range.GetMax() > kExtraNumberOfChars) - text_range.set_end(target_range.GetMax() + kExtraNumberOfChars); - - size_t len = text_range.length(); - size_t need_size = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR); - - if (!reconv) - return need_size; - - if (reconv->dwSize < need_size) - return 0; - - base::string16 text; - if (!GetTextInputClient()->GetTextFromRange(text_range, &text)) - return 0; - DCHECK_EQ(text_range.length(), text.length()); - - reconv->dwVersion = 0; - reconv->dwStrLen = len; - reconv->dwStrOffset = sizeof(RECONVERTSTRING); - reconv->dwCompStrLen = - client->HasCompositionText() ? target_range.length() : 0; - reconv->dwCompStrOffset = - (target_range.GetMin() - text_range.start()) * sizeof(WCHAR); - reconv->dwTargetStrLen = target_range.length(); - reconv->dwTargetStrOffset = reconv->dwCompStrOffset; - - memcpy((char*)reconv + sizeof(RECONVERTSTRING), - text.c_str(), len * sizeof(WCHAR)); - - // According to Microsoft API document, IMR_RECONVERTSTRING and - // IMR_DOCUMENTFEED should return reconv, but some applications return - // need_size. - return reinterpret_cast<LRESULT>(reconv); -} - -LRESULT InputMethodWin::OnReconvertString(RECONVERTSTRING* reconv) { - ui::TextInputClient* client = GetTextInputClient(); - if (!client) - return 0; - - // If there is a composition string already, we don't allow reconversion. - if (client->HasCompositionText()) - return 0; - - gfx::Range text_range; - if (!client->GetTextRange(&text_range) || text_range.is_empty()) - return 0; - - gfx::Range selection_range; - if (!client->GetSelectionRange(&selection_range) || - selection_range.is_empty()) { - return 0; - } - - DCHECK(text_range.Contains(selection_range)); - - size_t len = selection_range.length(); - size_t need_size = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR); - - if (!reconv) - return need_size; - - if (reconv->dwSize < need_size) - return 0; - - // TODO(penghuang): Return some extra context to help improve IME's - // reconversion accuracy. - base::string16 text; - if (!GetTextInputClient()->GetTextFromRange(selection_range, &text)) - return 0; - DCHECK_EQ(selection_range.length(), text.length()); - - reconv->dwVersion = 0; - reconv->dwStrLen = len; - reconv->dwStrOffset = sizeof(RECONVERTSTRING); - reconv->dwCompStrLen = len; - reconv->dwCompStrOffset = 0; - reconv->dwTargetStrLen = len; - reconv->dwTargetStrOffset = 0; - - memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING), - text.c_str(), len * sizeof(WCHAR)); - - // According to Microsoft API document, IMR_RECONVERTSTRING and - // IMR_DOCUMENTFEED should return reconv, but some applications return - // need_size. - return reinterpret_cast<LRESULT>(reconv); -} - -LRESULT InputMethodWin::OnQueryCharPosition(IMECHARPOSITION* char_positon) { - if (!char_positon) - return 0; - - if (char_positon->dwSize < sizeof(IMECHARPOSITION)) - return 0; - - ui::TextInputClient* client = GetTextInputClient(); - if (!client) - return 0; - - // Tentatively assume that the returned value from |client| is DIP (Density - // Independent Pixel). See the comment in text_input_client.h and - // http://crbug.com/360334. - gfx::Rect dip_rect; - if (client->HasCompositionText()) { - if (!client->GetCompositionCharacterBounds(char_positon->dwCharPos, - &dip_rect)) { - return 0; - } - } else { - // If there is no composition and the first character is queried, returns - // the caret bounds. This behavior is the same to that of RichEdit control. - if (char_positon->dwCharPos != 0) - return 0; - dip_rect = client->GetCaretBounds(); - } - const gfx::Rect rect = - display::win::ScreenWin::DIPToScreenRect(toplevel_window_handle_, - dip_rect); - - char_positon->pt.x = rect.x(); - char_positon->pt.y = rect.y(); - char_positon->cLineHeight = rect.height(); - return 1; // returns non-zero value when succeeded. -} - void InputMethodWin::RefreshInputLanguage() { TextInputType type_original = GetTextInputType(); imm32_manager_.SetInputLanguage(); @@ -677,18 +452,6 @@ } } -bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { - if (!client) - return false; - // When Aura is enabled, |attached_window_handle| should always be a top-level - // window. So we can safely assume that |attached_window_handle| is ready for - // receiving keyboard input as long as it is an active window. This works well - // even when the |attached_window_handle| becomes active but has not received - // WM_FOCUS yet. - return toplevel_window_handle_ && - GetActiveWindow() == toplevel_window_handle_; -} - ui::EventDispatchDetails InputMethodWin::DispatchFabricatedKeyEvent( ui::KeyEvent* event) { // The key event if from calling input.ime.sendKeyEvent or test.
diff --git a/ui/base/ime/input_method_win.h b/ui/base/ime/input_method_win.h index c41504e2..e75a875 100644 --- a/ui/base/ime/input_method_win.h +++ b/ui/base/ime/input_method_win.h
@@ -11,13 +11,13 @@ #include "base/compiler_specific.h" #include "base/macros.h" -#include "ui/base/ime/input_method_base.h" +#include "ui/base/ime/input_method_win_base.h" #include "ui/base/ime/win/imm32_manager.h" namespace ui { // A common InputMethod implementation based on IMM32. -class UI_BASE_IME_EXPORT InputMethodWin : public InputMethodBase { +class UI_BASE_IME_EXPORT InputMethodWin : public InputMethodWinBase { public: InputMethodWin(internal::InputMethodDelegate* delegate, HWND toplevel_window_handle); @@ -47,14 +47,6 @@ TextInputClient* focused) override; private: - // For both WM_CHAR and WM_SYSCHAR - LRESULT OnChar(HWND window_handle, - UINT message, - WPARAM wparam, - LPARAM lparam, - const base::NativeEvent& event, - BOOL* handled); - LRESULT OnImeSetContext(HWND window_handle, UINT message, WPARAM wparam, @@ -80,23 +72,8 @@ LPARAM lparam, BOOL* handled); - // Some IMEs rely on WM_IME_REQUEST message even when TSF is enabled. So - // OnImeRequest (and its actual implementations as OnDocumentFeed, - // OnReconvertString, and OnQueryCharPosition) are placed in this base class. - LRESULT OnImeRequest(UINT message, - WPARAM wparam, - LPARAM lparam, - BOOL* handled); - LRESULT OnDocumentFeed(RECONVERTSTRING* reconv); - LRESULT OnReconvertString(RECONVERTSTRING* reconv); - LRESULT OnQueryCharPosition(IMECHARPOSITION* char_positon); - void RefreshInputLanguage(); - // Returns true if the Win32 native window bound to |client| is considered - // to be ready for receiving keyboard input. - bool IsWindowFocused(const TextInputClient* client) const; - ui::EventDispatchDetails DispatchFabricatedKeyEvent(ui::KeyEvent* event); // Asks the client to confirm current composition text. @@ -118,21 +95,11 @@ // (See "ui/base/ime/win/ime_input.h" for its details.) ui::IMM32Manager imm32_manager_; - // The toplevel window handle. - // On non-Aura environment, this value is not used and always NULL. - const HWND toplevel_window_handle_; - // The new text direction and layout alignment requested by the user by // pressing ctrl-shift. It'll be sent to the text input client when the key // is released. base::i18n::TextDirection pending_requested_direction_; - // Represents if WM_CHAR[wparam=='\r'] should be dispatched to the focused - // text input client or ignored silently. This flag is introduced as a quick - // workaround against crbug.com/319100 - // TODO(yukawa, IME): Figure out long-term solution. - bool accept_carriage_return_; - // True when an IME should be allowed to process key events. bool enabled_;
diff --git a/ui/base/ime/input_method_win_base.cc b/ui/base/ime/input_method_win_base.cc new file mode 100644 index 0000000..013eafa --- /dev/null +++ b/ui/base/ime/input_method_win_base.cc
@@ -0,0 +1,276 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ui/base/ime/input_method_win_base.h" + +#include <stddef.h> +#include <stdint.h> +#include <cwctype> + +#include "base/auto_reset.h" +#include "base/bind.h" +#include "base/command_line.h" +#include "ui/base/ime/ime_bridge.h" +#include "ui/base/ime/ime_engine_handler_interface.h" +#include "ui/base/ime/text_input_client.h" +#include "ui/base/ime/win/tsf_input_scope.h" +#include "ui/display/win/screen_win.h" +#include "ui/events/event.h" +#include "ui/events/event_constants.h" +#include "ui/events/event_utils.h" +#include "ui/events/keycodes/keyboard_codes.h" +#include "ui/gfx/win/hwnd_util.h" + +namespace ui { +namespace { + +// Extra number of chars before and after selection (or composition) range which +// is returned to IME for improving conversion accuracy. +constexpr size_t kExtraNumberOfChars = 20; + +} // namespace + +InputMethodWinBase::InputMethodWinBase(internal::InputMethodDelegate* delegate, + HWND toplevel_window_handle) + : InputMethodBase(delegate), + toplevel_window_handle_(toplevel_window_handle) {} + +InputMethodWinBase::~InputMethodWinBase() {} + +void InputMethodWinBase::OnDidChangeFocusedClient( + TextInputClient* focused_before, + TextInputClient* focused) { + if (focused_before != focused) + accept_carriage_return_ = false; +} + +bool InputMethodWinBase::IsWindowFocused(const TextInputClient* client) const { + if (!client) + return false; + // When Aura is enabled, |attached_window_handle| should always be a top-level + // window. So we can safely assume that |attached_window_handle| is ready for + // receiving keyboard input as long as it is an active window. This works well + // even when the |attached_window_handle| becomes active but has not received + // WM_FOCUS yet. + return toplevel_window_handle_ && + GetActiveWindow() == toplevel_window_handle_; +} + +LRESULT InputMethodWinBase::OnChar(HWND window_handle, + UINT message, + WPARAM wparam, + LPARAM lparam, + const base::NativeEvent& event, + BOOL* handled) { + *handled = TRUE; + + // We need to send character events to the focused text input client event if + // its text input type is ui::TEXT_INPUT_TYPE_NONE. + if (GetTextInputClient()) { + const base::char16 kCarriageReturn = L'\r'; + const base::char16 ch = static_cast<base::char16>(wparam); + // A mask to determine the previous key state from |lparam|. The value is 1 + // if the key is down before the message is sent, or it is 0 if the key is + // up. + const uint32_t kPrevKeyDownBit = 0x40000000; + if (ch == kCarriageReturn && !(lparam & kPrevKeyDownBit)) + accept_carriage_return_ = true; + // Conditionally ignore '\r' events to work around https://crbug.com/319100. + // TODO(yukawa, IME): Figure out long-term solution. + if (ch != kCarriageReturn || accept_carriage_return_) { + ui::KeyEvent char_event(event); + GetTextInputClient()->InsertChar(char_event); + } + } + + // Explicitly show the system menu at a good location on [Alt]+[Space]. + // Note: Setting |handled| to FALSE for DefWindowProc triggering of the system + // menu causes undesirable titlebar artifacts in the classic theme. + if (message == WM_SYSCHAR && wparam == VK_SPACE) + gfx::ShowSystemMenu(window_handle); + + return 0; +} + +LRESULT InputMethodWinBase::OnImeRequest(UINT message, + WPARAM wparam, + LPARAM lparam, + BOOL* handled) { + *handled = FALSE; + + // Should not receive WM_IME_REQUEST message, if IME is disabled. + const ui::TextInputType type = GetTextInputType(); + if (type == ui::TEXT_INPUT_TYPE_NONE || + type == ui::TEXT_INPUT_TYPE_PASSWORD) { + return 0; + } + + switch (wparam) { + case IMR_RECONVERTSTRING: + *handled = TRUE; + return OnReconvertString(reinterpret_cast<RECONVERTSTRING*>(lparam)); + case IMR_DOCUMENTFEED: + *handled = TRUE; + return OnDocumentFeed(reinterpret_cast<RECONVERTSTRING*>(lparam)); + case IMR_QUERYCHARPOSITION: + *handled = TRUE; + return OnQueryCharPosition(reinterpret_cast<IMECHARPOSITION*>(lparam)); + default: + return 0; + } +} + +LRESULT InputMethodWinBase::OnDocumentFeed(RECONVERTSTRING* reconv) { + ui::TextInputClient* client = GetTextInputClient(); + if (!client) + return 0; + + gfx::Range text_range; + if (!client->GetTextRange(&text_range) || text_range.is_empty()) + return 0; + + bool result = false; + gfx::Range target_range; + if (client->HasCompositionText()) + result = client->GetCompositionTextRange(&target_range); + + if (!result || target_range.is_empty()) { + if (!client->GetSelectionRange(&target_range) || !target_range.IsValid()) { + return 0; + } + } + + if (!text_range.Contains(target_range)) + return 0; + + if (target_range.GetMin() - text_range.start() > kExtraNumberOfChars) + text_range.set_start(target_range.GetMin() - kExtraNumberOfChars); + + if (text_range.end() - target_range.GetMax() > kExtraNumberOfChars) + text_range.set_end(target_range.GetMax() + kExtraNumberOfChars); + + size_t len = text_range.length(); + size_t need_size = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR); + + if (!reconv) + return need_size; + + if (reconv->dwSize < need_size) + return 0; + + base::string16 text; + if (!GetTextInputClient()->GetTextFromRange(text_range, &text)) + return 0; + DCHECK_EQ(text_range.length(), text.length()); + + reconv->dwVersion = 0; + reconv->dwStrLen = len; + reconv->dwStrOffset = sizeof(RECONVERTSTRING); + reconv->dwCompStrLen = + client->HasCompositionText() ? target_range.length() : 0; + reconv->dwCompStrOffset = + (target_range.GetMin() - text_range.start()) * sizeof(WCHAR); + reconv->dwTargetStrLen = target_range.length(); + reconv->dwTargetStrOffset = reconv->dwCompStrOffset; + + memcpy((char*)reconv + sizeof(RECONVERTSTRING), text.c_str(), + len * sizeof(WCHAR)); + + // According to Microsoft API document, IMR_RECONVERTSTRING and + // IMR_DOCUMENTFEED should return reconv, but some applications return + // need_size. + return reinterpret_cast<LRESULT>(reconv); +} + +LRESULT InputMethodWinBase::OnReconvertString(RECONVERTSTRING* reconv) { + ui::TextInputClient* client = GetTextInputClient(); + if (!client) + return 0; + + // If there is a composition string already, we don't allow reconversion. + if (client->HasCompositionText()) + return 0; + + gfx::Range text_range; + if (!client->GetTextRange(&text_range) || text_range.is_empty()) + return 0; + + gfx::Range selection_range; + if (!client->GetSelectionRange(&selection_range) || + selection_range.is_empty()) { + return 0; + } + + DCHECK(text_range.Contains(selection_range)); + + size_t len = selection_range.length(); + size_t need_size = sizeof(RECONVERTSTRING) + len * sizeof(WCHAR); + + if (!reconv) + return need_size; + + if (reconv->dwSize < need_size) + return 0; + + // TODO(penghuang): Return some extra context to help improve IME's + // reconversion accuracy. + base::string16 text; + if (!GetTextInputClient()->GetTextFromRange(selection_range, &text)) + return 0; + DCHECK_EQ(selection_range.length(), text.length()); + + reconv->dwVersion = 0; + reconv->dwStrLen = len; + reconv->dwStrOffset = sizeof(RECONVERTSTRING); + reconv->dwCompStrLen = len; + reconv->dwCompStrOffset = 0; + reconv->dwTargetStrLen = len; + reconv->dwTargetStrOffset = 0; + + memcpy(reinterpret_cast<char*>(reconv) + sizeof(RECONVERTSTRING), + text.c_str(), len * sizeof(WCHAR)); + + // According to Microsoft API document, IMR_RECONVERTSTRING and + // IMR_DOCUMENTFEED should return reconv, but some applications return + // need_size. + return reinterpret_cast<LRESULT>(reconv); +} + +LRESULT InputMethodWinBase::OnQueryCharPosition(IMECHARPOSITION* char_positon) { + if (!char_positon) + return 0; + + if (char_positon->dwSize < sizeof(IMECHARPOSITION)) + return 0; + + ui::TextInputClient* client = GetTextInputClient(); + if (!client) + return 0; + + // Tentatively assume that the returned value from |client| is DIP (Density + // Independent Pixel). See the comment in text_input_client.h and + // http://crbug.com/360334. + gfx::Rect dip_rect; + if (client->HasCompositionText()) { + if (!client->GetCompositionCharacterBounds(char_positon->dwCharPos, + &dip_rect)) { + return 0; + } + } else { + // If there is no composition and the first character is queried, returns + // the caret bounds. This behavior is the same to that of RichEdit control. + if (char_positon->dwCharPos != 0) + return 0; + dip_rect = client->GetCaretBounds(); + } + const gfx::Rect rect = display::win::ScreenWin::DIPToScreenRect( + toplevel_window_handle_, dip_rect); + + char_positon->pt.x = rect.x(); + char_positon->pt.y = rect.y(); + char_positon->cLineHeight = rect.height(); + return 1; // returns non-zero value when succeeded. +} + +} // namespace ui
diff --git a/ui/base/ime/input_method_win_base.h b/ui/base/ime/input_method_win_base.h new file mode 100644 index 0000000..c0bb3903 --- /dev/null +++ b/ui/base/ime/input_method_win_base.h
@@ -0,0 +1,67 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_IME_INPUT_METHOD_WIN_BASE_H_ +#define UI_BASE_IME_INPUT_METHOD_WIN_BASE_H_ + +#include <windows.h> + +#include <string> + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "ui/base/ime/input_method_base.h" +#include "ui/base/ime/win/imm32_manager.h" + +namespace ui { + +// A common InputMethod base implementation for Windows. +class UI_BASE_IME_EXPORT InputMethodWinBase : public InputMethodBase { + public: + InputMethodWinBase(internal::InputMethodDelegate* delegate, + HWND toplevel_window_handle); + ~InputMethodWinBase() override; + + protected: + void OnDidChangeFocusedClient(TextInputClient* focused_before, + TextInputClient* focused) override; + + // Returns true if the Win32 native window bound to |client| is considered + // to be ready for receiving keyboard input. + bool IsWindowFocused(const TextInputClient* client) const; + + // For both WM_CHAR and WM_SYSCHAR + LRESULT OnChar(HWND window_handle, + UINT message, + WPARAM wparam, + LPARAM lparam, + const base::NativeEvent& event, + BOOL* handled); + + // Some IMEs rely on WM_IME_REQUEST message even when TSF is enabled. So + // OnImeRequest (and its actual implementations as OnDocumentFeed, + // OnReconvertString, and OnQueryCharPosition) are placed in this base class. + LRESULT OnImeRequest(UINT message, + WPARAM wparam, + LPARAM lparam, + BOOL* handled); + LRESULT OnDocumentFeed(RECONVERTSTRING* reconv); + LRESULT OnReconvertString(RECONVERTSTRING* reconv); + LRESULT OnQueryCharPosition(IMECHARPOSITION* char_positon); + + // The toplevel window handle. + const HWND toplevel_window_handle_; + + // Represents if WM_CHAR[wparam=='\r'] should be dispatched to the focused + // text input client or ignored silently. This flag is introduced as a quick + // workaround against https://crbug.com/319100 + // TODO(yukawa, IME): Figure out long-term solution. + bool accept_carriage_return_ = false; + + DISALLOW_COPY_AND_ASSIGN(InputMethodWinBase); +}; + +} // namespace ui + +#endif // UI_BASE_IME_INPUT_METHOD_WIN_BASE_H_
diff --git a/ui/base/ime/input_method_win_tsf.cc b/ui/base/ime/input_method_win_tsf.cc new file mode 100644 index 0000000..427ac89 --- /dev/null +++ b/ui/base/ime/input_method_win_tsf.cc
@@ -0,0 +1,146 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ui/base/ime/input_method_win_tsf.h" + +#include "ui/base/ime/text_input_client.h" +#include "ui/base/ime/win/tsf_bridge.h" +#include "ui/base/ime/win/tsf_event_router.h" + +namespace ui { + +class InputMethodWinTSF::TSFEventObserver : public TSFEventRouterObserver { + public: + TSFEventObserver() = default; + + // Returns true if we know for sure that a candidate window (or IME suggest, + // etc.) is open. + bool IsCandidatePopupOpen() const { return is_candidate_popup_open_; } + + // Overridden from TSFEventRouterObserver: + void OnCandidateWindowCountChanged(size_t window_count) override { + is_candidate_popup_open_ = (window_count != 0); + } + + private: + // True if we know for sure that a candidate window is open. + bool is_candidate_popup_open_ = false; + + DISALLOW_COPY_AND_ASSIGN(TSFEventObserver); +}; + +InputMethodWinTSF::InputMethodWinTSF(internal::InputMethodDelegate* delegate, + HWND toplevel_window_handle) + : InputMethodWinBase(delegate, toplevel_window_handle), + tsf_event_observer_(new TSFEventObserver()), + tsf_event_router_(new TSFEventRouter(tsf_event_observer_.get())) {} + +InputMethodWinTSF::~InputMethodWinTSF() {} + +ui::EventDispatchDetails InputMethodWinTSF::DispatchKeyEvent( + ui::KeyEvent* event) { + // TODO(dtapuska): Handle WM_CHAR events. + return ui::EventDispatchDetails(); +} + +void InputMethodWinTSF::OnFocus() { + tsf_event_router_->SetManager( + ui::TSFBridge::GetInstance()->GetThreadManager().Get()); +} + +void InputMethodWinTSF::OnBlur() { + tsf_event_router_->SetManager(nullptr); +} + +bool InputMethodWinTSF::OnUntranslatedIMEMessage( + const base::NativeEvent& event, + InputMethod::NativeEventResult* result) { + LRESULT original_result = 0; + BOOL handled = FALSE; + // Even when TSF is enabled, following IMM32/Win32 messages must be handled. + switch (event.message) { + case WM_IME_REQUEST: + // Some TSF-native TIPs (Text Input Processors) such as ATOK and Mozc + // still rely on WM_IME_REQUEST message to implement reverse conversion. + original_result = + OnImeRequest(event.message, event.wParam, event.lParam, &handled); + break; + case WM_CHAR: + case WM_SYSCHAR: + // ui::InputMethod interface is responsible for handling Win32 character + // messages. For instance, we will be here in the following cases. + // - TIP is not activated. (e.g, the current language profile is English) + // - TIP does not handle and WM_KEYDOWN and WM_KEYDOWN is translated into + // WM_CHAR by TranslateMessage API. (e.g, TIP is turned off) + // - Another application sends WM_CHAR through SendMessage API. + original_result = OnChar(event.hwnd, event.message, event.wParam, + event.lParam, event, &handled); + break; + } + if (result) + *result = original_result; + return !!handled; +} + +void InputMethodWinTSF::OnTextInputTypeChanged(const TextInputClient* client) { + if (!IsTextInputClientFocused(client) || !IsWindowFocused(client)) + return; + ui::TSFBridge::GetInstance()->CancelComposition(); + ui::TSFBridge::GetInstance()->OnTextInputTypeChanged(client); +} + +void InputMethodWinTSF::OnCaretBoundsChanged(const TextInputClient* client) { + if (!IsTextInputClientFocused(client) || !IsWindowFocused(client)) + return; + ui::TSFBridge::GetInstance()->OnTextLayoutChanged(); +} + +void InputMethodWinTSF::CancelComposition(const TextInputClient* client) { + if (IsTextInputClientFocused(client) && IsWindowFocused(client)) + ui::TSFBridge::GetInstance()->CancelComposition(); +} + +void InputMethodWinTSF::DetachTextInputClient(TextInputClient* client) { + InputMethodWinBase::DetachTextInputClient(client); + ui::TSFBridge::GetInstance()->RemoveFocusedClient(client); +} + +bool InputMethodWinTSF::IsCandidatePopupOpen() const { + return tsf_event_observer_->IsCandidatePopupOpen(); +} + +void InputMethodWinTSF::OnWillChangeFocusedClient( + TextInputClient* focused_before, + TextInputClient* focused) { + if (IsWindowFocused(focused_before)) { + ConfirmCompositionText(); + ui::TSFBridge::GetInstance()->RemoveFocusedClient(focused_before); + } +} + +void InputMethodWinTSF::OnDidChangeFocusedClient( + TextInputClient* focused_before, + TextInputClient* focused) { + if (IsWindowFocused(focused) && IsTextInputClientFocused(focused)) { + ui::TSFBridge::GetInstance()->SetFocusedClient(toplevel_window_handle_, + focused); + + // Force to update the input type since client's TextInputStateChanged() + // function might not be called if text input types before the client loses + // focus and after it acquires focus again are the same. + OnTextInputTypeChanged(focused); + + // Force to update caret bounds, in case the client thinks that the caret + // bounds has not changed. + OnCaretBoundsChanged(focused); + } + InputMethodWinBase::OnDidChangeFocusedClient(focused_before, focused); +} + +void InputMethodWinTSF::ConfirmCompositionText() { + if (!IsTextInputTypeNone()) + ui::TSFBridge::GetInstance()->ConfirmComposition(); +} + +} // namespace ui
diff --git a/ui/base/ime/input_method_win_tsf.h b/ui/base/ime/input_method_win_tsf.h new file mode 100644 index 0000000..29fef84 --- /dev/null +++ b/ui/base/ime/input_method_win_tsf.h
@@ -0,0 +1,58 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_IME_INPUT_METHOD_WIN_TSF_H_ +#define UI_BASE_IME_INPUT_METHOD_WIN_TSF_H_ + +#include <windows.h> + +#include <string> + +#include "ui/base/ime/input_method_win_base.h" + +namespace ui { + +class TSFEventRouter; + +// An InputMethod implementation based on Windows TSF API. +class UI_BASE_IME_EXPORT InputMethodWinTSF : public InputMethodWinBase { + public: + InputMethodWinTSF(internal::InputMethodDelegate* delegate, + HWND toplevel_window_handle); + ~InputMethodWinTSF() override; + + // Overridden from InputMethod: + ui::EventDispatchDetails DispatchKeyEvent(ui::KeyEvent* event) override; + void OnFocus() override; + void OnBlur() override; + bool OnUntranslatedIMEMessage(const base::NativeEvent& event, + NativeEventResult* result) override; + void OnTextInputTypeChanged(const TextInputClient* client) override; + void OnCaretBoundsChanged(const TextInputClient* client) override; + void CancelComposition(const TextInputClient* client) override; + void DetachTextInputClient(TextInputClient* client) override; + bool IsCandidatePopupOpen() const override; + + // Overridden from InputMethodBase: + void OnWillChangeFocusedClient(TextInputClient* focused_before, + TextInputClient* focused) override; + void OnDidChangeFocusedClient(TextInputClient* focused_before, + TextInputClient* focused) override; + + private: + class TSFEventObserver; + + // Asks the client to confirm current composition text. + void ConfirmCompositionText(); + + // TSF event router and observer. + std::unique_ptr<TSFEventObserver> tsf_event_observer_; + std::unique_ptr<TSFEventRouter> tsf_event_router_; + + DISALLOW_COPY_AND_ASSIGN(InputMethodWinTSF); +}; + +} // namespace ui + +#endif // UI_BASE_IME_INPUT_METHOD_WIN_TSF_H_
diff --git a/ui/base/ime/win/mock_tsf_bridge.cc b/ui/base/ime/win/mock_tsf_bridge.cc new file mode 100644 index 0000000..a69f3760 --- /dev/null +++ b/ui/base/ime/win/mock_tsf_bridge.cc
@@ -0,0 +1,70 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ui/base/ime/win/mock_tsf_bridge.h" + +#include "base/logging.h" +#include "ui/base/ime/text_input_client.h" + +namespace ui { + +MockTSFBridge::MockTSFBridge() = default; + +MockTSFBridge::~MockTSFBridge() = default; + +bool MockTSFBridge::CancelComposition() { + ++cancel_composition_call_count_; + return true; +} + +bool MockTSFBridge::ConfirmComposition() { + ++confirm_composition_call_count_; + return true; +} + +void MockTSFBridge::OnTextInputTypeChanged(const TextInputClient* client) { + latest_text_input_type_ = client->GetTextInputType(); +} + +void MockTSFBridge::OnTextLayoutChanged() { + ++on_text_layout_changed_; +} + +void MockTSFBridge::SetFocusedClient(HWND focused_window, + TextInputClient* client) { + ++set_focused_client_call_count_; + focused_window_ = focused_window; + text_input_client_ = client; +} + +void MockTSFBridge::RemoveFocusedClient(TextInputClient* client) { + ++remove_focused_client_call_count_; + DCHECK_EQ(client, text_input_client_); + text_input_client_ = nullptr; + focused_window_ = nullptr; +} + +Microsoft::WRL::ComPtr<ITfThreadMgr> MockTSFBridge::GetThreadManager() { + return thread_manager_; +} + +TextInputClient* MockTSFBridge::GetFocusedTextInputClient() const { + return text_input_client_; +} + +void MockTSFBridge::Reset() { + enable_ime_call_count_ = 0; + disable_ime_call_count_ = 0; + cancel_composition_call_count_ = 0; + confirm_composition_call_count_ = 0; + on_text_layout_changed_ = 0; + associate_focus_call_count_ = 0; + set_focused_client_call_count_ = 0; + remove_focused_client_call_count_ = 0; + text_input_client_ = nullptr; + focused_window_ = nullptr; + latest_text_input_type_ = TEXT_INPUT_TYPE_NONE; +} + +} // namespace ui
diff --git a/ui/base/ime/win/mock_tsf_bridge.h b/ui/base/ime/win/mock_tsf_bridge.h new file mode 100644 index 0000000..5baca1a --- /dev/null +++ b/ui/base/ime/win/mock_tsf_bridge.h
@@ -0,0 +1,99 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_ +#define UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_ + +#include <msctf.h> +#include <wrl/client.h> + +#include "base/compiler_specific.h" +#include "ui/base/ime/text_input_type.h" +#include "ui/base/ime/win/tsf_bridge.h" + +namespace ui { + +class MockTSFBridge : public TSFBridge { + public: + MockTSFBridge(); + ~MockTSFBridge() override; + + // TSFBridge: + bool CancelComposition() override; + bool ConfirmComposition() override; + void OnTextInputTypeChanged(const TextInputClient* client) override; + void OnTextLayoutChanged() override; + void SetFocusedClient(HWND focused_window, TextInputClient* client) override; + void RemoveFocusedClient(TextInputClient* client) override; + Microsoft::WRL::ComPtr<ITfThreadMgr> GetThreadManager() override; + TextInputClient* GetFocusedTextInputClient() const override; + + // Resets MockTSFBridge state including function call counter. + void Reset(); + + // Call count of EnableIME(). + unsigned enable_ime_call_count() const { return enable_ime_call_count_; } + + // Call count of DisableIME(). + unsigned disable_ime_call_count() const { return disable_ime_call_count_; } + + // Call count of CancelComposition(). + unsigned cancel_composition_call_count() const { + return cancel_composition_call_count_; + } + + // Call count of ConfirmComposition(). + unsigned confirm_composition_call_count() const { + return confirm_composition_call_count_; + } + + // Call count of OnTextLayoutChanged(). + unsigned on_text_layout_changed() const { return on_text_layout_changed_; } + + // Call count of AssociateFocus(). + unsigned associate_focus_call_count() const { + return associate_focus_call_count_; + } + + // Call count of SetFocusClient(). + unsigned set_focused_client_call_count() const { + return set_focused_client_call_count_; + } + + // Call count of RemoveFocusedClient(). + unsigned remove_focused_client_call_count() const { + return remove_focused_client_call_count_; + } + + // Returns current TextInputClient. + TextInputClient* text_input_clinet() const { return text_input_client_; } + + // Returns currently focused window handle. + HWND focused_window() const { return focused_window_; } + + // Returns latest text input type. + TextInputType latest_text_iput_type() const { + return latest_text_input_type_; + } + + private: + unsigned enable_ime_call_count_ = 0; + unsigned disable_ime_call_count_ = 0; + unsigned cancel_composition_call_count_ = 0; + unsigned confirm_composition_call_count_ = 0; + unsigned on_text_layout_changed_ = 0; + unsigned associate_focus_call_count_ = 0; + unsigned set_focused_client_call_count_ = 0; + unsigned remove_focused_client_call_count_ = 0; + TextInputClient* text_input_client_ = nullptr; + HWND focused_window_ = nullptr; + TextInputType latest_text_input_type_ = TEXT_INPUT_TYPE_NONE; + Microsoft::WRL::ComPtr<ITfThreadMgr> thread_manager_; + + DISALLOW_COPY_AND_ASSIGN(MockTSFBridge); +}; + +} // namespace ui + +#endif // UI_BASE_IME_WIN_MOCK_TSF_BRIDGE_H_
diff --git a/ui/base/ime/win/tsf_bridge.cc b/ui/base/ime/win/tsf_bridge.cc new file mode 100644 index 0000000..b5b1ba2 --- /dev/null +++ b/ui/base/ime/win/tsf_bridge.cc
@@ -0,0 +1,542 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include <msctf.h> + +#include <map> + +#include "base/logging.h" +#include "base/memory/ref_counted.h" +#include "base/message_loop/message_loop.h" +#include "base/no_destructor.h" +#include "base/threading/thread_local_storage.h" +#include "base/win/scoped_variant.h" +#include "ui/base/ime/text_input_client.h" +#include "ui/base/ime/win/tsf_bridge.h" +#include "ui/base/ime/win/tsf_text_store.h" +#include "ui/base/ui_base_features.h" + +namespace ui { + +namespace { + +// TSFBridgeImpl ----------------------------------------------------------- + +// A TLS implementation of TSFBridge. +class TSFBridgeImpl : public TSFBridge { + public: + TSFBridgeImpl(); + ~TSFBridgeImpl() override; + + bool Initialize(); + + // TsfBridge: + void OnTextInputTypeChanged(const TextInputClient* client) override; + void OnTextLayoutChanged() override; + bool CancelComposition() override; + bool ConfirmComposition() override; + void SetFocusedClient(HWND focused_window, TextInputClient* client) override; + void RemoveFocusedClient(TextInputClient* client) override; + Microsoft::WRL::ComPtr<ITfThreadMgr> GetThreadManager() override; + TextInputClient* GetFocusedTextInputClient() const override; + + private: + // Returns true if |tsf_document_map_| is successfully initialized. This + // method should be called from and only from Initialize(). + bool InitializeDocumentMapInternal(); + + // Returns true if |context| is successfully updated to be a disabled + // context, where an IME should be deactivated. This is suitable for some + // special input context such as password fields. + bool InitializeDisabledContext(ITfContext* context); + + // Returns true if a TSF document manager and a TSF context is successfully + // created with associating with given |text_store|. The returned + // |source_cookie| indicates the binding between |text_store| and |context|. + // You can pass nullptr to |text_store| and |source_cookie| when text store is + // not necessary. + bool CreateDocumentManager(TSFTextStore* text_store, + ITfDocumentMgr** document_manager, + ITfContext** context, + DWORD* source_cookie); + + // Returns true if |document_manager| is the focused document manager. + bool IsFocused(ITfDocumentMgr* document_manager); + + // Returns true if already initialized. + bool IsInitialized(); + + // Updates or clears the association maintained in the TSF runtime between + // |attached_window_handle_| and the current document manager. Keeping this + // association updated solves some tricky event ordering issues between + // logical text input focus managed by Chrome and native text input focus + // managed by the OS. + // Background: + // TSF runtime monitors some Win32 messages such as WM_ACTIVATE to + // change the focused document manager. This is problematic when + // TSFBridge::SetFocusedClient is called first then the target window + // receives WM_ACTIVATE. This actually occurs in Aura environment where + // WM_NCACTIVATE is used as a trigger to restore text input focus. + // Caveats: + // TSF runtime does not increment the reference count of the attached + // document manager. See the comment inside the method body for + // details. + void UpdateAssociateFocus(); + void ClearAssociateFocus(); + + // A triple of document manager, text store and binding cookie between + // a context owned by the document manager and the text store. This is a + // minimum working set of an editable document in TSF. + struct TSFDocument { + public: + TSFDocument() : cookie(TF_INVALID_COOKIE) {} + TSFDocument(const TSFDocument& src) + : document_manager(src.document_manager), cookie(src.cookie) {} + Microsoft::WRL::ComPtr<ITfDocumentMgr> document_manager; + scoped_refptr<TSFTextStore> text_store; + DWORD cookie; + }; + + // Returns a pointer to TSFDocument that is associated with the current + // TextInputType of |client_|. + TSFDocument* GetAssociatedDocument(); + + // An ITfThreadMgr object to be used in focus and document management. + Microsoft::WRL::ComPtr<ITfThreadMgr> thread_manager_; + + // A map from TextInputType to an editable document for TSF. We use multiple + // TSF documents that have different InputScopes and TSF attributes based on + // the TextInputType associated with the target document. For a TextInputType + // that is not coverted by this map, a default document, e.g. the document + // for TEXT_INPUT_TYPE_TEXT, should be used. + // Note that some IMEs don't change their state unless the document focus is + // changed. This is why we use multiple documents instead of changing TSF + // metadata of a single document on the fly. + typedef std::map<TextInputType, TSFDocument> TSFDocumentMap; + TSFDocumentMap tsf_document_map_; + + // An identifier of TSF client. + TfClientId client_id_ = TF_CLIENTID_NULL; + + // Current focused text input client. Do not free |client_|. + TextInputClient* client_ = nullptr; + + // Represents the window that is currently owns text input focus. + HWND attached_window_handle_ = nullptr; + + DISALLOW_COPY_AND_ASSIGN(TSFBridgeImpl); +}; + +TSFBridgeImpl::TSFBridgeImpl() = default; + +TSFBridgeImpl::~TSFBridgeImpl() { + DCHECK(base::MessageLoopForUI::IsCurrent()); + if (!IsInitialized()) + return; + for (TSFDocumentMap::iterator it = tsf_document_map_.begin(); + it != tsf_document_map_.end(); ++it) { + Microsoft::WRL::ComPtr<ITfContext> context; + Microsoft::WRL::ComPtr<ITfSource> source; + if (it->second.cookie != TF_INVALID_COOKIE && + SUCCEEDED( + it->second.document_manager->GetBase(context.GetAddressOf())) && + SUCCEEDED(context.CopyTo(source.GetAddressOf()))) { + source->UnadviseSink(it->second.cookie); + } + } + tsf_document_map_.clear(); + + client_id_ = TF_CLIENTID_NULL; +} + +bool TSFBridgeImpl::Initialize() { + DCHECK(base::MessageLoopForUI::IsCurrent()); + if (client_id_ != TF_CLIENTID_NULL) { + DVLOG(1) << "Already initialized."; + return false; + } + + if (FAILED(::CoCreateInstance(CLSID_TF_ThreadMgr, nullptr, CLSCTX_ALL, + IID_PPV_ARGS(&thread_manager_)))) { + DVLOG(1) << "Failed to create ThreadManager instance."; + return false; + } + + if (FAILED(thread_manager_->Activate(&client_id_))) { + DVLOG(1) << "Failed to activate Thread Manager."; + return false; + } + + if (!InitializeDocumentMapInternal()) + return false; + + // Japanese IME expects the default value of this compartment is + // TF_SENTENCEMODE_PHRASEPREDICT like IMM32 implementation. This value is + // managed per thread, so that it is enough to set this value at once. This + // value does not affect other language's IME behaviors. + Microsoft::WRL::ComPtr<ITfCompartmentMgr> thread_compartment_manager; + if (FAILED( + thread_manager_.CopyTo(thread_compartment_manager.GetAddressOf()))) { + DVLOG(1) << "Failed to get ITfCompartmentMgr."; + return false; + } + + Microsoft::WRL::ComPtr<ITfCompartment> sentence_compartment; + if (FAILED(thread_compartment_manager->GetCompartment( + GUID_COMPARTMENT_KEYBOARD_INPUTMODE_SENTENCE, + sentence_compartment.GetAddressOf()))) { + DVLOG(1) << "Failed to get sentence compartment."; + return false; + } + + base::win::ScopedVariant sentence_variant; + sentence_variant.Set(TF_SENTENCEMODE_PHRASEPREDICT); + if (FAILED( + sentence_compartment->SetValue(client_id_, sentence_variant.ptr()))) { + DVLOG(1) << "Failed to change the sentence mode."; + return false; + } + + return true; +} + +void TSFBridgeImpl::OnTextInputTypeChanged(const TextInputClient* client) { + DCHECK(base::MessageLoopForUI::IsCurrent()); + DCHECK(IsInitialized()); + + if (client != client_) { + // Called from not focusing client. Do nothing. + return; + } + + UpdateAssociateFocus(); + + TSFDocument* document = GetAssociatedDocument(); + if (!document) + return; + thread_manager_->SetFocus(document->document_manager.Get()); + OnTextLayoutChanged(); +} + +void TSFBridgeImpl::OnTextLayoutChanged() { + TSFDocument* document = GetAssociatedDocument(); + if (!document) + return; + if (!document->text_store) + return; + document->text_store->SendOnLayoutChange(); +} + +bool TSFBridgeImpl::CancelComposition() { + DCHECK(base::MessageLoopForUI::IsCurrent()); + DCHECK(IsInitialized()); + + TSFDocument* document = GetAssociatedDocument(); + if (!document) + return false; + if (!document->text_store) + return false; + + return document->text_store->CancelComposition(); +} + +bool TSFBridgeImpl::ConfirmComposition() { + DCHECK(base::MessageLoopForUI::IsCurrent()); + DCHECK(IsInitialized()); + + TSFDocument* document = GetAssociatedDocument(); + if (!document) + return false; + if (!document->text_store) + return false; + + return document->text_store->ConfirmComposition(); +} + +void TSFBridgeImpl::SetFocusedClient(HWND focused_window, + TextInputClient* client) { + DCHECK(base::MessageLoopForUI::IsCurrent()); + DCHECK(client); + DCHECK(IsInitialized()); + if (attached_window_handle_ != focused_window) + ClearAssociateFocus(); + client_ = client; + attached_window_handle_ = focused_window; + + for (TSFDocumentMap::iterator it = tsf_document_map_.begin(); + it != tsf_document_map_.end(); ++it) { + if (it->second.text_store.get() == nullptr) + continue; + it->second.text_store->SetFocusedTextInputClient(focused_window, client); + } + + // Synchronize text input type state. + OnTextInputTypeChanged(client); +} + +void TSFBridgeImpl::RemoveFocusedClient(TextInputClient* client) { + DCHECK(base::MessageLoopForUI::IsCurrent()); + DCHECK(IsInitialized()); + if (client_ != client) + return; + ClearAssociateFocus(); + client_ = nullptr; + attached_window_handle_ = nullptr; + for (TSFDocumentMap::iterator it = tsf_document_map_.begin(); + it != tsf_document_map_.end(); ++it) { + if (it->second.text_store.get() == nullptr) + continue; + it->second.text_store->SetFocusedTextInputClient(nullptr, nullptr); + } +} + +TextInputClient* TSFBridgeImpl::GetFocusedTextInputClient() const { + return client_; +} + +Microsoft::WRL::ComPtr<ITfThreadMgr> TSFBridgeImpl::GetThreadManager() { + DCHECK(base::MessageLoopForUI::IsCurrent()); + DCHECK(IsInitialized()); + return thread_manager_; +} + +bool TSFBridgeImpl::CreateDocumentManager(TSFTextStore* text_store, + ITfDocumentMgr** document_manager, + ITfContext** context, + DWORD* source_cookie) { + if (FAILED(thread_manager_->CreateDocumentMgr(document_manager))) { + DVLOG(1) << "Failed to create Document Manager."; + return false; + } + + DWORD edit_cookie = TF_INVALID_EDIT_COOKIE; + if (FAILED((*document_manager) + ->CreateContext(client_id_, 0, + static_cast<ITextStoreACP*>(text_store), + context, &edit_cookie))) { + DVLOG(1) << "Failed to create Context."; + return false; + } + + if (FAILED((*document_manager)->Push(*context))) { + DVLOG(1) << "Failed to push context."; + return false; + } + + if (!text_store || !source_cookie) + return true; + + Microsoft::WRL::ComPtr<ITfSource> source; + if (FAILED((*context)->QueryInterface(IID_PPV_ARGS(&source)))) { + DVLOG(1) << "Failed to get source."; + return false; + } + + if (FAILED(source->AdviseSink(IID_ITfTextEditSink, + static_cast<ITfTextEditSink*>(text_store), + source_cookie))) { + DVLOG(1) << "AdviseSink failed."; + return false; + } + + if (*source_cookie == TF_INVALID_COOKIE) { + DVLOG(1) << "The result of cookie is invalid."; + return false; + } + return true; +} + +bool TSFBridgeImpl::InitializeDocumentMapInternal() { + const TextInputType kTextInputTypes[] = { + TEXT_INPUT_TYPE_NONE, TEXT_INPUT_TYPE_TEXT, + TEXT_INPUT_TYPE_PASSWORD, TEXT_INPUT_TYPE_SEARCH, + TEXT_INPUT_TYPE_EMAIL, TEXT_INPUT_TYPE_NUMBER, + TEXT_INPUT_TYPE_TELEPHONE, TEXT_INPUT_TYPE_URL, + }; + for (size_t i = 0; i < arraysize(kTextInputTypes); ++i) { + const TextInputType input_type = kTextInputTypes[i]; + Microsoft::WRL::ComPtr<ITfContext> context; + Microsoft::WRL::ComPtr<ITfDocumentMgr> document_manager; + DWORD cookie = TF_INVALID_COOKIE; + const bool use_null_text_store = (input_type == TEXT_INPUT_TYPE_NONE); + DWORD* cookie_ptr = use_null_text_store ? nullptr : &cookie; + scoped_refptr<TSFTextStore> text_store = + use_null_text_store ? nullptr : new TSFTextStore(); + if (!CreateDocumentManager(text_store.get(), + document_manager.GetAddressOf(), + context.GetAddressOf(), cookie_ptr)) + return false; + const bool use_disabled_context = (input_type == TEXT_INPUT_TYPE_PASSWORD || + input_type == TEXT_INPUT_TYPE_NONE); + if (use_disabled_context && !InitializeDisabledContext(context.Get())) + return false; + tsf_document_map_[input_type].text_store = text_store; + tsf_document_map_[input_type].document_manager = document_manager; + tsf_document_map_[input_type].cookie = cookie; + } + return true; +} + +bool TSFBridgeImpl::InitializeDisabledContext(ITfContext* context) { + Microsoft::WRL::ComPtr<ITfCompartmentMgr> compartment_mgr; + if (FAILED(context->QueryInterface(IID_PPV_ARGS(&compartment_mgr)))) { + DVLOG(1) << "Failed to get CompartmentMgr."; + return false; + } + + Microsoft::WRL::ComPtr<ITfCompartment> disabled_compartment; + if (FAILED(compartment_mgr->GetCompartment( + GUID_COMPARTMENT_KEYBOARD_DISABLED, + disabled_compartment.GetAddressOf()))) { + DVLOG(1) << "Failed to get keyboard disabled compartment."; + return false; + } + + base::win::ScopedVariant variant; + variant.Set(1); + if (FAILED(disabled_compartment->SetValue(client_id_, variant.ptr()))) { + DVLOG(1) << "Failed to disable the DocumentMgr."; + return false; + } + + Microsoft::WRL::ComPtr<ITfCompartment> empty_context; + if (FAILED(compartment_mgr->GetCompartment(GUID_COMPARTMENT_EMPTYCONTEXT, + empty_context.GetAddressOf()))) { + DVLOG(1) << "Failed to get empty context compartment."; + return false; + } + base::win::ScopedVariant empty_context_variant; + empty_context_variant.Set(static_cast<int32_t>(1)); + if (FAILED( + empty_context->SetValue(client_id_, empty_context_variant.ptr()))) { + DVLOG(1) << "Failed to set empty context."; + return false; + } + + return true; +} + +bool TSFBridgeImpl::IsFocused(ITfDocumentMgr* document_manager) { + Microsoft::WRL::ComPtr<ITfDocumentMgr> focused_document_manager; + if (FAILED( + thread_manager_->GetFocus(focused_document_manager.GetAddressOf()))) + return false; + return focused_document_manager.Get() == document_manager; +} + +bool TSFBridgeImpl::IsInitialized() { + return client_id_ != TF_CLIENTID_NULL; +} + +void TSFBridgeImpl::UpdateAssociateFocus() { + if (attached_window_handle_ == nullptr) + return; + TSFDocument* document = GetAssociatedDocument(); + if (document == nullptr) { + ClearAssociateFocus(); + return; + } + // NOTE: ITfThreadMgr::AssociateFocus does not increment the ref count of + // the document manager to be attached. It is our responsibility to make sure + // the attached document manager will not be destroyed while it is attached. + // This should be true as long as TSFBridge::Shutdown() is called late phase + // of UI thread shutdown. + Microsoft::WRL::ComPtr<ITfDocumentMgr> previous_focus; + thread_manager_->AssociateFocus(attached_window_handle_, + document->document_manager.Get(), + previous_focus.GetAddressOf()); +} + +void TSFBridgeImpl::ClearAssociateFocus() { + if (attached_window_handle_ == nullptr) + return; + Microsoft::WRL::ComPtr<ITfDocumentMgr> previous_focus; + thread_manager_->AssociateFocus(attached_window_handle_, nullptr, + previous_focus.GetAddressOf()); +} + +TSFBridgeImpl::TSFDocument* TSFBridgeImpl::GetAssociatedDocument() { + if (!client_) + return nullptr; + TSFDocumentMap::iterator it = + tsf_document_map_.find(client_->GetTextInputType()); + if (it == tsf_document_map_.end()) { + it = tsf_document_map_.find(TEXT_INPUT_TYPE_TEXT); + // This check is necessary because it's possible that we failed to + // initialize |tsf_document_map_| and it has no TEXT_INPUT_TYPE_TEXT. + if (it == tsf_document_map_.end()) + return nullptr; + } + return &it->second; +} + +void Finalize(void* data) { + TSFBridgeImpl* delegate = static_cast<TSFBridgeImpl*>(data); + delete delegate; +} + +base::ThreadLocalStorage::Slot& TSFBridgeTLS() { + static base::NoDestructor<base::ThreadLocalStorage::Slot> tsf_bridge_tls( + &Finalize); + return *tsf_bridge_tls; +} + +} // namespace + +// TsfBridge ----------------------------------------------------------------- + +TSFBridge::TSFBridge() {} + +TSFBridge::~TSFBridge() {} + +// static +void TSFBridge::Initialize() { + if (!base::MessageLoopForUI::IsCurrent()) { + DVLOG(1) << "Do not use TSFBridge without UI thread."; + return; + } + TSFBridgeImpl* delegate = static_cast<TSFBridgeImpl*>(TSFBridgeTLS().Get()); + if (delegate) + return; + // If we aren't supporting TSF early out. + if (!base::FeatureList::IsEnabled(features::kTSFImeSupport)) + return; + delegate = new TSFBridgeImpl(); + TSFBridgeTLS().Set(delegate); + delegate->Initialize(); +} + +// static +TSFBridge* TSFBridge::ReplaceForTesting(TSFBridge* bridge) { + if (!base::MessageLoopForUI::IsCurrent()) { + DVLOG(1) << "Do not use TSFBridge without UI thread."; + return nullptr; + } + TSFBridge* old_bridge = TSFBridge::GetInstance(); + TSFBridgeTLS().Set(bridge); + return old_bridge; +} + +// static +void TSFBridge::Shutdown() { + if (!base::MessageLoopForUI::IsCurrent()) { + DVLOG(1) << "Do not use TSFBridge without UI thread."; + } + TSFBridgeImpl* delegate = static_cast<TSFBridgeImpl*>(TSFBridgeTLS().Get()); + TSFBridgeTLS().Set(nullptr); + delete delegate; +} + +// static +TSFBridge* TSFBridge::GetInstance() { + if (!base::MessageLoopForUI::IsCurrent()) { + DVLOG(1) << "Do not use TSFBridge without UI thread."; + return nullptr; + } + TSFBridgeImpl* delegate = static_cast<TSFBridgeImpl*>(TSFBridgeTLS().Get()); + DCHECK(delegate) << "Do no call GetInstance before TSFBridge::Initialize."; + return delegate; +} + +} // namespace ui
diff --git a/ui/base/ime/win/tsf_bridge.h b/ui/base/ime/win/tsf_bridge.h new file mode 100644 index 0000000..0d24edd --- /dev/null +++ b/ui/base/ime/win/tsf_bridge.h
@@ -0,0 +1,94 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_IME_WIN_TSF_BRIDGE_H_ +#define UI_BASE_IME_WIN_TSF_BRIDGE_H_ + +#include <msctf.h> +#include <windows.h> +#include <wrl/client.h> + +#include "base/macros.h" +#include "ui/base/ime/ui_base_ime_export.h" + +namespace ui { +class TextInputClient; + +// TSFBridge provides high level IME related operations on top of Text Services +// Framework (TSF). TSFBridge is managed by TLS because TSF related stuff is +// associated with each thread and not allowed to access across thread boundary. +// To be consistent with IMM32 behavior, TSFBridge is shared in the same thread. +// TSFBridge is used by the web content text inputting field, for example +// DisableIME() should be called if a password field is focused. +// +// TSFBridge also manages connectivity between TSFTextStore which is the backend +// of text inputting and current focused TextInputClient. +// +// All methods in this class must be used in UI thread. +class UI_BASE_IME_EXPORT TSFBridge { + public: + virtual ~TSFBridge(); + + // Returns the thread local TSFBridge instance. Initialize() must be called + // first. Do not cache this pointer and use it after TSFBridge Shutdown(). + static TSFBridge* GetInstance(); + + // Sets the thread local instance. Must be called before any calls to + // GetInstance(). + static void Initialize(); + + // Injects an alternative TSFBridge such as MockTSFBridge for testing. The + // injected object should be released by the caller. This function returns + // previous TSFBridge pointer with ownership. + static TSFBridge* ReplaceForTesting(TSFBridge* bridge); + + // Destroys the thread local instance. + static void Shutdown(); + + // Handles TextInputTypeChanged event. RWHVW is responsible for calling this + // handler whenever renderer's input text type is changed. Does nothing + // unless |client| is focused. + virtual void OnTextInputTypeChanged(const TextInputClient* client) = 0; + + // Sends an event to TSF manager that the text layout should be updated. + virtual void OnTextLayoutChanged() = 0; + + // Cancels the ongoing composition if exists. + // Returns true if there is no composition. + // Returns false if an edit session is on-going. + // Returns false if an error occures. + virtual bool CancelComposition() = 0; + + // Confirms the ongoing composition if exists. + // Returns true if there is no composition. + // Returns false if an edit session is on-going. + // Returns false if an error occures. + virtual bool ConfirmComposition() = 0; + + // Sets currently focused TextInputClient. + // Caller must free |client|. + virtual void SetFocusedClient(HWND focused_window, + TextInputClient* client) = 0; + + // Removes currently focused TextInputClient. + // Caller must free |client|. + virtual void RemoveFocusedClient(TextInputClient* client) = 0; + + // Obtains current thread manager. + virtual Microsoft::WRL::ComPtr<ITfThreadMgr> GetThreadManager() = 0; + + // Returns the focused text input client. + virtual TextInputClient* GetFocusedTextInputClient() const = 0; + + protected: + // Uses GetInstance() instead. + TSFBridge(); + + private: + DISALLOW_COPY_AND_ASSIGN(TSFBridge); +}; + +} // namespace ui + +#endif // UI_BASE_IME_WIN_TSF_BRIDGE_H_
diff --git a/ui/base/ime/win/tsf_event_router.cc b/ui/base/ime/win/tsf_event_router.cc new file mode 100644 index 0000000..a67ad22 --- /dev/null +++ b/ui/base/ime/win/tsf_event_router.cc
@@ -0,0 +1,296 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ui/base/ime/win/tsf_event_router.h" + +#include <msctf.h> +#include <wrl/client.h> +#include <set> +#include <utility> + +#include "base/bind.h" +#include "ui/base/win/atl_module.h" +#include "ui/gfx/range/range.h" + +namespace ui { + +// TSFEventRouter::Delegate ------------------------------------ + +// The implementation class of ITfUIElementSink, whose member functions will be +// called back by TSF when the UI element status is changed, for example when +// the candidate window is opened or closed. This class also implements +// ITfTextEditSink, whose member function is called back by TSF when the text +// editting session is finished. +class ATL_NO_VTABLE TSFEventRouter::Delegate + : public ATL::CComObjectRootEx<CComSingleThreadModel>, + public ITfUIElementSink, + public ITfTextEditSink { + public: + BEGIN_COM_MAP(Delegate) + COM_INTERFACE_ENTRY(ITfUIElementSink) + COM_INTERFACE_ENTRY(ITfTextEditSink) + END_COM_MAP() + + Delegate(); + ~Delegate(); + + // ITfTextEditSink: + STDMETHOD(OnEndEdit) + (ITfContext* context, + TfEditCookie read_only_cookie, + ITfEditRecord* edit_record) override; + + // ITfUiElementSink: + STDMETHOD(BeginUIElement)(DWORD element_id, BOOL* is_show) override; + STDMETHOD(UpdateUIElement)(DWORD element_id) override; + STDMETHOD(EndUIElement)(DWORD element_id) override; + + // Sets |thread_manager| to be monitored. |thread_manager| can be nullptr. + void SetManager(ITfThreadMgr* thread_manager); + + // Returns true if the IME is composing text. + bool IsImeComposing(); + + // Sets |router| to be forwarded TSF-related events. + void SetRouter(TSFEventRouter* router); + + private: + // Returns current composition range. Returns gfx::Range::InvalidRange if + // there is no composition. + static gfx::Range GetCompositionRange(ITfContext* context); + + // Returns true if the given |element_id| represents the candidate window. + bool IsCandidateWindowInternal(DWORD element_id); + + // A context associated with this class. + Microsoft::WRL::ComPtr<ITfContext> context_; + + // The ITfSource associated with |context_|. + Microsoft::WRL::ComPtr<ITfSource> context_source_; + + // The cookie for |context_source_|. + DWORD context_source_cookie_; + + // A UIElementMgr associated with this class. + Microsoft::WRL::ComPtr<ITfUIElementMgr> ui_element_manager_; + + // The ITfSouce associated with |ui_element_manager_|. + Microsoft::WRL::ComPtr<ITfSource> ui_source_; + + // The set of currently opened candidate window ids. + std::set<DWORD> open_candidate_window_ids_; + + // The cookie for |ui_source_|. + DWORD ui_source_cookie_ = TF_INVALID_COOKIE; + + TSFEventRouter* router_ = nullptr; + gfx::Range previous_composition_range_; + + DISALLOW_COPY_AND_ASSIGN(Delegate); +}; + +TSFEventRouter::Delegate::Delegate() + : previous_composition_range_(gfx::Range::InvalidRange()) {} + +TSFEventRouter::Delegate::~Delegate() = default; + +void TSFEventRouter::Delegate::SetRouter(TSFEventRouter* router) { + router_ = router; +} + +STDMETHODIMP TSFEventRouter::Delegate::OnEndEdit(ITfContext* context, + TfEditCookie read_only_cookie, + ITfEditRecord* edit_record) { + if (!edit_record || !context) + return E_INVALIDARG; + if (!router_) + return S_OK; + + // |edit_record| can be used to obtain updated ranges in terms of text + // contents and/or text attributes. Here we are interested only in text update + // so we use TF_GTP_INCL_TEXT and check if there is any range which contains + // updated text. + Microsoft::WRL::ComPtr<IEnumTfRanges> ranges; + if (FAILED(edit_record->GetTextAndPropertyUpdates(TF_GTP_INCL_TEXT, nullptr, + 0, ranges.GetAddressOf()))) + return S_OK; // Don't care about failures. + + ULONG fetched_count = 0; + Microsoft::WRL::ComPtr<ITfRange> range; + if (FAILED(ranges->Next(1, range.GetAddressOf(), &fetched_count))) + return S_OK; // Don't care about failures. + + const gfx::Range composition_range = GetCompositionRange(context); + + if (!previous_composition_range_.IsValid() && composition_range.IsValid()) + router_->OnTSFStartComposition(); + + // |fetched_count| != 0 means there is at least one range that contains + // updated text. + if (fetched_count != 0) + router_->OnTextUpdated(composition_range); + + if (previous_composition_range_.IsValid() && !composition_range.IsValid()) + router_->OnTSFEndComposition(); + + previous_composition_range_ = composition_range; + return S_OK; +} + +STDMETHODIMP TSFEventRouter::Delegate::BeginUIElement(DWORD element_id, + BOOL* is_show) { + if (is_show) + *is_show = TRUE; // Without this the UI element will not be shown. + + if (!IsCandidateWindowInternal(element_id)) + return S_OK; + + std::pair<std::set<DWORD>::iterator, bool> insert_result = + open_candidate_window_ids_.insert(element_id); + // Don't call if |router_| is null or |element_id| is already handled. + if (router_ && insert_result.second) + router_->OnCandidateWindowCountChanged(open_candidate_window_ids_.size()); + + return S_OK; +} + +STDMETHODIMP TSFEventRouter::Delegate::UpdateUIElement(DWORD element_id) { + return S_OK; +} + +STDMETHODIMP TSFEventRouter::Delegate::EndUIElement(DWORD element_id) { + if ((open_candidate_window_ids_.erase(element_id) != 0) && router_) + router_->OnCandidateWindowCountChanged(open_candidate_window_ids_.size()); + return S_OK; +} + +void TSFEventRouter::Delegate::SetManager(ITfThreadMgr* thread_manager) { + context_.Reset(); + + if (context_source_) { + context_source_->UnadviseSink(context_source_cookie_); + context_source_.Reset(); + } + context_source_cookie_ = TF_INVALID_COOKIE; + + ui_element_manager_.Reset(); + if (ui_source_) { + ui_source_->UnadviseSink(ui_source_cookie_); + ui_source_.Reset(); + } + ui_source_cookie_ = TF_INVALID_COOKIE; + + if (!thread_manager) + return; + + Microsoft::WRL::ComPtr<ITfDocumentMgr> document_manager; + if (FAILED(thread_manager->GetFocus(document_manager.GetAddressOf())) || + !document_manager.Get() || + FAILED(document_manager->GetBase(context_.GetAddressOf())) || + FAILED(context_.CopyTo(context_source_.GetAddressOf()))) + return; + context_source_->AdviseSink(IID_ITfTextEditSink, + static_cast<ITfTextEditSink*>(this), + &context_source_cookie_); + + if (FAILED( + thread_manager->QueryInterface(IID_PPV_ARGS(&ui_element_manager_))) || + FAILED(ui_element_manager_.CopyTo(ui_source_.GetAddressOf()))) + return; + ui_source_->AdviseSink(IID_ITfUIElementSink, + static_cast<ITfUIElementSink*>(this), + &ui_source_cookie_); +} + +bool TSFEventRouter::Delegate::IsImeComposing() { + return context_ && GetCompositionRange(context_.Get()).IsValid(); +} + +// static +gfx::Range TSFEventRouter::Delegate::GetCompositionRange(ITfContext* context) { + DCHECK(context); + Microsoft::WRL::ComPtr<ITfContextComposition> context_composition; + if (FAILED(context->QueryInterface(IID_PPV_ARGS(&context_composition)))) + return gfx::Range::InvalidRange(); + Microsoft::WRL::ComPtr<IEnumITfCompositionView> enum_composition_view; + if (FAILED(context_composition->EnumCompositions( + enum_composition_view.GetAddressOf()))) + return gfx::Range::InvalidRange(); + Microsoft::WRL::ComPtr<ITfCompositionView> composition_view; + if (enum_composition_view->Next(1, composition_view.GetAddressOf(), + nullptr) != S_OK) + return gfx::Range::InvalidRange(); + + Microsoft::WRL::ComPtr<ITfRange> range; + if (FAILED(composition_view->GetRange(range.GetAddressOf()))) + return gfx::Range::InvalidRange(); + + Microsoft::WRL::ComPtr<ITfRangeACP> range_acp; + if (FAILED(range.CopyTo(range_acp.GetAddressOf()))) + return gfx::Range::InvalidRange(); + + LONG start = 0; + LONG length = 0; + if (FAILED(range_acp->GetExtent(&start, &length))) + return gfx::Range::InvalidRange(); + + return gfx::Range(start, start + length); +} + +bool TSFEventRouter::Delegate::IsCandidateWindowInternal(DWORD element_id) { + DCHECK(ui_element_manager_.Get()); + Microsoft::WRL::ComPtr<ITfUIElement> ui_element; + if (FAILED(ui_element_manager_->GetUIElement(element_id, + ui_element.GetAddressOf()))) + return false; + Microsoft::WRL::ComPtr<ITfCandidateListUIElement> candidate_list_ui_element; + return SUCCEEDED(ui_element.CopyTo(candidate_list_ui_element.GetAddressOf())); +} + +// TSFEventRouter ------------------------------------------------------------ + +TSFEventRouter::TSFEventRouter(TSFEventRouterObserver* observer) + : observer_(observer) { + DCHECK(observer_); + CComObject<Delegate>* delegate; + ui::win::CreateATLModuleIfNeeded(); + if (SUCCEEDED(CComObject<Delegate>::CreateInstance(&delegate))) { + delegate->AddRef(); + delegate_.Attach(delegate); + delegate_->SetRouter(this); + } +} + +TSFEventRouter::~TSFEventRouter() { + if (delegate_) { + delegate_->SetManager(nullptr); + delegate_->SetRouter(nullptr); + } +} + +bool TSFEventRouter::IsImeComposing() { + return delegate_->IsImeComposing(); +} + +void TSFEventRouter::OnCandidateWindowCountChanged(size_t window_count) { + observer_->OnCandidateWindowCountChanged(window_count); +} + +void TSFEventRouter::OnTSFStartComposition() { + observer_->OnTSFStartComposition(); +} + +void TSFEventRouter::OnTextUpdated(const gfx::Range& composition_range) { + observer_->OnTextUpdated(composition_range); +} + +void TSFEventRouter::OnTSFEndComposition() { + observer_->OnTSFEndComposition(); +} + +void TSFEventRouter::SetManager(ITfThreadMgr* thread_manager) { + delegate_->SetManager(thread_manager); +} + +} // namespace ui
diff --git a/ui/base/ime/win/tsf_event_router.h b/ui/base/ime/win/tsf_event_router.h new file mode 100644 index 0000000..d094e1b --- /dev/null +++ b/ui/base/ime/win/tsf_event_router.h
@@ -0,0 +1,78 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_IME_WIN_TSF_EVENT_ROUTER_H_ +#define UI_BASE_IME_WIN_TSF_EVENT_ROUTER_H_ + +#include <atlbase.h> +#include <atlcom.h> +#include <msctf.h> + +#include <set> + +#include "base/callback.h" +#include "base/compiler_specific.h" +#include "ui/base/ime/text_input_type.h" +#include "ui/base/ime/ui_base_ime_export.h" +#include "ui/gfx/range/range.h" + +namespace ui { + +class TSFEventRouterObserver { + public: + TSFEventRouterObserver() {} + + // Called when the number of currently opened candidate windows changes. + virtual void OnCandidateWindowCountChanged(size_t window_count) {} + + // Called when a composition is started. + virtual void OnTSFStartComposition() {} + + // Called when the text contents are updated. If there is no composition, + // gfx::Range::InvalidRange is passed to |composition_range|. + virtual void OnTextUpdated(const gfx::Range& composition_range) {} + + // Called when a composition is terminated. + virtual void OnTSFEndComposition() {} + + protected: + virtual ~TSFEventRouterObserver() {} + + private: + DISALLOW_COPY_AND_ASSIGN(TSFEventRouterObserver); +}; + +// This class monitors TSF related events and forwards them to given +// |observer|. +class UI_BASE_IME_EXPORT TSFEventRouter { + public: + // Do not pass NULL to |observer|. + explicit TSFEventRouter(TSFEventRouterObserver* observer); + virtual ~TSFEventRouter(); + + // Returns true if the IME is composing text. + bool IsImeComposing(); + + // Callbacks from the TSFEventRouterDelegate: + void OnCandidateWindowCountChanged(size_t window_count); + void OnTSFStartComposition(); + void OnTextUpdated(const gfx::Range& composition_range); + void OnTSFEndComposition(); + + // Sets |thread_manager| to be monitored. |thread_manager| can be NULL. + void SetManager(ITfThreadMgr* thread_manager); + + private: + class Delegate; + + CComPtr<Delegate> delegate_; + + TSFEventRouterObserver* observer_; + + DISALLOW_COPY_AND_ASSIGN(TSFEventRouter); +}; + +} // namespace ui + +#endif // UI_BASE_IME_WIN_TSF_EVENT_ROUTER_H_
diff --git a/ui/base/ime/win/tsf_text_store.cc b/ui/base/ime/win/tsf_text_store.cc new file mode 100644 index 0000000..6fb766de --- /dev/null +++ b/ui/base/ime/win/tsf_text_store.cc
@@ -0,0 +1,925 @@ +// 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. + +#define INITGUID // required for GUID_PROP_INPUTSCOPE +#include "ui/base/ime/win/tsf_text_store.h" + +#include <InputScope.h> +#include <OleCtl.h> +#include <wrl/client.h> + +#include <algorithm> + +#include "base/win/scoped_variant.h" +#include "ui/base/ime/text_input_client.h" +#include "ui/base/ime/win/tsf_input_scope.h" +#include "ui/gfx/geometry/rect.h" + +namespace ui { +namespace { + +// We support only one view. +const TsViewCookie kViewCookie = 1; + +} // namespace + +TSFTextStore::TSFTextStore() { + if (FAILED(::CoCreateInstance(CLSID_TF_CategoryMgr, nullptr, CLSCTX_ALL, + IID_PPV_ARGS(&category_manager_)))) { + LOG(FATAL) << "Failed to initialize CategoryMgr."; + return; + } + if (FAILED(::CoCreateInstance(CLSID_TF_DisplayAttributeMgr, nullptr, + CLSCTX_ALL, + IID_PPV_ARGS(&display_attribute_manager_)))) { + LOG(FATAL) << "Failed to initialize DisplayAttributeMgr."; + return; + } +} + +TSFTextStore::~TSFTextStore() {} + +ULONG STDMETHODCALLTYPE TSFTextStore::AddRef() { + return InterlockedIncrement(&ref_count_); +} + +ULONG STDMETHODCALLTYPE TSFTextStore::Release() { + const LONG count = InterlockedDecrement(&ref_count_); + if (!count) { + delete this; + return 0; + } + return static_cast<ULONG>(count); +} + +STDMETHODIMP TSFTextStore::QueryInterface(REFIID iid, void** result) { + if (iid == IID_IUnknown || iid == IID_ITextStoreACP) { + *result = static_cast<ITextStoreACP*>(this); + } else if (iid == IID_ITfContextOwnerCompositionSink) { + *result = static_cast<ITfContextOwnerCompositionSink*>(this); + } else if (iid == IID_ITfTextEditSink) { + *result = static_cast<ITfTextEditSink*>(this); + } else { + *result = nullptr; + return E_NOINTERFACE; + } + AddRef(); + return S_OK; +} + +STDMETHODIMP TSFTextStore::AdviseSink(REFIID iid, + IUnknown* unknown, + DWORD mask) { + if (!IsEqualGUID(iid, IID_ITextStoreACPSink)) + return E_INVALIDARG; + if (text_store_acp_sink_) { + if (text_store_acp_sink_.Get() == unknown) { + text_store_acp_sink_mask_ = mask; + return S_OK; + } else { + return CONNECT_E_ADVISELIMIT; + } + } + if (FAILED(unknown->QueryInterface(IID_PPV_ARGS(&text_store_acp_sink_)))) + return E_UNEXPECTED; + text_store_acp_sink_mask_ = mask; + + return S_OK; +} + +STDMETHODIMP TSFTextStore::FindNextAttrTransition( + LONG acp_start, + LONG acp_halt, + ULONG num_filter_attributes, + const TS_ATTRID* filter_attributes, + DWORD flags, + LONG* acp_next, + BOOL* found, + LONG* found_offset) { + if (!acp_next || !found || !found_offset) + return E_INVALIDARG; + // We don't support any attributes. + // So we always return "not found". + *acp_next = 0; + *found = FALSE; + *found_offset = 0; + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetACPFromPoint(TsViewCookie view_cookie, + const POINT* point, + DWORD flags, + LONG* acp) { + NOTIMPLEMENTED(); + if (view_cookie != kViewCookie) + return E_INVALIDARG; + return E_NOTIMPL; +} + +STDMETHODIMP TSFTextStore::GetActiveView(TsViewCookie* view_cookie) { + if (!view_cookie) + return E_INVALIDARG; + // We support only one view. + *view_cookie = kViewCookie; + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetEmbedded(LONG acp_pos, + REFGUID service, + REFIID iid, + IUnknown** unknown) { + // We don't support any embedded objects. + NOTIMPLEMENTED(); + if (!unknown) + return E_INVALIDARG; + *unknown = nullptr; + return E_NOTIMPL; +} + +STDMETHODIMP TSFTextStore::GetEndACP(LONG* acp) { + if (!acp) + return E_INVALIDARG; + if (!HasReadLock()) + return TS_E_NOLOCK; + *acp = string_buffer_.size(); + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetFormattedText(LONG acp_start, + LONG acp_end, + IDataObject** data_object) { + NOTIMPLEMENTED(); + return E_NOTIMPL; +} + +STDMETHODIMP TSFTextStore::GetScreenExt(TsViewCookie view_cookie, RECT* rect) { + if (view_cookie != kViewCookie) + return E_INVALIDARG; + if (!rect) + return E_INVALIDARG; + + // {0, 0, 0, 0} means that the document rect is not currently displayed. + SetRect(rect, 0, 0, 0, 0); + + if (!IsWindow(window_handle_)) + return E_FAIL; + + // Currently ui::TextInputClient does not expose the document rect. So use + // the Win32 client rectangle instead. + // TODO(yukawa): Upgrade TextInputClient so that the client can retrieve the + // document rectangle. + RECT client_rect = {}; + if (!GetClientRect(window_handle_, &client_rect)) + return E_FAIL; + POINT left_top = {client_rect.left, client_rect.top}; + POINT right_bottom = {client_rect.right, client_rect.bottom}; + if (!ClientToScreen(window_handle_, &left_top)) + return E_FAIL; + if (!ClientToScreen(window_handle_, &right_bottom)) + return E_FAIL; + + rect->left = left_top.x; + rect->top = left_top.y; + rect->right = right_bottom.x; + rect->bottom = right_bottom.y; + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetSelection(ULONG selection_index, + ULONG selection_buffer_size, + TS_SELECTION_ACP* selection_buffer, + ULONG* fetched_count) { + if (!selection_buffer) + return E_INVALIDARG; + if (!fetched_count) + return E_INVALIDARG; + if (!HasReadLock()) + return TS_E_NOLOCK; + *fetched_count = 0; + if ((selection_buffer_size > 0) && + ((selection_index == 0) || (selection_index == TS_DEFAULT_SELECTION))) { + selection_buffer[0].acpStart = selection_.start(); + selection_buffer[0].acpEnd = selection_.end(); + selection_buffer[0].style.ase = TS_AE_END; + selection_buffer[0].style.fInterimChar = FALSE; + *fetched_count = 1; + } + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetStatus(TS_STATUS* status) { + if (!status) + return E_INVALIDARG; + + status->dwDynamicFlags = 0; + // We use transitory contexts and we don't support hidden text. + // TODO(dtapuska): Remove TS_SS_TRANSITORY it was added to fix + // https://crbug.com/148355 + status->dwStaticFlags = TS_SS_TRANSITORY | TS_SS_NOHIDDENTEXT; + + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetText(LONG acp_start, + LONG acp_end, + wchar_t* text_buffer, + ULONG text_buffer_size, + ULONG* text_buffer_copied, + TS_RUNINFO* run_info_buffer, + ULONG run_info_buffer_size, + ULONG* run_info_buffer_copied, + LONG* next_acp) { + if (!text_buffer_copied || !run_info_buffer_copied) + return E_INVALIDARG; + if (!text_buffer && text_buffer_size != 0) + return E_INVALIDARG; + if (!run_info_buffer && run_info_buffer_size != 0) + return E_INVALIDARG; + if (!next_acp) + return E_INVALIDARG; + if (!HasReadLock()) + return TF_E_NOLOCK; + const LONG string_buffer_size = string_buffer_.size(); + if (acp_end == -1) + acp_end = string_buffer_size; + if (!((0 <= acp_start) && (acp_start <= acp_end) && + (acp_end <= string_buffer_size))) { + return TF_E_INVALIDPOS; + } + acp_end = std::min(acp_end, acp_start + static_cast<LONG>(text_buffer_size)); + *text_buffer_copied = acp_end - acp_start; + + const base::string16& result = + string_buffer_.substr(acp_start, *text_buffer_copied); + for (size_t i = 0; i < result.size(); ++i) { + text_buffer[i] = result[i]; + } + + if (run_info_buffer_size) { + run_info_buffer[0].uCount = *text_buffer_copied; + run_info_buffer[0].type = TS_RT_PLAIN; + *run_info_buffer_copied = 1; + } + + *next_acp = acp_end; + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetTextExt(TsViewCookie view_cookie, + LONG acp_start, + LONG acp_end, + RECT* rect, + BOOL* clipped) { + if (!rect || !clipped) + return E_INVALIDARG; + if (!text_input_client_) + return E_UNEXPECTED; + if (view_cookie != kViewCookie) + return E_INVALIDARG; + if (!HasReadLock()) + return TS_E_NOLOCK; + if (!((static_cast<LONG>(committed_size_) <= acp_start) && + (acp_start <= acp_end) && + (acp_end <= static_cast<LONG>(string_buffer_.size())))) { + return TS_E_INVALIDPOS; + } + + // According to a behavior of notepad.exe and wordpad.exe, top left corner of + // rect indicates a first character's one, and bottom right corner of rect + // indicates a last character's one. + // We use RECT instead of gfx::Rect since left position may be bigger than + // right position when composition has multiple lines. + RECT result; + gfx::Rect tmp_rect; + const uint32_t start_pos = acp_start - committed_size_; + const uint32_t end_pos = acp_end - committed_size_; + + if (start_pos == end_pos) { + // According to MSDN document, if |acp_start| and |acp_end| are equal it is + // OK to just return E_INVALIDARG. + // http://msdn.microsoft.com/en-us/library/ms538435 + // But when using Pinin IME of Windows 8, this method is called with the + // equal values of |acp_start| and |acp_end|. So we handle this condition. + if (start_pos == 0) { + if (text_input_client_->GetCompositionCharacterBounds(0, &tmp_rect)) { + tmp_rect.set_width(0); + result = tmp_rect.ToRECT(); + } else if (string_buffer_.size() == committed_size_) { + result = text_input_client_->GetCaretBounds().ToRECT(); + } else { + return TS_E_NOLAYOUT; + } + } else if (text_input_client_->GetCompositionCharacterBounds(start_pos - 1, + &tmp_rect)) { + result.left = tmp_rect.right(); + result.right = tmp_rect.right(); + result.top = tmp_rect.y(); + result.bottom = tmp_rect.bottom(); + } else { + return TS_E_NOLAYOUT; + } + } else { + if (text_input_client_->GetCompositionCharacterBounds(start_pos, + &tmp_rect)) { + result.left = tmp_rect.x(); + result.top = tmp_rect.y(); + result.right = tmp_rect.right(); + result.bottom = tmp_rect.bottom(); + if (text_input_client_->GetCompositionCharacterBounds(end_pos - 1, + &tmp_rect)) { + result.right = tmp_rect.right(); + result.bottom = tmp_rect.bottom(); + } else { + // We may not be able to get the last character bounds, so we use the + // first character bounds instead of returning TS_E_NOLAYOUT. + } + } else { + // Hack for PPAPI flash. PPAPI flash does not support GetCaretBounds, so + // it's better to return previous caret rectangle instead. + // TODO(nona, kinaba): Remove this hack. + if (start_pos == 0) { + result = text_input_client_->GetCaretBounds().ToRECT(); + } else { + return TS_E_NOLAYOUT; + } + } + } + + *rect = result; + *clipped = FALSE; + return S_OK; +} + +STDMETHODIMP TSFTextStore::GetWnd(TsViewCookie view_cookie, + HWND* window_handle) { + if (!window_handle) + return E_INVALIDARG; + if (view_cookie != kViewCookie) + return E_INVALIDARG; + *window_handle = window_handle_; + return S_OK; +} + +STDMETHODIMP TSFTextStore::InsertEmbedded(DWORD flags, + LONG acp_start, + LONG acp_end, + IDataObject* data_object, + TS_TEXTCHANGE* change) { + // We don't support any embedded objects. + NOTIMPLEMENTED(); + return E_NOTIMPL; +} + +STDMETHODIMP TSFTextStore::InsertEmbeddedAtSelection(DWORD flags, + IDataObject* data_object, + LONG* acp_start, + LONG* acp_end, + TS_TEXTCHANGE* change) { + // We don't support any embedded objects. + NOTIMPLEMENTED(); + return E_NOTIMPL; +} + +STDMETHODIMP TSFTextStore::InsertTextAtSelection(DWORD flags, + const wchar_t* text_buffer, + ULONG text_buffer_size, + LONG* acp_start, + LONG* acp_end, + TS_TEXTCHANGE* text_change) { + const LONG start_pos = selection_.start(); + const LONG end_pos = selection_.end(); + const LONG new_end_pos = start_pos + text_buffer_size; + + if (flags & TS_IAS_QUERYONLY) { + if (!HasReadLock()) + return TS_E_NOLOCK; + if (acp_start) + *acp_start = start_pos; + if (acp_end) { + *acp_end = end_pos; + } + return S_OK; + } + + if (!HasReadWriteLock()) + return TS_E_NOLOCK; + if (!text_buffer) + return E_INVALIDARG; + + DCHECK_LE(start_pos, end_pos); + string_buffer_ = string_buffer_.substr(0, start_pos) + + base::string16(text_buffer, text_buffer + text_buffer_size) + + string_buffer_.substr(end_pos); + if (acp_start) + *acp_start = start_pos; + if (acp_end) + *acp_end = new_end_pos; + if (text_change) { + text_change->acpStart = start_pos; + text_change->acpOldEnd = end_pos; + text_change->acpNewEnd = new_end_pos; + } + selection_.set_start(start_pos); + selection_.set_end(new_end_pos); + return S_OK; +} + +STDMETHODIMP TSFTextStore::QueryInsert(LONG acp_test_start, + LONG acp_test_end, + ULONG text_size, + LONG* acp_result_start, + LONG* acp_result_end) { + if (!acp_result_start || !acp_result_end || acp_test_start > acp_test_end) + return E_INVALIDARG; + const LONG committed_size = static_cast<LONG>(committed_size_); + const LONG buffer_size = static_cast<LONG>(string_buffer_.size()); + *acp_result_start = + std::min(std::max(committed_size, acp_test_start), buffer_size); + *acp_result_end = + std::min(std::max(committed_size, acp_test_end), buffer_size); + return S_OK; +} + +STDMETHODIMP TSFTextStore::QueryInsertEmbedded(const GUID* service, + const FORMATETC* format, + BOOL* insertable) { + if (!format) + return E_INVALIDARG; + // We don't support any embedded objects. + if (insertable) + *insertable = FALSE; + return S_OK; +} + +STDMETHODIMP TSFTextStore::RequestAttrsAtPosition( + LONG acp_pos, + ULONG attribute_buffer_size, + const TS_ATTRID* attribute_buffer, + DWORD flags) { + // We don't support any document attributes. + // This method just returns S_OK, and the subsequently called + // RetrieveRequestedAttrs() returns 0 as the number of supported attributes. + return S_OK; +} + +STDMETHODIMP TSFTextStore::RequestAttrsTransitioningAtPosition( + LONG acp_pos, + ULONG attribute_buffer_size, + const TS_ATTRID* attribute_buffer, + DWORD flags) { + // We don't support any document attributes. + // This method just returns S_OK, and the subsequently called + // RetrieveRequestedAttrs() returns 0 as the number of supported attributes. + return S_OK; +} + +STDMETHODIMP TSFTextStore::RequestLock(DWORD lock_flags, HRESULT* result) { + if (!text_store_acp_sink_.Get()) + return E_FAIL; + if (!result) + return E_INVALIDARG; + + if (current_lock_type_ != 0) { + if (lock_flags & TS_LF_SYNC) { + // Can't lock synchronously. + *result = TS_E_SYNCHRONOUS; + return S_OK; + } + // Queue the lock request. + lock_queue_.push_back(lock_flags & TS_LF_READWRITE); + *result = TS_S_ASYNC; + return S_OK; + } + + // Lock + current_lock_type_ = (lock_flags & TS_LF_READWRITE); + + edit_flag_ = false; + const size_t last_committed_size = committed_size_; + + // Grant the lock. + *result = text_store_acp_sink_->OnLockGranted(current_lock_type_); + + // Unlock + current_lock_type_ = 0; + + // Handles the pending lock requests. + while (!lock_queue_.empty()) { + current_lock_type_ = lock_queue_.front(); + lock_queue_.pop_front(); + text_store_acp_sink_->OnLockGranted(current_lock_type_); + current_lock_type_ = 0; + } + + if (!edit_flag_) { + return S_OK; + } + + // If the text store is edited in OnLockGranted(), we may need to call + // TextInputClient::InsertText() or TextInputClient::SetCompositionText(). + const size_t new_committed_size = committed_size_; + const base::string16& new_committed_string = string_buffer_.substr( + last_committed_size, new_committed_size - last_committed_size); + const base::string16& composition_string = + string_buffer_.substr(new_committed_size); + + // If there is new committed string, calls TextInputClient::InsertText(). + if ((!new_committed_string.empty()) && text_input_client_) { + text_input_client_->InsertText(new_committed_string); + } + + // Calls TextInputClient::SetCompositionText(). + CompositionText composition_text; + composition_text.text = composition_string; + composition_text.ime_text_spans = text_spans_; + // Adjusts the offset. + for (size_t i = 0; i < composition_text.ime_text_spans.size(); ++i) { + composition_text.ime_text_spans[i].start_offset -= new_committed_size; + composition_text.ime_text_spans[i].end_offset -= new_committed_size; + } + if (selection_.start() < new_committed_size) { + composition_text.selection.set_start(0); + } else { + composition_text.selection.set_start(selection_.start() - + new_committed_size); + } + if (selection_.end() < new_committed_size) { + composition_text.selection.set_end(0); + } else { + composition_text.selection.set_end(selection_.end() - new_committed_size); + } + if (text_input_client_) + text_input_client_->SetCompositionText(composition_text); + + // If there is no composition string, clear the text store status. + // And call OnSelectionChange(), OnLayoutChange(), and OnTextChange(). + if ((composition_string.empty()) && (new_committed_size != 0)) { + string_buffer_.clear(); + committed_size_ = 0; + selection_.set_start(0); + selection_.set_end(0); + if (text_store_acp_sink_mask_ & TS_AS_SEL_CHANGE) + text_store_acp_sink_->OnSelectionChange(); + if (text_store_acp_sink_mask_ & TS_AS_LAYOUT_CHANGE) + text_store_acp_sink_->OnLayoutChange(TS_LC_CHANGE, 0); + if (text_store_acp_sink_mask_ & TS_AS_TEXT_CHANGE) { + TS_TEXTCHANGE textChange; + textChange.acpStart = 0; + textChange.acpOldEnd = new_committed_size; + textChange.acpNewEnd = 0; + text_store_acp_sink_->OnTextChange(0, &textChange); + } + } + + return S_OK; +} + +STDMETHODIMP TSFTextStore::RequestSupportedAttrs( + DWORD /* flags */, // Seems that we should ignore this. + ULONG attribute_buffer_size, + const TS_ATTRID* attribute_buffer) { + if (!attribute_buffer) + return E_INVALIDARG; + if (!text_input_client_) + return E_FAIL; + // We support only input scope attribute. + for (size_t i = 0; i < attribute_buffer_size; ++i) { + if (IsEqualGUID(GUID_PROP_INPUTSCOPE, attribute_buffer[i])) + return S_OK; + } + return E_FAIL; +} + +STDMETHODIMP TSFTextStore::RetrieveRequestedAttrs( + ULONG attribute_buffer_size, + TS_ATTRVAL* attribute_buffer, + ULONG* attribute_buffer_copied) { + if (!attribute_buffer_copied) + return E_INVALIDARG; + if (!attribute_buffer) + return E_INVALIDARG; + if (!text_input_client_) + return E_UNEXPECTED; + // We support only input scope attribute. + *attribute_buffer_copied = 0; + if (attribute_buffer_size == 0) + return S_OK; + + attribute_buffer[0].dwOverlapId = 0; + attribute_buffer[0].idAttr = GUID_PROP_INPUTSCOPE; + attribute_buffer[0].varValue.vt = VT_UNKNOWN; + attribute_buffer[0].varValue.punkVal = + tsf_inputscope::CreateInputScope(text_input_client_->GetTextInputType(), + text_input_client_->GetTextInputMode()); + attribute_buffer[0].varValue.punkVal->AddRef(); + *attribute_buffer_copied = 1; + return S_OK; +} + +STDMETHODIMP TSFTextStore::SetSelection( + ULONG selection_buffer_size, + const TS_SELECTION_ACP* selection_buffer) { + if (!HasReadWriteLock()) + return TF_E_NOLOCK; + if (selection_buffer_size > 0) { + const LONG start_pos = selection_buffer[0].acpStart; + const LONG end_pos = selection_buffer[0].acpEnd; + if (!((static_cast<LONG>(committed_size_) <= start_pos) && + (start_pos <= end_pos) && + (end_pos <= static_cast<LONG>(string_buffer_.size())))) { + return TF_E_INVALIDPOS; + } + selection_.set_start(start_pos); + selection_.set_end(end_pos); + } + return S_OK; +} + +STDMETHODIMP TSFTextStore::SetText(DWORD flags, + LONG acp_start, + LONG acp_end, + const wchar_t* text_buffer, + ULONG text_buffer_size, + TS_TEXTCHANGE* text_change) { + if (!HasReadWriteLock()) + return TS_E_NOLOCK; + if (!((static_cast<LONG>(committed_size_) <= acp_start) && + (acp_start <= acp_end) && + (acp_end <= static_cast<LONG>(string_buffer_.size())))) { + return TS_E_INVALIDPOS; + } + + TS_SELECTION_ACP selection; + selection.acpStart = acp_start; + selection.acpEnd = acp_end; + selection.style.ase = TS_AE_NONE; + selection.style.fInterimChar = 0; + + HRESULT ret; + ret = SetSelection(1, &selection); + if (ret != S_OK) + return ret; + + TS_TEXTCHANGE change; + ret = InsertTextAtSelection(0, text_buffer, text_buffer_size, &acp_start, + &acp_end, &change); + if (ret != S_OK) + return ret; + + if (text_change) + *text_change = change; + + return S_OK; +} + +STDMETHODIMP TSFTextStore::UnadviseSink(IUnknown* unknown) { + if (text_store_acp_sink_.Get() != unknown) + return CONNECT_E_NOCONNECTION; + text_store_acp_sink_.Reset(); + text_store_acp_sink_mask_ = 0; + return S_OK; +} + +STDMETHODIMP TSFTextStore::OnStartComposition( + ITfCompositionView* composition_view, + BOOL* ok) { + if (ok) + *ok = TRUE; + return S_OK; +} + +STDMETHODIMP TSFTextStore::OnUpdateComposition( + ITfCompositionView* composition_view, + ITfRange* range) { + return S_OK; +} + +STDMETHODIMP TSFTextStore::OnEndComposition( + ITfCompositionView* composition_view) { + return S_OK; +} + +STDMETHODIMP TSFTextStore::OnEndEdit(ITfContext* context, + TfEditCookie read_only_edit_cookie, + ITfEditRecord* edit_record) { + if (!context || !edit_record) + return E_INVALIDARG; + + size_t committed_size; + ImeTextSpans spans; + if (!GetCompositionStatus(context, read_only_edit_cookie, &committed_size, + &spans)) { + return S_OK; + } + text_spans_ = spans; + committed_size_ = committed_size; + edit_flag_ = true; + return S_OK; +} + +bool TSFTextStore::GetDisplayAttribute(TfGuidAtom guid_atom, + TF_DISPLAYATTRIBUTE* attribute) { + GUID guid; + if (FAILED(category_manager_->GetGUID(guid_atom, &guid))) + return false; + + Microsoft::WRL::ComPtr<ITfDisplayAttributeInfo> display_attribute_info; + if (FAILED(display_attribute_manager_->GetDisplayAttributeInfo( + guid, display_attribute_info.GetAddressOf(), nullptr))) { + return false; + } + return SUCCEEDED(display_attribute_info->GetAttributeInfo(attribute)); +} + +bool TSFTextStore::GetCompositionStatus( + ITfContext* context, + const TfEditCookie read_only_edit_cookie, + size_t* committed_size, + ImeTextSpans* spans) { + DCHECK(context); + DCHECK(committed_size); + DCHECK(spans); + const GUID* rgGuids[2] = {&GUID_PROP_COMPOSING, &GUID_PROP_ATTRIBUTE}; + Microsoft::WRL::ComPtr<ITfReadOnlyProperty> track_property; + if (FAILED(context->TrackProperties(rgGuids, 2, nullptr, 0, + track_property.GetAddressOf()))) { + return false; + } + + *committed_size = 0; + spans->clear(); + Microsoft::WRL::ComPtr<ITfRange> start_to_end_range; + Microsoft::WRL::ComPtr<ITfRange> end_range; + if (FAILED(context->GetStart(read_only_edit_cookie, + start_to_end_range.GetAddressOf()))) { + return false; + } + if (FAILED(context->GetEnd(read_only_edit_cookie, end_range.GetAddressOf()))) + return false; + if (FAILED(start_to_end_range->ShiftEndToRange( + read_only_edit_cookie, end_range.Get(), TF_ANCHOR_END))) { + return false; + } + + Microsoft::WRL::ComPtr<IEnumTfRanges> ranges; + if (FAILED(track_property->EnumRanges(read_only_edit_cookie, + ranges.GetAddressOf(), + start_to_end_range.Get()))) { + return false; + } + + while (true) { + Microsoft::WRL::ComPtr<ITfRange> range; + if (ranges->Next(1, range.GetAddressOf(), nullptr) != S_OK) + break; + base::win::ScopedVariant value; + Microsoft::WRL::ComPtr<IEnumTfPropertyValue> enum_prop_value; + if (FAILED(track_property->GetValue(read_only_edit_cookie, range.Get(), + value.Receive()))) { + return false; + } + if (FAILED(value.AsInput()->punkVal->QueryInterface( + IID_PPV_ARGS(&enum_prop_value)))) + return false; + + TF_PROPERTYVAL property_value; + bool is_composition = false; + bool has_display_attribute = false; + TF_DISPLAYATTRIBUTE display_attribute = {}; + while (enum_prop_value->Next(1, &property_value, nullptr) == S_OK) { + if (IsEqualGUID(property_value.guidId, GUID_PROP_COMPOSING)) { + is_composition = (property_value.varValue.lVal == TRUE); + } else if (IsEqualGUID(property_value.guidId, GUID_PROP_ATTRIBUTE)) { + TfGuidAtom guid_atom = + static_cast<TfGuidAtom>(property_value.varValue.lVal); + if (GetDisplayAttribute(guid_atom, &display_attribute)) + has_display_attribute = true; + } + VariantClear(&property_value.varValue); + } + + Microsoft::WRL::ComPtr<ITfRangeACP> range_acp; + range.CopyTo(range_acp.GetAddressOf()); + LONG start_pos, length; + range_acp->GetExtent(&start_pos, &length); + if (!is_composition) { + if (*committed_size < static_cast<size_t>(start_pos + length)) + *committed_size = start_pos + length; + } else { + ImeTextSpan span; + span.start_offset = start_pos; + span.end_offset = start_pos + length; + span.underline_color = SK_ColorBLACK; + span.background_color = SK_ColorTRANSPARENT; + if (has_display_attribute) { + span.thickness = display_attribute.fBoldLine + ? ImeTextSpan::Thickness::kThick + : ImeTextSpan::Thickness::kThin; + } + spans->push_back(span); + } + } + return true; +} + +void TSFTextStore::SetFocusedTextInputClient( + HWND focused_window, + TextInputClient* text_input_client) { + window_handle_ = focused_window; + text_input_client_ = text_input_client; +} + +void TSFTextStore::RemoveFocusedTextInputClient( + TextInputClient* text_input_client) { + if (text_input_client_ == text_input_client) { + window_handle_ = nullptr; + text_input_client_ = nullptr; + } +} + +bool TSFTextStore::CancelComposition() { + // If there is an on-going document lock, we must not edit the text. + if (edit_flag_) + return false; + + if (string_buffer_.empty()) + return true; + + // Unlike ImmNotifyIME(NI_COMPOSITIONSTR, CPS_CANCEL, 0) in IMM32, TSF does + // not have a dedicated method to cancel composition. However, CUAS actually + // has a protocol conversion from CPS_CANCEL into TSF operations. According + // to the observations on Windows 7, TIPs are expected to cancel composition + // when an on-going composition text is replaced with an empty string. So + // we use the same operation to cancel composition here to minimize the risk + // of potential compatibility issues. + + const size_t previous_buffer_size = string_buffer_.size(); + string_buffer_.clear(); + committed_size_ = 0; + selection_.set_start(0); + selection_.set_end(0); + if (text_store_acp_sink_mask_ & TS_AS_SEL_CHANGE) + text_store_acp_sink_->OnSelectionChange(); + if (text_store_acp_sink_mask_ & TS_AS_LAYOUT_CHANGE) + text_store_acp_sink_->OnLayoutChange(TS_LC_CHANGE, 0); + if (text_store_acp_sink_mask_ & TS_AS_TEXT_CHANGE) { + TS_TEXTCHANGE textChange = {}; + textChange.acpStart = 0; + textChange.acpOldEnd = previous_buffer_size; + textChange.acpNewEnd = 0; + text_store_acp_sink_->OnTextChange(0, &textChange); + } + return true; +} + +bool TSFTextStore::ConfirmComposition() { + // If there is an on-going document lock, we must not edit the text. + if (edit_flag_) + return false; + + if (string_buffer_.empty()) + return true; + + // See the comment in TSFTextStore::CancelComposition. + // This logic is based on the observation about how to emulate + // ImmNotifyIME(NI_COMPOSITIONSTR, CPS_COMPLETE, 0) by CUAS. + + const base::string16& composition_text = + string_buffer_.substr(committed_size_); + if (!composition_text.empty()) + text_input_client_->InsertText(composition_text); + + const size_t previous_buffer_size = string_buffer_.size(); + string_buffer_.clear(); + committed_size_ = 0; + selection_.set_start(0); + selection_.set_end(0); + if (text_store_acp_sink_mask_ & TS_AS_SEL_CHANGE) + text_store_acp_sink_->OnSelectionChange(); + if (text_store_acp_sink_mask_ & TS_AS_LAYOUT_CHANGE) + text_store_acp_sink_->OnLayoutChange(TS_LC_CHANGE, 0); + if (text_store_acp_sink_mask_ & TS_AS_TEXT_CHANGE) { + TS_TEXTCHANGE textChange = {}; + textChange.acpStart = 0; + textChange.acpOldEnd = previous_buffer_size; + textChange.acpNewEnd = 0; + text_store_acp_sink_->OnTextChange(0, &textChange); + } + return true; +} + +void TSFTextStore::SendOnLayoutChange() { + if (text_store_acp_sink_ && (text_store_acp_sink_mask_ & TS_AS_LAYOUT_CHANGE)) + text_store_acp_sink_->OnLayoutChange(TS_LC_CHANGE, 0); +} + +bool TSFTextStore::HasReadLock() const { + return (current_lock_type_ & TS_LF_READ) == TS_LF_READ; +} + +bool TSFTextStore::HasReadWriteLock() const { + return (current_lock_type_ & TS_LF_READWRITE) == TS_LF_READWRITE; +} + +} // namespace ui
diff --git a/ui/base/ime/win/tsf_text_store.h b/ui/base/ime/win/tsf_text_store.h new file mode 100644 index 0000000..687ca8f6 --- /dev/null +++ b/ui/base/ime/win/tsf_text_store.h
@@ -0,0 +1,311 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ +#define UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ + +#include <msctf.h> +#include <wrl/client.h> +#include <deque> + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "base/strings/string16.h" +#include "ui/base/ime/ime_text_span.h" +#include "ui/base/ime/ui_base_ime_export.h" +#include "ui/gfx/range/range.h" + +namespace ui { +class TextInputClient; + +// TSFTextStore is used to interact with the input method via TSF manager. +// TSFTextStore have a string buffer which is manipulated by TSF manager through +// ITextStoreACP interface methods such as SetText(). +// When the input method updates the composition, TSFTextStore calls +// TextInputClient::SetCompositionText(). And when the input method finishes the +// composition, TSFTextStore calls TextInputClient::InsertText() and clears the +// buffer. +// +// How TSFTextStore works: +// - The user enters "a". +// - The input method set composition as "a". +// - TSF manager calls TSFTextStore::RequestLock(). +// - TSFTextStore callbacks ITextStoreACPSink::OnLockGranted(). +// - In OnLockGranted(), TSF manager calls +// - TSFTextStore::OnStartComposition() +// - TSFTextStore::SetText() +// The string buffer is set as "a". +// - TSFTextStore::OnUpdateComposition() +// - TSFTextStore::OnEndEdit() +// TSFTextStore can get the composition information such as underlines. +// - TSFTextStore calls TextInputClient::SetCompositionText(). +// "a" is shown with an underline as composition string. +// - The user enters <space>. +// - The input method set composition as "A". +// - TSF manager calls TSFTextStore::RequestLock(). +// - TSFTextStore callbacks ITextStoreACPSink::OnLockGranted(). +// - In OnLockGranted(), TSF manager calls +// - TSFTextStore::SetText() +// The string buffer is set as "A". +// - TSFTextStore::OnUpdateComposition() +// - TSFTextStore::OnEndEdit() +// - TSFTextStore calls TextInputClient::SetCompositionText(). +// "A" is shown with an underline as composition string. +// - The user enters <enter>. +// - The input method commits "A". +// - TSF manager calls TSFTextStore::RequestLock(). +// - TSFTextStore callbacks ITextStoreACPSink::OnLockGranted(). +// - In OnLockGranted(), TSF manager calls +// - TSFTextStore::OnEndComposition() +// - TSFTextStore::OnEndEdit() +// TSFTextStore knows "A" is committed. +// - TSFTextStore calls TextInputClient::InsertText(). +// "A" is shown as committed string. +// - TSFTextStore clears the string buffer. +// - TSFTextStore calls OnSelectionChange(), OnLayoutChange() and +// OnTextChange() of ITextStoreACPSink to let TSF manager know that the +// string buffer has been changed. +// +// About the locking scheme: +// When TSF manager manipulates the string buffer it calls RequestLock() to get +// the lock of the document. If TSFTextStore can grant the lock request, it +// callbacks ITextStoreACPSink::OnLockGranted(). +// RequestLock() is called from only one thread, but called recursively in +// OnLockGranted() or OnSelectionChange() or OnLayoutChange() or OnTextChange(). +// If the document is locked and the lock request is asynchronous, TSFTextStore +// queues the request. The queued requests will be handled after the current +// lock is removed. +// More information about document locks can be found here: +// http://msdn.microsoft.com/en-us/library/ms538064 +// +// More information about TSF can be found here: +// http://msdn.microsoft.com/en-us/library/ms629032 +class UI_BASE_IME_EXPORT TSFTextStore : public ITextStoreACP, + public ITfContextOwnerCompositionSink, + public ITfTextEditSink { + public: + TSFTextStore(); + virtual ~TSFTextStore(); + + // ITextStoreACP: + STDMETHOD_(ULONG, AddRef)() override; + STDMETHOD_(ULONG, Release)() override; + STDMETHOD(QueryInterface)(REFIID iid, void** ppv) override; + STDMETHOD(AdviseSink)(REFIID iid, IUnknown* unknown, DWORD mask) override; + STDMETHOD(FindNextAttrTransition) + (LONG acp_start, + LONG acp_halt, + ULONG num_filter_attributes, + const TS_ATTRID* filter_attributes, + DWORD flags, + LONG* acp_next, + BOOL* found, + LONG* found_offset) override; + STDMETHOD(GetACPFromPoint) + (TsViewCookie view_cookie, + const POINT* point, + DWORD flags, + LONG* acp) override; + STDMETHOD(GetActiveView)(TsViewCookie* view_cookie) override; + STDMETHOD(GetEmbedded) + (LONG acp_pos, REFGUID service, REFIID iid, IUnknown** unknown) override; + STDMETHOD(GetEndACP)(LONG* acp) override; + STDMETHOD(GetFormattedText) + (LONG acp_start, LONG acp_end, IDataObject** data_object) override; + STDMETHOD(GetScreenExt)(TsViewCookie view_cookie, RECT* rect) override; + STDMETHOD(GetSelection) + (ULONG selection_index, + ULONG selection_buffer_size, + TS_SELECTION_ACP* selection_buffer, + ULONG* fetched_count) override; + STDMETHOD(GetStatus)(TS_STATUS* pdcs) override; + STDMETHOD(GetText) + (LONG acp_start, + LONG acp_end, + wchar_t* text_buffer, + ULONG text_buffer_size, + ULONG* text_buffer_copied, + TS_RUNINFO* run_info_buffer, + ULONG run_info_buffer_size, + ULONG* run_info_buffer_copied, + LONG* next_acp) override; + STDMETHOD(GetTextExt) + (TsViewCookie view_cookie, + LONG acp_start, + LONG acp_end, + RECT* rect, + BOOL* clipped) override; + STDMETHOD(GetWnd)(TsViewCookie view_cookie, HWND* window_handle) override; + STDMETHOD(InsertEmbedded) + (DWORD flags, + LONG acp_start, + LONG acp_end, + IDataObject* data_object, + TS_TEXTCHANGE* change) override; + STDMETHOD(InsertEmbeddedAtSelection) + (DWORD flags, + IDataObject* data_object, + LONG* acp_start, + LONG* acp_end, + TS_TEXTCHANGE* change) override; + STDMETHOD(InsertTextAtSelection) + (DWORD flags, + const wchar_t* text_buffer, + ULONG text_buffer_size, + LONG* acp_start, + LONG* acp_end, + TS_TEXTCHANGE* text_change) override; + STDMETHOD(QueryInsert) + (LONG acp_test_start, + LONG acp_test_end, + ULONG text_size, + LONG* acp_result_start, + LONG* acp_result_end) override; + STDMETHOD(QueryInsertEmbedded) + (const GUID* service, const FORMATETC* format, BOOL* insertable) override; + STDMETHOD(RequestAttrsAtPosition) + (LONG acp_pos, + ULONG attribute_buffer_size, + const TS_ATTRID* attribute_buffer, + DWORD flags) override; + STDMETHOD(RequestAttrsTransitioningAtPosition) + (LONG acp_pos, + ULONG attribute_buffer_size, + const TS_ATTRID* attribute_buffer, + DWORD flags) override; + STDMETHOD(RequestLock)(DWORD lock_flags, HRESULT* result) override; + STDMETHOD(RequestSupportedAttrs) + (DWORD flags, + ULONG attribute_buffer_size, + const TS_ATTRID* attribute_buffer) override; + STDMETHOD(RetrieveRequestedAttrs) + (ULONG attribute_buffer_size, + TS_ATTRVAL* attribute_buffer, + ULONG* attribute_buffer_copied) override; + STDMETHOD(SetSelection) + (ULONG selection_buffer_size, + const TS_SELECTION_ACP* selection_buffer) override; + STDMETHOD(SetText) + (DWORD flags, + LONG acp_start, + LONG acp_end, + const wchar_t* text_buffer, + ULONG text_buffer_size, + TS_TEXTCHANGE* text_change) override; + STDMETHOD(UnadviseSink)(IUnknown* unknown) override; + + // ITfContextOwnerCompositionSink: + STDMETHOD(OnStartComposition) + (ITfCompositionView* composition_view, BOOL* ok) override; + STDMETHOD(OnUpdateComposition) + (ITfCompositionView* composition_view, ITfRange* range) override; + STDMETHOD(OnEndComposition)(ITfCompositionView* composition_view) override; + + // ITfTextEditSink: + STDMETHOD(OnEndEdit) + (ITfContext* context, + TfEditCookie read_only_edit_cookie, + ITfEditRecord* edit_record) override; + + // Sets currently focused TextInputClient. + void SetFocusedTextInputClient(HWND focused_window, + TextInputClient* text_input_client); + // Removes currently focused TextInputClient. + void RemoveFocusedTextInputClient(TextInputClient* text_input_client); + + // Cancels the ongoing composition if exists. + bool CancelComposition(); + + // Confirms the ongoing composition if exists. + bool ConfirmComposition(); + + // Sends OnLayoutChange() via |text_store_acp_sink_|. + void SendOnLayoutChange(); + + private: + friend class TSFTextStoreTest; + friend class TSFTextStoreTestCallback; + + // Checks if the document has a read-only lock. + bool HasReadLock() const; + + // Checks if the document has a read and write lock. + bool HasReadWriteLock() const; + + // Gets the display attribute structure. + bool GetDisplayAttribute(TfGuidAtom guid_atom, + TF_DISPLAYATTRIBUTE* attribute); + + // Gets the committed string size and underline information of the context. + bool GetCompositionStatus(ITfContext* context, + const TfEditCookie read_only_edit_cookie, + size_t* committed_size, + ImeTextSpans* spans); + + // The refrence count of this instance. + volatile LONG ref_count_ = 0; + + // A pointer of ITextStoreACPSink, this instance is given in AdviseSink. + Microsoft::WRL::ComPtr<ITextStoreACPSink> text_store_acp_sink_; + + // The current mask of |text_store_acp_sink_|. + DWORD text_store_acp_sink_mask_ = 0; + + // HWND of the current view window which is set in SetFocusedTextInputClient. + HWND window_handle_ = nullptr; + + // Current TextInputClient which is set in SetFocusedTextInputClient. + TextInputClient* text_input_client_ = nullptr; + + // TODO(dtapuska): determine if we can expose more the entire document + // more than the committed string and composition string to the TIP. + // |string_buffer_| contains committed string and composition string. + // Example: "aoi" is committed, and "umi" is under composition. + // |string_buffer_|: "aoiumi" + // |committed_size_|: 3 + base::string16 string_buffer_; + size_t committed_size_ = 0; + + // |selection_start_| and |selection_end_| indicates the selection range. + // Example: "iue" is selected + // |string_buffer_|: "aiueo" + // |selection_.start()|: 1 + // |selection_.end()|: 4 + gfx::Range selection_; + + // |start_offset| and |end_offset| of |text_spans_| indicates + // the offsets in |string_buffer_|. + // Example: "aoi" is committed. There are two underlines in "umi" and "no". + // |string_buffer_|: "aoiumino" + // |committed_size_|: 3 + // text_spans_[0].start_offset: 3 + // text_spans_[0].end_offset: 6 + // text_spans_[1].start_offset: 6 + // text_spans_[1].end_offset: 8 + ImeTextSpans text_spans_; + + // |edit_flag_| indicates that the status is edited during + // ITextStoreACPSink::OnLockGranted(). + bool edit_flag_ = false; + + // The type of current lock. + // 0: No lock. + // TS_LF_READ: read-only lock. + // TS_LF_READWRITE: read/write lock. + DWORD current_lock_type_ = 0; + + // Queue of the lock request used in RequestLock(). + std::deque<DWORD> lock_queue_; + + // Category manager and Display attribute manager are used to obtain the + // attributes of the composition string. + Microsoft::WRL::ComPtr<ITfCategoryMgr> category_manager_; + Microsoft::WRL::ComPtr<ITfDisplayAttributeMgr> display_attribute_manager_; + + DISALLOW_COPY_AND_ASSIGN(TSFTextStore); +}; + +} // namespace ui + +#endif // UI_BASE_IME_WIN_TSF_TEXT_STORE_H_
diff --git a/ui/base/ime/win/tsf_text_store_unittest.cc b/ui/base/ime/win/tsf_text_store_unittest.cc new file mode 100644 index 0000000..76c3eb1 --- /dev/null +++ b/ui/base/ime/win/tsf_text_store_unittest.cc
@@ -0,0 +1,1302 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "ui/base/ime/win/tsf_text_store.h" + +#include <initguid.h> // for GUID_NULL and GUID_PROP_INPUTSCOPE + +#include <InputScope.h> +#include <OleCtl.h> +#include <wrl/client.h> + +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/win/scoped_com_initializer.h" +#include "base/win/scoped_variant.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/ime/text_input_client.h" +#include "ui/events/event.h" +#include "ui/gfx/geometry/rect.h" + +using testing::_; +using testing::Invoke; +using testing::Return; + +namespace ui { +namespace { + +class MockTextInputClient : public TextInputClient { + public: + ~MockTextInputClient() {} + MOCK_METHOD1(SetCompositionText, void(const ui::CompositionText&)); + MOCK_METHOD0(ConfirmCompositionText, void()); + MOCK_METHOD0(ClearCompositionText, void()); + MOCK_METHOD1(InsertText, void(const base::string16&)); + MOCK_METHOD1(InsertChar, void(const ui::KeyEvent&)); + MOCK_CONST_METHOD0(GetTextInputType, ui::TextInputType()); + MOCK_CONST_METHOD0(GetTextInputMode, ui::TextInputMode()); + MOCK_CONST_METHOD0(GetTextDirection, base::i18n::TextDirection()); + MOCK_CONST_METHOD0(GetTextInputFlags, int()); + MOCK_CONST_METHOD0(CanComposeInline, bool()); + MOCK_CONST_METHOD0(GetCaretBounds, gfx::Rect()); + MOCK_CONST_METHOD2(GetCompositionCharacterBounds, bool(uint32_t, gfx::Rect*)); + MOCK_CONST_METHOD0(HasCompositionText, bool()); + MOCK_CONST_METHOD1(GetTextRange, bool(gfx::Range*)); + MOCK_CONST_METHOD1(GetCompositionTextRange, bool(gfx::Range*)); + MOCK_CONST_METHOD1(GetSelectionRange, bool(gfx::Range*)); + MOCK_METHOD1(SetSelectionRange, bool(const gfx::Range&)); + MOCK_METHOD1(DeleteRange, bool(const gfx::Range&)); + MOCK_CONST_METHOD2(GetTextFromRange, + bool(const gfx::Range&, base::string16*)); + MOCK_METHOD0(OnInputMethodChanged, void()); + MOCK_METHOD1(ChangeTextDirectionAndLayoutAlignment, + bool(base::i18n::TextDirection)); + MOCK_METHOD2(ExtendSelectionAndDelete, void(size_t, size_t)); + MOCK_METHOD1(EnsureCaretNotInRect, void(const gfx::Rect&)); + MOCK_CONST_METHOD1(IsTextEditCommandEnabled, bool(TextEditCommand)); + MOCK_METHOD1(SetTextEditCommandForNextKeyEvent, void(TextEditCommand)); + MOCK_CONST_METHOD0(GetClientSourceInfo, const std::string&()); +}; + +class MockStoreACPSink : public ITextStoreACPSink { + public: + MockStoreACPSink() : ref_count_(0) {} + + // IUnknown + ULONG STDMETHODCALLTYPE AddRef() override { + return InterlockedIncrement(&ref_count_); + } + ULONG STDMETHODCALLTYPE Release() override { + const LONG count = InterlockedDecrement(&ref_count_); + if (!count) { + delete this; + return 0; + } + return static_cast<ULONG>(count); + } + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void** report) override { + if (iid == IID_IUnknown || iid == IID_ITextStoreACPSink) { + *report = static_cast<ITextStoreACPSink*>(this); + } else { + *report = nullptr; + return E_NOINTERFACE; + } + AddRef(); + return S_OK; + } + + // ITextStoreACPSink + MOCK_METHOD2_WITH_CALLTYPE(STDMETHODCALLTYPE, + OnTextChange, + HRESULT(DWORD, const TS_TEXTCHANGE*)); + MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, OnSelectionChange, HRESULT()); + MOCK_METHOD2_WITH_CALLTYPE(STDMETHODCALLTYPE, + OnLayoutChange, + HRESULT(TsLayoutCode, TsViewCookie)); + MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, OnStatusChange, HRESULT(DWORD)); + MOCK_METHOD4_WITH_CALLTYPE(STDMETHODCALLTYPE, + OnAttrsChange, + HRESULT(LONG, LONG, ULONG, const TS_ATTRID*)); + MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, OnLockGranted, HRESULT(DWORD)); + MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, + OnStartEditTransaction, + HRESULT()); + MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, + OnEndEditTransaction, + HRESULT()); + + private: + virtual ~MockStoreACPSink() {} + + volatile LONG ref_count_; +}; + +const HWND kWindowHandle = reinterpret_cast<HWND>(1); + +} // namespace + +class TSFTextStoreTest : public testing::Test { + protected: + void SetUp() override { + text_store_ = new TSFTextStore(); + sink_ = new MockStoreACPSink(); + EXPECT_EQ(S_OK, text_store_->AdviseSink(IID_ITextStoreACPSink, sink_.get(), + TS_AS_ALL_SINKS)); + text_store_->SetFocusedTextInputClient(kWindowHandle, &text_input_client_); + } + + void TearDown() override { + EXPECT_EQ(S_OK, text_store_->UnadviseSink(sink_.get())); + sink_ = nullptr; + text_store_ = nullptr; + } + + // Accessors to the internal state of TSFTextStore. + base::string16* string_buffer() { return &text_store_->string_buffer_; } + size_t* committed_size() { return &text_store_->committed_size_; } + + base::win::ScopedCOMInitializer com_initializer_; + MockTextInputClient text_input_client_; + scoped_refptr<TSFTextStore> text_store_; + scoped_refptr<MockStoreACPSink> sink_; +}; + +class TSFTextStoreTestCallback { + public: + explicit TSFTextStoreTestCallback(TSFTextStore* text_store) + : text_store_(text_store) { + CHECK(text_store_); + } + virtual ~TSFTextStoreTestCallback() {} + + protected: + // Accessors to the internal state of TSFTextStore. + bool* edit_flag() { return &text_store_->edit_flag_; } + base::string16* string_buffer() { return &text_store_->string_buffer_; } + size_t* committed_size() { return &text_store_->committed_size_; } + gfx::Range* selection() { return &text_store_->selection_; } + ImeTextSpans* text_spans() { return &text_store_->text_spans_; } + + void SetInternalState(const base::string16& new_string_buffer, + LONG new_committed_size, + LONG new_selection_start, + LONG new_selection_end) { + ASSERT_LE(0, new_committed_size); + ASSERT_LE(new_committed_size, new_selection_start); + ASSERT_LE(new_selection_start, new_selection_end); + ASSERT_LE(new_selection_end, static_cast<LONG>(new_string_buffer.size())); + *string_buffer() = new_string_buffer; + *committed_size() = new_committed_size; + selection()->set_start(new_selection_start); + selection()->set_end(new_selection_end); + } + + bool HasReadLock() const { return text_store_->HasReadLock(); } + bool HasReadWriteLock() const { return text_store_->HasReadWriteLock(); } + + void GetSelectionTest(LONG expected_acp_start, LONG expected_acp_end) { + TS_SELECTION_ACP selection = {}; + ULONG fetched = 0; + EXPECT_EQ(S_OK, text_store_->GetSelection(0, 1, &selection, &fetched)); + EXPECT_EQ(1u, fetched); + EXPECT_EQ(expected_acp_start, selection.acpStart); + EXPECT_EQ(expected_acp_end, selection.acpEnd); + } + + void SetSelectionTest(LONG acp_start, LONG acp_end, HRESULT expected_result) { + TS_SELECTION_ACP selection = {}; + selection.acpStart = acp_start; + selection.acpEnd = acp_end; + selection.style.ase = TS_AE_NONE; + selection.style.fInterimChar = 0; + EXPECT_EQ(expected_result, text_store_->SetSelection(1, &selection)); + if (expected_result == S_OK) { + GetSelectionTest(acp_start, acp_end); + } + } + + void SetTextTest(LONG acp_start, + LONG acp_end, + const base::string16& text, + HRESULT error_code) { + TS_TEXTCHANGE change = {}; + ASSERT_EQ(error_code, + text_store_->SetText(0, acp_start, acp_end, text.c_str(), + text.size(), &change)); + if (error_code == S_OK) { + EXPECT_EQ(acp_start, change.acpStart); + EXPECT_EQ(acp_end, change.acpOldEnd); + EXPECT_EQ(acp_start + text.size(), (size_t)change.acpNewEnd); + } + } + + void GetTextTest(LONG acp_start, + LONG acp_end, + const base::string16& expected_string, + LONG expected_next_acp) { + wchar_t buffer[1024] = {}; + ULONG text_buffer_copied = 0; + TS_RUNINFO run_info = {}; + ULONG run_info_buffer_copied = 0; + LONG next_acp = 0; + ASSERT_EQ(S_OK, text_store_->GetText(acp_start, acp_end, buffer, 1024, + &text_buffer_copied, &run_info, 1, + &run_info_buffer_copied, &next_acp)); + ASSERT_EQ(expected_string.size(), text_buffer_copied); + EXPECT_EQ(expected_string, + base::string16(buffer, buffer + text_buffer_copied)); + EXPECT_EQ(1u, run_info_buffer_copied); + EXPECT_EQ(expected_string.size(), run_info.uCount); + EXPECT_EQ(TS_RT_PLAIN, run_info.type); + EXPECT_EQ(expected_next_acp, next_acp); + } + + void GetTextErrorTest(LONG acp_start, LONG acp_end, HRESULT error_code) { + wchar_t buffer[1024] = {}; + ULONG text_buffer_copied = 0; + TS_RUNINFO run_info = {}; + ULONG run_info_buffer_copied = 0; + LONG next_acp = 0; + EXPECT_EQ(error_code, + text_store_->GetText(acp_start, acp_end, buffer, 1024, + &text_buffer_copied, &run_info, 1, + &run_info_buffer_copied, &next_acp)); + } + + void InsertTextAtSelectionTest(const wchar_t* buffer, + ULONG buffer_size, + LONG expected_start, + LONG expected_end, + LONG expected_change_start, + LONG expected_change_old_end, + LONG expected_change_new_end) { + LONG start = 0; + LONG end = 0; + TS_TEXTCHANGE change = {}; + EXPECT_EQ(S_OK, text_store_->InsertTextAtSelection(0, buffer, buffer_size, + &start, &end, &change)); + EXPECT_EQ(expected_start, start); + EXPECT_EQ(expected_end, end); + EXPECT_EQ(expected_change_start, change.acpStart); + EXPECT_EQ(expected_change_old_end, change.acpOldEnd); + EXPECT_EQ(expected_change_new_end, change.acpNewEnd); + } + + void InsertTextAtSelectionQueryOnlyTest(const wchar_t* buffer, + ULONG buffer_size, + LONG expected_start, + LONG expected_end) { + LONG start = 0; + LONG end = 0; + EXPECT_EQ(S_OK, text_store_->InsertTextAtSelection(TS_IAS_QUERYONLY, buffer, + buffer_size, &start, + &end, nullptr)); + EXPECT_EQ(expected_start, start); + EXPECT_EQ(expected_end, end); + } + + void GetTextExtTest(TsViewCookie view_cookie, + LONG acp_start, + LONG acp_end, + LONG expected_left, + LONG expected_top, + LONG expected_right, + LONG expected_bottom) { + RECT rect = {}; + BOOL clipped = FALSE; + EXPECT_EQ(S_OK, text_store_->GetTextExt(view_cookie, acp_start, acp_end, + &rect, &clipped)); + EXPECT_EQ(expected_left, rect.left); + EXPECT_EQ(expected_top, rect.top); + EXPECT_EQ(expected_right, rect.right); + EXPECT_EQ(expected_bottom, rect.bottom); + EXPECT_EQ(FALSE, clipped); + } + + void GetTextExtNoLayoutTest(TsViewCookie view_cookie, + LONG acp_start, + LONG acp_end) { + RECT rect = {}; + BOOL clipped = FALSE; + EXPECT_EQ(TS_E_NOLAYOUT, text_store_->GetTextExt(view_cookie, acp_start, + acp_end, &rect, &clipped)); + } + + scoped_refptr<TSFTextStore> text_store_; + + private: + DISALLOW_COPY_AND_ASSIGN(TSFTextStoreTestCallback); +}; + +namespace { + +const HRESULT kInvalidResult = 0x12345678; + +TEST_F(TSFTextStoreTest, GetStatusTest) { + TS_STATUS status = {}; + EXPECT_EQ(S_OK, text_store_->GetStatus(&status)); + EXPECT_EQ(0u, status.dwDynamicFlags); + EXPECT_EQ((ULONG)(TS_SS_TRANSITORY | TS_SS_NOHIDDENTEXT), + status.dwStaticFlags); +} + +TEST_F(TSFTextStoreTest, QueryInsertTest) { + LONG result_start = 0; + LONG result_end = 0; + *string_buffer() = L""; + *committed_size() = 0; + EXPECT_EQ(E_INVALIDARG, + text_store_->QueryInsert(0, 0, 0, nullptr, &result_end)); + EXPECT_EQ(E_INVALIDARG, + text_store_->QueryInsert(0, 0, 0, &result_start, nullptr)); + EXPECT_EQ(S_OK, + text_store_->QueryInsert(0, 0, 0, &result_start, &result_end)); + EXPECT_EQ(0, result_start); + EXPECT_EQ(0, result_end); + *string_buffer() = L"1234"; + *committed_size() = 1; + EXPECT_EQ(S_OK, + text_store_->QueryInsert(0, 1, 0, &result_start, &result_end)); + EXPECT_EQ(1, result_start); + EXPECT_EQ(1, result_end); + EXPECT_EQ(E_INVALIDARG, + text_store_->QueryInsert(1, 0, 0, &result_start, &result_end)); + EXPECT_EQ(S_OK, + text_store_->QueryInsert(2, 2, 0, &result_start, &result_end)); + EXPECT_EQ(2, result_start); + EXPECT_EQ(2, result_end); + EXPECT_EQ(S_OK, + text_store_->QueryInsert(2, 3, 0, &result_start, &result_end)); + EXPECT_EQ(2, result_start); + EXPECT_EQ(3, result_end); + EXPECT_EQ(E_INVALIDARG, + text_store_->QueryInsert(3, 2, 0, &result_start, &result_end)); + EXPECT_EQ(S_OK, + text_store_->QueryInsert(3, 4, 0, &result_start, &result_end)); + EXPECT_EQ(3, result_start); + EXPECT_EQ(4, result_end); + EXPECT_EQ(S_OK, + text_store_->QueryInsert(3, 5, 0, &result_start, &result_end)); + EXPECT_EQ(3, result_start); + EXPECT_EQ(4, result_end); +} + +class SyncRequestLockTestCallback : public TSFTextStoreTestCallback { + public: + explicit SyncRequestLockTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store) {} + + HRESULT LockGranted1(DWORD flags) { + EXPECT_TRUE(HasReadLock()); + EXPECT_FALSE(HasReadWriteLock()); + return S_OK; + } + + HRESULT LockGranted2(DWORD flags) { + EXPECT_TRUE(HasReadLock()); + EXPECT_TRUE(HasReadWriteLock()); + return S_OK; + } + + HRESULT LockGranted3(DWORD flags) { + EXPECT_TRUE(HasReadLock()); + EXPECT_FALSE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ | TS_LF_SYNC, &result)); + EXPECT_EQ(TS_E_SYNCHRONOUS, result); + return S_OK; + } + + HRESULT LockGranted4(DWORD flags) { + EXPECT_TRUE(HasReadLock()); + EXPECT_FALSE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, + text_store_->RequestLock(TS_LF_READWRITE | TS_LF_SYNC, &result)); + EXPECT_EQ(TS_E_SYNCHRONOUS, result); + return S_OK; + } + + HRESULT LockGranted5(DWORD flags) { + EXPECT_TRUE(HasReadLock()); + EXPECT_TRUE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ | TS_LF_SYNC, &result)); + EXPECT_EQ(TS_E_SYNCHRONOUS, result); + return S_OK; + } + + HRESULT LockGranted6(DWORD flags) { + EXPECT_TRUE(HasReadLock()); + EXPECT_TRUE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, + text_store_->RequestLock(TS_LF_READWRITE | TS_LF_SYNC, &result)); + EXPECT_EQ(TS_E_SYNCHRONOUS, result); + return S_OK; + } + + private: + DISALLOW_COPY_AND_ASSIGN(SyncRequestLockTestCallback); +}; + +TEST_F(TSFTextStoreTest, SynchronousRequestLockTest) { + SyncRequestLockTestCallback callback(text_store_.get()); + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce(Invoke(&callback, &SyncRequestLockTestCallback::LockGranted1)) + .WillOnce(Invoke(&callback, &SyncRequestLockTestCallback::LockGranted2)) + .WillOnce(Invoke(&callback, &SyncRequestLockTestCallback::LockGranted3)) + .WillOnce(Invoke(&callback, &SyncRequestLockTestCallback::LockGranted4)) + .WillOnce(Invoke(&callback, &SyncRequestLockTestCallback::LockGranted5)) + .WillOnce(Invoke(&callback, &SyncRequestLockTestCallback::LockGranted6)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ | TS_LF_SYNC, &result)); + EXPECT_EQ(S_OK, result); + result = kInvalidResult; + EXPECT_EQ(S_OK, + text_store_->RequestLock(TS_LF_READWRITE | TS_LF_SYNC, &result)); + EXPECT_EQ(S_OK, result); + + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ | TS_LF_SYNC, &result)); + EXPECT_EQ(S_OK, result); + result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ | TS_LF_SYNC, &result)); + EXPECT_EQ(S_OK, result); + + result = kInvalidResult; + EXPECT_EQ(S_OK, + text_store_->RequestLock(TS_LF_READWRITE | TS_LF_SYNC, &result)); + EXPECT_EQ(S_OK, result); + result = kInvalidResult; + EXPECT_EQ(S_OK, + text_store_->RequestLock(TS_LF_READWRITE | TS_LF_SYNC, &result)); + EXPECT_EQ(S_OK, result); +} + +class AsyncRequestLockTestCallback : public TSFTextStoreTestCallback { + public: + explicit AsyncRequestLockTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store), state_(0) {} + + HRESULT LockGranted1(DWORD flags) { + EXPECT_EQ(0, state_); + state_ = 1; + EXPECT_TRUE(HasReadLock()); + EXPECT_FALSE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ, &result)); + EXPECT_EQ(TS_S_ASYNC, result); + EXPECT_EQ(1, state_); + state_ = 2; + return S_OK; + } + + HRESULT LockGranted2(DWORD flags) { + EXPECT_EQ(2, state_); + EXPECT_TRUE(HasReadLock()); + EXPECT_FALSE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(TS_S_ASYNC, result); + EXPECT_EQ(2, state_); + state_ = 3; + return S_OK; + } + + HRESULT LockGranted3(DWORD flags) { + EXPECT_EQ(3, state_); + EXPECT_TRUE(HasReadLock()); + EXPECT_TRUE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(TS_S_ASYNC, result); + EXPECT_EQ(3, state_); + state_ = 4; + return S_OK; + } + + HRESULT LockGranted4(DWORD flags) { + EXPECT_EQ(4, state_); + EXPECT_TRUE(HasReadLock()); + EXPECT_TRUE(HasReadWriteLock()); + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ, &result)); + EXPECT_EQ(TS_S_ASYNC, result); + EXPECT_EQ(4, state_); + state_ = 5; + return S_OK; + } + + HRESULT LockGranted5(DWORD flags) { + EXPECT_EQ(5, state_); + EXPECT_TRUE(HasReadLock()); + EXPECT_FALSE(HasReadWriteLock()); + state_ = 6; + return S_OK; + } + + private: + int state_; + + DISALLOW_COPY_AND_ASSIGN(AsyncRequestLockTestCallback); +}; + +TEST_F(TSFTextStoreTest, AsynchronousRequestLockTest) { + AsyncRequestLockTestCallback callback(text_store_.get()); + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce(Invoke(&callback, &AsyncRequestLockTestCallback::LockGranted1)) + .WillOnce(Invoke(&callback, &AsyncRequestLockTestCallback::LockGranted2)) + .WillOnce(Invoke(&callback, &AsyncRequestLockTestCallback::LockGranted3)) + .WillOnce(Invoke(&callback, &AsyncRequestLockTestCallback::LockGranted4)) + .WillOnce(Invoke(&callback, &AsyncRequestLockTestCallback::LockGranted5)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ, &result)); + EXPECT_EQ(S_OK, result); +} + +class RequestLockTextChangeTestCallback : public TSFTextStoreTestCallback { + public: + explicit RequestLockTextChangeTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store), state_(0) {} + + HRESULT LockGranted1(DWORD flags) { + EXPECT_EQ(0, state_); + state_ = 1; + EXPECT_TRUE(HasReadLock()); + EXPECT_TRUE(HasReadWriteLock()); + + *edit_flag() = true; + SetInternalState(L"012345", 6, 6, 6); + text_spans()->clear(); + + state_ = 2; + return S_OK; + } + + void InsertText(const base::string16& text) { + EXPECT_EQ(2, state_); + EXPECT_EQ(L"012345", text); + state_ = 3; + } + + void SetCompositionText(const ui::CompositionText& composition) { + EXPECT_EQ(3, state_); + EXPECT_EQ(L"", composition.text); + EXPECT_EQ(0u, composition.selection.start()); + EXPECT_EQ(0u, composition.selection.end()); + EXPECT_EQ(0u, composition.ime_text_spans.size()); + state_ = 4; + } + + HRESULT OnTextChange(DWORD flags, const TS_TEXTCHANGE* change) { + EXPECT_EQ(4, state_); + HRESULT result = kInvalidResult; + state_ = 5; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(S_OK, result); + EXPECT_EQ(6, state_); + state_ = 7; + return S_OK; + } + + HRESULT LockGranted2(DWORD flags) { + EXPECT_EQ(5, state_); + EXPECT_TRUE(HasReadLock()); + EXPECT_TRUE(HasReadWriteLock()); + state_ = 6; + return S_OK; + } + + private: + int state_; + + DISALLOW_COPY_AND_ASSIGN(RequestLockTextChangeTestCallback); +}; + +TEST_F(TSFTextStoreTest, RequestLockOnTextChangeTest) { + RequestLockTextChangeTestCallback callback(text_store_.get()); + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce( + Invoke(&callback, &RequestLockTextChangeTestCallback::LockGranted1)) + .WillOnce( + Invoke(&callback, &RequestLockTextChangeTestCallback::LockGranted2)); + + EXPECT_CALL(*sink_, OnSelectionChange()).WillOnce(Return(S_OK)); + EXPECT_CALL(*sink_, OnLayoutChange(_, _)).WillOnce(Return(S_OK)); + EXPECT_CALL(*sink_, OnTextChange(_, _)) + .WillOnce( + Invoke(&callback, &RequestLockTextChangeTestCallback::OnTextChange)); + EXPECT_CALL(text_input_client_, InsertText(_)) + .WillOnce( + Invoke(&callback, &RequestLockTextChangeTestCallback::InsertText)); + EXPECT_CALL(text_input_client_, SetCompositionText(_)) + .WillOnce(Invoke(&callback, + &RequestLockTextChangeTestCallback::SetCompositionText)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(S_OK, result); +} + +class SelectionTestCallback : public TSFTextStoreTestCallback { + public: + explicit SelectionTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store) {} + + HRESULT ReadLockGranted(DWORD flags) { + SetInternalState(L"", 0, 0, 0); + + GetSelectionTest(0, 0); + SetSelectionTest(0, 0, TF_E_NOLOCK); + + SetInternalState(L"012345", 0, 0, 3); + + GetSelectionTest(0, 3); + SetSelectionTest(0, 0, TF_E_NOLOCK); + + return S_OK; + } + + HRESULT ReadWriteLockGranted(DWORD flags) { + SetInternalState(L"", 0, 0, 0); + + SetSelectionTest(0, 0, S_OK); + GetSelectionTest(0, 0); + SetSelectionTest(0, 1, TF_E_INVALIDPOS); + SetSelectionTest(1, 0, TF_E_INVALIDPOS); + SetSelectionTest(1, 1, TF_E_INVALIDPOS); + + SetInternalState(L"0123456", 3, 3, 3); + + SetSelectionTest(0, 0, TF_E_INVALIDPOS); + SetSelectionTest(0, 1, TF_E_INVALIDPOS); + SetSelectionTest(0, 3, TF_E_INVALIDPOS); + SetSelectionTest(0, 6, TF_E_INVALIDPOS); + SetSelectionTest(0, 7, TF_E_INVALIDPOS); + SetSelectionTest(0, 8, TF_E_INVALIDPOS); + + SetSelectionTest(1, 0, TF_E_INVALIDPOS); + SetSelectionTest(1, 1, TF_E_INVALIDPOS); + SetSelectionTest(1, 3, TF_E_INVALIDPOS); + SetSelectionTest(1, 6, TF_E_INVALIDPOS); + SetSelectionTest(1, 7, TF_E_INVALIDPOS); + SetSelectionTest(1, 8, TF_E_INVALIDPOS); + + SetSelectionTest(3, 0, TF_E_INVALIDPOS); + SetSelectionTest(3, 1, TF_E_INVALIDPOS); + SetSelectionTest(3, 3, S_OK); + SetSelectionTest(3, 6, S_OK); + SetSelectionTest(3, 7, S_OK); + SetSelectionTest(3, 8, TF_E_INVALIDPOS); + + SetSelectionTest(6, 0, TF_E_INVALIDPOS); + SetSelectionTest(6, 1, TF_E_INVALIDPOS); + SetSelectionTest(6, 3, TF_E_INVALIDPOS); + SetSelectionTest(6, 6, S_OK); + SetSelectionTest(6, 7, S_OK); + SetSelectionTest(6, 8, TF_E_INVALIDPOS); + + SetSelectionTest(7, 0, TF_E_INVALIDPOS); + SetSelectionTest(7, 1, TF_E_INVALIDPOS); + SetSelectionTest(7, 3, TF_E_INVALIDPOS); + SetSelectionTest(7, 6, TF_E_INVALIDPOS); + SetSelectionTest(7, 7, S_OK); + SetSelectionTest(7, 8, TF_E_INVALIDPOS); + + SetSelectionTest(8, 0, TF_E_INVALIDPOS); + SetSelectionTest(8, 1, TF_E_INVALIDPOS); + SetSelectionTest(8, 3, TF_E_INVALIDPOS); + SetSelectionTest(8, 6, TF_E_INVALIDPOS); + SetSelectionTest(8, 7, TF_E_INVALIDPOS); + SetSelectionTest(8, 8, TF_E_INVALIDPOS); + + return S_OK; + } +}; + +TEST_F(TSFTextStoreTest, SetGetSelectionTest) { + SelectionTestCallback callback(text_store_.get()); + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce(Invoke(&callback, &SelectionTestCallback::ReadLockGranted)) + .WillOnce( + Invoke(&callback, &SelectionTestCallback::ReadWriteLockGranted)); + + TS_SELECTION_ACP selection_buffer = {}; + ULONG fetched_count = 0; + EXPECT_EQ(TS_E_NOLOCK, + text_store_->GetSelection(0, 1, &selection_buffer, &fetched_count)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ, &result)); + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); +} + +class SetGetTextTestCallback : public TSFTextStoreTestCallback { + public: + explicit SetGetTextTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store) {} + + HRESULT ReadLockGranted(DWORD flags) { + SetTextTest(0, 0, L"", TF_E_NOLOCK); + + GetTextTest(0, -1, L"", 0); + GetTextTest(0, 0, L"", 0); + GetTextErrorTest(0, 1, TF_E_INVALIDPOS); + + SetInternalState(L"0123456", 3, 3, 3); + + GetTextErrorTest(-1, -1, TF_E_INVALIDPOS); + GetTextErrorTest(-1, 0, TF_E_INVALIDPOS); + GetTextErrorTest(-1, 1, TF_E_INVALIDPOS); + GetTextErrorTest(-1, 3, TF_E_INVALIDPOS); + GetTextErrorTest(-1, 6, TF_E_INVALIDPOS); + GetTextErrorTest(-1, 7, TF_E_INVALIDPOS); + GetTextErrorTest(-1, 8, TF_E_INVALIDPOS); + + GetTextTest(0, -1, L"0123456", 7); + GetTextTest(0, 0, L"", 0); + GetTextTest(0, 1, L"0", 1); + GetTextTest(0, 3, L"012", 3); + GetTextTest(0, 6, L"012345", 6); + GetTextTest(0, 7, L"0123456", 7); + GetTextErrorTest(0, 8, TF_E_INVALIDPOS); + + GetTextTest(1, -1, L"123456", 7); + GetTextErrorTest(1, 0, TF_E_INVALIDPOS); + GetTextTest(1, 1, L"", 1); + GetTextTest(1, 3, L"12", 3); + GetTextTest(1, 6, L"12345", 6); + GetTextTest(1, 7, L"123456", 7); + GetTextErrorTest(1, 8, TF_E_INVALIDPOS); + + GetTextTest(3, -1, L"3456", 7); + GetTextErrorTest(3, 0, TF_E_INVALIDPOS); + GetTextErrorTest(3, 1, TF_E_INVALIDPOS); + GetTextTest(3, 3, L"", 3); + GetTextTest(3, 6, L"345", 6); + GetTextTest(3, 7, L"3456", 7); + GetTextErrorTest(3, 8, TF_E_INVALIDPOS); + + GetTextTest(6, -1, L"6", 7); + GetTextErrorTest(6, 0, TF_E_INVALIDPOS); + GetTextErrorTest(6, 1, TF_E_INVALIDPOS); + GetTextErrorTest(6, 3, TF_E_INVALIDPOS); + GetTextTest(6, 6, L"", 6); + GetTextTest(6, 7, L"6", 7); + GetTextErrorTest(6, 8, TF_E_INVALIDPOS); + + GetTextTest(7, -1, L"", 7); + GetTextErrorTest(7, 0, TF_E_INVALIDPOS); + GetTextErrorTest(7, 1, TF_E_INVALIDPOS); + GetTextErrorTest(7, 3, TF_E_INVALIDPOS); + GetTextErrorTest(7, 6, TF_E_INVALIDPOS); + GetTextTest(7, 7, L"", 7); + GetTextErrorTest(7, 8, TF_E_INVALIDPOS); + + GetTextErrorTest(8, -1, TF_E_INVALIDPOS); + GetTextErrorTest(8, 0, TF_E_INVALIDPOS); + GetTextErrorTest(8, 1, TF_E_INVALIDPOS); + GetTextErrorTest(8, 3, TF_E_INVALIDPOS); + GetTextErrorTest(8, 6, TF_E_INVALIDPOS); + GetTextErrorTest(8, 7, TF_E_INVALIDPOS); + GetTextErrorTest(8, 8, TF_E_INVALIDPOS); + + return S_OK; + } + + HRESULT ReadWriteLockGranted(DWORD flags) { + SetInternalState(L"", 0, 0, 0); + SetTextTest(0, 0, L"", S_OK); + + SetInternalState(L"", 0, 0, 0); + SetTextTest(0, 1, L"", TS_E_INVALIDPOS); + + SetInternalState(L"0123456", 3, 3, 3); + + SetTextTest(0, 0, L"", TS_E_INVALIDPOS); + SetTextTest(0, 1, L"", TS_E_INVALIDPOS); + SetTextTest(0, 3, L"", TS_E_INVALIDPOS); + SetTextTest(0, 6, L"", TS_E_INVALIDPOS); + SetTextTest(0, 7, L"", TS_E_INVALIDPOS); + SetTextTest(0, 8, L"", TS_E_INVALIDPOS); + + SetTextTest(1, 0, L"", TS_E_INVALIDPOS); + SetTextTest(1, 1, L"", TS_E_INVALIDPOS); + SetTextTest(1, 3, L"", TS_E_INVALIDPOS); + SetTextTest(1, 6, L"", TS_E_INVALIDPOS); + SetTextTest(1, 7, L"", TS_E_INVALIDPOS); + SetTextTest(1, 8, L"", TS_E_INVALIDPOS); + + SetTextTest(3, 0, L"", TS_E_INVALIDPOS); + SetTextTest(3, 1, L"", TS_E_INVALIDPOS); + + SetTextTest(3, 3, L"", S_OK); + GetTextTest(0, -1, L"0123456", 7); + GetSelectionTest(3, 3); + SetInternalState(L"0123456", 3, 3, 3); + + SetTextTest(3, 6, L"", S_OK); + GetTextTest(0, -1, L"0126", 4); + GetSelectionTest(3, 3); + SetInternalState(L"0123456", 3, 3, 3); + + SetTextTest(3, 7, L"", S_OK); + GetTextTest(0, -1, L"012", 3); + GetSelectionTest(3, 3); + SetInternalState(L"0123456", 3, 3, 3); + + SetTextTest(3, 8, L"", TS_E_INVALIDPOS); + + SetTextTest(6, 0, L"", TS_E_INVALIDPOS); + SetTextTest(6, 1, L"", TS_E_INVALIDPOS); + SetTextTest(6, 3, L"", TS_E_INVALIDPOS); + + SetTextTest(6, 6, L"", S_OK); + GetTextTest(0, -1, L"0123456", 7); + GetSelectionTest(6, 6); + SetInternalState(L"0123456", 3, 3, 3); + + SetTextTest(6, 7, L"", S_OK); + GetTextTest(0, -1, L"012345", 6); + GetSelectionTest(6, 6); + SetInternalState(L"0123456", 3, 3, 3); + + SetTextTest(6, 8, L"", TS_E_INVALIDPOS); + + SetTextTest(7, 0, L"", TS_E_INVALIDPOS); + SetTextTest(7, 1, L"", TS_E_INVALIDPOS); + SetTextTest(7, 3, L"", TS_E_INVALIDPOS); + SetTextTest(7, 6, L"", TS_E_INVALIDPOS); + + SetTextTest(7, 7, L"", S_OK); + GetTextTest(0, -1, L"0123456", 7); + GetSelectionTest(7, 7); + SetInternalState(L"0123456", 3, 3, 3); + + SetTextTest(7, 8, L"", TS_E_INVALIDPOS); + + SetInternalState(L"0123456", 3, 3, 3); + SetTextTest(3, 3, L"abc", S_OK); + GetTextTest(0, -1, L"012abc3456", 10); + GetSelectionTest(3, 6); + + SetInternalState(L"0123456", 3, 3, 3); + SetTextTest(3, 6, L"abc", S_OK); + GetTextTest(0, -1, L"012abc6", 7); + GetSelectionTest(3, 6); + + SetInternalState(L"0123456", 3, 3, 3); + SetTextTest(3, 7, L"abc", S_OK); + GetTextTest(0, -1, L"012abc", 6); + GetSelectionTest(3, 6); + + SetInternalState(L"0123456", 3, 3, 3); + SetTextTest(6, 6, L"abc", S_OK); + GetTextTest(0, -1, L"012345abc6", 10); + GetSelectionTest(6, 9); + + SetInternalState(L"0123456", 3, 3, 3); + SetTextTest(6, 7, L"abc", S_OK); + GetTextTest(0, -1, L"012345abc", 9); + GetSelectionTest(6, 9); + + SetInternalState(L"0123456", 3, 3, 3); + SetTextTest(7, 7, L"abc", S_OK); + GetTextTest(0, -1, L"0123456abc", 10); + GetSelectionTest(7, 10); + + return S_OK; + } + + private: + DISALLOW_COPY_AND_ASSIGN(SetGetTextTestCallback); +}; + +TEST_F(TSFTextStoreTest, SetGetTextTest) { + SetGetTextTestCallback callback(text_store_.get()); + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce(Invoke(&callback, &SetGetTextTestCallback::ReadLockGranted)) + .WillOnce( + Invoke(&callback, &SetGetTextTestCallback::ReadWriteLockGranted)); + + wchar_t buffer[1024] = {}; + ULONG text_buffer_copied = 0; + TS_RUNINFO run_info = {}; + ULONG run_info_buffer_copied = 0; + LONG next_acp = 0; + EXPECT_EQ(TF_E_NOLOCK, text_store_->GetText( + 0, -1, buffer, 1024, &text_buffer_copied, + &run_info, 1, &run_info_buffer_copied, &next_acp)); + TS_TEXTCHANGE change = {}; + EXPECT_EQ(TF_E_NOLOCK, text_store_->SetText(0, 0, 0, L"abc", 3, &change)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ, &result)); + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); +} + +class InsertTextAtSelectionTestCallback : public TSFTextStoreTestCallback { + public: + explicit InsertTextAtSelectionTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store) {} + + HRESULT ReadLockGranted(DWORD flags) { + const wchar_t kBuffer[] = L"0123456789"; + + SetInternalState(L"abcedfg", 0, 0, 0); + InsertTextAtSelectionQueryOnlyTest(kBuffer, 10, 0, 0); + GetSelectionTest(0, 0); + InsertTextAtSelectionQueryOnlyTest(kBuffer, 0, 0, 0); + + SetInternalState(L"abcedfg", 0, 2, 5); + InsertTextAtSelectionQueryOnlyTest(kBuffer, 10, 2, 5); + GetSelectionTest(2, 5); + InsertTextAtSelectionQueryOnlyTest(kBuffer, 0, 2, 5); + + LONG start = 0; + LONG end = 0; + TS_TEXTCHANGE change = {}; + EXPECT_EQ(TS_E_NOLOCK, text_store_->InsertTextAtSelection( + 0, kBuffer, 10, &start, &end, &change)); + return S_OK; + } + + HRESULT ReadWriteLockGranted(DWORD flags) { + SetInternalState(L"abcedfg", 0, 0, 0); + + const wchar_t kBuffer[] = L"0123456789"; + InsertTextAtSelectionQueryOnlyTest(kBuffer, 10, 0, 0); + GetSelectionTest(0, 0); + InsertTextAtSelectionQueryOnlyTest(kBuffer, 0, 0, 0); + + SetInternalState(L"", 0, 0, 0); + InsertTextAtSelectionTest(kBuffer, 10, 0, 10, 0, 0, 10); + GetSelectionTest(0, 10); + GetTextTest(0, -1, L"0123456789", 10); + + SetInternalState(L"abcedfg", 0, 0, 0); + InsertTextAtSelectionTest(kBuffer, 10, 0, 10, 0, 0, 10); + GetSelectionTest(0, 10); + GetTextTest(0, -1, L"0123456789abcedfg", 17); + + SetInternalState(L"abcedfg", 0, 0, 3); + InsertTextAtSelectionTest(kBuffer, 0, 0, 0, 0, 3, 0); + GetSelectionTest(0, 0); + GetTextTest(0, -1, L"edfg", 4); + + SetInternalState(L"abcedfg", 0, 3, 7); + InsertTextAtSelectionTest(kBuffer, 10, 3, 13, 3, 7, 13); + GetSelectionTest(3, 13); + GetTextTest(0, -1, L"abc0123456789", 13); + + SetInternalState(L"abcedfg", 0, 7, 7); + InsertTextAtSelectionTest(kBuffer, 10, 7, 17, 7, 7, 17); + GetSelectionTest(7, 17); + GetTextTest(0, -1, L"abcedfg0123456789", 17); + + return S_OK; + } + + private: + DISALLOW_COPY_AND_ASSIGN(InsertTextAtSelectionTestCallback); +}; + +TEST_F(TSFTextStoreTest, InsertTextAtSelectionTest) { + InsertTextAtSelectionTestCallback callback(text_store_.get()); + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce(Invoke(&callback, + &InsertTextAtSelectionTestCallback::ReadLockGranted)) + .WillOnce(Invoke( + &callback, &InsertTextAtSelectionTestCallback::ReadWriteLockGranted)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ, &result)); + EXPECT_EQ(S_OK, result); + result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(S_OK, result); +} + +class ScenarioTestCallback : public TSFTextStoreTestCallback { + public: + explicit ScenarioTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store) {} + + HRESULT LockGranted1(DWORD flags) { + SetSelectionTest(0, 0, S_OK); + + SetTextTest(0, 0, L"abc", S_OK); + SetTextTest(1, 2, L"xyz", S_OK); + + GetTextTest(0, -1, L"axyzc", 5); + + text_spans()->clear(); + ImeTextSpan text_span; + text_span.start_offset = 0; + text_span.end_offset = 5; + text_span.underline_color = SK_ColorBLACK; + text_span.thickness = ImeTextSpan::Thickness::kThin; + text_span.background_color = SK_ColorTRANSPARENT; + text_spans()->push_back(text_span); + *edit_flag() = true; + *committed_size() = 0; + return S_OK; + } + + void SetCompositionText1(const ui::CompositionText& composition) { + EXPECT_EQ(L"axyzc", composition.text); + EXPECT_EQ(1u, composition.selection.start()); + EXPECT_EQ(4u, composition.selection.end()); + ASSERT_EQ(1u, composition.ime_text_spans.size()); + EXPECT_EQ(SK_ColorBLACK, composition.ime_text_spans[0].underline_color); + EXPECT_EQ(SK_ColorTRANSPARENT, + composition.ime_text_spans[0].background_color); + EXPECT_EQ(0u, composition.ime_text_spans[0].start_offset); + EXPECT_EQ(5u, composition.ime_text_spans[0].end_offset); + EXPECT_EQ(ImeTextSpan::Thickness::kThin, + composition.ime_text_spans[0].thickness); + } + + HRESULT LockGranted2(DWORD flags) { + SetTextTest(3, 4, L"ZCP", S_OK); + GetTextTest(0, -1, L"axyZCPc", 7); + + text_spans()->clear(); + ImeTextSpan text_span; + text_span.start_offset = 3; + text_span.end_offset = 5; + text_span.underline_color = SK_ColorBLACK; + text_span.thickness = ImeTextSpan::Thickness::kThick; + text_spans()->push_back(text_span); + text_span.start_offset = 5; + text_span.end_offset = 7; + text_span.underline_color = SK_ColorBLACK; + text_span.thickness = ImeTextSpan::Thickness::kThin; + text_spans()->push_back(text_span); + + *edit_flag() = true; + *committed_size() = 3; + + return S_OK; + } + + void InsertText2(const base::string16& text) { EXPECT_EQ(L"axy", text); } + + void SetCompositionText2(const ui::CompositionText& composition) { + EXPECT_EQ(L"ZCPc", composition.text); + EXPECT_EQ(0u, composition.selection.start()); + EXPECT_EQ(3u, composition.selection.end()); + ASSERT_EQ(2u, composition.ime_text_spans.size()); + EXPECT_EQ(SK_ColorBLACK, composition.ime_text_spans[0].underline_color); + EXPECT_EQ(0u, composition.ime_text_spans[0].start_offset); + EXPECT_EQ(2u, composition.ime_text_spans[0].end_offset); + EXPECT_EQ(ImeTextSpan::Thickness::kThick, + composition.ime_text_spans[0].thickness); + EXPECT_EQ(SK_ColorBLACK, composition.ime_text_spans[1].underline_color); + EXPECT_EQ(2u, composition.ime_text_spans[1].start_offset); + EXPECT_EQ(4u, composition.ime_text_spans[1].end_offset); + EXPECT_EQ(ImeTextSpan::Thickness::kThin, + composition.ime_text_spans[1].thickness); + } + + HRESULT LockGranted3(DWORD flags) { + GetTextTest(0, -1, L"axyZCPc", 7); + + text_spans()->clear(); + *edit_flag() = true; + *committed_size() = 7; + + return S_OK; + } + + void InsertText3(const base::string16& text) { EXPECT_EQ(L"ZCPc", text); } + + void SetCompositionText3(const ui::CompositionText& composition) { + EXPECT_EQ(L"", composition.text); + EXPECT_EQ(0u, composition.selection.start()); + EXPECT_EQ(0u, composition.selection.end()); + EXPECT_EQ(0u, composition.ime_text_spans.size()); + } + + private: + DISALLOW_COPY_AND_ASSIGN(ScenarioTestCallback); +}; + +TEST_F(TSFTextStoreTest, ScenarioTest) { + ScenarioTestCallback callback(text_store_.get()); + EXPECT_CALL(text_input_client_, SetCompositionText(_)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::SetCompositionText1)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::SetCompositionText2)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::SetCompositionText3)); + + EXPECT_CALL(text_input_client_, InsertText(_)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::InsertText2)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::InsertText3)); + + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::LockGranted1)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::LockGranted2)) + .WillOnce(Invoke(&callback, &ScenarioTestCallback::LockGranted3)); + + // OnSelectionChange will be called once after LockGranted3(). + EXPECT_CALL(*sink_, OnSelectionChange()).WillOnce(Return(S_OK)); + + // OnLayoutChange will be called once after LockGranted3(). + EXPECT_CALL(*sink_, OnLayoutChange(_, _)).WillOnce(Return(S_OK)); + + // OnTextChange will be called once after LockGranted3(). + EXPECT_CALL(*sink_, OnTextChange(_, _)).WillOnce(Return(S_OK)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(S_OK, result); + result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(S_OK, result); + result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READWRITE, &result)); + EXPECT_EQ(S_OK, result); +} + +class GetTextExtTestCallback : public TSFTextStoreTestCallback { + public: + explicit GetTextExtTestCallback(TSFTextStore* text_store) + : TSFTextStoreTestCallback(text_store), + layout_prepared_character_num_(0) {} + + HRESULT LockGranted(DWORD flags) { + SetInternalState(L"0123456789012", 0, 0, 0); + layout_prepared_character_num_ = 13; + + TsViewCookie view_cookie = 0; + EXPECT_EQ(S_OK, text_store_->GetActiveView(&view_cookie)); + GetTextExtTest(view_cookie, 0, 0, 11, 12, 11, 20); + GetTextExtTest(view_cookie, 0, 1, 11, 12, 20, 20); + GetTextExtTest(view_cookie, 0, 2, 11, 12, 30, 20); + GetTextExtTest(view_cookie, 9, 9, 100, 12, 100, 20); + GetTextExtTest(view_cookie, 9, 10, 101, 12, 110, 20); + GetTextExtTest(view_cookie, 10, 10, 110, 12, 110, 20); + GetTextExtTest(view_cookie, 11, 11, 20, 112, 20, 120); + GetTextExtTest(view_cookie, 11, 12, 21, 112, 30, 120); + GetTextExtTest(view_cookie, 9, 12, 101, 12, 30, 120); + GetTextExtTest(view_cookie, 9, 13, 101, 12, 40, 120); + GetTextExtTest(view_cookie, 0, 13, 11, 12, 40, 120); + GetTextExtTest(view_cookie, 13, 13, 40, 112, 40, 120); + + layout_prepared_character_num_ = 12; + GetTextExtNoLayoutTest(view_cookie, 13, 13); + + layout_prepared_character_num_ = 0; + GetTextExtNoLayoutTest(view_cookie, 0, 0); + + SetInternalState(L"", 0, 0, 0); + GetTextExtTest(view_cookie, 0, 0, 1, 2, 4, 6); + + // Last character is not availabe due to timing issue of async API. + // In this case, we will get first character bounds instead of whole text + // bounds. + SetInternalState(L"abc", 0, 0, 3); + layout_prepared_character_num_ = 2; + GetTextExtTest(view_cookie, 0, 0, 11, 12, 11, 20); + + // TODO(nona, kinaba): Remove following test case after PPAPI supporting + // GetCompositionCharacterBounds. + SetInternalState(L"a", 0, 0, 1); + layout_prepared_character_num_ = 0; + GetTextExtTest(view_cookie, 0, 1, 1, 2, 4, 6); + return S_OK; + } + + bool GetCompositionCharacterBounds(uint32_t index, gfx::Rect* rect) { + if (index >= layout_prepared_character_num_) + return false; + rect->set_x((index % 10) * 10 + 11); + rect->set_y((index / 10) * 100 + 12); + rect->set_width(9); + rect->set_height(8); + return true; + } + + gfx::Rect GetCaretBounds() { return gfx::Rect(1, 2, 3, 4); } + + private: + uint32_t layout_prepared_character_num_; + + DISALLOW_COPY_AND_ASSIGN(GetTextExtTestCallback); +}; + +TEST_F(TSFTextStoreTest, GetTextExtTest) { + GetTextExtTestCallback callback(text_store_.get()); + EXPECT_CALL(text_input_client_, GetCaretBounds()) + .WillRepeatedly( + Invoke(&callback, &GetTextExtTestCallback::GetCaretBounds)); + + EXPECT_CALL(text_input_client_, GetCompositionCharacterBounds(_, _)) + .WillRepeatedly(Invoke( + &callback, &GetTextExtTestCallback::GetCompositionCharacterBounds)); + + EXPECT_CALL(*sink_, OnLockGranted(_)) + .WillOnce(Invoke(&callback, &GetTextExtTestCallback::LockGranted)); + + HRESULT result = kInvalidResult; + EXPECT_EQ(S_OK, text_store_->RequestLock(TS_LF_READ, &result)); + EXPECT_EQ(S_OK, result); +} + +TEST_F(TSFTextStoreTest, RequestSupportedAttrs) { + EXPECT_CALL(text_input_client_, GetTextInputType()) + .WillRepeatedly(Return(TEXT_INPUT_TYPE_TEXT)); + EXPECT_CALL(text_input_client_, GetTextInputMode()) + .WillRepeatedly(Return(TEXT_INPUT_MODE_DEFAULT)); + + EXPECT_HRESULT_FAILED(text_store_->RequestSupportedAttrs(0, 1, nullptr)); + + const TS_ATTRID kUnknownAttributes[] = {GUID_NULL}; + EXPECT_HRESULT_FAILED(text_store_->RequestSupportedAttrs( + 0, arraysize(kUnknownAttributes), kUnknownAttributes)) + << "Must fail for unknown attributes"; + + const TS_ATTRID kAttributes[] = {GUID_NULL, GUID_PROP_INPUTSCOPE, GUID_NULL}; + EXPECT_EQ(S_OK, text_store_->RequestSupportedAttrs(0, arraysize(kAttributes), + kAttributes)) + << "InputScope must be supported"; + + { + SCOPED_TRACE("Check if RequestSupportedAttrs fails while focus is lost"); + // Emulate focus lost + text_store_->SetFocusedTextInputClient(nullptr, nullptr); + EXPECT_HRESULT_FAILED(text_store_->RequestSupportedAttrs(0, 0, nullptr)); + EXPECT_HRESULT_FAILED(text_store_->RequestSupportedAttrs( + 0, arraysize(kAttributes), kAttributes)); + } +} + +TEST_F(TSFTextStoreTest, RetrieveRequestedAttrs) { + EXPECT_CALL(text_input_client_, GetTextInputType()) + .WillRepeatedly(Return(TEXT_INPUT_TYPE_TEXT)); + EXPECT_CALL(text_input_client_, GetTextInputMode()) + .WillRepeatedly(Return(TEXT_INPUT_MODE_DEFAULT)); + + ULONG num_copied = 0xfffffff; + EXPECT_HRESULT_FAILED( + text_store_->RetrieveRequestedAttrs(1, nullptr, &num_copied)); + + { + SCOPED_TRACE("Make sure if InputScope is supported"); + TS_ATTRVAL buffer[2] = {}; + num_copied = 0xfffffff; + ASSERT_EQ(S_OK, text_store_->RetrieveRequestedAttrs(arraysize(buffer), + buffer, &num_copied)); + bool input_scope_found = false; + for (size_t i = 0; i < num_copied; ++i) { + base::win::ScopedVariant variant; + // Move ownership from |buffer[i].varValue| to |variant|. + std::swap(*variant.Receive(), buffer[i].varValue); + if (IsEqualGUID(buffer[i].idAttr, GUID_PROP_INPUTSCOPE)) { + EXPECT_EQ(VT_UNKNOWN, variant.type()); + Microsoft::WRL::ComPtr<ITfInputScope> input_scope; + EXPECT_HRESULT_SUCCEEDED(variant.AsInput()->punkVal->QueryInterface( + IID_PPV_ARGS(&input_scope))); + input_scope_found = true; + // we do not break here to clean up all the retrieved VARIANTs. + } + } + EXPECT_TRUE(input_scope_found); + } + { + SCOPED_TRACE("Check if RetrieveRequestedAttrs fails while focus is lost"); + // Emulate focus lost + text_store_->SetFocusedTextInputClient(nullptr, nullptr); + num_copied = 0xfffffff; + TS_ATTRVAL buffer[2] = {}; + EXPECT_HRESULT_FAILED(text_store_->RetrieveRequestedAttrs( + arraysize(buffer), buffer, &num_copied)); + } +} + +} // namespace +} // namespace ui
diff --git a/ui/base/ui_base_features.cc b/ui/base/ui_base_features.cc index 2ff84fc..3644927d 100644 --- a/ui/base/ui_base_features.cc +++ b/ui/base/ui_base_features.cc
@@ -14,7 +14,7 @@ // Enables the floating virtual keyboard behavior. const base::Feature kEnableFloatingVirtualKeyboard = { - "enable-floating-virtual-keyboard", base::FEATURE_DISABLED_BY_DEFAULT}; + "enable-floating-virtual-keyboard", base::FEATURE_ENABLED_BY_DEFAULT}; // Applies the material design mode to elements throughout Chrome (not just top // Chrome). @@ -45,6 +45,9 @@ // Enables using WM_POINTER instead of WM_TOUCH for touch events. const base::Feature kPointerEventsForTouch = {"PointerEventsForTouch", base::FEATURE_ENABLED_BY_DEFAULT}; +// Enables using TSF (over IMM32) for IME. +const base::Feature kTSFImeSupport = {"TSFImeSupport", + base::FEATURE_DISABLED_BY_DEFAULT}; bool IsUsingWMPointerForTouch() { return base::win::GetVersion() >= base::win::VERSION_WIN8 &&
diff --git a/ui/base/ui_base_features.h b/ui/base/ui_base_features.h index c7d20168e..725692d 100644 --- a/ui/base/ui_base_features.h +++ b/ui/base/ui_base_features.h
@@ -23,6 +23,7 @@ UI_BASE_EXPORT extern const base::Feature kDirectManipulationStylus; UI_BASE_EXPORT extern const base::Feature kPointerEventsForTouch; UI_BASE_EXPORT extern const base::Feature kPrecisionTouchpad; +UI_BASE_EXPORT extern const base::Feature kTSFImeSupport; // Returns true if the system should use WM_POINTER events for touch events. UI_BASE_EXPORT bool IsUsingWMPointerForTouch();
diff --git a/ui/file_manager/file_manager/foreground/css/file_manager.css b/ui/file_manager/file_manager/foreground/css/file_manager.css index 4f63438..420ce58f 100644 --- a/ui/file_manager/file_manager/foreground/css/file_manager.css +++ b/ui/file_manager/file_manager/foreground/css/file_manager.css
@@ -25,6 +25,7 @@ html { height: 100%; + overflow: hidden; } html.col-resize * {
diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn index 9c38caf..d268ffd 100644 --- a/ui/gfx/BUILD.gn +++ b/ui/gfx/BUILD.gn
@@ -4,7 +4,7 @@ import("//build/config/jumbo.gni") import("//build/config/ui.gni") -import("//device/vr/features/features.gni") +import("//device/vr/buildflags/buildflags.gni") import("//testing/test.gni") import("//testing/libfuzzer/fuzzer_test.gni") @@ -59,6 +59,8 @@ "color_utils.h", "decorated_text.cc", "decorated_text.h", + "decorated_text_mac.h", + "decorated_text_mac.mm", "favicon_size.cc", "favicon_size.h", "font.cc", @@ -250,7 +252,7 @@ "//base:base_static", "//base:i18n", "//base/third_party/dynamic_annotations", - "//device/vr/features", + "//device/vr/buildflags", "//skia", "//third_party/zlib", ]
diff --git a/ui/gfx/DEPS b/ui/gfx/DEPS index 808d12b..1fa6347 100644 --- a/ui/gfx/DEPS +++ b/ui/gfx/DEPS
@@ -2,7 +2,7 @@ "+base", "+cc/base", "+cc/paint", - "+device/vr/features/features.h", + "+device/vr/buildflags/buildflags.h", "+skia/ext", "+third_party/harfbuzz-ng", "+third_party/skia",
diff --git a/ui/gfx/decorated_text_mac.h b/ui/gfx/decorated_text_mac.h new file mode 100644 index 0000000..ad1aa59 --- /dev/null +++ b/ui/gfx/decorated_text_mac.h
@@ -0,0 +1,22 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_GFX_DECORATED_TEXT_MAC_H_ +#define UI_GFX_DECORATED_TEXT_MAC_H_ + +#include "ui/gfx/gfx_export.h" + +@class NSAttributedString; + +namespace gfx { + +struct DecoratedText; + +// Returns a NSAttributedString from |decorated_text|. +GFX_EXPORT NSAttributedString* GetAttributedStringFromDecoratedText( + const DecoratedText& decorated_text); + +} // namespace gfx + +#endif // UI_GFX_DECORATED_TEXT_MAC_H_ \ No newline at end of file
diff --git a/ui/gfx/decorated_text_mac.mm b/ui/gfx/decorated_text_mac.mm new file mode 100644 index 0000000..80942a61 --- /dev/null +++ b/ui/gfx/decorated_text_mac.mm
@@ -0,0 +1,51 @@ +// Copyright 2018 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ui/gfx/decorated_text_mac.h" + +#import <Cocoa/Cocoa.h> + +#import "base/mac/scoped_nsobject.h" +#include "base/strings/sys_string_conversions.h" +#include "ui/gfx/decorated_text.h" + +namespace gfx { + +NSAttributedString* GetAttributedStringFromDecoratedText( + const DecoratedText& decorated_text) { + base::scoped_nsobject<NSMutableAttributedString> str( + [[NSMutableAttributedString alloc] + initWithString:base::SysUTF16ToNSString(decorated_text.text)]); + [str beginEditing]; + + NSValue* const line_style = + @(NSUnderlineStyleSingle | NSUnderlinePatternSolid); + + for (const auto& attribute : decorated_text.attributes) { + DCHECK(!attribute.range.is_reversed()); + DCHECK_LE(attribute.range.end(), [str length]); + + NSMutableDictionary* attrs = [NSMutableDictionary dictionary]; + NSRange range = attribute.range.ToNSRange(); + + if (attribute.font.GetNativeFont()) + attrs[NSFontAttributeName] = attribute.font.GetNativeFont(); + + // NSFont does not have underline as an attribute. Hence handle it + // separately. + const bool underline = attribute.font.GetStyle() & gfx::Font::UNDERLINE; + if (underline) + attrs[NSUnderlineStyleAttributeName] = line_style; + + if (attribute.strike) + attrs[NSStrikethroughStyleAttributeName] = line_style; + + [str setAttributes:attrs range:range]; + } + + [str endEditing]; + return str.autorelease(); +} + +} // namespace gfx
diff --git a/ui/gfx/font_render_params.h b/ui/gfx/font_render_params.h index 39d72e3..8cda96de 100644 --- a/ui/gfx/font_render_params.h +++ b/ui/gfx/font_render_params.h
@@ -9,7 +9,7 @@ #include <vector> #include "build/build_config.h" -#include "device/vr/features/features.h" +#include "device/vr/buildflags/buildflags.h" #include "third_party/skia/include/core/SkFontLCDConfig.h" #include "ui/gfx/font.h" #include "ui/gfx/gfx_export.h"
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index 3d706df..ac61b2d 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc
@@ -973,9 +973,9 @@ return offset; } -bool RenderText::GetDecoratedWordAtPoint(const Point& point, - DecoratedText* decorated_word, - Point* baseline_point) { +bool RenderText::GetWordLookupDataAtPoint(const Point& point, + DecoratedText* decorated_word, + Point* baseline_point) { if (obscured()) return false; @@ -990,9 +990,16 @@ DCHECK(!word_range.is_reversed()); DCHECK(!word_range.is_empty()); - const std::vector<Rect> word_bounds = GetSubstringBounds(word_range); - if (word_bounds.empty() || - !GetDecoratedTextForRange(word_range, decorated_word)) { + return GetLookupDataForRange(word_range, decorated_word, baseline_point); +} + +bool RenderText::GetLookupDataForRange(const Range& range, + DecoratedText* decorated_text, + Point* baseline_point) { + EnsureLayout(); + + const std::vector<Rect> word_bounds = GetSubstringBounds(range); + if (word_bounds.empty() || !GetDecoratedTextForRange(range, decorated_text)) { return false; }
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h index 47fa4c6..b17fadb3 100644 --- a/ui/gfx/render_text.h +++ b/ui/gfx/render_text.h
@@ -507,9 +507,19 @@ // at the point, returns a nearby word. |baseline_point| should correspond to // the baseline point of the leftmost glyph of the |word| in the view's // coordinates. Returns false, if no word can be retrieved. - bool GetDecoratedWordAtPoint(const Point& point, - DecoratedText* decorated_word, - Point* baseline_point); + bool GetWordLookupDataAtPoint(const Point& point, + DecoratedText* decorated_word, + Point* baseline_point); + + // Retrieves the text at |range| along with its styling information. + // |baseline_point| should correspond to the baseline point of + // the leftmost glyph of the text in the view's coordinates. If the text + // spans multiple lines, |baseline_point| will correspond with the leftmost + // glyph on the first line in the range. Returns false, if no text can be + // retrieved. + bool GetLookupDataForRange(const Range& range, + DecoratedText* decorated_text, + Point* baseline_point); // Retrieves the text in the given |range|. base::string16 GetTextFromRange(const Range& range) const;
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index 5a47cee..ee8ac5b 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc
@@ -4574,9 +4574,9 @@ EXPECT_FALSE(GetRendererPaint().isLCDRenderText()); } -// Verify GetDecoratedWordAtPoint returns the correct baseline point and +// Verify GetWordLookupDataAtPoint returns the correct baseline point and // decorated word for an LTR string. -TEST_P(RenderTextHarfBuzzTest, GetDecoratedWordAtPoint_LTR) { +TEST_P(RenderTextHarfBuzzTest, GetWordLookupDataAtPoint_LTR) { const base::string16 ltr = UTF8ToUTF16(" ab c "); const int kWordOneStartIndex = 2; const int kWordTwoStartIndex = 6; @@ -4621,14 +4621,14 @@ { SCOPED_TRACE(base::StringPrintf("Query to the left of text bounds")); - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( Point(-5, cursor_y), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); } { SCOPED_TRACE(base::StringPrintf("Query to the right of text bounds")); - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( Point(105, cursor_y), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); @@ -4641,8 +4641,8 @@ render_text->GetCursorBounds(SelectionModel(i, CURSOR_FORWARD), false) .origin(); - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, - &baseline_point)); + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint(query, &decorated_word, + &baseline_point)); if (i < kWordTwoStartIndex) { VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); @@ -4654,9 +4654,9 @@ } } -// Verify GetDecoratedWordAtPoint returns the correct baseline point and +// Verify GetWordLookupDataAtPoint returns the correct baseline point and // decorated word for an RTL string. -TEST_P(RenderTextHarfBuzzTest, GetDecoratedWordAtPoint_RTL) { +TEST_P(RenderTextHarfBuzzTest, GetWordLookupDataAtPoint_RTL) { const base::string16 rtl = UTF8ToUTF16(" \u0634\u0632 \u0634"); const int kWordOneStartIndex = 1; const int kWordTwoStartIndex = 5; @@ -4699,14 +4699,14 @@ { SCOPED_TRACE(base::StringPrintf("Query to the left of text bounds")); - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( Point(-5, cursor_y), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); } { SCOPED_TRACE(base::StringPrintf("Query to the right of text bounds")); - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( Point(105, cursor_y), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); @@ -4721,8 +4721,8 @@ render_text->GetCursorBounds(SelectionModel(i, CURSOR_FORWARD), false) .top_right(); - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, - &baseline_point)); + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint(query, &decorated_word, + &baseline_point)); if (i < kWordTwoStartIndex) { VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); @@ -4733,8 +4733,8 @@ } } -// Test that GetDecoratedWordAtPoint behaves correctly for multiline text. -TEST_P(RenderTextHarfBuzzTest, GetDecoratedWordAtPoint_Multiline) { +// Test that GetWordLookupDataAtPoint behaves correctly for multiline text. +TEST_P(RenderTextHarfBuzzTest, GetWordLookupDataAtPoint_Multiline) { const base::string16 text = UTF8ToUTF16("a b\n..\ncd."); const size_t kWordOneIndex = 0; // Index of character 'a'. const size_t kWordTwoIndex = 2; // Index of character 'b'. @@ -4784,36 +4784,36 @@ Point baseline_point; { // Query to the left of the first line. - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( Point(-5, GetCursorYForTesting(0)), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); } { // Query on the second line. - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( Point(5, GetCursorYForTesting(1)), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); } { // Query at the center point of the character 'c'. - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( left_glyph_word_3.CenterPoint(), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_3, decorated_word); EXPECT_TRUE(left_glyph_word_3.Contains(baseline_point)); } { // Query to the right of the third line. - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint( + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint( Point(505, GetCursorYForTesting(2)), &decorated_word, &baseline_point)); VerifyDecoratedWordsAreEqual(expected_word_3, decorated_word); EXPECT_TRUE(left_glyph_word_3.Contains(baseline_point)); } } -// Verify the boolean return value of GetDecoratedWordAtPoint. -TEST_P(RenderTextHarfBuzzTest, GetDecoratedWordAtPoint_Return) { +// Verify the boolean return value of GetWordLookupDataAtPoint. +TEST_P(RenderTextHarfBuzzTest, GetWordLookupDataAtPoint_Return) { RenderText* render_text = GetRenderText(); render_text->SetText(UTF8ToUTF16("...")); @@ -4824,21 +4824,90 @@ Point query = render_text->GetCursorBounds(SelectionModel(0, CURSOR_FORWARD), false) .origin(); - EXPECT_FALSE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, - &baseline_point)); + EXPECT_FALSE(render_text->GetWordLookupDataAtPoint(query, &decorated_word, + &baseline_point)); render_text->SetText(UTF8ToUTF16("abc")); query = render_text->GetCursorBounds(SelectionModel(0, CURSOR_FORWARD), false) .origin(); - EXPECT_TRUE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, - &baseline_point)); + EXPECT_TRUE(render_text->GetWordLookupDataAtPoint(query, &decorated_word, + &baseline_point)); // False should be returned for obscured text. render_text->SetObscured(true); query = render_text->GetCursorBounds(SelectionModel(0, CURSOR_FORWARD), false) .origin(); - EXPECT_FALSE(render_text->GetDecoratedWordAtPoint(query, &decorated_word, - &baseline_point)); + EXPECT_FALSE(render_text->GetWordLookupDataAtPoint(query, &decorated_word, + &baseline_point)); +} + +// Test that GetLookupDataAtPoint behaves correctly when the range spans lines. +TEST_P(RenderTextHarfBuzzTest, GetLookupDataAtRange_Multiline) { + const base::string16 text = UTF8ToUTF16("a\nb"); + constexpr Range kWordOneRange = Range(0, 1); // Range of character 'a'. + constexpr Range kWordTwoRange = Range(2, 3); // Range of character 'b'. + constexpr Range kTextRange = Range(0, 3); // Range of the entire text. + + // Set up render text. Apply style ranges so that each character index gets + // a corresponding font. + RenderText* render_text = GetRenderText(); + render_text->SetMultiline(true); + render_text->SetDisplayRect(Rect(500, 500)); + render_text->SetText(text); + render_text->ApplyWeight(Font::Weight::SEMIBOLD, kWordOneRange); + render_text->ApplyStyle(UNDERLINE, true, kWordTwoRange); + + // Set up test expectations. + const std::vector<RenderText::FontSpan> font_spans = + render_text->GetFontSpansForTesting(); + + DecoratedText expected_word_1; + expected_word_1.text = UTF8ToUTF16("a"); + expected_word_1.attributes.push_back(CreateRangedAttribute( + font_spans, 0, kWordOneRange.start(), Font::Weight::SEMIBOLD, 0)); + const Rect left_glyph_word_1 = GetSubstringBoundsUnion(kWordOneRange); + + DecoratedText expected_word_2; + expected_word_2.text = UTF8ToUTF16("b"); + expected_word_2.attributes.push_back( + CreateRangedAttribute(font_spans, 0, kWordTwoRange.start(), + Font::Weight::NORMAL, UNDERLINE_MASK)); + const Rect left_glyph_word_2 = GetSubstringBoundsUnion(kWordTwoRange); + + DecoratedText expected_entire_text; + expected_entire_text.text = UTF8ToUTF16("a\nb"); + expected_entire_text.attributes.push_back( + CreateRangedAttribute(font_spans, kWordOneRange.start(), + kWordOneRange.start(), Font::Weight::SEMIBOLD, 0)); + expected_entire_text.attributes.push_back( + CreateRangedAttribute(font_spans, 1, 1, Font::Weight::NORMAL, 0)); + expected_entire_text.attributes.push_back(CreateRangedAttribute( + font_spans, kWordTwoRange.start(), kWordTwoRange.start(), + Font::Weight::NORMAL, UNDERLINE_MASK)); + + DecoratedText decorated_word; + Point baseline_point; + { + // Query for the range of the first word. + EXPECT_TRUE(render_text->GetLookupDataForRange( + kWordOneRange, &decorated_word, &baseline_point)); + VerifyDecoratedWordsAreEqual(expected_word_1, decorated_word); + EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); + } + { + // Query for the range of the second word. + EXPECT_TRUE(render_text->GetLookupDataForRange( + kWordTwoRange, &decorated_word, &baseline_point)); + VerifyDecoratedWordsAreEqual(expected_word_2, decorated_word); + EXPECT_TRUE(left_glyph_word_2.Contains(baseline_point)); + } + { + // Query the entire text range. + EXPECT_TRUE(render_text->GetLookupDataForRange(kTextRange, &decorated_word, + &baseline_point)); + VerifyDecoratedWordsAreEqual(expected_entire_text, decorated_word); + EXPECT_TRUE(left_glyph_word_1.Contains(baseline_point)); + } } // Tests text selection made at end points of individual lines of multiline
diff --git a/ui/login/display_manager.js b/ui/login/display_manager.js index 3102fbf..b04db12a 100644 --- a/ui/login/display_manager.js +++ b/ui/login/display_manager.js
@@ -14,6 +14,7 @@ /** @const */ var SCREEN_OOBE_UPDATE = 'update'; /** @const */ var SCREEN_OOBE_RESET = 'reset'; /** @const */ var SCREEN_OOBE_ENROLLMENT = 'oauth-enrollment'; +/** @const */ var SCREEN_OOBE_DEMO_SETUP = 'demo-setup'; /** @const */ var SCREEN_OOBE_KIOSK_ENABLE = 'kiosk-enable'; /** @const */ var SCREEN_OOBE_AUTO_ENROLLMENT_CHECK = 'auto-enrollment-check'; /** @const */ var SCREEN_GAIA_SIGNIN = 'gaia-signin'; @@ -57,6 +58,7 @@ 'app_launch_network_config'; /** @const */ var ACCELERATOR_BOOTSTRAPPING_SLAVE = "bootstrapping_slave"; /** @const */ var ACCELERATOR_DEMO_MODE = "demo_mode"; +/** @const */ var ACCELERATOR_SEND_FEEDBACK = "send_feedback"; /* Signin UI state constants. Used to control header bar UI. */ /** @const */ var SIGNIN_UI_STATE = { @@ -446,6 +448,8 @@ -1) { chrome.send('setupDemoMode'); } + } else if (name == ACCELERATOR_SEND_FEEDBACK) { + chrome.send('sendFeedback'); } },
diff --git a/ui/message_center/public/mojo/BUILD.gn b/ui/message_center/public/mojo/BUILD.gn index d6aaf83..59d1d2b 100644 --- a/ui/message_center/public/mojo/BUILD.gn +++ b/ui/message_center/public/mojo/BUILD.gn
@@ -12,6 +12,7 @@ public_deps = [ "//mojo/common:common_custom_types", + "//mojo/public/mojom/base", "//ui/gfx/image/mojo:interfaces", "//url/mojom:url_mojom_gurl", ]
diff --git a/ui/views/animation/ink_drop.h b/ui/views/animation/ink_drop.h index 0664440..3569e01 100644 --- a/ui/views/animation/ink_drop.h +++ b/ui/views/animation/ink_drop.h
@@ -36,11 +36,12 @@ // Animates from the current InkDropState to |ink_drop_state|. virtual void AnimateToState(InkDropState ink_drop_state) = 0; - // Immediately snaps the InkDropState to ACTIVATED. This more specific - // implementation of the non-existent SnapToState(InkDropState) function is - // the only one available because it was the only InkDropState that clients - // needed to skip animations for. + // Immediately snaps the InkDropState to ACTIVATED and HIDDEN specifically. + // These are more specific implementations of the non-existent + // SnapToState(InkDropState) function are the only ones available because they + // were the only InkDropState that clients needed to skip animations for. virtual void SnapToActivated() = 0; + virtual void SnapToHidden() = 0; // Enables or disables the hover state. virtual void SetHovered(bool is_hovered) = 0;
diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc index 3a23786e..5a769f05 100644 --- a/ui/views/animation/ink_drop_host_view.cc +++ b/ui/views/animation/ink_drop_host_view.cc
@@ -226,7 +226,7 @@ // If we're being removed hide the ink-drop so if we're highlighted now the // highlight won't be active if we're added back again. if (!details.is_add && details.child == this && ink_drop_) { - GetInkDrop()->AnimateToState(InkDropState::HIDDEN); + GetInkDrop()->SnapToHidden(); GetInkDrop()->SetHovered(false); } View::ViewHierarchyChanged(details);
diff --git a/ui/views/animation/ink_drop_impl.cc b/ui/views/animation/ink_drop_impl.cc index 5841c78..f052e38 100644 --- a/ui/views/animation/ink_drop_impl.cc +++ b/ui/views/animation/ink_drop_impl.cc
@@ -343,7 +343,7 @@ // TODO(bruthig): Investigate if the animation framework can address this // issue instead. See https://crbug.com/663335. if (GetInkDrop()->ink_drop_ripple_) - GetInkDrop()->ink_drop_ripple_->HideImmediately(); + GetInkDrop()->ink_drop_ripple_->SnapToHidden(); GetInkDrop()->SetHighlightState( state_factory()->CreateVisibleState(base::TimeDelta(), false)); } @@ -647,6 +647,13 @@ ink_drop_ripple_->SnapToActivated(); } +void InkDropImpl::SnapToHidden() { + DestroyHiddenTargetedAnimations(); + if (!ink_drop_ripple_) + return; + ink_drop_ripple_->SnapToHidden(); +} + void InkDropImpl::SetHovered(bool is_hovered) { is_hovered_ = is_hovered; highlight_state_->OnHoverChanged();
diff --git a/ui/views/animation/ink_drop_impl.h b/ui/views/animation/ink_drop_impl.h index 47dd80a..98ec237 100644 --- a/ui/views/animation/ink_drop_impl.h +++ b/ui/views/animation/ink_drop_impl.h
@@ -66,6 +66,7 @@ InkDropState GetTargetInkDropState() const override; void AnimateToState(InkDropState ink_drop_state) override; void SnapToActivated() override; + void SnapToHidden() override; void SetHovered(bool is_hovered) override; void SetFocused(bool is_focused) override; bool IsHighlightFadingInOrVisible() const override;
diff --git a/ui/views/animation/ink_drop_ripple.cc b/ui/views/animation/ink_drop_ripple.cc index f6360a8..ea16770 100644 --- a/ui/views/animation/ink_drop_ripple.cc +++ b/ui/views/animation/ink_drop_ripple.cc
@@ -91,7 +91,7 @@ return GetRootLayer()->visible(); } -void InkDropRipple::HideImmediately() { +void InkDropRipple::SnapToHidden() { AbortAllAnimations(); SetStateToHidden(); target_ink_drop_state_ = InkDropState::HIDDEN;
diff --git a/ui/views/animation/ink_drop_ripple.h b/ui/views/animation/ink_drop_ripple.h index 6f05f7f6..645abff 100644 --- a/ui/views/animation/ink_drop_ripple.h +++ b/ui/views/animation/ink_drop_ripple.h
@@ -70,7 +70,7 @@ // // NOTE: This will NOT raise Animation(Started|Ended) events for the state // transition to HIDDEN! - void HideImmediately(); + void SnapToHidden(); // Immediately snaps the ink drop to the ACTIVATED target state. All pending // animations are aborted. Events will be raised for the pending animations
diff --git a/ui/views/animation/ink_drop_ripple_unittest.cc b/ui/views/animation/ink_drop_ripple_unittest.cc index 2bb5077..0184bc4c 100644 --- a/ui/views/animation/ink_drop_ripple_unittest.cc +++ b/ui/views/animation/ink_drop_ripple_unittest.cc
@@ -250,7 +250,7 @@ ink_drop_ripple_->target_ink_drop_state()); } -TEST_P(InkDropRippleTest, HideImmediatelyWithoutActiveAnimations) { +TEST_P(InkDropRippleTest, SnapToHiddenWithoutActiveAnimations) { ink_drop_ripple_->AnimateToState(views::InkDropState::ACTION_PENDING); test_api_->CompleteAnimations(); EXPECT_EQ(1, observer_.last_animation_started_ordinal()); @@ -259,7 +259,7 @@ EXPECT_FALSE(test_api_->HasActiveAnimations()); EXPECT_NE(InkDropState::HIDDEN, ink_drop_ripple_->target_ink_drop_state()); - ink_drop_ripple_->HideImmediately(); + ink_drop_ripple_->SnapToHidden(); EXPECT_FALSE(test_api_->HasActiveAnimations()); EXPECT_EQ(views::InkDropState::HIDDEN, @@ -272,8 +272,8 @@ } // Verifies all active animations are aborted and the InkDropState is set to -// HIDDEN after invoking HideImmediately(). -TEST_P(InkDropRippleTest, HideImmediatelyWithActiveAnimations) { +// HIDDEN after invoking SnapToHidden(). +TEST_P(InkDropRippleTest, SnapToHiddenWithActiveAnimations) { // TODO(bruthig): Re-enable! For some reason these tests fail on some win // trunk builds. See crbug.com/731811. if (!gfx::Animation::ShouldRenderRichAnimation()) @@ -284,7 +284,7 @@ EXPECT_NE(InkDropState::HIDDEN, ink_drop_ripple_->target_ink_drop_state()); EXPECT_EQ(1, observer_.last_animation_started_ordinal()); - ink_drop_ripple_->HideImmediately(); + ink_drop_ripple_->SnapToHidden(); EXPECT_FALSE(test_api_->HasActiveAnimations()); EXPECT_EQ(views::InkDropState::HIDDEN,
diff --git a/ui/views/animation/ink_drop_stub.cc b/ui/views/animation/ink_drop_stub.cc index 2883d89..9a8237b 100644 --- a/ui/views/animation/ink_drop_stub.cc +++ b/ui/views/animation/ink_drop_stub.cc
@@ -20,6 +20,8 @@ void InkDropStub::SnapToActivated() {} +void InkDropStub::SnapToHidden() {} + void InkDropStub::SetHovered(bool is_hovered) {} void InkDropStub::SetFocused(bool is_hovered) {}
diff --git a/ui/views/animation/ink_drop_stub.h b/ui/views/animation/ink_drop_stub.h index f9f6e72..86ed882 100644 --- a/ui/views/animation/ink_drop_stub.h +++ b/ui/views/animation/ink_drop_stub.h
@@ -23,6 +23,7 @@ InkDropState GetTargetInkDropState() const override; void AnimateToState(InkDropState state) override; void SnapToActivated() override; + void SnapToHidden() override; void SetHovered(bool is_hovered) override; void SetFocused(bool is_hovered) override; bool IsHighlightFadingInOrVisible() const override;
diff --git a/ui/views/animation/test/test_ink_drop.cc b/ui/views/animation/test/test_ink_drop.cc index ecaeee0..4874f1d4 100644 --- a/ui/views/animation/test/test_ink_drop.cc +++ b/ui/views/animation/test/test_ink_drop.cc
@@ -24,6 +24,10 @@ state_ = InkDropState::ACTIVATED; } +void TestInkDrop::SnapToHidden() { + state_ = InkDropState::HIDDEN; +} + void TestInkDrop::SetHovered(bool is_hovered) { is_hovered_ = is_hovered; }
diff --git a/ui/views/animation/test/test_ink_drop.h b/ui/views/animation/test/test_ink_drop.h index 5bf826b..0d2ffffe 100644 --- a/ui/views/animation/test/test_ink_drop.h +++ b/ui/views/animation/test/test_ink_drop.h
@@ -25,6 +25,7 @@ InkDropState GetTargetInkDropState() const override; void AnimateToState(InkDropState ink_drop_state) override; void SnapToActivated() override; + void SnapToHidden() override; void SetHovered(bool is_hovered) override; void SetFocused(bool is_focused) override; bool IsHighlightFadingInOrVisible() const override;
diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm index 43ca47e3..d57a5e3 100644 --- a/ui/views/cocoa/bridged_content_view.mm +++ b/ui/views/cocoa/bridged_content_view.mm
@@ -24,6 +24,7 @@ #import "ui/events/keycodes/keyboard_code_conversion_mac.h" #include "ui/gfx/canvas_paint_mac.h" #include "ui/gfx/decorated_text.h" +#import "ui/gfx/decorated_text_mac.h" #include "ui/gfx/geometry/rect.h" #import "ui/gfx/mac/coordinate_conversion.h" #include "ui/gfx/path.h" @@ -200,42 +201,6 @@ return substring; } -NSAttributedString* GetAttributedString( - const gfx::DecoratedText& decorated_text) { - base::scoped_nsobject<NSMutableAttributedString> str( - [[NSMutableAttributedString alloc] - initWithString:base::SysUTF16ToNSString(decorated_text.text)]); - [str beginEditing]; - - NSValue* const line_style = - @(NSUnderlineStyleSingle | NSUnderlinePatternSolid); - - for (const auto& attribute : decorated_text.attributes) { - DCHECK(!attribute.range.is_reversed()); - DCHECK_LE(attribute.range.end(), [str length]); - - NSMutableDictionary* attrs = [NSMutableDictionary dictionary]; - NSRange range = attribute.range.ToNSRange(); - - if (attribute.font.GetNativeFont()) - attrs[NSFontAttributeName] = attribute.font.GetNativeFont(); - - // NSFont does not have underline as an attribute. Hence handle it - // separately. - const bool underline = attribute.font.GetStyle() & gfx::Font::UNDERLINE; - if (underline) - attrs[NSUnderlineStyleAttributeName] = line_style; - - if (attribute.strike) - attrs[NSStrikethroughStyleAttributeName] = line_style; - - [str setAttributes:attrs range:range]; - } - - [str endEditing]; - return str.autorelease(); -} - ui::TextEditCommand GetTextEditCommandForMenuAction(SEL action) { if (action == @selector(undo:)) return ui::TextEditCommand::UNDO; @@ -904,7 +869,7 @@ views::View::ConvertPointToTarget(hostedView_, target, &locationInTarget); gfx::DecoratedText decoratedWord; gfx::Point baselinePoint; - if (!wordLookupClient->GetDecoratedWordAtPoint( + if (!wordLookupClient->GetWordLookupDataAtPoint( locationInTarget, &decoratedWord, &baselinePoint)) { return; } @@ -913,7 +878,8 @@ views::View::ConvertPointToTarget(target, hostedView_, &baselinePoint); NSPoint baselinePointAppKit = NSMakePoint( baselinePoint.x(), NSHeight([self frame]) - baselinePoint.y()); - [self showDefinitionForAttributedString:GetAttributedString(decoratedWord) + [self showDefinitionForAttributedString: + gfx::GetAttributedStringFromDecoratedText(decoratedWord) atPoint:baselinePointAppKit]; }
diff --git a/ui/views/controls/button/button_unittest.cc b/ui/views/controls/button/button_unittest.cc index dc91808..067653b 100644 --- a/ui/views/controls/button/button_unittest.cc +++ b/ui/views/controls/button/button_unittest.cc
@@ -525,8 +525,12 @@ ui::test::EventGenerator generator(widget()->GetNativeWindow()); generator.MoveMouseToInHost(2, 2); EXPECT_TRUE(ink_drop->is_hovered()); + // Set ink-drop state to ACTIVATED to make sure that removing the container + // sets it back to HIDDEN. + ink_drop->AnimateToState(InkDropState::ACTIVATED); test_container.RemoveAllChildViews(false); EXPECT_FALSE(ink_drop->is_hovered()); + EXPECT_EQ(InkDropState::HIDDEN, ink_drop->GetTargetInkDropState()); // Make sure hiding the ink drop happens even if the button is indirectly // being removed. @@ -541,7 +545,11 @@ EXPECT_FALSE(ink_drop->is_hovered()); generator.MoveMouseToInHost(10, 10); EXPECT_TRUE(ink_drop->is_hovered()); + // Set ink-drop state to ACTIVATED to make sure that removing the container + // sets it back to HIDDEN. + ink_drop->AnimateToState(InkDropState::ACTIVATED); parent_test_container.RemoveAllChildViews(false); + EXPECT_EQ(InkDropState::HIDDEN, ink_drop->GetTargetInkDropState()); EXPECT_FALSE(ink_drop->is_hovered()); // Remove references to and delete button() which cannot be removed by owned
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc index 6b6d5f02..9085592 100644 --- a/ui/views/controls/label.cc +++ b/ui/views/controls/label.cc
@@ -665,13 +665,21 @@ MENU_ANCHOR_TOPLEFT, source_type); } -bool Label::GetDecoratedWordAtPoint(const gfx::Point& point, - gfx::DecoratedText* decorated_word, - gfx::Point* baseline_point) { +bool Label::GetWordLookupDataAtPoint(const gfx::Point& point, + gfx::DecoratedText* decorated_word, + gfx::Point* baseline_point) { + gfx::RenderText* render_text = GetRenderTextForSelectionController(); + return render_text ? render_text->GetWordLookupDataAtPoint( + point, decorated_word, baseline_point) + : false; +} + +bool Label::GetWordLookupDataFromSelection(gfx::DecoratedText* decorated_text, + gfx::Point* baseline_point) { gfx::RenderText* render_text = GetRenderTextForSelectionController(); return render_text - ? render_text->GetDecoratedWordAtPoint(point, decorated_word, - baseline_point) + ? render_text->GetLookupDataForRange( + render_text->selection(), decorated_text, baseline_point) : false; }
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h index 635025a82..1d35afe 100644 --- a/ui/views/controls/label.h +++ b/ui/views/controls/label.h
@@ -268,9 +268,12 @@ ui::MenuSourceType source_type) override; // WordLookupClient overrides: - bool GetDecoratedWordAtPoint(const gfx::Point& point, - gfx::DecoratedText* decorated_word, - gfx::Point* baseline_point) override; + bool GetWordLookupDataAtPoint(const gfx::Point& point, + gfx::DecoratedText* decorated_word, + gfx::Point* baseline_point) override; + + bool GetWordLookupDataFromSelection(gfx::DecoratedText* decorated_text, + gfx::Point* baseline_point) override; // SelectionControllerDelegate overrides: gfx::RenderText* GetRenderTextForSelectionController() override;
diff --git a/ui/views/controls/menu/menu_runner.h b/ui/views/controls/menu/menu_runner.h index f708e22..56a53d9 100644 --- a/ui/views/controls/menu/menu_runner.h +++ b/ui/views/controls/menu/menu_runner.h
@@ -95,11 +95,6 @@ // shelf uses the flag to continue dragging an item without lifting the // finger after the context menu of the item is opened. SEND_GESTURE_EVENTS_TO_OWNER = 1 << 7, - - // Whether to always use a menu rendered with views::MenuItemView, even if - // the MenuRunnerImpl would otherwise pick a native implementation on this - // platform. - ALWAYS_VIEWS = 1 << 8, }; // Creates a new MenuRunner, which may use a native menu if available.
diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.mm b/ui/views/controls/menu/menu_runner_impl_cocoa.mm index c27d55e22..274559a 100644 --- a/ui/views/controls/menu/menu_runner_impl_cocoa.mm +++ b/ui/views/controls/menu/menu_runner_impl_cocoa.mm
@@ -119,8 +119,7 @@ int32_t run_types, const base::Closure& on_menu_closed_callback) { if ((run_types & kNativeRunTypes) != 0 && - (run_types & MenuRunner::IS_NESTED) == 0 && - (run_types & MenuRunner::ALWAYS_VIEWS) == 0) { + (run_types & MenuRunner::IS_NESTED) == 0) { return new MenuRunnerImplCocoa(menu_model, on_menu_closed_callback); }
diff --git a/ui/views/controls/styled_label.cc b/ui/views/controls/styled_label.cc index 51ae7229..5e7982d 100644 --- a/ui/views/controls/styled_label.cc +++ b/ui/views/controls/styled_label.cc
@@ -274,6 +274,11 @@ SchedulePaint(); } +void StyledLabel::ClearStyleRanges() { + style_ranges_.clear(); + PreferredSizeChanged(); +} + int StyledLabel::GetDefaultLineHeight() const { return specified_line_height_ > 0 ? specified_line_height_
diff --git a/ui/views/controls/styled_label.h b/ui/views/controls/styled_label.h index 14a76375..3268ad5 100644 --- a/ui/views/controls/styled_label.h +++ b/ui/views/controls/styled_label.h
@@ -139,6 +139,9 @@ // Sets the horizontal alignment; the argument value is mirrored in RTL UI. void SetHorizontalAlignment(gfx::HorizontalAlignment alignment); + // Clears all the styles applied to the label. + void ClearStyleRanges(); + private: struct StyleRange { StyleRange(const gfx::Range& range,
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index 51c15f6..a617032 100644 --- a/ui/views/controls/textfield/textfield.cc +++ b/ui/views/controls/textfield/textfield.cc
@@ -1190,11 +1190,18 @@ //////////////////////////////////////////////////////////////////////////////// // Textfield, WordLookupClient overrides: -bool Textfield::GetDecoratedWordAtPoint(const gfx::Point& point, - gfx::DecoratedText* decorated_word, - gfx::Point* baseline_point) { - return GetRenderText()->GetDecoratedWordAtPoint(point, decorated_word, - baseline_point); +bool Textfield::GetWordLookupDataAtPoint(const gfx::Point& point, + gfx::DecoratedText* decorated_word, + gfx::Point* baseline_point) { + return GetRenderText()->GetWordLookupDataAtPoint(point, decorated_word, + baseline_point); +} + +bool Textfield::GetWordLookupDataFromSelection( + gfx::DecoratedText* decorated_text, + gfx::Point* baseline_point) { + return GetRenderText()->GetLookupDataForRange(GetRenderText()->selection(), + decorated_text, baseline_point); } //////////////////////////////////////////////////////////////////////////////// @@ -1291,10 +1298,20 @@ // Textfield, ui::SimpleMenuModel::Delegate overrides: bool Textfield::IsCommandIdChecked(int command_id) const { + if (text_services_context_menu_ && + text_services_context_menu_->SupportsCommand(command_id)) { + return text_services_context_menu_->IsCommandIdChecked(command_id); + } + return true; } bool Textfield::IsCommandIdEnabled(int command_id) const { + if (text_services_context_menu_ && + text_services_context_menu_->SupportsCommand(command_id)) { + return text_services_context_menu_->IsCommandIdEnabled(command_id); + } + return Textfield::IsTextEditCommandEnabled( GetTextEditCommandFromMenuCommand(command_id, HasSelection())); } @@ -1328,6 +1345,12 @@ } void Textfield::ExecuteCommand(int command_id, int event_flags) { + if (text_services_context_menu_ && + text_services_context_menu_->SupportsCommand(command_id)) { + text_services_context_menu_->ExecuteCommand(command_id); + return; + } + Textfield::ExecuteTextEditCommand( GetTextEditCommandFromMenuCommand(command_id, HasSelection())); } @@ -2087,6 +2110,14 @@ GetInputMethod()->OnCaretBoundsChanged(this); if (touch_selection_controller_) touch_selection_controller_->SelectionChanged(); + +#if defined(OS_MACOSX) + // On Mac, the context menu contains a look up item which displays the + // selected text. As such, the menu needs to be updated if the selection has + // changed. + context_menu_contents_.reset(); +#endif + // Screen reader users don't expect notifications about unfocused textfields. if (HasFocus()) NotifyAccessibilityEvent(ax::mojom::Event::kTextSelectionChanged, true);
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h index 5ab239d..c1de5b7 100644 --- a/ui/views/controls/textfield/textfield.h +++ b/ui/views/controls/textfield/textfield.h
@@ -288,9 +288,11 @@ const gfx::Point& p) override; // WordLookupClient overrides: - bool GetDecoratedWordAtPoint(const gfx::Point& point, - gfx::DecoratedText* decorated_word, - gfx::Point* baseline_point) override; + bool GetWordLookupDataAtPoint(const gfx::Point& point, + gfx::DecoratedText* decorated_word, + gfx::Point* baseline_point) override; + bool GetWordLookupDataFromSelection(gfx::DecoratedText* decorated_text, + gfx::Point* baseline_point) override; // SelectionControllerDelegate overrides: bool HasTextBeingDragged() const override;
diff --git a/ui/views/controls/textfield/textfield_unittest.cc b/ui/views/controls/textfield/textfield_unittest.cc index fc2c11f2..608b424 100644 --- a/ui/views/controls/textfield/textfield_unittest.cc +++ b/ui/views/controls/textfield/textfield_unittest.cc
@@ -30,6 +30,7 @@ #include "ui/base/ime/input_method_factory.h" #include "ui/base/ime/text_edit_commands.h" #include "ui/base/ime/text_input_client.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/ui_base_switches.h" #include "ui/base/ui_base_switches_util.h" #include "ui/events/event.h" @@ -698,15 +699,29 @@ const bool is_all_selected = !text.empty() && textfield_->GetSelectedRange().length() == text.length(); - EXPECT_EQ(can_undo, menu->IsEnabledAt(0 /* UNDO */)); - EXPECT_TRUE(menu->IsEnabledAt(1 /* Separator */)); - EXPECT_EQ(textfield_has_selection, menu->IsEnabledAt(2 /* CUT */)); - EXPECT_EQ(textfield_has_selection, menu->IsEnabledAt(3 /* COPY */)); + int menu_index = 0; +#if defined(OS_MACOSX) + // On Mac, the Look Up item should appear at the top of the menu if the + // textfield has a selection. + if (textfield_has_selection) { + EXPECT_TRUE(menu->IsEnabledAt(menu_index++ /* LOOK UP */)); + EXPECT_TRUE(menu->IsEnabledAt(menu_index++ /* Separator */)); + } +#endif + + EXPECT_EQ(can_undo, menu->IsEnabledAt(menu_index++ /* UNDO */)); + EXPECT_TRUE(menu->IsEnabledAt(menu_index++ /* Separator */)); + EXPECT_EQ(textfield_has_selection, + menu->IsEnabledAt(menu_index++ /* CUT */)); + EXPECT_EQ(textfield_has_selection, + menu->IsEnabledAt(menu_index++ /* COPY */)); EXPECT_NE(GetClipboardText(ui::CLIPBOARD_TYPE_COPY_PASTE).empty(), - menu->IsEnabledAt(4 /* PASTE */)); - EXPECT_EQ(textfield_has_selection, menu->IsEnabledAt(5 /* DELETE */)); - EXPECT_TRUE(menu->IsEnabledAt(6 /* Separator */)); - EXPECT_EQ(!is_all_selected, menu->IsEnabledAt(7 /* SELECT ALL */)); + menu->IsEnabledAt(menu_index++ /* PASTE */)); + EXPECT_EQ(textfield_has_selection, + menu->IsEnabledAt(menu_index++ /* DELETE */)); + EXPECT_TRUE(menu->IsEnabledAt(menu_index++ /* Separator */)); + EXPECT_EQ(!is_all_selected, + menu->IsEnabledAt(menu_index++ /* SELECT ALL */)); } void PressMouseButton(ui::EventFlags mouse_button_flags, int extra_flags) { @@ -3446,6 +3461,34 @@ EXPECT_TRUE(test_api_->IsTextDirectionCheckedInContextMenu( base::i18n::TextDirection::RIGHT_TO_LEFT)); } + +// Tests to see if the look up item is updated when the textfield's selected +// text has changed. +TEST_F(TextfieldTest, LookUpItemUpdate) { + InitTextfield(); + EXPECT_TRUE(textfield_->context_menu_controller()); + + const base::string16 kTextOne = ASCIIToUTF16("crake"); + textfield_->SetText(kTextOne); + textfield_->SelectAll(false); + + ui::MenuModel* context_menu = GetContextMenuModel(); + EXPECT_TRUE(context_menu); + EXPECT_GT(context_menu->GetItemCount(), 0); + EXPECT_EQ(context_menu->GetLabelAt(0), + l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_LOOK_UP, kTextOne)); + + const base::string16 kTextTwo = ASCIIToUTF16("rail"); + textfield_->SetText(kTextTwo); + textfield_->SelectAll(false); + + context_menu = GetContextMenuModel(); + EXPECT_TRUE(context_menu); + EXPECT_GT(context_menu->GetItemCount(), 0); + EXPECT_EQ(context_menu->GetLabelAt(0), + l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_LOOK_UP, kTextTwo)); +} + #endif // defined(OS_MACOSX) TEST_F(TextfieldTest, AccessibilitySelectionEvents) {
diff --git a/ui/views/controls/views_text_services_context_menu.h b/ui/views/controls/views_text_services_context_menu.h index 2388b27..bf41135 100644 --- a/ui/views/controls/views_text_services_context_menu.h +++ b/ui/views/controls/views_text_services_context_menu.h
@@ -34,6 +34,14 @@ VIEWS_EXPORT static bool IsTextDirectionCheckedForTesting( ViewsTextServicesContextMenu* menu, base::i18n::TextDirection direction); + + // Returns true if the given |command_id| is handled by the menu. + virtual bool SupportsCommand(int command_id) const = 0; + + // Methods associated with SimpleMenuModel::Delegate. + virtual bool IsCommandIdChecked(int command_id) const = 0; + virtual bool IsCommandIdEnabled(int command_id) const = 0; + virtual void ExecuteCommand(int command_id) = 0; }; } // namespace views
diff --git a/ui/views/controls/views_text_services_context_menu_mac.mm b/ui/views/controls/views_text_services_context_menu_mac.mm index be96d8a..539c9076 100644 --- a/ui/views/controls/views_text_services_context_menu_mac.mm +++ b/ui/views/controls/views_text_services_context_menu_mac.mm
@@ -4,10 +4,18 @@ #include "ui/views/controls/views_text_services_context_menu.h" +#import <Cocoa/Cocoa.h> + #include "base/memory/ptr_util.h" #include "ui/base/cocoa/text_services_context_menu.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/base/models/simple_menu_model.h" +#include "ui/gfx/decorated_text.h" +#import "ui/gfx/decorated_text_mac.h" +#include "ui/strings/grit/ui_strings.h" #include "ui/views/controls/textfield/textfield.h" +#include "ui/views/view.h" +#include "ui/views/widget/widget.h" namespace views { @@ -16,19 +24,48 @@ // This class serves as a bridge to TextServicesContextMenu to add and handle // text service items in the context menu. The items include Speech, Look Up // and BiDi. -// TODO (spqchan): Add Look Up and BiDi. class ViewsTextServicesContextMenuMac : public ViewsTextServicesContextMenu, public ui::TextServicesContextMenu::Delegate { public: ViewsTextServicesContextMenuMac(ui::SimpleMenuModel* menu, Textfield* client) : text_services_menu_(this), client_(client) { + // The menu index for "Look Up". + constexpr int kLookupMenuIndex = 0; + + base::string16 text = GetSelectedText(); + if (!text.empty()) { + menu->InsertItemAt( + kLookupMenuIndex, IDS_CONTENT_CONTEXT_LOOK_UP, + l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_LOOK_UP, text)); + menu->InsertSeparatorAt(kLookupMenuIndex + 1, ui::NORMAL_SEPARATOR); + } text_services_menu_.AppendToContextMenu(menu); text_services_menu_.AppendEditableItems(menu); } ~ViewsTextServicesContextMenuMac() override {} + // ViewsTextServicesContextMenu: + bool SupportsCommand(int command_id) const override { + return command_id == IDS_CONTENT_CONTEXT_LOOK_UP; + } + + bool IsCommandIdChecked(int command_id) const override { + DCHECK_EQ(IDS_CONTENT_CONTEXT_LOOK_UP, command_id); + return false; + } + + bool IsCommandIdEnabled(int command_id) const override { + DCHECK_EQ(IDS_CONTENT_CONTEXT_LOOK_UP, command_id); + return true; + } + + void ExecuteCommand(int command_id) override { + DCHECK_EQ(IDS_CONTENT_CONTEXT_LOOK_UP, command_id); + LookUpInDictionary(); + } + // TextServicesContextMenu::Delegate: base::string16 GetSelectedText() const override { return client_->GetSelectedText(); @@ -55,6 +92,24 @@ } private: + // Handler for the "Look Up" menu item. + void LookUpInDictionary() { + gfx::Point baseline_point; + gfx::DecoratedText text; + if (client_->GetWordLookupDataFromSelection(&text, &baseline_point)) { + Widget* widget = client_->GetWidget(); + gfx::NativeView view = widget->GetNativeView(); + views::View::ConvertPointToTarget(client_, widget->GetRootView(), + &baseline_point); + + NSPoint lookup_point = NSMakePoint( + baseline_point.x(), NSHeight([view frame]) - baseline_point.y()); + [view showDefinitionForAttributedString: + gfx::GetAttributedStringFromDecoratedText(text) + atPoint:lookup_point]; + } + } + // Appends and handles the text service menu. ui::TextServicesContextMenu text_services_menu_;
diff --git a/ui/views/linux_ui/OWNERS b/ui/views/linux_ui/OWNERS index 4733a4f..280ba478 100644 --- a/ui/views/linux_ui/OWNERS +++ b/ui/views/linux_ui/OWNERS
@@ -1 +1 @@ -erg@chromium.org +thomasanderson@chromium.org
diff --git a/ui/views/selection_controller.cc b/ui/views/selection_controller.cc index aa400d8..b4a3a403 100644 --- a/ui/views/selection_controller.cc +++ b/ui/views/selection_controller.cc
@@ -164,7 +164,8 @@ base::TimeDelta time_delta = event.time_stamp() - last_click_time_; if (!last_click_time_.is_null() && time_delta.InMilliseconds() <= GetDoubleClickInterval() && - !View::ExceededDragThreshold(event.location() - last_click_location_)) { + !View::ExceededDragThreshold(event.root_location() - + last_click_location_)) { // Upon clicking after a triple click, the count should go back to // double click and alternate between double and triple. This assignment // maps 0 to 1, 1 to 2, 2 to 1. @@ -173,7 +174,7 @@ aggregated_clicks_ = 0; } last_click_time_ = event.time_stamp(); - last_click_location_ = event.location(); + last_click_location_ = event.root_location(); } }
diff --git a/ui/views/widget/desktop_aura/OWNERS b/ui/views/widget/desktop_aura/OWNERS index deec896..9069e120 100644 --- a/ui/views/widget/desktop_aura/OWNERS +++ b/ui/views/widget/desktop_aura/OWNERS
@@ -1,3 +1,2 @@ -# Elliot is the owner of all the X11 stuff. -per-file *x11*=erg@chromium.org -per-file window_event_filter*=erg@chromium.org +per-file *x11*=thomasanderson@chromium.org +per-file window_event_filter*=thomasanderson@chromium.org
diff --git a/ui/views/word_lookup_client.h b/ui/views/word_lookup_client.h index d9c200f5..15b9c795 100644 --- a/ui/views/word_lookup_client.h +++ b/ui/views/word_lookup_client.h
@@ -22,9 +22,13 @@ // displayed at the point, returns a nearby word. |baseline_point| should // correspond to the baseline point of the leftmost glyph of the |word| in the // view's coordinates. Returns false, if no word can be retrieved. - virtual bool GetDecoratedWordAtPoint(const gfx::Point& point, - gfx::DecoratedText* decorated_word, - gfx::Point* baseline_point) = 0; + virtual bool GetWordLookupDataAtPoint(const gfx::Point& point, + gfx::DecoratedText* decorated_word, + gfx::Point* baseline_point) = 0; + + virtual bool GetWordLookupDataFromSelection( + gfx::DecoratedText* decorated_text, + gfx::Point* baseline_point) = 0; protected: virtual ~WordLookupClient() {}
diff --git a/ui/webui/resources/cr_elements/chromeos/network/cr_network_select.js b/ui/webui/resources/cr_elements/chromeos/network/cr_network_select.js index 26a37dc4..5b4f6b7 100644 --- a/ui/webui/resources/cr_elements/chromeos/network/cr_network_select.js +++ b/ui/webui/resources/cr_elements/chromeos/network/cr_network_select.js
@@ -153,28 +153,32 @@ this.ensureCellularNetwork_(networkStates); this.networkStateList_ = networkStates; var defaultNetwork; - if (networkStates.length > 0) { - // Handle an edge case where Ethernet is connecting. - if (networkStates.length > 1 && - networkStates[0].ConnectionState == - CrOnc.ConnectionState.CONNECTING && - networkStates[1].ConnectionState == CrOnc.ConnectionState.CONNECTED) { - defaultNetwork = networkStates[1]; - } else { - defaultNetwork = networkStates[0]; + for (var i = 0; i < networkStates.length; ++i) { + var state = networkStates[i]; + if (state.ConnectionState == CrOnc.ConnectionState.CONNECTED) { + defaultNetwork = state; + break; } - } else if (!this.defaultNetworkState_) { - return; // No change + if (state.ConnectionState == CrOnc.ConnectionState.CONNECTING && + !defaultNetwork) { + defaultNetwork = state; + // Do not break here in case a non WiFi network is connecting but a + // WiFi network is connected. + } else if (state.Type == CrOnc.Type.WI_FI) { + break; // Non connecting or connected WiFI networks are always last. + } } - if (defaultNetwork && this.defaultNetworkState_ && - defaultNetwork.GUID == this.defaultNetworkState_.GUID && - defaultNetwork.ConnectionState == - this.defaultNetworkState_.ConnectionState) { + if ((!defaultNetwork && !this.defaultNetworkState_) || + (defaultNetwork && this.defaultNetworkState_ && + defaultNetwork.GUID == this.defaultNetworkState_.GUID && + defaultNetwork.ConnectionState == + this.defaultNetworkState_.ConnectionState)) { return; // No change to network or ConnectionState } - this.defaultNetworkState_ = + this.defaultNetworkState_ = defaultNetwork ? /** @type {!CrOnc.NetworkStateProperties|undefined} */ ( - Object.assign({}, defaultNetwork)); + Object.assign({}, defaultNetwork)) : + undefined; this.fire('default-network-changed', defaultNetwork); },
diff --git a/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.html b/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.html index bc13ad1d..3a075c1 100644 --- a/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.html +++ b/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.html
@@ -43,7 +43,8 @@ <cr-profile-avatar-selector-grid id="avatar-grid" ignore-modified-key-events="[[ignoreModifiedKeyEvents]]"> <template is="dom-repeat" items="[[avatars]]"> - <paper-button class="avatar" title="[[item.label]]" + <paper-button class$="avatar [[getSelectedClass_(item.selected)]]" + title="[[item.label]]" style$="background-image: [[getIconImageSet_(item.url)]]" on-tap="onAvatarTap_"> </paper-button>
diff --git a/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js b/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js index 2716e934..ea4098d 100644 --- a/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js +++ b/ui/webui/resources/cr_elements/cr_profile_avatar_selector/cr_profile_avatar_selector.js
@@ -10,7 +10,8 @@ /** * @typedef {{url: string, * label: string, - * isGaiaAvatar: (boolean|undefined)}} + * isGaiaAvatar: (boolean|undefined), + * selected: (boolean|undefined)}} */ let AvatarIcon; @@ -47,6 +48,13 @@ }, }, + /** @private */ + getSelectedClass_: function(isSelected) { + // TODO(dpapad): Rename 'iron-selected' to 'selected' now that this CSS + // class is not assigned by any iron-* behavior. + return isSelected ? 'iron-selected' : ''; + }, + /** * @param {string} iconUrl * @return {string} A CSS image-set for multiple scale factors. @@ -61,13 +69,14 @@ * @private */ onAvatarTap_: function(e) { - // TODO(dpapad): Rename 'iron-selected' to 'selected' now that this CSS - // class is not assigned by any iron-* behavior. + // Manual selection for profile creation if (this.selectedAvatarElement_) this.selectedAvatarElement_.classList.remove('iron-selected'); - this.selectedAvatarElement_ = /** @type {!HTMLElement} */ (e.target); this.selectedAvatarElement_.classList.add('iron-selected'); + + // |selectedAvatar| is set to pass back selection to the owner of this + // component. this.selectedAvatar = /** @type {!{model: {item: !AvatarIcon}}} */ (e).model.item; },